Class: Xrechnung::InvoiceLine
- Inherits:
-
Object
- Object
- Xrechnung::InvoiceLine
- Includes:
- MemberContainer
- Defined in:
- lib/xrechnung/invoice_line.rb
Instance Attribute Summary collapse
- #allowance_charges ⇒ Array<Xrechnung::AllowanceCharge>
- #id ⇒ Integer
- #invoice_period ⇒ Xrechnung::InvoicePeriod
- #invoiced_quantity ⇒ Xrechnung::Quantity
- #item ⇒ Xrechnung::Item
- #line_extension_amount ⇒ Xrechnung::Currency
- #price ⇒ Xrechnung::Price
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ InvoiceLine
constructor
A new instance of InvoiceLine.
-
#to_xml(xml) ⇒ Object
noinspection RubyResolve.
Methods included from MemberContainer
Constructor Details
#initialize(**kwargs) ⇒ InvoiceLine
Returns a new instance of InvoiceLine.
35 36 37 38 39 40 |
# File 'lib/xrechnung/invoice_line.rb', line 35 def initialize(**kwargs) unless kwargs[:line_extension_amount].is_a?(Currency) kwargs[:line_extension_amount] = Currency::EUR(kwargs[:line_extension_amount]) end super(**kwargs) end |
Instance Attribute Details
#allowance_charges ⇒ Array<Xrechnung::AllowanceCharge>
33 |
# File 'lib/xrechnung/invoice_line.rb', line 33 member :allowance_charges, type: Array, default: [] |
#id ⇒ Integer
9 |
# File 'lib/xrechnung/invoice_line.rb', line 9 member :id, type: Integer |
#invoice_period ⇒ Xrechnung::InvoicePeriod
21 |
# File 'lib/xrechnung/invoice_line.rb', line 21 member :invoice_period, type: Xrechnung::InvoicePeriod, optional: true |
#invoiced_quantity ⇒ Xrechnung::Quantity
13 |
# File 'lib/xrechnung/invoice_line.rb', line 13 member :invoiced_quantity, type: Xrechnung::Quantity |
#item ⇒ Xrechnung::Item
25 |
# File 'lib/xrechnung/invoice_line.rb', line 25 member :item, type: Xrechnung::Item |
#line_extension_amount ⇒ Xrechnung::Currency
17 |
# File 'lib/xrechnung/invoice_line.rb', line 17 member :line_extension_amount, type: Xrechnung::Currency |
#price ⇒ Xrechnung::Price
29 |
# File 'lib/xrechnung/invoice_line.rb', line 29 member :price, type: Xrechnung::Price |
Instance Method Details
#to_xml(xml) ⇒ Object
noinspection RubyResolve
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/xrechnung/invoice_line.rb', line 43 def to_xml(xml) xml.cac :InvoiceLine do xml.cbc :ID, id xml.cbc :InvoicedQuantity, invoiced_quantity.amount_to_s, unitCode: invoiced_quantity.unit_code xml.cbc :LineExtensionAmount, *line_extension_amount.xml_args invoice_period&.to_xml(xml) unless self.class.members[:invoice_period].optional && invoice_period.nil? allowance_charges.each do |allowance_charge| allowance_charge.to_xml(xml) end item&.to_xml(xml) price&.to_xml(xml) end end |