Skip to content

Commit

Permalink
fix: precision causing outstanding issue on partly paid invoices (#36030
Browse files Browse the repository at this point in the history
)

fix: precision causing outstanding issue on partly paid invoices (#36030)

* fix: precision causing outstanding issue on partly paid invoices

* chore: linters

(cherry picked from commit 5c820ec)

Co-authored-by: Dany Robert <danyrt@wahni.com>
  • Loading branch information
mergify[bot] and rtdany10 committed Jul 10, 2023
1 parent 2732276 commit cf3ec93
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ def validate_allocated_amount_with_latest_data(self):
_("{0} {1} has already been fully paid.").format(d.reference_doctype, d.reference_name)
)
# The reference has already been partly paid
elif (
latest.outstanding_amount < latest.invoice_amount
and flt(d.outstanding_amount, d.precision("outstanding_amount")) != latest.outstanding_amount
):
elif latest.outstanding_amount < latest.invoice_amount and flt(
d.outstanding_amount, d.precision("outstanding_amount")
) != flt(latest.outstanding_amount, d.precision("outstanding_amount")):
frappe.throw(
_(
"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
Expand Down

0 comments on commit cf3ec93

Please sign in to comment.