mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Merge pull request #46677 from frappe/mergify/bp/version-15-hotfix/pr-46577
fix: customer credit limit check based on `bypass_credit_limit_check` in Journal Entry (backport #46577)
This commit is contained in:
@@ -576,8 +576,22 @@ class JournalEntry(AccountsController):
|
|||||||
if customers:
|
if customers:
|
||||||
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
||||||
|
|
||||||
|
customer_details = frappe._dict(
|
||||||
|
frappe.db.get_all(
|
||||||
|
"Customer Credit Limit",
|
||||||
|
filters={
|
||||||
|
"parent": ["in", customers],
|
||||||
|
"parenttype": ["=", "Customer"],
|
||||||
|
"company": ["=", self.company],
|
||||||
|
},
|
||||||
|
fields=["parent", "bypass_credit_limit_check"],
|
||||||
|
as_list=True,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
for customer in customers:
|
for customer in customers:
|
||||||
check_credit_limit(customer, self.company)
|
ignore_outstanding_sales_order = bool(customer_details.get(customer))
|
||||||
|
check_credit_limit(customer, self.company, ignore_outstanding_sales_order)
|
||||||
|
|
||||||
def validate_cheque_info(self):
|
def validate_cheque_info(self):
|
||||||
if self.voucher_type in ["Bank Entry"]:
|
if self.voucher_type in ["Bank Entry"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user