From e7aa7dcb9809f767fcdac3ac77faec76010033d7 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Sat, 16 Nov 2024 19:43:41 +0100 Subject: [PATCH] fix: add partial amount for multiple payments only --- eu_einvoice/european_e_invoice/custom/sales_invoice.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eu_einvoice/european_e_invoice/custom/sales_invoice.py b/eu_einvoice/european_e_invoice/custom/sales_invoice.py index 9394df1..1be65f5 100644 --- a/eu_einvoice/european_e_invoice/custom/sales_invoice.py +++ b/eu_einvoice/european_e_invoice/custom/sales_invoice.py @@ -269,7 +269,12 @@ def get_xml(invoice, company, seller_address=None, customer_address=None): payment_terms = PaymentTerms() payment_terms.description = ps.description payment_terms.due = ps.due_date - payment_terms.partial_amount.add((ps.payment_amount, invoice.currency)) + + if len(invoice.payment_schedule) > 1: + payment_terms.partial_amount.add( + (ps.payment_amount, None) + ) # [CII-DT-031] - currencyID should not be present + if ps.discount and ps.discount_date: payment_terms.discount_terms.basis_date_time = ps.discount_date if ps.discount_type == "Percentage":