Merge pull request #37805 from frappe/mergify/bp/version-15-hotfix/pr-37793
refactor: pull remarks only if needed on AR/AP report (backport #37793)
This commit is contained in:
commit
7a5bfe0009
@ -718,6 +718,7 @@ class ReceivablePayableReport(object):
|
|||||||
query = (
|
query = (
|
||||||
qb.from_(ple)
|
qb.from_(ple)
|
||||||
.select(
|
.select(
|
||||||
|
ple.name,
|
||||||
ple.account,
|
ple.account,
|
||||||
ple.voucher_type,
|
ple.voucher_type,
|
||||||
ple.voucher_no,
|
ple.voucher_no,
|
||||||
@ -731,13 +732,15 @@ class ReceivablePayableReport(object):
|
|||||||
ple.account_currency,
|
ple.account_currency,
|
||||||
ple.amount,
|
ple.amount,
|
||||||
ple.amount_in_account_currency,
|
ple.amount_in_account_currency,
|
||||||
ple.remarks,
|
|
||||||
)
|
)
|
||||||
.where(ple.delinked == 0)
|
.where(ple.delinked == 0)
|
||||||
.where(Criterion.all(self.qb_selection_filter))
|
.where(Criterion.all(self.qb_selection_filter))
|
||||||
.where(Criterion.any(self.or_filters))
|
.where(Criterion.any(self.or_filters))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.filters.get("show_remarks"):
|
||||||
|
query = query.select(ple.remarks)
|
||||||
|
|
||||||
if self.filters.get("group_by_party"):
|
if self.filters.get("group_by_party"):
|
||||||
query = query.orderby(self.ple.party, self.ple.posting_date)
|
query = query.orderby(self.ple.party, self.ple.posting_date)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user