Skip to content

Commit

Permalink
fix: per_billed condition for Payment Entry (#34969)
Browse files Browse the repository at this point in the history
fix: per_billed condition for Payment Entry (#34969)

fix: per_billed condition for Payment Entry (#34969)

(cherry picked from commit d6bc8bb)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit f9f42c7)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] committed May 1, 2023
1 parent 5746ddc commit 563e5c0
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 @@ -1855,7 +1855,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))

party_type = set_party_type(dt)
Expand Down

0 comments on commit 563e5c0

Please sign in to comment.