Class: ErpIntegration::SalesOrder

Inherits:
Resource
  • Object
show all
Defined in:
lib/erp_integration/sales_order.rb

Overview

The ‘ErpIntegration::SalesOrder` exposes an uniformed API for interaction with third-party ERP vendors.

Instance Attribute Summary collapse

Attributes inherited from Resource

#raw_api_response

Instance Method Summary collapse

Methods inherited from Resource

adapter, adapter_klass, adapter_path, adapter_type, #assign_attributes, #initialize, #method_missing, resource_name, respond_to_missing?

Methods included from Resources::Persistence

#destroy, included, #persisted?, #update

Methods included from Resources::Validations

#errors, #valid?, #validate_with

Constructor Details

This class inherits a constructor from ErpIntegration::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ErpIntegration::Resource

Instance Attribute Details

#amount_invoicedObject

Returns the value of attribute amount_invoiced.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def amount_invoiced
  @amount_invoiced
end

#attachmentsObject

Returns the value of attribute attachments.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def attachments
  @attachments
end

#carrierObject

Returns the value of attribute carrier.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def carrier
  @carrier
end

#carrier_serviceObject

Returns the value of attribute carrier_service.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def carrier_service
  @carrier_service
end

#channelObject

Returns the value of attribute channel.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def channel
  @channel
end

#channel_identifierObject

Returns the value of attribute channel_identifier.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def channel_identifier
  @channel_identifier
end

#commentObject

Returns the value of attribute comment.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def comment
  @comment
end

#companyObject

Returns the value of attribute company.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def company
  @company
end

#confirmation_timeObject

Returns the value of attribute confirmation_time.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def confirmation_time
  @confirmation_time
end

#create_dateObject

Returns the value of attribute create_date.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def create_date
  @create_date
end

#currencyObject

Returns the value of attribute currency.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def currency
  @currency
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def description
  @description
end

#gateway_transactionObject

Returns the value of attribute gateway_transaction.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def gateway_transaction
  @gateway_transaction
end

#gift_messageObject

Returns the value of attribute gift_message.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def gift_message
  @gift_message
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def id
  @id
end

#invoice_addressObject

Returns the value of attribute invoice_address.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def invoice_address
  @invoice_address
end

#invoice_methodObject

Returns the value of attribute invoice_method.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def invoice_method
  @invoice_method
end

#invoice_stateObject

Returns the value of attribute invoice_state.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def invoice_state
  @invoice_state
end

#invoicesObject

Returns the value of attribute invoices.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def invoices
  @invoices
end

#linesObject

Returns the value of attribute lines.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def lines
  @lines
end

#metadataObject

Returns the value of attribute metadata.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def 
  @metadata
end

#movesObject

Returns the value of attribute moves.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def moves
  @moves
end

#numberObject

Returns the value of attribute number.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def number
  @number
end

#partyObject

Returns the value of attribute party.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def party
  @party
end

#payment_termObject

Returns the value of attribute payment_term.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def payment_term
  @payment_term
end

#payment_totalObject

Returns the value of attribute payment_total.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def payment_total
  @payment_total
end

#price_listObject

Returns the value of attribute price_list.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def price_list
  @price_list
end

#referenceObject

Returns the value of attribute reference.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def reference
  @reference
end

#sale_dateObject

Returns the value of attribute sale_date.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def sale_date
  @sale_date
end

#sales_personObject

Returns the value of attribute sales_person.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def sales_person
  @sales_person
end

#shipment_addressObject

Returns the value of attribute shipment_address.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipment_address
  @shipment_address
end

#shipment_amountObject

Returns the value of attribute shipment_amount.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipment_amount
  @shipment_amount
end

#shipment_methodObject

Returns the value of attribute shipment_method.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipment_method
  @shipment_method
end

#shipment_returnsObject

Returns the value of attribute shipment_returns.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipment_returns
  @shipment_returns
end

#shipment_stateObject

Returns the value of attribute shipment_state.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipment_state
  @shipment_state
end

#shipmentsObject

Returns the value of attribute shipments.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipments
  @shipments
end

#shipping_instructionsObject

Returns the value of attribute shipping_instructions.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipping_instructions
  @shipping_instructions
end

#shipping_start_dateObject

Returns the value of attribute shipping_start_date.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def shipping_start_date
  @shipping_start_date
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def state
  @state
end

#tax_amountObject

Returns the value of attribute tax_amount.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def tax_amount
  @tax_amount
end

#total_amountObject

Returns the value of attribute total_amount.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def total_amount
  @total_amount
end

#total_quantityObject

Returns the value of attribute total_quantity.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def total_quantity
  @total_quantity
end

#total_shipment_costObject

Returns the value of attribute total_shipment_cost.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def total_shipment_cost
  @total_shipment_cost
end

#untaxed_amountObject

Returns the value of attribute untaxed_amount.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def untaxed_amount
  @untaxed_amount
end

#warehouseObject

Returns the value of attribute warehouse.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def warehouse
  @warehouse
end

#weightObject

Returns the value of attribute weight.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def weight
  @weight
end

#weight_uomObject

Returns the value of attribute weight_uom.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def weight_uom
  @weight_uom
end

#write_dateObject

Returns the value of attribute write_date.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def write_date
  @write_date
end

#write_uidObject

Returns the value of attribute write_uid.



7
8
9
# File 'lib/erp_integration/sales_order.rb', line 7

def write_uid
  @write_uid
end

Instance Method Details

#cancelObject



19
20
21
# File 'lib/erp_integration/sales_order.rb', line 19

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

#confirmObject



31
32
33
# File 'lib/erp_integration/sales_order.rb', line 31

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

#duplicateObject



27
28
29
# File 'lib/erp_integration/sales_order.rb', line 27

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

#processObject



35
36
37
# File 'lib/erp_integration/sales_order.rb', line 35

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

#return!(options) ⇒ Object



23
24
25
# File 'lib/erp_integration/sales_order.rb', line 23

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

#shipped?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/erp_integration/sales_order.rb', line 39

def shipped?
  state == 'done'
end