details:   https://code.tryton.org/tryton/commit/8cb523173e02
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Feb 13 18:28:24 2026 +0100
description:
        Render invoice payment means in UBL and UNCEFACT
diffstat:

 modules/edocument_ubl/CHANGELOG                                      |   1 +
 modules/edocument_ubl/template/2/CreditNote.xml                      |  24 
++++++++
 modules/edocument_ubl/template/2/Invoice.xml                         |  24 
++++++++
 modules/edocument_uncefact/CHANGELOG                                 |   1 +
 modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml |  27 
++++++++-
 5 files changed, 74 insertions(+), 3 deletions(-)

diffs (121 lines):

diff -r a5ec3c1e6c37 -r 8cb523173e02 modules/edocument_ubl/CHANGELOG
--- a/modules/edocument_ubl/CHANGELOG   Fri Feb 13 18:27:14 2026 +0100
+++ b/modules/edocument_ubl/CHANGELOG   Fri Feb 13 18:28:24 2026 +0100
@@ -1,3 +1,4 @@
+* Render payment means
 * Set BillingReference to Invoice and Credit Note
 * Render allowance and charge
 * Fill buyer's item identification
diff -r a5ec3c1e6c37 -r 8cb523173e02 
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml   Fri Feb 13 18:27:14 
2026 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml   Fri Feb 13 18:28:24 
2026 +0100
@@ -57,6 +57,30 @@
 <cac:AccountingCustomerParty>
     ${Party(this.accounting_customer_party, this.accounting_customer_address, 
this.accounting_customer_tax_identifier, 
identifications=[this.accounting_customer_party.identifier_iso6523] if 
(specification or '').startswith('peppol') else None, 
specification=specification)}
 </cac:AccountingCustomerParty>
+<py:for each="payment_mean in this.invoice.payment_means">
+    <cac:PaymentMeans py:if="payment_mean.unece_code">
+        <cbc:PaymentMeansCode>${payment_mean.unece_code}</cbc:PaymentMeansCode>
+        <cbc:PaymentID 
py:if="this.invoice.customer_payment_reference">${this.invoice.customer_payment_reference}</cbc:PaymentID>
+        <py:choose test="payment_mean.instrument.__name__">
+            <py:when test="'bank.account'">
+                <cac:PayeeFinancialAccount>
+                    <cbc:ID>${payment_mean.instrument.iban_compact}</cbc:ID>
+                    <cac:FinancialInstitutionBranch 
py:if="payment_mean.instrument.bank and payment_mean.instrument.bank.bic">
+                        <cbc:ID>${payment_mean.instrument.bank.bic}</cbc:ID>
+                    </cac:FinancialInstitutionBranch>
+                </cac:PayeeFinancialAccount>
+            </py:when>
+            <py:when test="'party.party.reception_direct_debit'">
+                <cac:PaymentMandate 
py:if="payment_mean.instrument.sepa_mandate">
+                    <cbc:ID>${payment_mean.instrument.identification}</cbc:ID>
+                    <cac:PayerFinancialAccount>
+                        
<cbc:ID>${payment_mean.instrument.account_number.number}</cbc:ID>
+                    </cac:PayerFinancialAccount>
+                </cac:PaymentMandate>
+            </py:when>
+        </py:choose>
+    </cac:PaymentMeans>
+</py:for>
 <py:choose test="(specification or '').startswith('peppol')">
     <py:when test="True">
         <cac:PaymentTerms py:if="this.invoice.payment_term and 
this.invoice.payment_term.description">
diff -r a5ec3c1e6c37 -r 8cb523173e02 
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml      Fri Feb 13 18:27:14 
2026 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml      Fri Feb 13 18:28:24 
2026 +0100
@@ -57,6 +57,30 @@
 <cac:AccountingCustomerParty>
     ${Party(this.accounting_customer_party, this.accounting_customer_address, 
this.accounting_customer_tax_identifier, 
identifications=[this.accounting_customer_party.identifier_iso6523] if 
(specification or '').startswith('peppol') else None, 
specification=specification)}
 </cac:AccountingCustomerParty>
