From cf3ec935a7f14bfd9ff99feb76f875043147d89e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:49:41 +0530 Subject: [PATCH] fix: precision causing outstanding issue on partly paid invoices (#36030) 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 5c820ecc20f261b26d02b94e3778c331bb7ec0be) Co-authored-by: Dany Robert --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 619d573e261..c9929cc2d47 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -194,10 +194,9 @@ class PaymentEntry(AccountsController): _("{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."