mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(selling): round only the final credit exposure
This commit is contained in:
@@ -592,8 +592,11 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False,
|
||||
customer_outstanding = get_customer_outstanding(customer, company, ignore_outstanding_sales_order)
|
||||
if extra_amount > 0:
|
||||
customer_outstanding += flt(extra_amount)
|
||||
customer_outstanding = flt(
|
||||
customer_outstanding, frappe.get_precision("Customer Credit Limit", "credit_limit")
|
||||
)
|
||||
|
||||
if credit_limit > 0 and flt(customer_outstanding) > credit_limit:
|
||||
if credit_limit > 0 and customer_outstanding > credit_limit:
|
||||
message = _("Credit limit has been crossed for customer {0} ({1}/{2})").format(
|
||||
customer, customer_outstanding, credit_limit
|
||||
)
|
||||
|
||||
@@ -683,10 +683,7 @@ class DeliveryNote(SellingController):
|
||||
|
||||
if validate_against_credit_limit:
|
||||
check_credit_limit(
|
||||
self.customer,
|
||||
self.company,
|
||||
bypass_credit_limit_check_at_sales_order,
|
||||
flt(extra_amount, self.precision("base_grand_total")),
|
||||
self.customer, self.company, bypass_credit_limit_check_at_sales_order, extra_amount
|
||||
)
|
||||
|
||||
def validate_packed_qty(self):
|
||||
|
||||
Reference in New Issue
Block a user