+<py:for each="payment_mean in this.invoice.payment_means">
+    <cac:PaymentMeans py:if="payment_mean.unece_code">
+        <cbc:PaymentMeansCode>${payment_mean.unece_code}</cbc:PaymentMeansCode>
+        <cbc:PaymentID 
py:if="this.invoice.customer_payment_reference">${this.invoice.customer_payment_reference}</cbc:PaymentID>
+        <py:choose test="payment_mean.instrument.__name__">
+            <py:when test="'bank.account'">
+                <cac:PayeeFinancialAccount>
+                    <cbc:ID>${payment_mean.instrument.iban_compact}</cbc:ID>
+                    <cac:FinancialInstitutionBranch 
py:if="payment_mean.instrument.bank and payment_mean.instrument.bank.bic">
+                        <cbc:ID>${payment_mean.instrument.bank.bic}</cbc:ID>
+                    </cac:FinancialInstitutionBranch>
+                </cac:PayeeFinancialAccount>
+            </py:when>
+            <py:when test="'party.party.reception_direct_debit'">
+                <cac:PaymentMandate 
py:if="payment_mean.instrument.sepa_mandate">
+                    <cbc:ID>${payment_mean.instrument.identification}</cbc:ID>
+                    <cac:PayerFinancialAccount>
+                        
<cbc:ID>${payment_mean.instrument.account_number.number}</cbc:ID>
+                    </cac:PayerFinancialAccount>
+                </cac:PaymentMandate>
+            </py:when>
+        </py:choose>
+    </cac:PaymentMeans>
+</py:for>
 <py:choose test="(specification or '').startswith('peppol')">
     <py:when test="True">
         <cac:PaymentTerms py:if="this.invoice.payment_term and 
this.invoice.payment_term.description">
diff -r a5ec3c1e6c37 -r 8cb523173e02 modules/edocument_uncefact/CHANGELOG
--- a/modules/edocument_uncefact/CHANGELOG      Fri Feb 13 18:27:14 2026 +0100
+++ b/modules/edocument_uncefact/CHANGELOG      Fri Feb 13 18:28:24 2026 +0100
@@ -1,3 +1,4 @@
+* Render payment means
 
 Version 7.8.0 - 2025-12-15
 --------------------------
diff -r a5ec3c1e6c37 -r 8cb523173e02 
modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
--- a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml      
Fri Feb 13 18:27:14 2026 +0100
+++ b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml      
Fri Feb 13 18:28:24 2026 +0100
@@ -115,9 +115,30 @@
             <ram:InvoiceDateTime>
                 ${DateTime(this.invoice.invoice_date)}
             </ram:InvoiceDateTime>
-            <ram:SpecifiedTradeSettlementPaymentMeans>
-                <ram:TypeCode>1</ram:TypeCode>  <!-- Instrument not defined -->
-            </ram:SpecifiedTradeSettlementPaymentMeans>
+            <py:for each="payment_mean in this.invoice.payment_means">
+                <ram:SpecifiedTradeSettlementPaymentMeans 
py:if="payment_mean.unece_code">
+                    <ram:TypeCode>${payment_mean.unece_code}</ram:TypeCode>
+                    <ram:ID 
py:if="this.invoice.customer_payment_reference">${this.invoice.customer_payment_reference}</ram:ID>
+                    <py:choose test="payment_mean.unece_code">
+                        <py:when test="'42'">
+                            <ram:PayeePartyCreditorFinancialAccount>
+                                
<udt:IBANID>${payment_mean.instrument.iban}</udt:IBANID>
+                            </ram:PayeePartyCreditorFinancialAccount>
+                            <ram:PayeeSpecifiedCreditorFinancialInstitution 
py:if="payment_mean.instrument.bank and payment_mean.instrument.bank.bic">
+                                
<udt:BICID>${payment_mean.instrument.bank.bic}</udt:BICID>
+                            </ram:PayeeSpecifiedCreditorFinancialInstitution>
+                        </py:when>
+                        <py:when test="'59'">
+                            <ram:PayerPartyDebtorFinancialAccount 
py:if="payment_mean.instrument.sepa_mandate">
+                                
<udt:IBANID>${payment_mean.instrument.account_number.number}</udt:IBANID>
+                                <ram:PayerSpecifiedDebtorFinancialInstitution 
py:if="payment_mean.instrument.account_number.account.bank and 
payment_mean.instrument.account_number.account.bank.bic">
+                                    
<udt:BICID>${payment_mean.instrument.account_number.account.bank.bic}</udt:BICID>
+                                </ram:PayerSpecifiedDebtorFinancialInstitution>
+                            </ram:PayerPartyDebtorFinancialAccount>
+                        </py:when>
+                    </py:choose>
+                </ram:SpecifiedTradeSettlementPaymentMeans>
+            </py:for>
             <py:for each="tax in this.invoice.taxes">
                 ${TradeTax(tax.tax, tax.amount, tax.base)}
             </py:for>

Reply via email to