Skip to content

Commit

Permalink
refactor: pull remarks only if needed on AR/AP report
Browse files Browse the repository at this point in the history
(cherry picked from commit eb73017)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Oct 31, 2023
1 parent 59e67cd commit 0589232
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 0589232

Please sign in to comment.