Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi
2013-07-30 14:51:08 +05:30
4 changed files with 11 additions and 6 deletions

View File

@@ -151,7 +151,7 @@ class DocType:
balance = webnotes.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry`
where account = %s and ifnull(is_cancelled, 'No') = 'No'""", self.doc.account)
balance = account["debit_or_credit"] == "Debit" and \
balance[0][0] or -1*balance[0][0]
flt(balance[0][0]) or -1*flt(balance[0][0])
if flt(balance) < 0:
msgprint(_("Negative balance is not allowed for account ") + self.doc.account,