Skip to content

Commit

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

* fix: precision causing outstanding issue on partly paid invoices

* chore: linters
  • Loading branch information
rtdany10 authored Jul 10, 2023
1 parent b3a99e3 commit 5c820ec
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 @@ -237,10 +237,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 5c820ec

Please sign in to comment.