From 7b3543caaf9f9bae808ad4640bd1181be92145b0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Nov 2014 15:45:52 +0530 Subject: [PATCH] Check credit limit only if customer debited --- erpnext/accounts/doctype/journal_voucher/journal_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 67362ddfb4..856728e49b 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -73,7 +73,7 @@ class JournalVoucher(AccountsController): frappe.throw(_("Row{0}: Party Type and Party is only applicable against Receivable / Payable account {1}").format(d.idx, d.account)) def check_credit_limit(self): - customers = list(set([d.party for d in self.get("entries") if d.party_type=="Customer"])) + customers = list(set([d.party for d in self.get("entries") if d.party_type=="Customer" and flt(d.debit) > 0])) if customers: from erpnext.selling.doctype.customer.customer import check_credit_limit for customer in customers: