details:   https://code.tryton.org/tryton/commit/9ef460ce1657
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Jan 19 12:17:43 2026 +0100
description:
        Set BillingReference to Invoice and Credit Note UBL

        Closes #14517
diffstat:

 modules/edocument_ubl/CHANGELOG                 |  1 +
 modules/edocument_ubl/template/2/CreditNote.xml |  6 ++++++
 modules/edocument_ubl/template/2/Invoice.xml    |  6 ++++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r e75c7ceb6871 -r 9ef460ce1657 modules/edocument_ubl/CHANGELOG
--- a/modules/edocument_ubl/CHANGELOG   Mon Jan 19 12:15:30 2026 +0100
+++ b/modules/edocument_ubl/CHANGELOG   Mon Jan 19 12:17:43 2026 +0100
@@ -1,3 +1,4 @@
+* Set BillingReference to Invoice and Credit Note
 * Render allowance and charge
 * Fill buyer's item identification
 
diff -r e75c7ceb6871 -r 9ef460ce1657 
modules/edocument_ubl/template/2/CreditNote.xml
--- a/modules/edocument_ubl/template/2/CreditNote.xml   Mon Jan 19 12:15:30 
2026 +0100
+++ b/modules/edocument_ubl/template/2/CreditNote.xml   Mon Jan 19 12:17:43 
2026 +0100
@@ -24,6 +24,12 @@
     <cbc:ID>${this.sale_reference or 'NA'}</cbc:ID>
     <cbc:SalesOrderID 
py:if="this.sale_number">${this.sale_number}</cbc:SalesOrderID>
 </cac:OrderReference>
+<cac:BillingReference py:for="origin_invoice in this.invoice.origin_invoices">
+    <cac:InvoiceDocumentReference>
+        <cbc:ID>${origin_invoice.number}</cbc:ID>
+        <cbc:IssueDate>${origin_invoice.invoice_date}</cbc:IssueDate>
+    </cac:InvoiceDocumentReference>
+</cac:BillingReference>
 <cac:AdditionalDocumentReference py:for="document in 
this.additional_documents">
     <cbc:ID>${document['id']}</cbc:ID>
     <cbc:DocumentTypeCode 
py:if="document.get('code')">${document['code']}</cbc:DocumentTypeCode>
diff -r e75c7ceb6871 -r 9ef460ce1657 
modules/edocument_ubl/template/2/Invoice.xml
--- a/modules/edocument_ubl/template/2/Invoice.xml      Mon Jan 19 12:15:30 
2026 +0100
+++ b/modules/edocument_ubl/template/2/Invoice.xml      Mon Jan 19 12:17:43 
2026 +0100
@@ -24,6 +24,12 @@
     <cbc:ID>${this.sale_reference or 'NA'}</cbc:ID>
     <cbc:SalesOrderID 
py:if="this.sale_number">${this.sale_number}</cbc:SalesOrderID>
 </cac:OrderReference>
+<cac:BillingReference py:for="origin_invoice in this.invoice.origin_invoices">
+    <cac:InvoiceDocumentReference>
+        <cbc:ID>${origin_invoice.number}</cbc:ID>
+        <cbc:IssueDate>${origin_invoice.invoice_date}</cbc:IssueDate>
+    </cac:InvoiceDocumentReference>
+</cac:BillingReference>
 <cac:AdditionalDocumentReference py:for="document in 
this.additional_documents">
     <cbc:ID>${document['id']}</cbc:ID>
     <cbc:DocumentTypeCode 
py:if="document.get('code')">${document['code']}</cbc:DocumentTypeCode>

Reply via email to