Class: Xrechnung::TaxCategory
- Inherits:
-
Object
- Object
- Xrechnung::TaxCategory
show all
- Includes:
- MemberContainer
- Defined in:
- lib/xrechnung/tax_category.rb
Overview
<cbc:ID>S</cbc:ID>
<cbc:Percent>16.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
Instance Attribute Summary collapse
Instance Method Summary
collapse
#[], #[]=, included, #initialize
Instance Attribute Details
#id ⇒ String
22
|
# File 'lib/xrechnung/tax_category.rb', line 22
member :id, type: String
|
#percent ⇒ BigDecimal
26
|
# File 'lib/xrechnung/tax_category.rb', line 26
member :percent, type: BigDecimal, transform_value: ->(v) { v.nil? ? nil : BigDecimal(v, 0) }
|
#tax_exemption_reason ⇒ String
38
|
# File 'lib/xrechnung/tax_category.rb', line 38
member :tax_exemption_reason, type: String
|
#tax_exemption_reason_code ⇒ String
34
|
# File 'lib/xrechnung/tax_category.rb', line 34
member :tax_exemption_reason_code, type: String
|
#tax_scheme_id ⇒ String
30
|
# File 'lib/xrechnung/tax_category.rb', line 30
member :tax_scheme_id, type: String, default: "VAT"
|
Instance Method Details
#to_xml(xml, root_tag_name: :TaxCategory) ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/xrechnung/tax_category.rb', line 41
def to_xml(xml, root_tag_name: :TaxCategory)
xml.cac root_tag_name do
xml.cbc :ID, id
xml.cbc :Percent, format("%.2f", percent) unless percent.nil?
unless tax_exemption_reason_code.nil?
xml.cbc :TaxExemptionReasonCode, tax_exemption_reason_code
xml.cbc :TaxExemptionReason, tax_exemption_reason
end
xml.cac :TaxScheme do
xml.cbc :ID, tax_scheme_id
end
end
end
|