en16931 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82694745f476c409a9426718145ecf0a20ea7df0b43887c15367a6fee0ddb1a6
4
- data.tar.gz: 7f5e45615e2cceaa50ea3533cd57a78bf844f78995ffeb04e20f1c3c01a9a296
3
+ metadata.gz: ab2fcb48e5865373d6e367fef22b0bbdcc9d197cd7181f76ae11f70c6f8cfda7
4
+ data.tar.gz: 81a2bc644ccb5434150c5f2bb7df0f61292b684c44ef07dee8052a67eadb171d
5
5
  SHA512:
6
- metadata.gz: 2b46c041335e5ceb2d1085c3c5f4ad38973ad04ac0867085a48a3b36777fcd26cd749dee7e90a893dbabfc8734cb7d8864307b85dd9b842a754069bf2d61b68f
7
- data.tar.gz: e7bf88692a48caa4c9d55baaf3f2b48f61bacd5561b14b5791708eb821f2f268771c2544be6b8d7b6df01b57c8164929d1ddcec5227cac3de9fb4a81702d8b56
6
+ metadata.gz: 14ba87494ae371989918668535de1b17468da5e2c32e3fd5011abfaf29aa94c4c4e73cded3182203b424a2220cbc9b19588b4a2c1a54871c793be51fd7778a3a
7
+ data.tar.gz: d3467aad1cdd1cce58cc09c3ea4146d3bf988a62d75be237d95cff5a3cd40e3ae605fb76a759fa625d76f4fb5e80d65b614a3d57ffa8d599039c83f9959121fe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.3] - 2026-10-21
4
+
5
+ - The recipient block shows the buyer's contact person ("z. Hd.") and VAT identifier. Like the XML, it leaves the VAT identifier out for invoices outside the scope of VAT (category O).
6
+ - `Invoice#references` takes further references of the buyer, such as a cost centre or an order number. The layout prints them in the header below the buyer reference; the XML, which has no field for them, carries them as notes.
7
+
3
8
  ## [0.1.2] - 2026-10-21
4
9
 
5
10
  - Long payment terms no longer run under the GiroCode; beside it the payment block is narrower.
