From 32335da8398876fde80da12e3079ad3a23de6d0e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 12:03:46 +0530 Subject: [PATCH] fix: add parenttype condition to payment schedule query in accounts receivable report (backport #46370) (#46499) Fix: add parenttype condition to payment schedule query in accounts receivable report (#46370) fix: add parenttype condition to payment schedule query in accounts receivable report (cherry picked from commit f311a0fc1ca80be3bda349175d1cb36f3009bb12) Co-authored-by: Shanuka Hewage <89955436+Shanuka-98@users.noreply.github.com> --- .../accounts/report/accounts_receivable/accounts_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 54b2c604bf4..2fcae9fa778 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -520,7 +520,7 @@ class ReceivablePayableReport: ps.description, ps.paid_amount, ps.discounted_amount from `tab{row.voucher_type}` si, `tabPayment Schedule` ps where - si.name = ps.parent and + si.name = ps.parent and ps.parenttype = '{row.voucher_type}' and si.name = %s and si.is_return = 0 order by ps.paid_amount desc, due_date