Class: Xrechnung::TaxSubtotal

Inherits:
Object
  • Object
show all
Includes:
MemberContainer
Defined in:
lib/xrechnung/tax_subtotal.rb

Overview

cac:TaxSubtotal <cbc:TaxableAmount currencyID="EUR">1294.30</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">207.09</cbc:TaxAmount> cac:TaxCategory cbc:IDS</cbc:ID> cbc:Percent16.00</cbc:Percent> cac:TaxScheme cbc:IDVAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal>

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MemberContainer

#[], #[]=, included

Constructor Details

#initialize(**kwargs) ⇒ TaxSubtotal

Returns a new instance of TaxSubtotal.



33
34
35
36
# File 'lib/xrechnung/tax_subtotal.rb', line 33

def initialize(**kwargs)
  super
  self.taxable_amount ||= Currency::EUR(0)
end

Instance Attribute Details

#tax_amountXrechnung::Currency

Returns:



24
# File 'lib/xrechnung/tax_subtotal.rb', line 24

member :tax_amount, type: Xrechnung::Currency

#tax_categoryXrechnung::TaxCategory



28
# File 'lib/xrechnung/tax_subtotal.rb', line 28

member :tax_category, type: Xrechnung::TaxCategory

#taxable_amountXrechnung::Currency

Returns:



20
# File 'lib/xrechnung/tax_subtotal.rb', line 20

member :taxable_amount, type: Xrechnung::Currency

Instance Method Details

#to_xml(xml) ⇒ Object

noinspection RubyResolve



39
40
41
42
43
44
45
# File 'lib/xrechnung/tax_subtotal.rb', line 39

def to_xml(xml)
  xml.cac :TaxSubtotal do
    xml.cbc :TaxableAmount, *taxable_amount.xml_args
    xml.cbc :TaxAmount, *tax_amount.xml_args
    tax_category&.to_xml(xml)
  end
end