Class: SunatInvoice::SummaryLine
- Defined in:
- lib/sunat_invoice/summary_line.rb
Constant Summary collapse
- CHARGES =
{ discount: false, charge: true }.freeze
Constants included from Utils
Utils::COMMON_NAMESPACES, Utils::CREDIT_NOTE_NAMESPACES, Utils::DAILY_SUMMARY_NAMESPACES, Utils::DEBIT_NOTE_NAMESPACES, Utils::INVOICE_NAMESPACES, Utils::SUMMARY_NAMESPACES, Utils::TRADE_NAMESPACES, Utils::VOIDED_NAMESPACES
Instance Attribute Summary collapse
-
#charge_type ⇒ Object
Returns the value of attribute charge_type.
-
#document_serial ⇒ Object
Returns the value of attribute document_serial.
-
#document_type ⇒ Object
Returns the value of attribute document_type.
-
#end_document_number ⇒ Object
Returns the value of attribute end_document_number.
-
#exempt ⇒ Object
Returns the value of attribute exempt.
-
#non_taxable ⇒ Object
Returns the value of attribute non_taxable.
-
#other_charge ⇒ Object
Returns the value of attribute other_charge.
-
#start_document_number ⇒ Object
Returns the value of attribute start_document_number.
-
#taxable ⇒ Object
Returns the value of attribute taxable.
-
#total_amount ⇒ Object
Returns the value of attribute total_amount.
Attributes inherited from Line
Instance Method Summary collapse
-
#initialize(*args) ⇒ SummaryLine
constructor
A new instance of SummaryLine.
- #xml(xml, index, currency) ⇒ Object
Methods inherited from Line
Methods included from Utils
Methods inherited from Model
Constructor Details
#initialize(*args) ⇒ SummaryLine
Returns a new instance of SummaryLine.
16 17 18 19 20 21 22 |
# File 'lib/sunat_invoice/summary_line.rb', line 16 def initialize(*args) super(*args) @taxable ||= 0.01 @non_taxable ||= 0.01 @exempt ||= 0.01 @other_charge ||= 0.01 end |
Instance Attribute Details
#charge_type ⇒ Object
Returns the value of attribute charge_type.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def charge_type @charge_type end |
#document_serial ⇒ Object
Returns the value of attribute document_serial.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def document_serial @document_serial end |
#document_type ⇒ Object
Returns the value of attribute document_type.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def document_type @document_type end |
#end_document_number ⇒ Object
Returns the value of attribute end_document_number.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def end_document_number @end_document_number end |
#exempt ⇒ Object
Returns the value of attribute exempt.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def exempt @exempt end |
#non_taxable ⇒ Object
Returns the value of attribute non_taxable.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def non_taxable @non_taxable end |
#other_charge ⇒ Object
Returns the value of attribute other_charge.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def other_charge @other_charge end |
#start_document_number ⇒ Object
Returns the value of attribute start_document_number.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def start_document_number @start_document_number end |
#taxable ⇒ Object
Returns the value of attribute taxable.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def taxable @taxable end |
#total_amount ⇒ Object
Returns the value of attribute total_amount.
7 8 9 |
# File 'lib/sunat_invoice/summary_line.rb', line 7 def total_amount @total_amount end |
Instance Method Details
#xml(xml, index, currency) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sunat_invoice/summary_line.rb', line 24 def xml(xml, index, currency) xml['sac'].SummaryDocumentsLine do xml['cbc'].LineID(index + 1) build_documents_info(xml) amount_xml(xml['sac'], 'TotalAmount', total_amount, currency) build_payments(xml, currency) build_other_charge(xml, currency) build_taxes_xml(xml, currency) end end |