Class: Xrechnung::TaxCategory
- Inherits:
-
Object
- Object
- Xrechnung::TaxCategory
show all
- Includes:
- MemberContainer
- Defined in:
- lib/xrechnung/tax_category.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
#[], #[]=, included, #initialize
Instance Attribute Details
#id ⇒ String
28
|
# File 'lib/xrechnung/tax_category.rb', line 28
member :id, type: String
|
#percent ⇒ BigDecimal
32
|
# File 'lib/xrechnung/tax_category.rb', line 32
member :percent, type: BigDecimal, transform_value: ->(v) { v.nil? ? nil : BigDecimal(v, 0) }
|
#tax_exemption_reason ⇒ String
44
|
# File 'lib/xrechnung/tax_category.rb', line 44
member :tax_exemption_reason, type: String
|
#tax_exemption_reason_code ⇒ String
40
|
# File 'lib/xrechnung/tax_category.rb', line 40
member :tax_exemption_reason_code, type: String
|
#tax_scheme_id ⇒ String
36
|
# File 'lib/xrechnung/tax_category.rb', line 36
member :tax_scheme_id, type: String, default: "VAT"
|
Instance Method Details
#to_xml(xml, root_tag_name: :TaxCategory) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/xrechnung/tax_category.rb', line 47
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
|