Module: Ksef::FA3::AdvanceReader
- Extended by:
- NodeReader
- Defined in:
- lib/ksef/fa3/advance_reader.rb
Overview
Reads the two elements that make an invoice part of an advance-payment sequence:
Zamowienie, the order a ZAL collects against, and FakturaZaliczkowa, the advance
invoices a ROZ settles (docs/REFERENCE.md §8.5).
Split out for the reason CorrectionReader is: it is the part of reading an invoice that is entirely about one family of types.
Constant Summary
Constants included from NodeReader
NodeReader::NAMESPACES, NodeReader::PREFIX
Class Method Summary collapse
-
.advances_from(fa_node) ⇒ Array<AdvanceInvoice>
Empty when the invoice settles nothing.
- .order_from(fa_node) ⇒ Order?
Class Method Details
.advances_from(fa_node) ⇒ Array<AdvanceInvoice>
Returns empty when the invoice settles nothing.
26 27 28 |
# File 'lib/ksef/fa3/advance_reader.rb', line 26 def advances_from(fa_node) elements(fa_node, "FakturaZaliczkowa").map { |node| advance_from(node) } end |
.order_from(fa_node) ⇒ Order?
17 18 19 20 21 22 23 |
# File 'lib/ksef/fa3/advance_reader.rb', line 17 def order_from(fa_node) node = element(fa_node, "Zamowienie") return nil if node.nil? Order.new(total: text!(node, "WartoscZamowienia"), lines: elements(node, "ZamowienieWiersz").map { |row| order_line_from(row) }) end |