Class: Einvoice::Neweb::Model::Invoice
- Inherits:
-
Base
- Object
- Base
- Einvoice::Neweb::Model::Invoice
show all
- Defined in:
- lib/einvoice/neweb/model/invoice.rb
Constant Summary
collapse
- VALID_OPTIONS_KEYS =
[
:seller_id,
:buyer_name,
:buyer_id,
:customs_clearance_mark,
:invoice_type,
:donate_mark,
:carrier_type,
:carrier_id1,
:carrier_id2,
:print_mark,
:n_p_o_b_a_n,
:random_number,
:invoice_item,
:sales_amount,
:free_tax_sales_amount,
:zero_tax_sales_amount,
:tax_type,
:tax_rate,
:tax_amount,
:total_amount,
:contact,
:customer_defined
].freeze
Instance Method Summary
collapse
Methods inherited from Base
#attributes, #attributes=
Methods included from Validator
#valid_float?
Constructor Details
Returns a new instance of Invoice.
54
55
56
|
# File 'lib/einvoice/neweb/model/invoice.rb', line 54
def initialize
raise NotImplementedError, "You should initialize with subclasses"
end
|
Instance Method Details
#payload ⇒ Object
58
59
60
|
# File 'lib/einvoice/neweb/model/invoice.rb', line 58
def payload
serializable_hash(except: [:errors, :validation_context], include: [:invoice_item, :contact, :customer_defined])
end
|
#wrapped_payload ⇒ Object
62
63
64
65
66
|
# File 'lib/einvoice/neweb/model/invoice.rb', line 62
def wrapped_payload
{ invoice_root:
{ invoice: payload }
}
end
|