fix: Do not consider cancelled entries

This commit is contained in:
Deepesh Garg 2022-03-13 18:13:12 +05:30
parent 13dce71c21
commit 6308e1be91

View File

@ -107,6 +107,7 @@ def get_opening_balances(filters):
select party, sum(debit) as opening_debit, sum(credit) as opening_credit
from `tabGL Entry`
where company=%(company)s
and is_cancelled=0
and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != ''
and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes')
{account_filter}
@ -133,6 +134,7 @@ def get_balances_within_period(filters):
select party, sum(debit) as debit, sum(credit) as credit
from `tabGL Entry`
where company=%(company)s
and is_cancelled = 0
and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != ''
and posting_date >= %(from_date)s and posting_date <= %(to_date)s
and ifnull(is_opening, 'No') = 'No'