Merge pull request #22855 from nabinhait/gl-balance-fix-pre--v13

fix: Ignore cancelled gl entries to get account balance
This commit is contained in:
Deepesh Garg 2020-07-30 22:15:46 +05:30 committed by GitHub
commit 7a004615a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,7 @@ def get_balance_on(account=None, date=None, party_type=None, party=None, company
cost_center = frappe.form_dict.get("cost_center") cost_center = frappe.form_dict.get("cost_center")
cond = [] cond = ["is_cancelled=0"]
if date: if date:
cond.append("posting_date <= %s" % frappe.db.escape(cstr(date))) cond.append("posting_date <= %s" % frappe.db.escape(cstr(date)))
else: else:
@ -206,7 +206,7 @@ def get_balance_on(account=None, date=None, party_type=None, party=None, company
return flt(bal) return flt(bal)
def get_count_on(account, fieldname, date): def get_count_on(account, fieldname, date):
cond = [] cond = ["is_cancelled=0"]
if date: if date:
cond.append("posting_date <= %s" % frappe.db.escape(cstr(date))) cond.append("posting_date <= %s" % frappe.db.escape(cstr(date)))
else: else: