Skip to content

Commit

Permalink
Merge pull request #37805 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-37793

refactor: pull remarks only if needed on AR/AP report (backport #37793)
  • Loading branch information
ruthra-kumar authored Oct 31, 2023
2 parents c8243ec + 0589232 commit 7a5bfe0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ def get_ple_entries(self):
query = (
qb.from_(ple)
.select(
ple.name,
ple.account,
ple.voucher_type,
ple.voucher_no,
Expand All @@ -731,13 +732,15 @@ def get_ple_entries(self):
ple.account_currency,
ple.amount,
ple.amount_in_account_currency,
ple.remarks,
)
.where(ple.delinked == 0)
.where(Criterion.all(self.qb_selection_filter))
.where(Criterion.any(self.or_filters))
)

if self.filters.get("show_remarks"):
query = query.select(ple.remarks)

if self.filters.get("group_by_party"):
query = query.orderby(self.ple.party, self.ple.posting_date)
else:
Expand Down

0 comments on commit 7a5bfe0

Please sign in to comment.