Update template to use invoice taxes of lines as invoice tax

Closes #14609
This commit is contained in:
Cédric Krier
2026-02-16 13:31:03 +01:00
parent 071d5e4fef
commit 2b7c3f9f89
3 changed files with 10 additions and 10 deletions
@@ -78,8 +78,8 @@ this repository contains the full copyright notices and license terms. -->
</py:with>
<cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
<cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${abs(allowance_charge.amount)}</cbc:Amount>
<cac:TaxCategory py:for="tax in allowance_charge.invoice_taxes">
${TaxCategory(tax)}
<cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
${TaxCategory(tax_line.tax)}
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal py:for="group, lines, amount in this.taxes">
@@ -122,8 +122,8 @@ this repository contains the full copyright notices and license terms. -->
</cac:StandardItemIdentification>
</py:with>
</py:if>
<cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
${TaxCategory(tax)}
<cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
${TaxCategory(tax_line.tax)}
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
+4 -4
View File
@@ -78,8 +78,8 @@ this repository contains the full copyright notices and license terms. -->
</py:with>
<cbc:AllowanceChargeReason>${allowance_charge.product.name}</cbc:AllowanceChargeReason>
<cbc:Amount py:attrs="{'currencyID': this.invoice.currency.code}">${abs(allowance_charge.amount)}</cbc:Amount>
<cac:TaxCategory py:for="tax in allowance_charge.invoice_taxes">
${TaxCategory(tax)}
<cac:TaxCategory py:for="tax_line in allowance_charge.invoice_taxes">
${TaxCategory(tax_line.tax)}
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal py:for="group, lines, amount in this.taxes">
@@ -122,8 +122,8 @@ this repository contains the full copyright notices and license terms. -->
</cac:StandardItemIdentification>
</py:with>
</py:if>
<cac:ClassifiedTaxCategory py:for="tax in line.invoice_taxes">
${TaxCategory(tax)}
<cac:ClassifiedTaxCategory py:for="tax_line in line.invoice_taxes">
${TaxCategory(tax_line.tax)}
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
+2 -2
View File
@@ -104,13 +104,13 @@ def get_invoice():
unit_price=Decimal('100.0000'),
amount=Decimal('100.00'),
description="Description",
invoice_taxes=[t.tax for t in taxes],
invoice_taxes=taxes,
), Mock(spec=Invoice,
type='line',
product=charge,
quantity=1,
amount=Decimal('5.00'),
invoice_taxes=[t.tax for t in taxes],
invoice_taxes=taxes,
)]
invoice = MagicMock(spec=Invoice,
id=-1,