Skip to content

Commit

Permalink
fix: add partial amount for multiple payments only
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Nov 16, 2024
1 parent 4ad12e3 commit e7aa7dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eu_einvoice/european_e_invoice/custom/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit e7aa7dc

Please sign in to comment.