Check credit limit only if customer debited

This commit is contained in:
Nabin Hait 2014-11-03 15:45:52 +05:30
parent 98050e7646
commit 7b3543caaf

View File

@ -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: