python-drafthorse icon indicating copy to clipboard operation
python-drafthorse copied to clipboard

add: support for multiple bank accounts

Open jo47011 opened this issue 10 months ago • 1 comments

Changed TradeSettlement#payment_means to a MultiField thus now multiple banks can be added.

Usage example:

for bank in invoice_data.Seller.Banks:
    payment_means = PaymentMeans()
    payment_means.type_code = "ZZZ"
    if bank.IBAN:
        payment_means.payee_account.iban = bank.IBAN
    if bank.BIC:
        payment_means.payee_institution.bic = bank.BIC
    if invoice_data.Seller.Name:
        payment_means.payee_account.account_name = invoice_data.Seller.Name
    if bank.BankName:
        payment_means.information.value = bank.BankName

    doc.trade.settlement.payment_means.add(payment_means)

results in (quba viewer): banks

jo47011 avatar Jan 29 '25 17:01 jo47011

Anything else you need so someone can review/approve this PR? Thanks.

jo47011 avatar Feb 13 '25 10:02 jo47011

While syntactically valid ZUGFeRD, it's not allowed by EN16931, so I'm not sure there's a practical use case for it? We could still add it, but I'm a little less enthusiastic about breaking changes in that case

raphaelm avatar Sep 02 '25 12:09 raphaelm