Skip to content

Commit

Permalink
fix(general_ledger): Order by in case Group by Account (#28093)
Browse files Browse the repository at this point in the history
* Update general_ledger.py

Fix order_by_statement if filter group by: Group by Account

* chore: whitespace

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
(cherry picked from commit f24ed67)
  • Loading branch information
zeta17 authored and mergify-bot committed Oct 27, 2021
1 parent 2a60a65 commit a830f6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erpnext/accounts/report/general_ledger/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def get_gl_entries(filters, accounting_dimensions):

if filters.get("group_by") == "Group by Voucher":
order_by_statement = "order by posting_date, voucher_type, voucher_no"
if filters.get("group_by") == "Group by Account":
order_by_statement = "order by account, posting_date, creation"

if filters.get("include_default_book_entries"):
filters['company_fb'] = frappe.db.get_value("Company",
Expand Down

0 comments on commit a830f6c

Please sign in to comment.