From b883e4ee0d5a1fdbb8c25fe95f7af6b76d07b099 Mon Sep 17 00:00:00 2001 From: ashish Date: Thu, 26 Oct 2017 20:32:08 +0530 Subject: [PATCH] customer.py -- get_credit_limit function which gets called by the above customer_credit_balance report is updated to deduct the amount of sales order for which credit limit bypass flag is set. cint function is added. --- erpnext/selling/doctype/customer/customer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 648e129b0d..5a0ddccf0e 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -191,7 +191,7 @@ def get_customer_outstanding(customer, company,caller=None): #PR : 10861, Author : ashish-greycube & jigneshpshah, Email:mr.ashish.shah@gmail.com # Since the credit limit check is bypassed at sales order level, when customer credit balance report is run we need to treat sales order with status 'To Deliver and Bill' as not outstanding outstanding_based_on_bypassed_so = 0.0 - bypass_credit_limit_check_at_sales_order = frappe.db.get_value("Customer", customer, "bypass_credit_limit_check_at_sales_order") + bypass_credit_limit_check_at_sales_order = cint(frappe.db.get_value("Customer", customer, "bypass_credit_limit_check_at_sales_order")) if bypass_credit_limit_check_at_sales_order == 1 and caller=='customer_credit_balance_report': outstanding_based_on_bypassed_so = frappe.db.sql(""" select (sum(base_grand_total))