Class: FacturX::Invoice
- Inherits:
-
Object
- Object
- FacturX::Invoice
- Defined in:
- lib/factur_x/invoice.rb
Instance Attribute Summary collapse
-
#allowances ⇒ Object
readonly
Returns the value of attribute allowances.
-
#billing_period_end ⇒ Object
readonly
Returns the value of attribute billing_period_end.
-
#billing_period_start ⇒ Object
readonly
Returns the value of attribute billing_period_start.
-
#business_process ⇒ Object
readonly
Returns the value of attribute business_process.
-
#buyer ⇒ Object
readonly
Returns the value of attribute buyer.
-
#buyer_reference ⇒ Object
readonly
Returns the value of attribute buyer_reference.
-
#charges ⇒ Object
readonly
Returns the value of attribute charges.
-
#contract_reference ⇒ Object
readonly
Returns the value of attribute contract_reference.
-
#creditor_reference ⇒ Object
readonly
Returns the value of attribute creditor_reference.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#delivered_on ⇒ Object
readonly
Returns the value of attribute delivered_on.
-
#despatch_advice_reference ⇒ Object
readonly
Returns the value of attribute despatch_advice_reference.
-
#issued_on ⇒ Object
readonly
Returns the value of attribute issued_on.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#payee ⇒ Object
readonly
Returns the value of attribute payee.
-
#payment_means ⇒ Object
readonly
Returns the value of attribute payment_means.
-
#payment_reference ⇒ Object
readonly
Returns the value of attribute payment_reference.
-
#payment_terms ⇒ Object
readonly
Returns the value of attribute payment_terms.
-
#preceding_invoices ⇒ Object
readonly
Returns the value of attribute preceding_invoices.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#project_reference ⇒ Object
readonly
Returns the value of attribute project_reference.
-
#purchase_order_reference ⇒ Object
readonly
Returns the value of attribute purchase_order_reference.
-
#receiving_advice_reference ⇒ Object
readonly
Returns the value of attribute receiving_advice_reference.
-
#sales_order_reference ⇒ Object
readonly
Returns the value of attribute sales_order_reference.
-
#seller ⇒ Object
readonly
Returns the value of attribute seller.
-
#ship_to ⇒ Object
readonly
Returns the value of attribute ship_to.
-
#tax_breakdowns ⇒ Object
readonly
Returns the value of attribute tax_breakdowns.
-
#tax_representative ⇒ Object
readonly
Returns the value of attribute tax_representative.
-
#totals ⇒ Object
readonly
Returns the value of attribute totals.
-
#type_code ⇒ Object
readonly
Returns the value of attribute type_code.
Instance Method Summary collapse
- #billing_period? ⇒ Boolean
- #credit_note? ⇒ Boolean
-
#initialize(number:, issued_on:, seller:, buyer:, lines:, tax_breakdowns:, totals:, type_code: Codes::COMMERCIAL_INVOICE, currency: "EUR", business_process: nil, notes: [], buyer_reference: nil, payee: nil, tax_representative: nil, ship_to: nil, delivered_on: nil, payment_reference: nil, creditor_reference: nil, payment_means: [], payment_terms: nil, allowances: [], charges: [], purchase_order_reference: nil, sales_order_reference: nil, contract_reference: nil, project_reference: nil, project_name: nil, despatch_advice_reference: nil, receiving_advice_reference: nil, preceding_invoices: [], billing_period_start: nil, billing_period_end: nil) ⇒ Invoice
constructor
A new instance of Invoice.
- #to_xml(**options) ⇒ Object
Constructor Details
#initialize(number:, issued_on:, seller:, buyer:, lines:, tax_breakdowns:, totals:, type_code: Codes::COMMERCIAL_INVOICE, currency: "EUR", business_process: nil, notes: [], buyer_reference: nil, payee: nil, tax_representative: nil, ship_to: nil, delivered_on: nil, payment_reference: nil, creditor_reference: nil, payment_means: [], payment_terms: nil, allowances: [], charges: [], purchase_order_reference: nil, sales_order_reference: nil, contract_reference: nil, project_reference: nil, project_name: nil, despatch_advice_reference: nil, receiving_advice_reference: nil, preceding_invoices: [], billing_period_start: nil, billing_period_end: nil) ⇒ Invoice
Returns a new instance of Invoice.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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/factur_x/invoice.rb', line 17 def initialize(number:, issued_on:, seller:, buyer:, lines:, tax_breakdowns:, totals:, type_code: Codes::COMMERCIAL_INVOICE, currency: "EUR", business_process: nil, notes: [], buyer_reference: nil, payee: nil, tax_representative: nil, ship_to: nil, delivered_on: nil, payment_reference: nil, creditor_reference: nil, payment_means: [], payment_terms: nil, allowances: [], charges: [], purchase_order_reference: nil, sales_order_reference: nil, contract_reference: nil, project_reference: nil, project_name: nil, despatch_advice_reference: nil, receiving_advice_reference: nil, preceding_invoices: [], billing_period_start: nil, billing_period_end: nil) @number = number @type_code = type_code @issued_on = issued_on @currency = currency @business_process = business_process @notes = Array(notes) @buyer_reference = buyer_reference @seller = seller @buyer = buyer @payee = payee @tax_representative = tax_representative @ship_to = ship_to @delivered_on = delivered_on @payment_reference = payment_reference @creditor_reference = creditor_reference @payment_means = Array(payment_means) @payment_terms = payment_terms @lines = number_lines(Array(lines)) @allowances = Array(allowances) @charges = Array(charges) @tax_breakdowns = Array(tax_breakdowns) @totals = totals @purchase_order_reference = purchase_order_reference @sales_order_reference = sales_order_reference @contract_reference = contract_reference @project_reference = project_reference @project_name = project_name @despatch_advice_reference = despatch_advice_reference @receiving_advice_reference = receiving_advice_reference @preceding_invoices = Array(preceding_invoices) @billing_period_start = billing_period_start @billing_period_end = billing_period_end end |
Instance Attribute Details
#allowances ⇒ Object (readonly)
Returns the value of attribute allowances.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def allowances @allowances end |
#billing_period_end ⇒ Object (readonly)
Returns the value of attribute billing_period_end.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def billing_period_end @billing_period_end end |
#billing_period_start ⇒ Object (readonly)
Returns the value of attribute billing_period_start.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def billing_period_start @billing_period_start end |
#business_process ⇒ Object (readonly)
Returns the value of attribute business_process.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def business_process @business_process end |
#buyer ⇒ Object (readonly)
Returns the value of attribute buyer.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def buyer @buyer end |
#buyer_reference ⇒ Object (readonly)
Returns the value of attribute buyer_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def buyer_reference @buyer_reference end |
#charges ⇒ Object (readonly)
Returns the value of attribute charges.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def charges @charges end |
#contract_reference ⇒ Object (readonly)
Returns the value of attribute contract_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def contract_reference @contract_reference end |
#creditor_reference ⇒ Object (readonly)
Returns the value of attribute creditor_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def creditor_reference @creditor_reference end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def currency @currency end |
#delivered_on ⇒ Object (readonly)
Returns the value of attribute delivered_on.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def delivered_on @delivered_on end |
#despatch_advice_reference ⇒ Object (readonly)
Returns the value of attribute despatch_advice_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def despatch_advice_reference @despatch_advice_reference end |
#issued_on ⇒ Object (readonly)
Returns the value of attribute issued_on.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def issued_on @issued_on end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def lines @lines end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def notes @notes end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def number @number end |
#payee ⇒ Object (readonly)
Returns the value of attribute payee.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def payee @payee end |
#payment_means ⇒ Object (readonly)
Returns the value of attribute payment_means.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def payment_means @payment_means end |
#payment_reference ⇒ Object (readonly)
Returns the value of attribute payment_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def payment_reference @payment_reference end |
#payment_terms ⇒ Object (readonly)
Returns the value of attribute payment_terms.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def payment_terms @payment_terms end |
#preceding_invoices ⇒ Object (readonly)
Returns the value of attribute preceding_invoices.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def preceding_invoices @preceding_invoices end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def project_name @project_name end |
#project_reference ⇒ Object (readonly)
Returns the value of attribute project_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def project_reference @project_reference end |
#purchase_order_reference ⇒ Object (readonly)
Returns the value of attribute purchase_order_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def purchase_order_reference @purchase_order_reference end |
#receiving_advice_reference ⇒ Object (readonly)
Returns the value of attribute receiving_advice_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def receiving_advice_reference @receiving_advice_reference end |
#sales_order_reference ⇒ Object (readonly)
Returns the value of attribute sales_order_reference.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def sales_order_reference @sales_order_reference end |
#seller ⇒ Object (readonly)
Returns the value of attribute seller.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def seller @seller end |
#ship_to ⇒ Object (readonly)
Returns the value of attribute ship_to.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def ship_to @ship_to end |
#tax_breakdowns ⇒ Object (readonly)
Returns the value of attribute tax_breakdowns.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def tax_breakdowns @tax_breakdowns end |
#tax_representative ⇒ Object (readonly)
Returns the value of attribute tax_representative.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def tax_representative @tax_representative end |
#totals ⇒ Object (readonly)
Returns the value of attribute totals.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def totals @totals end |
#type_code ⇒ Object (readonly)
Returns the value of attribute type_code.
7 8 9 |
# File 'lib/factur_x/invoice.rb', line 7 def type_code @type_code end |
Instance Method Details
#billing_period? ⇒ Boolean
67 68 69 |
# File 'lib/factur_x/invoice.rb', line 67 def billing_period? !billing_period_start.nil? || !billing_period_end.nil? end |
#credit_note? ⇒ Boolean
63 64 65 |
# File 'lib/factur_x/invoice.rb', line 63 def credit_note? type_code == Codes::CREDIT_NOTE end |