Skip to content

Commit

Permalink
[FIX] take care of invoice and credit paid amount
Browse files Browse the repository at this point in the history
  • Loading branch information
njeudy committed Oct 1, 2024
1 parent c6c177f commit e64066b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions purchase_advance_payment/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ def _compute_purchase_advance_payment(self):
# Consider payments in related invoices.
invoice_paid_amount = 0.0
for inv in order.invoice_ids:
# use the reconciled payment amounts instead of the invoice
# amount_residual that also includes reconciled credit notes.
for payment in inv._get_reconciled_invoices_partials():
if payment[2].journal_id.type != "purchase":
invoice_paid_amount += payment[1]
invoice_paid_amount += inv.amount_total - inv.amount_residual
amount_residual = order.amount_total - advance_amount - invoice_paid_amount
payment_state = "not_paid"
if mls or order.invoice_ids:
Expand Down

0 comments on commit e64066b

Please sign in to comment.