Skip to content

Commit

Permalink
Merge pull request #17 from doits/add_payment_reference
Browse files Browse the repository at this point in the history
Add payment reference
  • Loading branch information
halfbyte authored Jan 8, 2025
2 parents d251c68 + dcf941f commit 3f3df62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/secretariat/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module Secretariat
:line_items,
:currency_code,
:payment_type,
:payment_reference,
:payment_text,
:payment_terms_text,
:payment_due_date,
Expand Down Expand Up @@ -212,6 +213,9 @@ def to_xml(version: 1, validate: true)
end
trade_settlement = by_version(version, 'ApplicableSupplyChainTradeSettlement', 'ApplicableHeaderTradeSettlement')
xml['ram'].send(trade_settlement) do
if payment_reference && payment_reference != ''
xml['ram'].PaymentReference payment_reference
end
xml['ram'].InvoiceCurrencyCode currency_code
xml['ram'].SpecifiedTradeSettlementPaymentMeans do
xml['ram'].TypeCode payment_code
Expand Down
1 change: 1 addition & 0 deletions test/invoice_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def make_de_invoice
currency_code: 'USD',
payment_type: :CREDITCARD,
payment_text: 'Kreditkarte',
payment_reference: 'INV 123123123',
payment_iban: 'DE02120300000000202051',
payment_terms_text: "Zahlbar innerhalb von 14 Tagen ohne Abzug",
tax_category: :STANDARDRATE,
Expand Down

0 comments on commit 3f3df62

Please sign in to comment.