transaction.scm date subtotal options - calling wizards ...

Christopher Lam christopher.lck at
Fri Sep 22 08:48:11 EDT 2017

Hi devs,

While working on transaction.scm (again) to fix a sorting/grouping bug[1],
I came across some inconsistencies:

1. if I choose sortkey "date" "exact-time" -- they do the exact same thing,
but otherwise work well

2. if I choose sortkey "reconciled date" -- it does what it says, however
*the date-subtotal selector is not used at all.*

3. if I choose sortkey "register order"
(a) first, I'm not entirely sure what exactly this mean - *does it mean,
sort by EntryDate *(accessible by xaccTransGetDateEntered

(b) second, it allows date-subtotal selection, which to me is puzzling, but
could be acceptable if we're sorting by EntryDate

My conclusion from above would be that the original date-sorting-types has
a typo, it was (define date-sorting-types (list 'date 'exact-time
'register-order)) but it should really be (define date-sorting-types (list
'date 'exact-time 'reconciled-date))

*What would be the consensus from wizards if we had to do it right?*

I suggest:
1. We change (define date-sorting-types (list 'date 'exact-time
2. When sorting by register-order, it should disallow date-subtotals

My solution to produce my report correctly requires a custom sorting
algorithm which is nearly complete, and would override the
qof-query-set-sort-order. Work-in-progress at

[1] this bug relates to my preferred sorting/grouping: prime-sortkey=date,
subtotal=quarterly, sec-sortkey=account-name, subtotal=true. This will
produce an incorrect grouping whereby a quarter (eg 2016 Q1) will be split
incorrectly, because the query will sort by dates rather than quarters.
Documented in my comment on

More information about the gnucash-devel mailing list