From 54ecc8ebba614d981dcb039dc429834a482108d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 6 Oct 2015 14:28:41 +0530 Subject: [PATCH] minor fix in credit limit --- 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 9e5e7bdc7e..21f6578df4 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -212,7 +212,7 @@ def get_customer_outstanding(customer, company): from `tabSales Invoice Item` where dn_detail = %s and docstatus = 1""", dn_item.name)[0][0] - if flt(dn_item.amount) > flt(si_amount): + if flt(dn_item.amount) > flt(si_amount) and dn_item.base_net_total: outstanding_based_on_dn += ((flt(dn_item.amount) - flt(si_amount)) \ / dn_item.base_net_total) * dn_item.base_grand_total