GNOME Bugzilla – Bug 506798
Custom Reports don't allow sorting by Account Code
Last modified: 2018-06-29 21:58:09 UTC
example: Using the Account Summary report does not respect the current sort of Account Code in my Accounts Page. Nor does it offer the ability to set the sort order of the report. Since Account Code is the approved method for sorting your accounts in the view it should be respected for reports.
I propose the following patch: Index: src/report/report-system/html-acct-table.scm =================================================================== --- src/report/report-system/html-acct-table.scm (revision 16888) +++ src/report/report-system/html-acct-table.scm (working copy) @@ -756,7 +756,7 @@ (for-each (lambda (acct) - (let* ((subaccts (gnc-account-get-children acct)) + (let* ((subaccts (gnc-account-get-children-sorted acct)) ;; assign output parameters (account acct) (account-name (xaccAccountGetName acct))
The gnc-account-get-children-sorted routine should be called once, outside the for-each, because otherwise it gets called for each split and that could take a long time and really reduce the performance of the report.
Ah, looking at the whole function now I rescind my previous statement; your patch looks correct.
Seems to be a duplicate of Bug 484587 – Accounts do not show in alphanumeric order
Created attachment 104984 [details] [review] Patch to enable standard sorting For completeness.. the proposed patch as attachement.
*** Bug 484587 has been marked as a duplicate of this bug. ***
Applied to trunk as r16940. Awaiting backport to branches/2.2. Thanks a lot!
Applied to branches/2.2 as r16982 for GnuCash 2.2.4.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=506798. Please update any external references or bookmarks.