data/README.md CHANGED
@@ -37,6 +37,7 @@ buyer = EN16931::Party.new(
37
37
  invoice = EN16931::Invoice.new(
38
38
  number: "2026-0001", issue_date: Date.new(2026, 10, 20), due_date: Date.new(2026, 11, 3),
39
39
  seller: seller, buyer: buyer, buyer_reference: "PO-4711",
40
+ references: { "Kostenstelle" => "4711" }, # printed in the header, an XML note
40
41
  tax: EN16931::DE.standard,
41
42
  lines: [EN16931::Line.new(description: "Produktvideo TikTok, 60 Sekunden", unit_price: "1500.00")],
42
43
  payment: EN16931::Payment.new(iban: "DE89 3704 0044 0532 0130 00", bic: "COBADEFFXXX", holder: "Lena Beispiel",
@@ -14,12 +14,14 @@ module EN16931
14
14
  }.freeze
15
15
 
16
16
  attr_reader :number, :issue_date, :due_date, :seller, :buyer, :lines, :tax, :currency, :buyer_reference,
17
- :type, :payment, :period, :notes, :delivery_date, :preceding, :allowances, :charges, :prepaid
17
+ :type, :payment, :period, :notes, :references, :delivery_date, :preceding, :allowances, :charges, :prepaid
18
18
 
19
19
  # @param preceding [Hash, nil] { number:, issue_date: } of the invoice a correction refers to (BG-3)
20
20
  # @param period [Range<Date>, nil] the invoicing period (BG-14), e.g. a retainer month
21
+ # @param references [Hash{String => String}] further references of the buyer, e.g. a cost centre; printed
22
+ # in the header and, having no field of their own in EN 16931, carried in the XML as notes
21
23
  def initialize(number:, issue_date:, seller:, buyer:, lines:, tax:, type: :invoice, due_date: nil, currency: "EUR",
22
- buyer_reference: nil, payment: nil, period: nil, notes: [], delivery_date: nil, preceding: nil,
24
+ buyer_reference: nil, payment: nil, period: nil, notes: [], references: {}, delivery_date: nil, preceding: nil,
23
25
  allowances: [], charges: [], prepaid: 0)
24
26
  raise ArgumentError, "unknown type #{type.inspect}" unless TYPES.key?(type)
25
27
  raise ArgumentError, "an invoice needs at least one line" if lines.empty?
@@ -37,6 +39,7 @@ module EN16931
37
39
  @payment = payment
38
40
  @period = period
39
41
  @notes = Array(notes)
42
+ @references = references.to_h
40
43
  @delivery_date = delivery_date
41
44
  @preceding = preceding
42
45
  # The list decides the direction; the flag follows it.
@@ -14,7 +14,7 @@ module EN16931
14
14
  reference: "Ihre Referenz", preceding: "Zur Rechnung", pos: "Pos.", description: "Beschreibung", qty: "Menge", unit_price: "Einzelpreis",
15
15
  net: "Netto", sum_net: "Summe netto", vat: "Umsatzsteuer", allowance: "Nachlass", charge: "Zuschlag", prepaid: "Bereits gezahlt",
16
16
  gross: "Gesamtbetrag", payable: "Zahlbetrag", payment: "Zahlung", iban: "IBAN", bic: "BIC", holder: "Kontoinhaber",
17
- reference_line: "Verwendungszweck", vat_id: "USt-IdNr.", tax_number: "Steuernummer", contact: "Kontakt",
17
+ reference_line: "Verwendungszweck", vat_id: "USt-IdNr.", tax_number: "Steuernummer", contact: "Kontakt", attention: "z. Hd.",
18
18
  giro_code: "GiroCode", units: %w[Stk. Std. Tage Monate pauschal Leistung] },
19
19
  en: { invoice: "Invoice", credit_note: "Credit note", corrected: "Corrected invoice", self_billed: "Self-billed invoice",
20
20
  partial: "Partial invoice", prepayment: "Prepayment invoice",
@@ -22,7 +22,7 @@ module EN16931
22
22
  reference: "Your reference", preceding: "Refers to invoice", pos: "No.", description: "Description", qty: "Quantity", unit_price: "Unit price",
23
23
  net: "Net", sum_net: "Total net", vat: "VAT", allowance: "Discount", charge: "Charge", prepaid: "Prepaid",
24
24
  gross: "Total", payable: "Amount due", payment: "Payment", iban: "IBAN", bic: "BIC", holder: "Account holder",
25
- reference_line: "Payment reference", vat_id: "VAT id", tax_number: "Tax number", contact: "Contact",
25
+ reference_line: "Payment reference", vat_id: "VAT id", tax_number: "Tax number", contact: "Contact", attention: "Attn.",
26
26
  giro_code: "Scan to pay", units: ["pcs", "h", "days", "months", "lump sum", "service"] },
27
27
  cs: { invoice: "Faktura", credit_note: "Dobropis", corrected: "Opravná faktura", self_billed: "Faktura vystavená odběratelem",
28
28
  partial: "Dílčí faktura", prepayment: "Zálohová faktura",
@@ -30,7 +30,7 @@ module EN16931
30
30
  reference: "Vaše reference", preceding: "K faktuře", pos: "Č.", description: "Popis", qty: "Množství", unit_price: "Jedn. cena",
31
31
  net: "Bez DPH", sum_net: "Celkem bez DPH", vat: "DPH", allowance: "Sleva", charge: "Příplatek", prepaid: "Již zaplaceno",
32
32
  gross: "Celkem", payable: "K úhradě", payment: "Platba", iban: "IBAN", bic: "BIC", holder: "Majitel účtu",
33
- reference_line: "Účel platby", vat_id: "DIČ", tax_number: "Daňové číslo", contact: "Kontakt",
33
+ reference_line: "Účel platby", vat_id: "DIČ", tax_number: "Daňové číslo", contact: "Kontakt", attention: "K rukám",
34
34
  giro_code: "Naskenujte a zaplaťte", units: ["ks", "hod.", "dny", "měsíce", "paušál", "služba"] },
35
35
  da: { invoice: "Faktura", credit_note: "Kreditnota", corrected: "Korrigeret faktura", self_billed: "Selvfakturering",
36
36
  partial: "Delfaktura", prepayment: "Forudbetalingsfaktura",
@@ -38,7 +38,7 @@ module EN16931
38
38
  reference: "Jeres reference", preceding: "Vedrører faktura", pos: "Nr.", description: "Beskrivelse", qty: "Antal", unit_price: "Enhedspris",
39
39
  net: "Netto", sum_net: "I alt netto", vat: "Moms", allowance: "Rabat", charge: "Tillæg", prepaid: "Allerede betalt",
40
40
  gross: "I alt", payable: "Beløb til betaling", payment: "Betaling", iban: "IBAN", bic: "BIC", holder: "Kontohaver",
41
- reference_line: "Betalingsreference", vat_id: "Momsnr.", tax_number: "Skattenummer", contact: "Kontakt",
41
+ reference_line: "Betalingsreference", vat_id: "Momsnr.", tax_number: "Skattenummer", contact: "Kontakt", attention: "Att.:",
42
42
  giro_code: "Scan for at betale", units: ["stk.", "t.", "dage", "måneder", "samlet", "ydelse"] },
43
43
  es: { invoice: "Factura", credit_note: "Nota de abono", corrected: "Factura rectificativa", self_billed: "Autofactura",
44
44
  partial: "Factura parcial", prepayment: "Factura de anticipo",
@@ -46,7 +46,7 @@ module EN16931
46
46
  reference: "Su referencia", preceding: "Referente a la factura", pos: "N.º", description: "Descripción", qty: "Cantidad", unit_price: "Precio unitario",
47
47
  net: "Neto", sum_net: "Total neto", vat: "IVA", allowance: "Descuento", charge: "Recargo", prepaid: "Ya pagado",
48
48
  gross: "Total", payable: "Importe a pagar", payment: "Pago", iban: "IBAN", bic: "BIC", holder: "Titular de la cuenta",
49
- reference_line: "Concepto", vat_id: "NIF-IVA", tax_number: "Número fiscal", contact: "Contacto",
49
+ reference_line: "Concepto", vat_id: "NIF-IVA", tax_number: "Número fiscal", contact: "Contacto", attention: "A la atención de",
50
50
  giro_code: "Escanear para pagar", units: ["uds.", "h", "días", "meses", "global", "servicio"] },
51
51
  et: { invoice: "Arve", credit_note: "Kreeditarve", corrected: "Parandatud arve", self_billed: "Ostja koostatud arve",
52
52
  partial: "Osaarve", prepayment: "Ettemaksuarve",
@@ -54,7 +54,7 @@ module EN16931
54
54
  reference: "Teie viide", preceding: "Seotud arvega", pos: "Nr", description: "Kirjeldus", qty: "Kogus", unit_price: "Ühikuhind",
55
55
  net: "Neto", sum_net: "Kokku neto", vat: "Käibemaks", allowance: "Allahindlus", charge: "Lisatasu", prepaid: "Juba makstud",
56
56
  gross: "Kokku", payable: "Tasumisele kuulub", payment: "Makse", iban: "IBAN", bic: "BIC", holder: "Konto omanik",
57
- reference_line: "Selgitus", vat_id: "KMKR nr", tax_number: "Maksunumber", contact: "Kontakt",
57
+ reference_line: "Selgitus", vat_id: "KMKR nr", tax_number: "Maksunumber", contact: "Kontakt", attention: "Kontaktisik:",
58
58
  giro_code: "Skanni ja maksa", units: %w[tk h päeva kuud ühekordne teenus] },
59
59
  fi: { invoice: "Lasku", credit_note: "Hyvityslasku", corrected: "Korjattu lasku", self_billed: "Itselaskutus",
60
60
  partial: "Osalasku", prepayment: "Ennakkolasku",
@@ -62,7 +62,7 @@ module EN16931
62
62
  reference: "Viitteenne", preceding: "Koskee laskua", pos: "Nro", description: "Kuvaus", qty: "Määrä", unit_price: "Yksikköhinta",
63
63
  net: "Netto", sum_net: "Yhteensä netto", vat: "ALV", allowance: "Alennus", charge: "Lisämaksu", prepaid: "Jo maksettu",
64
64
  gross: "Yhteensä", payable: "Maksettava", payment: "Maksu", iban: "IBAN", bic: "BIC", holder: "Tilinhaltija",
65
- reference_line: "Viesti", vat_id: "ALV-tunniste", tax_number: "Verotunniste", contact: "Yhteystiedot",
65
+ reference_line: "Viesti", vat_id: "ALV-tunniste", tax_number: "Verotunniste", contact: "Yhteystiedot", attention: "Yhteyshenkilö:",
66
66
  giro_code: "Skannaa ja maksa", units: %w[kpl h päivää kuukautta kertaerä palvelu] },
67
67
  fr: { invoice: "Facture", credit_note: "Avoir", corrected: "Facture rectificative", self_billed: "Autofacturation",
68
68
  partial: "Facture partielle", prepayment: "Facture d'acompte",
@@ -70,7 +70,7 @@ module EN16931
70
70
  reference: "Votre référence", preceding: "Se rapporte à la facture", pos: "N°", description: "Désignation", qty: "Quantité", unit_price: "Prix unitaire",
71
71
  net: "Net HT", sum_net: "Total HT", vat: "TVA", allowance: "Remise", charge: "Supplément", prepaid: "Déjà payé",
72
72
  gross: "Total TTC", payable: "Montant à payer", payment: "Paiement", iban: "IBAN", bic: "BIC", holder: "Titulaire du compte",
73
- reference_line: "Référence de paiement", vat_id: "N° TVA", tax_number: "N° fiscal", contact: "Contact",
73
+ reference_line: "Référence de paiement", vat_id: "N° TVA", tax_number: "N° fiscal", contact: "Contact", attention: "À l'attention de",
74
74
  giro_code: "Scanner pour payer", units: %w[pce h jours mois forfait prestation] },
75
75
  it: { invoice: "Fattura", credit_note: "Nota di credito", corrected: "Fattura rettificativa", self_billed: "Autofattura",
76
76
  partial: "Fattura parziale", prepayment: "Fattura di acconto",
@@ -78,7 +78,7 @@ module EN16931
78
78
  reference: "Vostro riferimento", preceding: "Riferita alla fattura", pos: "N.", description: "Descrizione", qty: "Quantità", unit_price: "Prezzo unitario",
79
79
  net: "Netto", sum_net: "Totale imponibile", vat: "IVA", allowance: "Sconto", charge: "Maggiorazione", prepaid: "Già pagato",
80
80
  gross: "Totale", payable: "Importo da pagare", payment: "Pagamento", iban: "IBAN", bic: "BIC", holder: "Intestatario del conto",
81
- reference_line: "Causale", vat_id: "Partita IVA", tax_number: "Codice fiscale", contact: "Contatto",
81
+ reference_line: "Causale", vat_id: "Partita IVA", tax_number: "Codice fiscale", contact: "Contatto", attention: "Alla c.a. di",
82
82
  giro_code: "Scansiona per pagare", units: %w[pz h giorni mesi forfait prestazione] },
83
83
  lv: { invoice: "Rēķins", credit_note: "Kredītrēķins", corrected: "Labots rēķins", self_billed: "Pircēja sagatavots rēķins",
84
84
  partial: "Daļējs rēķins", prepayment: "Avansa rēķins",
@@ -86,7 +86,7 @@ module EN16931
86
86
  reference: "Jūsu atsauce", preceding: "Attiecas uz rēķinu", pos: "Nr.", description: "Apraksts", qty: "Daudzums", unit_price: "Vienības cena",
87
87
  net: "Neto", sum_net: "Kopā neto", vat: "PVN", allowance: "Atlaide", charge: "Piemaksa", prepaid: "Jau samaksāts",
88
88
  gross: "Kopā", payable: "Apmaksājamā summa", payment: "Maksājums", iban: "IBAN", bic: "BIC", holder: "Konta turētājs",
89
- reference_line: "Maksājuma mērķis", vat_id: "PVN reģ. nr.", tax_number: "Nodokļu maksātāja nr.", contact: "Kontakti",
89
+ reference_line: "Maksājuma mērķis", vat_id: "PVN reģ. nr.", tax_number: "Nodokļu maksātāja nr.", contact: "Kontakti", attention: "Kontaktpersona:",
90
90
  giro_code: "Skenējiet, lai samaksātu", units: ["gab.", "h", "dienas", "mēneši", "kopsumma", "pakalpojums"] },
91
91
  nl: { invoice: "Factuur", credit_note: "Creditnota", corrected: "Gecorrigeerde factuur", self_billed: "Factuur opgemaakt door afnemer",
92
92
  partial: "Deelfactuur", prepayment: "Voorschotfactuur",
@@ -94,7 +94,7 @@ module EN16931
94
94
  reference: "Uw referentie", preceding: "Betreft factuur", pos: "Nr.", description: "Omschrijving", qty: "Aantal", unit_price: "Stukprijs",
95
95
  net: "Netto", sum_net: "Totaal netto", vat: "Btw", allowance: "Korting", charge: "Toeslag", prepaid: "Reeds betaald",
96
96
  gross: "Totaal", payable: "Te betalen", payment: "Betaling", iban: "IBAN", bic: "BIC", holder: "Rekeninghouder",
97
- reference_line: "Betalingskenmerk", vat_id: "Btw-nr.", tax_number: "Fiscaal nummer", contact: "Contact",
97
+ reference_line: "Betalingskenmerk", vat_id: "Btw-nr.", tax_number: "Fiscaal nummer", contact: "Contact", attention: "T.a.v.",
98
98
  giro_code: "Scan om te betalen", units: ["st.", "u", "dagen", "maanden", "forfaitair", "dienst"] },
99
99
  pl: { invoice: "Faktura", credit_note: "Nota uznaniowa", corrected: "Faktura korygująca", self_billed: "Samofakturowanie",
100
100
  partial: "Faktura częściowa", prepayment: "Faktura zaliczkowa",
@@ -102,7 +102,7 @@ module EN16931
102
102
  reference: "Państwa referencja", preceding: "Dotyczy faktury", pos: "Lp.", description: "Opis", qty: "Ilość", unit_price: "Cena jedn.",
103
103
  net: "Netto", sum_net: "Razem netto", vat: "VAT", allowance: "Rabat", charge: "Dopłata", prepaid: "Już zapłacono",
104
104
  gross: "Razem", payable: "Do zapłaty", payment: "Płatność", iban: "IBAN", bic: "BIC", holder: "Właściciel rachunku",
105
- reference_line: "Tytuł przelewu", vat_id: "Nr VAT", tax_number: "Numer podatkowy", contact: "Kontakt",
105
+ reference_line: "Tytuł przelewu", vat_id: "Nr VAT", tax_number: "Numer podatkowy", contact: "Kontakt", attention: "Do rąk",
106
106
  giro_code: "Zeskanuj, aby zapłacić", units: ["szt.", "godz.", "dni", "mies.", "ryczałt", "usługa"] },
107
107
  pt: { invoice: "Fatura", credit_note: "Nota de crédito", corrected: "Fatura retificativa", self_billed: "Autofaturação",
108
108
  partial: "Fatura parcial", prepayment: "Fatura de adiantamento",
@@ -110,7 +110,7 @@ module EN16931
110
110
  reference: "A sua referência", preceding: "Referente à fatura", pos: "N.º", description: "Descrição", qty: "Quantidade", unit_price: "Preço unitário",
111
111
  net: "Líquido", sum_net: "Total líquido", vat: "IVA", allowance: "Desconto", charge: "Acréscimo", prepaid: "Já pago",
112
112
  gross: "Total", payable: "Valor a pagar", payment: "Pagamento", iban: "IBAN", bic: "BIC", holder: "Titular da conta",
113
- reference_line: "Referência de pagamento", vat_id: "N.º IVA", tax_number: "Número fiscal", contact: "Contacto",
113
+ reference_line: "Referência de pagamento", vat_id: "N.º IVA", tax_number: "Número fiscal", contact: "Contacto", attention: "A/C",
114
114
  giro_code: "Digitalize para pagar", units: ["un.", "h", "dias", "meses", "valor global", "serviço"] },
115
115
  ro: { invoice: "Factură", credit_note: "Notă de credit", corrected: "Factură de corecție", self_billed: "Autofactură",
116
116
  partial: "Factură parțială", prepayment: "Factură de avans",
@@ -118,7 +118,7 @@ module EN16931
118
118
  reference: "Referința dvs.", preceding: "Se referă la factura", pos: "Nr.", description: "Descriere", qty: "Cantitate", unit_price: "Preț unitar",
119
119
  net: "Net", sum_net: "Total net", vat: "TVA", allowance: "Reducere", charge: "Supliment", prepaid: "Deja plătit",
120
120
  gross: "Total", payable: "De plată", payment: "Plată", iban: "IBAN", bic: "BIC", holder: "Titular cont",
121
- reference_line: "Referință plată", vat_id: "Cod TVA", tax_number: "Cod fiscal", contact: "Contact",
121
+ reference_line: "Referință plată", vat_id: "Cod TVA", tax_number: "Cod fiscal", contact: "Contact", attention: "În atenția",
122
122
  giro_code: "Scanați pentru a plăti", units: ["buc.", "h", "zile", "luni", "forfetar", "serviciu"] },
123
123
  ru: { invoice: "Счёт", credit_note: "Кредит-нота", corrected: "Исправленный счёт", self_billed: "Счёт, выставленный покупателем",
124
124
  partial: "Частичный счёт", prepayment: "Счёт на предоплату",
@@ -126,7 +126,7 @@ module EN16931
126
126
  reference: "Ваш референс", preceding: "К счёту", pos: "№", description: "Описание", qty: "Кол-во", unit_price: "Цена за ед.",
127
127
  net: "Нетто", sum_net: "Итого нетто", vat: "НДС", allowance: "Скидка", charge: "Надбавка", prepaid: "Уже оплачено",
128
128
  gross: "Итого", payable: "К оплате", payment: "Оплата", iban: "IBAN", bic: "BIC", holder: "Владелец счёта",
129
- reference_line: "Назначение платежа", vat_id: "Номер НДС", tax_number: "Налоговый номер", contact: "Контакт",
129
+ reference_line: "Назначение платежа", vat_id: "Номер НДС", tax_number: "Налоговый номер", contact: "Контакт", attention: "Вниманию:",
130
130
  giro_code: "Отсканируйте для оплаты", units: ["шт.", "ч", "дн.", "мес.", "паушально", "услуга"] },
131
131
  sv: { invoice: "Faktura", credit_note: "Kreditfaktura", corrected: "Rättad faktura", self_billed: "Självfaktura",
132
132
  partial: "Delfaktura", prepayment: "Förskottsfaktura",
@@ -134,7 +134,7 @@ module EN16931
134
134
  reference: "Er referens", preceding: "Avser faktura", pos: "Nr", description: "Beskrivning", qty: "Antal", unit_price: "À-pris",
135
135
  net: "Netto", sum_net: "Summa netto", vat: "Moms", allowance: "Rabatt", charge: "Tillägg", prepaid: "Redan betalt",
136
136
  gross: "Totalt", payable: "Att betala", payment: "Betalning", iban: "IBAN", bic: "BIC", holder: "Kontoinnehavare",
137
- reference_line: "Betalningsreferens", vat_id: "Momsreg.nr", tax_number: "Skattenummer", contact: "Kontakt",
137
+ reference_line: "Betalningsreferens", vat_id: "Momsreg.nr", tax_number: "Skattenummer", contact: "Kontakt", attention: "Att:",
138
138
  giro_code: "Skanna för att betala", units: ["st", "tim", "dagar", "månader", "fast pris", "tjänst"] },
139
139
  tr: { invoice: "Fatura", credit_note: "Alacak dekontu", corrected: "Düzeltilmiş fatura", self_billed: "Alıcı tarafından düzenlenen fatura",
140
140
  partial: "Kısmi fatura", prepayment: "Ön ödeme faturası",
@@ -142,7 +142,7 @@ module EN16931
142
142
  reference: "Referansınız", preceding: "İlgili fatura", pos: "No", description: "Açıklama", qty: "Miktar", unit_price: "Birim fiyat",
143
143
  net: "Net", sum_net: "Net toplam", vat: "KDV", allowance: "İndirim", charge: "Ek ücret", prepaid: "Ödenmiş",
144
144
  gross: "Toplam", payable: "Ödenecek tutar", payment: "Ödeme", iban: "IBAN", bic: "BIC", holder: "Hesap sahibi",
145
- reference_line: "Ödeme açıklaması", vat_id: "KDV no", tax_number: "Vergi numarası", contact: "İletişim",
145
+ reference_line: "Ödeme açıklaması", vat_id: "KDV no", tax_number: "Vergi numarası", contact: "İletişim", attention: "İlgili kişi:",
146
146
  giro_code: "Ödemek için tarayın", units: %w[adet sa gün ay götürü hizmet] },
147
147
  # Chinese needs a font with CJK glyphs; pass one through Branding#font.
148
148
  zh: { invoice: "发票", credit_note: "贷记单", corrected: "更正发票", self_billed: "买方自开发票",
@@ -151,7 +151,7 @@ module EN16931
151
151
  reference: "您的参考号", preceding: "关联发票", pos: "序号", description: "描述", qty: "数量", unit_price: "单价",
152
152
  net: "净额", sum_net: "净额合计", vat: "增值税", allowance: "折扣", charge: "附加费", prepaid: "已付款",
153
153
  gross: "总计", payable: "应付金额", payment: "付款", iban: "IBAN", bic: "BIC", holder: "账户持有人",
154
- reference_line: "付款附言", vat_id: "增值税号", tax_number: "税号", contact: "联系方式",
154
+ reference_line: "付款附言", vat_id: "增值税号", tax_number: "税号", contact: "联系方式", attention: "收件人:",
155
155
  giro_code: "扫码付款", units: %w[件 小时 天 个月 一次性 服务] }
156
156
  }.transform_values { |labels| labels.merge(units: UNIT_CODES.zip(labels[:units]).to_h).freeze }.freeze
