fix: ignore cancelled payments in Sales/Purchase Register

(cherry picked from commit 0f1be03faf)
This commit is contained in:
ruthra kumar
2024-01-03 20:56:12 +05:30
parent 20aac93731
commit 36b8e972f1

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 == 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] == 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)
)