Merge pull request #28427 from frappe/mergify/bp/version-13-hotfix/pr-28425
fix: performance issue while submitting the Journal Entry (backport #28425)
This commit is contained in:
@@ -440,11 +440,14 @@ def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None):
|
|||||||
|
|
||||||
|
|
||||||
def check_credit_limit(customer, company, ignore_outstanding_sales_order=False, extra_amount=0):
|
def check_credit_limit(customer, company, ignore_outstanding_sales_order=False, extra_amount=0):
|
||||||
|
credit_limit = get_credit_limit(customer, company)
|
||||||
|
if not credit_limit:
|
||||||
|
return
|
||||||
|
|
||||||
customer_outstanding = get_customer_outstanding(customer, company, ignore_outstanding_sales_order)
|
customer_outstanding = get_customer_outstanding(customer, company, ignore_outstanding_sales_order)
|
||||||
if extra_amount > 0:
|
if extra_amount > 0:
|
||||||
customer_outstanding += flt(extra_amount)
|
customer_outstanding += flt(extra_amount)
|
||||||
|
|
||||||
credit_limit = get_credit_limit(customer, company)
|
|
||||||
if credit_limit > 0 and flt(customer_outstanding) > credit_limit:
|
if credit_limit > 0 and flt(customer_outstanding) > credit_limit:
|
||||||
msgprint(_("Credit limit has been crossed for customer {0} ({1}/{2})")
|
msgprint(_("Credit limit has been crossed for customer {0} ({1}/{2})")
|
||||||
.format(customer, customer_outstanding, credit_limit))
|
.format(customer, customer_outstanding, credit_limit))
|
||||||
|
|||||||
Reference in New Issue
Block a user