Class: Agris::Api::AccountsReceivables::Invoice
- Inherits:
-
Object
- Object
- Agris::Api::AccountsReceivables::Invoice
- Includes:
- XmlModel
- Defined in:
- lib/agris/api/accounts_receivables/invoice.rb
Defined Under Namespace
Classes: LineItem
Constant Summary collapse
- ATTRIBUTE_NAMES =
%w( invoice_location invoice_location_description invoice_no invoice_date ship_date pickup_delivery due_date discount_date original_date last_pay_date trans_status tran_status_desc aging_period aging_period_description doc_type doc_type_desc invoice_desc ref_order_no xref_doc_loc xref_doc_loc_description xref_doc days_to_pay terms_code terms_desc first_inv_settle_no name_id_type name_id_type_desc invoice_type invoice_type_desc state_county_code state_county_desc usr_order_field_1 usr_order_field_2 usr_invoice_field1 usr_invoice_field2 bill_to_id bill_to_description ship_to_id ship_to_description shipper_id shipper_description agent_id agent_description invoice_amount discount_amount applied_amount due_amount net_amount discount_remaining discount_applied sales_tax field_history_updated use_standard_discount_ratio delete lastchange_datetime lastchange_user_id lastchange_user_name currency_code currency_description exchange_rate exchange_rate_date integration_guid unique_id ).freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Invoice
constructor
A new instance of Invoice.
Methods included from XmlModel
Constructor Details
#initialize(hash = {}) ⇒ Invoice
Returns a new instance of Invoice.
90 91 92 93 94 |
# File 'lib/agris/api/accounts_receivables/invoice.rb', line 90 def initialize(hash = {}) super @line_items = [] end |
Class Method Details
.from_xml_hash(hash) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/agris/api/accounts_receivables/invoice.rb', line 76 def self.from_xml_hash(hash) super.tap do |document| if hash['lineitems'] document.line_items.concat( [hash['lineitems']['lineitem']] .flatten .map do |lineitem| LineItem.from_xml_hash(lineitem) end ) end end end |