Merge pull request #33418 from ruthra-kumar/filter_issue_in_ar_ap_report
fix: payment terms and sales partner filter issue in Accounts Receivable report
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 9d96843..fb2e444 100755
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -798,19 +798,19 @@
if self.filters.get("payment_terms_template"):
self.qb_selection_filter.append(
- self.ple.party_isin(
- qb.from_(self.customer).where(
- self.customer.payment_terms == self.filters.get("payment_terms_template")
- )
+ self.ple.party.isin(
+ qb.from_(self.customer)
+ .select(self.customer.name)
+ .where(self.customer.payment_terms == self.filters.get("payment_terms_template"))
)
)
if self.filters.get("sales_partner"):
self.qb_selection_filter.append(
- self.ple.party_isin(
- qb.from_(self.customer).where(
- self.customer.default_sales_partner == self.filters.get("payment_terms_template")
- )
+ self.ple.party.isin(
+ qb.from_(self.customer)
+ .select(self.customer.name)
+ .where(self.customer.default_sales_partner == self.filters.get("payment_terms_template"))
)
)