Sha256: 83fcb289e6acb0bbc6e058945dbef34ff6a2a016529e1cad48694204bdefbeb2

Contents?: true

Size: 1.45 KB

Versions: 10

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

module ErpIntegration
  # The `ErpIntegration::SalesOrder` exposes an uniformed API for interaction with
  # third-party ERP vendors.
  class SalesOrder < Resource
    attr_accessor :id, :channel, :number, :party, :sale_date, :shipment_address,
                  :amount_invoiced, :attachments, :carrier, :carrier_service,
                  :channel_identifier, :comment, :company, :confirmation_time,
                  :create_date, :currency, :description, :gateway_transaction,
                  :invoice_address, :invoice_method, :invoice_state, :invoices,
                  :lines, :metadata, :moves, :payment_term, :payment_total, :price_list,
                  :reference, :sales_person, :shipment_amount, :shipment_method,
                  :shipment_returns, :shipment_state, :shipments, :shipping_instructions,
                  :shipping_start_date, :state, :tax_amount, :total_amount, :total_quantity,
                  :total_shipment_cost, :untaxed_amount, :warehouse, :weight, :weight_uom,
                  :write_date, :write_uid, :gift_message

    def cancel
      self.class.adapter.cancel(id)
    end

    def return!(options)
      self.class.adapter.return!(id, options)
    end

    def duplicate
      self.class.adapter.duplicate(id)
    end

    def confirm
      self.class.adapter.confirm(id)
    end

    def process
      self.class.adapter.process(id)
    end

    def shipped?
      state == 'done'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
erp_integration-0.57.0 lib/erp_integration/sales_order.rb
erp_integration-0.56.0 lib/erp_integration/sales_order.rb
erp_integration-0.55.0 lib/erp_integration/sales_order.rb
erp_integration-0.54.0 lib/erp_integration/sales_order.rb
erp_integration-0.53.1 lib/erp_integration/sales_order.rb
erp_integration-0.53.0 lib/erp_integration/sales_order.rb
erp_integration-0.52.0 lib/erp_integration/sales_order.rb
erp_integration-0.50.0 lib/erp_integration/sales_order.rb
erp_integration-0.49.0 lib/erp_integration/sales_order.rb
erp_integration-0.48.0 lib/erp_integration/sales_order.rb