Skip to content

Commit

Permalink
fix: per_billed condition for Payment Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Apr 20, 2023
1 parent dd93ea0 commit 4bf50e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,10 @@ def get_payment_entry(
):
reference_doc = None
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) >= 99.99:
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) >= (
100.0 + over_billing_allowance
):
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))

if not party_type:
Expand Down

0 comments on commit 4bf50e7

Please sign in to comment.