[fix] Get Balance only if account or party mentioned
This commit is contained in:
parent
91e1077e4c
commit
26bc1a58af
@ -101,6 +101,7 @@ def get_balance_on(account=None, date=None, party_type=None, party=None):
|
||||
cond.append("""gle.party_type = "%s" and gle.party = "%s" """ %
|
||||
(party_type.replace('"', '\\"'), party.replace('"', '\\"')))
|
||||
|
||||
if account or (party_type and party):
|
||||
bal = frappe.db.sql("""
|
||||
SELECT sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
|
||||
FROM `tabGL Entry` gle
|
||||
|
Loading…
Reference in New Issue
Block a user