157
157
 
@@ -81,8 +81,11 @@ module EN16931
81
81
  pdf.move_down 6
82
82
  buyer = invoice.buyer
83
83
  pdf.text buyer.name, style: :bold
84
+ pdf.text "#{t(:attention)} #{buyer.contact_name}" if buyer.contact_name && buyer.contact_name != buyer.name
84
85
  buyer.address_lines.each { |line| pdf.text line }
85
86
  pdf.text country_name(buyer.country) unless buyer.country == invoice.seller.country
87
+ # Same rule as the XML: outside the scope of VAT no VAT identifiers.
88
+ pdf.text "#{t(:vat_id)} #{buyer.vat_id}" if buyer.vat_id && invoice.taxes.none?(&:forbids_vat_identifiers?)
86
89
  pdf.move_down 28
87
90
  end
88
91
 
@@ -94,6 +97,7 @@ module EN16931
94
97
  rows << [t(:delivery), date(invoice.delivery_date)] if invoice.delivery_date
95
98
  rows << [t(:period), "#{date(invoice.period.begin)} – #{date(invoice.period.end)}"] if invoice.period
96
99
  rows << [t(:reference), invoice.buyer_reference] if invoice.buyer_reference
100
+ rows.concat(invoice.references.to_a)
97
101
  if invoice.preceding
98
102
  rows << [t(:preceding),
99
103
  [invoice.preceding[:number], (date(invoice.preceding[:issue_date]) if invoice.preceding[:issue_date])].compact.join(", ")]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EN16931
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/en16931/xml.rb CHANGED
@@ -47,7 +47,8 @@ module EN16931
47
47
  doc.due_date = invoice.due_date
48
48
  doc.delivery_date = invoice.delivery_date
49
49
  doc.buyer_reference = invoice.buyer_reference
50
- doc.note = invoice.notes.join("\n") unless invoice.notes.empty?
50
+ notes = invoice.references.map { |name, value| "#{name}: #{value}" } + invoice.notes
51
+ doc.note = notes.join("\n") unless notes.empty?
51
52
  hide_vat_ids = invoice.taxes.any?(&:forbids_vat_identifiers?)
52
53
  doc.seller = party(invoice.seller, vat_identifier: !hide_vat_ids, seller: true)
53
54
  doc.buyer = party(invoice.buyer, vat_identifier: !hide_vat_ids)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: en16931
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schwed