Class: Agris::Api::NewOrder

Inherits:
Object
  • Object
show all
Includes:
XmlModel
Defined in:
lib/agris/api/new_order.rb

Constant Summary collapse

ATTRIBUTE_NAMES =
%w(
  order_location
  order_number
  order_status
  order_type
  line_item_no
  order_date
  shipment_date
  bill_to_from_id
  item_location
  item_number
  item_descr
  price_code
  price_level
  price_schedule
  invoice_terms
  contract_location
  contract_number
  contract_price_schedule
  weight_uom
  quantity_uom
  price_uom
  state
  county
  trancode_1
  trancode_2
  trancode_3
  trancode_4
  trancode_5
  user_order_field_1
  user_order_field_2
  user_line_item_field_1
  external_order_number
  user_line_item_field_1
  exec_id
  ship_to_from_id
  shipper_id
  agent_id
  quantity_ordered
  unit_price
  pre_promo_price
  amount_ordered
  change_type
  cost_proration
  add_update_option
  update_field_selection
  reserved
  last_production_stage
  in_blend
  expiration_date
  item_description
  uniqueid
).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlModel

included

Constructor Details

#initialize(hash = {}) ⇒ NewOrder

Returns a new instance of NewOrder.



64
65
66
67
68
# File 'lib/agris/api/new_order.rb', line 64

def initialize(hash = {})
  super

  @record_type = 'INVP0'
end

Instance Attribute Details

#record_typeObject (readonly)

Returns the value of attribute record_type.



61
62
63
# File 'lib/agris/api/new_order.rb', line 61

def record_type
  @record_type
end

Instance Method Details

#add_remark(remark) ⇒ Object



70
71
72
73
74
75
# File 'lib/agris/api/new_order.rb', line 70

def add_remark(remark)
  @remarks ||= []
  @remarks << remark

  self
end

#remarksObject



77
78
79
# File 'lib/agris/api/new_order.rb', line 77

def remarks
  @remarks || []
end

#xml_ignore_attributesObject



81
82
83
# File 'lib/agris/api/new_order.rb', line 81

def xml_ignore_attributes
  [:remarks]
end