Skip to content

Commit

Permalink
fix: cost_center filter fix for 'Get Outstanding Invoice' in PE
Browse files Browse the repository at this point in the history
(cherry picked from commit 8eb9300)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Dec 15, 2022
1 parent 9b2b281 commit ff61997
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.py
Expand Up @@ -1187,6 +1187,7 @@ def get_outstanding_reference_documents(args):

ple = qb.DocType("Payment Ledger Entry")
common_filter = []
accounting_dimensions_filter = []
posting_and_due_date = []

# confirm that Supplier is not blocked
Expand Down Expand Up @@ -1216,7 +1217,7 @@ def get_outstanding_reference_documents(args):
# Add cost center condition
if args.get("cost_center"):
condition += " and cost_center='%s'" % args.get("cost_center")
common_filter.append(ple.cost_center == args.get("cost_center"))
accounting_dimensions_filter.append(ple.cost_center == args.get("cost_center"))

date_fields_dict = {
"posting_date": ["from_posting_date", "to_posting_date"],
Expand All @@ -1242,6 +1243,7 @@ def get_outstanding_reference_documents(args):
posting_date=posting_and_due_date,
min_outstanding=args.get("outstanding_amt_greater_than"),
max_outstanding=args.get("outstanding_amt_less_than"),
accounting_dimensions=accounting_dimensions_filter,
)

outstanding_invoices = split_invoices_based_on_payment_terms(outstanding_invoices)
Expand Down

0 comments on commit ff61997

Please sign in to comment.