Merge pull request #39136 from frappe/mergify/bp/version-14-hotfix/pr-39125

fix: ignore cancelled payments in Sales/Purchase Register (backport #39125)
This commit is contained in:
ruthra kumar
2024-01-15 14:49:22 +05:30
committed by GitHub
3 changed files with 7 additions and 4 deletions

View File

@@ -433,7 +433,7 @@ def get_payments(filters):
account_fieldname="paid_to", account_fieldname="paid_to",
party="supplier", party="supplier",
party_name="supplier_name", party_name="supplier_name",
party_account=get_party_account("Supplier", filters.supplier, filters.company), party_account=[get_party_account("Supplier", filters.supplier, filters.company)],
) )
payment_entries = get_payment_entries(filters, args) payment_entries = get_payment_entries(filters, args)
journal_entries = get_journal_entries(filters, args) journal_entries = get_journal_entries(filters, args)

View File

@@ -477,7 +477,7 @@ def get_payments(filters):
account_fieldname="paid_from", account_fieldname="paid_from",
party="customer", party="customer",
party_name="customer_name", party_name="customer_name",
party_account=get_party_account("Customer", filters.customer, filters.company), party_account=[get_party_account("Customer", filters.customer, filters.company)],
) )
payment_entries = get_payment_entries(filters, args) payment_entries = get_payment_entries(filters, args)
journal_entries = get_journal_entries(filters, args) journal_entries = get_journal_entries(filters, args)

View File

@@ -251,8 +251,9 @@ def get_journal_entries(filters, args):
) )
.where( .where(
(je.voucher_type == "Journal Entry") (je.voucher_type == "Journal Entry")
& (je.docstatus == 1)
& (journal_account.party == filters.get(args.party)) & (journal_account.party == filters.get(args.party))
& (journal_account.account == args.party_account) & (journal_account.account.isin(args.party_account))
) )
.orderby(je.posting_date, je.name, order=Order.desc) .orderby(je.posting_date, je.name, order=Order.desc)
) )
@@ -281,7 +282,9 @@ def get_payment_entries(filters, args):
pe.cost_center, pe.cost_center,
) )
.where( .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) .orderby(pe.posting_date, pe.name, order=Order.desc)
) )