diff --git a/modules/account_payment_sepa/template/pain.001.001.03.xml b/modules/account_payment_sepa/template/pain.001.001.03.xml
index adf29b89ac..218ed4505d 100644
--- a/modules/account_payment_sepa/template/pain.001.001.03.xml
+++ b/modules/account_payment_sepa/template/pain.001.001.03.xml
@@ -32,7 +32,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
@@ -45,7 +45,7 @@ this repository contains the full copyright notices and license terms. -->
TRF
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -77,7 +77,7 @@ this repository contains the full copyright notices and license terms. -->
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.001.001.05.xml b/modules/account_payment_sepa/template/pain.001.001.05.xml
index 2b628bf1cf..7af176b4a3 100644
--- a/modules/account_payment_sepa/template/pain.001.001.05.xml
+++ b/modules/account_payment_sepa/template/pain.001.001.05.xml
@@ -13,7 +13,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
@@ -26,7 +26,7 @@ this repository contains the full copyright notices and license terms. -->
TRF
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -59,7 +59,7 @@ this repository contains the full copyright notices and license terms. -->
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.001.001.09.xml b/modules/account_payment_sepa/template/pain.001.001.09.xml
index 439e2177e9..3f539700bd 100644
--- a/modules/account_payment_sepa/template/pain.001.001.09.xml
+++ b/modules/account_payment_sepa/template/pain.001.001.09.xml
@@ -14,7 +14,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_payable_initiator_id)}
@@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. -->
TRF
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -61,7 +61,7 @@ this repository contains the full copyright notices and license terms. -->
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.001.003.03.xml b/modules/account_payment_sepa/template/pain.001.003.03.xml
index 04e9adced7..197dc835d4 100644
--- a/modules/account_payment_sepa/template/pain.001.003.03.xml
+++ b/modules/account_payment_sepa/template/pain.001.003.03.xml
@@ -15,7 +15,7 @@ this repository contains the full copyright notices and license terms. -->
${group.sepa_message_id[:35]}
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_payable_initiator_id, with_address=False)}
@@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. -->
TRF
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -52,7 +52,7 @@ this repository contains the full copyright notices and license terms. -->
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.008.001.02.xml b/modules/account_payment_sepa/template/pain.008.001.02.xml
index 1df9251c93..5c20943097 100644
--- a/modules/account_payment_sepa/template/pain.008.001.02.xml
+++ b/modules/account_payment_sepa/template/pain.008.001.02.xml
@@ -32,7 +32,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
@@ -45,7 +45,7 @@ this repository contains the full copyright notices and license terms. -->
DD
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -83,7 +83,7 @@ this repository contains the full copyright notices and license terms. -->
${payment.sepa_end_to_end_id}
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.008.001.04.xml b/modules/account_payment_sepa/template/pain.008.001.04.xml
index c7211cc56f..de0a812727 100644
--- a/modules/account_payment_sepa/template/pain.008.001.04.xml
+++ b/modules/account_payment_sepa/template/pain.008.001.04.xml
@@ -13,7 +13,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${len(group.payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
@@ -26,7 +26,7 @@ this repository contains the full copyright notices and license terms. -->
DD
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -64,7 +64,7 @@ this repository contains the full copyright notices and license terms. -->
${payment.sepa_end_to_end_id}
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.008.001.08.xml b/modules/account_payment_sepa/template/pain.008.001.08.xml
index 707ee8180e..d70ac381b3 100644
--- a/modules/account_payment_sepa/template/pain.008.001.08.xml
+++ b/modules/account_payment_sepa/template/pain.008.001.08.xml
@@ -14,7 +14,7 @@ this repository contains the full copyright notices and license terms. -->
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${len(group.payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_receivable_initiator_id)}
@@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. -->
DD
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -64,7 +64,7 @@ this repository contains the full copyright notices and license terms. -->
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa/template/pain.008.003.02.xml b/modules/account_payment_sepa/template/pain.008.003.02.xml
index a167344082..37d1ee1b82 100644
--- a/modules/account_payment_sepa/template/pain.008.003.02.xml
+++ b/modules/account_payment_sepa/template/pain.008.003.02.xml
@@ -15,7 +15,7 @@ this repository contains the full copyright notices and license terms. -->
${group.sepa_message_id[:35]}
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_receivable_initiator_id, with_address=False)}
@@ -25,7 +25,7 @@ this repository contains the full copyright notices and license terms. -->
DD
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
SEPA
@@ -56,7 +56,7 @@ this repository contains the full copyright notices and license terms. -->
${payment.sepa_instruction_id}
${payment.sepa_end_to_end_id}
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa_cfonb/template/pain.001.001.03-cfonb.xml b/modules/account_payment_sepa_cfonb/template/pain.001.001.03-cfonb.xml
index cf9b578bd1..ab237aed47 100644
--- a/modules/account_payment_sepa_cfonb/template/pain.001.001.03-cfonb.xml
+++ b/modules/account_payment_sepa_cfonb/template/pain.001.001.03-cfonb.xml
@@ -26,7 +26,7 @@ this repository contains the full copyright notices and license terms. -->
${group.sepa_message_id[:35]}
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party)}
@@ -36,7 +36,7 @@ this repository contains the full copyright notices and license terms. -->
TRF
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
@@ -62,7 +62,7 @@ this repository contains the full copyright notices and license terms. -->
${payment.sepa_end_to_end_id}
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
diff --git a/modules/account_payment_sepa_cfonb/template/pain.008.001.02-cfonb.xml b/modules/account_payment_sepa_cfonb/template/pain.008.001.02-cfonb.xml
index 7bda4d37a5..a81676d936 100644
--- a/modules/account_payment_sepa_cfonb/template/pain.008.001.02-cfonb.xml
+++ b/modules/account_payment_sepa_cfonb/template/pain.008.001.02-cfonb.xml
@@ -32,7 +32,7 @@ this repository contains the full copyright notices and license terms. -->
${group.sepa_message_id[:35]}
${datetime.datetime.now().replace(microsecond=0).isoformat()}
${sum(len(payments) for _, payments in group.sepa_payments)}
- ${format(sum(p.amount for p in group.payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in group.payments), 'f')}
${PartyIdentification(group.sepa_initiating_party)}
@@ -42,7 +42,7 @@ this repository contains the full copyright notices and license terms. -->
DD
${'true' if group.journal.sepa_batch_booking else 'false'}
${len(payments)}
- ${format(sum(p.amount for p in payments).normalize(), 'f')}
+ ${format(sum(p.amount for p in payments), 'f')}
SEPA
@@ -73,7 +73,7 @@ this repository contains the full copyright notices and license terms. -->
${payment.sepa_instruction_id}
${payment.sepa_end_to_end_id}
- ${format(payment.amount.normalize(), 'f')}
+ ${format(payment.amount, 'f')}
${mandate.identification}
diff --git a/modules/edocument_ubl/template/2/CreditNote.xml b/modules/edocument_ubl/template/2/CreditNote.xml
index f9fdd61bee..973b3162ba 100644
--- a/modules/edocument_ubl/template/2/CreditNote.xml
+++ b/modules/edocument_ubl/template/2/CreditNote.xml
@@ -90,7 +90,7 @@ this repository contains the full copyright notices and license terms. -->
${this.invoice.payment_term.description}
- ${format(line.amount.normalize(), 'f')}
+ ${format(line.amount, 'f')}
${line.maturity_date}
@@ -101,16 +101,16 @@ this repository contains the full copyright notices and license terms. -->
${reason_code}
${allowance_charge.product.name}
- ${format(abs(allowance_charge.amount).normalize(), 'f')}
+ ${format(abs(allowance_charge.amount), 'f')}
${TaxCategory(tax_line.tax)}
- ${format((-amount).normalize(), 'f')}
+ ${format(-amount, 'f')}
- ${format((-line.base).normalize(), 'f')}
- ${format((-line.amount).normalize(), 'f')}
+ ${format(-line.base, 'f')}
+ ${format(-line.amount, 'f')}
${format((line.tax.rate * 100).normalize(), 'f')}
${TaxCategory(line.tax)}
@@ -118,19 +118,19 @@ this repository contains the full copyright notices and license terms. -->
- ${format((-this.invoice.untaxed_amount).normalize(), 'f')}
- ${format((-this.invoice.untaxed_amount).normalize(), 'f')}
- ${format((-(this.invoice.untaxed_amount + this.invoice.tax_amount)).normalize(), 'f')}
+ ${format(-this.invoice.untaxed_amount, 'f')}
+ ${format(-this.invoice.untaxed_amount, 'f')}
+ ${format(-(this.invoice.untaxed_amount + this.invoice.tax_amount), 'f')}
- ${format((-(this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount)).normalize(), 'f')}
+ ${format(-(this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount), 'f')}
- ${format((-this.prepaid_amount).normalize(), 'f')}
- ${format((-this.invoice.total_amount + this.prepaid_amount).normalize(), 'f')}
+ ${format(-this.prepaid_amount, 'f')}
+ ${format(-this.invoice.total_amount + this.prepaid_amount, 'f')}
${line_id}
- ${format(-Decimal(str(line.quantity)), 'f')}
- ${format((-line.amount).normalize(), 'f')}
+ ${format(-Decimal(str(line.quantity)).normalize(), 'f')}
+ ${format(-line.amount, 'f')}
${line.description}
${line.product.name if line.product else line.summary}
diff --git a/modules/edocument_ubl/template/2/Invoice.xml b/modules/edocument_ubl/template/2/Invoice.xml
index a66d06cc3f..4e097a8b73 100644
--- a/modules/edocument_ubl/template/2/Invoice.xml
+++ b/modules/edocument_ubl/template/2/Invoice.xml
@@ -90,7 +90,7 @@ this repository contains the full copyright notices and license terms. -->
${this.invoice.payment_term.description}
- ${format(line.amount.normalize(), 'f')}
+ ${format(line.amount, 'f')}
${line.maturity_date}
@@ -101,16 +101,16 @@ this repository contains the full copyright notices and license terms. -->
${reason_code}
${allowance_charge.product.name}
- ${format(abs(allowance_charge.amount).normalize(), 'f')}
+ ${format(abs(allowance_charge.amount), 'f')}
${TaxCategory(tax_line.tax)}
- ${format(amount.normalize(), 'f')}
+ ${format(amount, 'f')}
- ${format(line.base.normalize(), 'f')}
- ${format(line.amount.normalize(), 'f')}
+ ${format(line.base, 'f')}
+ ${format(line.amount, 'f')}
${format((line.tax.rate * 100).normalize(), 'f')}
${TaxCategory(line.tax)}
@@ -118,19 +118,19 @@ this repository contains the full copyright notices and license terms. -->
- ${format(this.invoice.untaxed_amount.normalize(), 'f')}
- ${format(this.invoice.untaxed_amount.normalize(), 'f')}
- ${format((this.invoice.untaxed_amount + this.invoice.tax_amount).normalize(), 'f')}
+ ${format(this.invoice.untaxed_amount, 'f')}
+ ${format(this.invoice.untaxed_amount, 'f')}
+ ${format((this.invoice.untaxed_amount + this.invoice.tax_amount), 'f')}
- ${format((this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount).normalize(), 'f')}
+ ${format((this.invoice.total_amount - this.invoice.untaxed_amount - this.invoice.tax_amount), 'f')}
- ${format(this.prepaid_amount.normalize(), 'f')}
- ${format((this.invoice.total_amount - this.prepaid_amount).normalize(), 'f')}
+ ${format(this.prepaid_amount, 'f')}
+ ${format(this.invoice.total_amount - this.prepaid_amount, 'f')}
${line_id}
- ${format(Decimal(str(line.quantity)), 'f')}
- ${format(line.amount.normalize(), 'f')}
+ ${format(Decimal(str(line.quantity)).normalize(), 'f')}
+ ${format(line.amount, 'f')}
${line.description}
${line.product.name if line.product else line.summary}
diff --git a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
index 84790ed7d4..1c4abe68a1 100644
--- a/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
+++ b/modules/edocument_uncefact/template/16B-CII/CrossIndustryInvoice.xml
@@ -59,11 +59,11 @@ this repository contains the full copyright notices and license terms. -->
- ${format((amount * this.type_sign).normalize(), 'f')}
+ ${format(amount * this.type_sign, 'f')}
${tax.unece_code}
${tax.vatex_code}
${tax.legal_notice}
- ${format((base * this.type_sign).normalize(), 'f')}
+ ${format(base * this.type_sign, 'f')}
${tax.unece_category_code}
${format((tax.rate * 100).normalize(), 'f')}
@@ -92,18 +92,18 @@ this repository contains the full copyright notices and license terms. -->
- ${format(this.invoice.currency.round(line.unit_price).normalize(), 'f')}
+ ${format(this.invoice.currency.round(line.unit_price), 'f')}
- ${format(abs(Decimal(str(line.quantity))), 'f')}
+ ${format(abs(Decimal(str(line.quantity)).normalize()), 'f')}
${TradeTax(tax.tax)}
- ${format((line.amount * this.type_sign).normalize(), 'f')}
+ ${format(line.amount * this.type_sign, 'f')}
@@ -181,15 +181,15 @@ this repository contains the full copyright notices and license terms. -->
${DateTime(line.maturity_date)}
- ${format(((line.amount_second_currency or (line.debit - line.credit)) * this.type_sign).normalize(), 'f')}
+ ${format((line.amount_second_currency or (line.debit - line.credit)) * this.type_sign, 'f')}
- ${format((this.invoice.untaxed_amount * this.type_sign).normalize(), 'f')}
- ${format((this.invoice.untaxed_amount * this.type_sign).normalize(), 'f')}
- ${format((this.invoice.tax_amount * this.type_sign).normalize(), 'f')}
- ${format((this.invoice.total_amount * this.type_sign).normalize(), 'f')}
- ${format((this.invoice.amount_to_pay * this.type_sign).normalize(), 'f')}
+ ${format(this.invoice.untaxed_amount * this.type_sign, 'f')}
+ ${format(this.invoice.untaxed_amount * this.type_sign, 'f')}
+ ${format(this.invoice.tax_amount * this.type_sign, 'f')}
+ ${format(this.invoice.total_amount * this.type_sign, 'f')}
+ ${format(this.invoice.amount_to_pay * this.type_sign, 'f')}