Skip to content

Commit

Permalink
fix: Add filter for outstanding_amount to fetch open PRs
Browse files Browse the repository at this point in the history
(cherry picked from commit 214dfab)
  • Loading branch information
Abdeali099 authored and mergify[bot] committed Nov 29, 2024
1 parent eb80984 commit 7e847f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,7 @@ def get_open_payment_requests_for_references(references=None):
.where(Tuple(PR.reference_doctype, PR.reference_name).isin(list(refs)))
.where(PR.status != "Paid")
.where(PR.docstatus == 1)
.where(PR.outstanding_amount > 0) # to avoid old PRs with 0 outstanding amount
.orderby(Coalesce(PR.transaction_date, PR.creation), order=frappe.qb.asc)
).run(as_dict=True)

Expand Down

0 comments on commit 7e847f2

Please sign in to comment.