Class: Xrechnung::Item
Instance Attribute Summary collapse
Instance Method Summary
collapse
#[], #[]=, included, #initialize
Instance Attribute Details
#buyers_item_identification_id ⇒ Xrechnung::Id
19
|
# File 'lib/xrechnung/item.rb', line 19
member :buyers_item_identification_id, type: Xrechnung::Id, optional: true
|
31
|
# File 'lib/xrechnung/item.rb', line 31
member :classified_tax_category, type: Xrechnung::TaxCategory
|
27
|
# File 'lib/xrechnung/item.rb', line 27
member :commodity_classification, type: Xrechnung::TaxCategory
|
#description ⇒ String
7
|
# File 'lib/xrechnung/item.rb', line 7
member :description, type: String
|
#name ⇒ String
11
|
# File 'lib/xrechnung/item.rb', line 11
member :name, type: String
|
#sellers_item_identification_id ⇒ Xrechnung::Id
23
|
# File 'lib/xrechnung/item.rb', line 23
member :sellers_item_identification_id, type: Xrechnung::Id, optional: true
|
#standard_item_identification_id ⇒ Xrechnung::Id
15
|
# File 'lib/xrechnung/item.rb', line 15
member :standard_item_identification_id, type: Xrechnung::Id, optional: true
|
Instance Method Details
#to_xml(xml) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/xrechnung/item.rb', line 34
def to_xml(xml) xml.cac :Item do
xml.cbc :Description, description
xml.cbc :Name, name
unless standard_item_identification_id.nil?
xml.cac :StandardItemIdentification do
xml.cbc :ID, standard_item_identification_id.id, schemeID: standard_item_identification_id.scheme_id
end
end
unless buyers_item_identification_id.nil?
xml.cac :BuyersItemIdentification do
xml.cbc :ID, buyers_item_identification_id.id
end
end
unless sellers_item_identification_id.nil?
xml.cac :SellersItemIdentification do
xml.cbc :ID, sellers_item_identification_id.id
end
end
xml.cac :CommodityClassification, commodity_classification unless commodity_classification.nil?
classified_tax_category&.to_xml(xml, root_tag_name: :ClassifiedTaxCategory)
end
end
|