details: https://code.tryton.org/tryton/commit/bfa7b38340da
branch: default
user: Cédric Krier <[email protected]>
date: Mon Mar 16 10:20:09 2026 +0100
description:
Set a default undefined payment mean in UNCEFACT/CII invoice
Chorus-pro requires to have a SpecifiedTradeSettlementPaymentMeans.
diffstat:
modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml | 57
+++++----
1 files changed, 33 insertions(+), 24 deletions(-)
diffs (67 lines):
diff -r 088457ac5334 -r bfa7b38340da
modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
--- a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
Mon Mar 02 10:58:40 2026 +0100
+++ b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
Mon Mar 16 10:20:09 2026 +0100
@@ -115,30 +115,39 @@
<ram:InvoiceDateTime>
${DateTime(this.invoice.invoice_date)}
</ram:InvoiceDateTime>
- <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:choose test="len(this.invoice.payment_means)">
+ <py:when test="0">
+ <ram:SpecifiedTradeSettlementPaymentMeans>
+ <ram:TypeCode>1</ram:TypeCode> <!-- Instrument not
defined -->
+ </ram:SpecifiedTradeSettlementPaymentMeans>
+ </py:when>
+ <py:otherwise>
+ <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:otherwise>
+ </py:choose>
<py:for each="tax in this.invoice.taxes">
${TradeTax(tax.tax, tax.amount, tax.base)}
</py:for>