[fix] [minor] null value issue
This commit is contained in:
parent
f90df7da02
commit
4525a0b900
@ -151,7 +151,7 @@ class DocType:
|
|||||||
balance = webnotes.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry`
|
balance = webnotes.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry`
|
||||||
where account = %s and ifnull(is_cancelled, 'No') = 'No'""", self.doc.account)
|
where account = %s and ifnull(is_cancelled, 'No') = 'No'""", self.doc.account)
|
||||||
balance = account["debit_or_credit"] == "Debit" and \
|
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:
|
if flt(balance) < 0:
|
||||||
msgprint(_("Negative balance is not allowed for account ") + self.doc.account,
|
msgprint(_("Negative balance is not allowed for account ") + self.doc.account,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user