Skip to content

Commit bd0115d

Browse files
committed
Add payment_bic and payment_payee_account_name to invoice
[Verification of Payee](https://www.europeanpaymentscouncil.eu/what-we-do/other-schemes/verification-payee) will require payee account names to be correct on bank transfers, so having that information within the XML available will be helpful when processing invoices. The BIC has been added for the sake of completeness.
1 parent 43516a3 commit bd0115d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/secretariat/invoice.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module Secretariat
3333
:payment_terms_text,
3434
:payment_due_date,
3535
:payment_iban,
36+
:payment_bic,
37+
:payment_payee_account_name,
3638
:tax_category,
3739
:tax_percent,
3840
:tax_amount,
@@ -263,9 +265,15 @@ def to_xml(version: 1, validate: true)
263265
xml['ram'].SpecifiedTradeSettlementPaymentMeans do
264266
xml['ram'].TypeCode payment_code
265267
xml['ram'].Information payment_text
266-
if payment_iban
268+
if payment_iban || payment_payee_account_name
267269
xml['ram'].PayeePartyCreditorFinancialAccount do
268-
xml['ram'].IBANID payment_iban
270+
xml['ram'].IBANID payment_iban if payment_iban
271+
xml['ram'].AccountName payment_payee_account_name if payment_payee_account_name
272+
end
273+
end
274+
if payment_bic
275+
xml['ram'].PayeeSpecifiedCreditorFinancialInstitution do
276+
xml['ram'].BICID payment_bic
269277
end
270278
end
271279
end

test/invoice_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ def make_negative_de_invoice
345345
payment_reference: 'INV 123123123',
346346
payment_iban: 'DE02120300000000202051',
347347
payment_terms_text: "Wir zahlen die Gutschrift unmittelbar aus",
348+
payment_bic: 'BYLADEM1001',
349+
payment_payee_account_name: 'Depfu inc',
348350
tax_category: :STANDARDRATE,
349351
tax_amount: BigDecimal('-38'),
350352
basis_amount: BigDecimal('-200'),

0 commit comments

Comments
 (0)