Merge pull request #30207 from deepeshgarg007/trail_balance_for_party

fix: Do not consider cancelled entries
This commit is contained in:
Deepesh Garg 2022-03-14 17:19:34 +05:30 committed by GitHub
commit 25a128220a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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'