Merge pull request #23205 from mujeerhashmi/fix_customer_ledger_summary

fix: Filter out cancelled entries in customer ledger summary
This commit is contained in:
Deepesh Garg 2020-08-30 23:13:27 +05:30 committed by GitHub
commit 34cef4d7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,7 +173,7 @@ class PartyLedgerSummaryReport(object):
from `tabGL Entry` gle
{join}
where
gle.docstatus < 2 and gle.party_type=%(party_type)s and ifnull(gle.party, '') != ''
gle.docstatus < 2 and gle.is_cancelled = 0 and gle.party_type=%(party_type)s and ifnull(gle.party, '') != ''
and gle.posting_date <= %(to_date)s {conditions}
order by gle.posting_date
""".format(join=join, join_field=join_field, conditions=conditions), self.filters, as_dict=True)
@ -248,7 +248,7 @@ class PartyLedgerSummaryReport(object):
from
`tabGL Entry`
where
docstatus < 2
docstatus < 2 and is_cancelled = 0
and (voucher_type, voucher_no) in (
select voucher_type, voucher_no from `tabGL Entry` gle, `tabAccount` acc
where acc.name = gle.account and acc.account_type = '{income_or_expense}'