fix: ignore cancelled payments in Sales/Purchase Register

(cherry picked from commit 0f1be03faf96aaf83063e28dc57a5e016944683c)
This commit is contained in:
ruthra kumar 2024-01-03 20:56:12 +05:30 committed by Mergify
parent 18575e137c
commit 9e1b443857

View File

@ -251,6 +251,7 @@ def get_journal_entries(filters, args):
)
.where(
(je.voucher_type == "Journal Entry")
& (je.docstatus == 1)
& (journal_account.party == filters.get(args.party))
& (journal_account.account.isin(args.party_account))
)
@ -281,7 +282,9 @@ def get_payment_entries(filters, args):
pe.cost_center,
)
.where(
(pe.party == filters.get(args.party)) & (pe[args.account_fieldname].isin(args.party_account))
(pe.docstatus == 1)
& (pe.party == filters.get(args.party))
& (pe[args.account_fieldname].isin(args.party_account))
)
.orderby(pe.posting_date, pe.name, order=Order.desc)
)