gnucash maint: [report-utilities] fix gnc:account-accumulate-at-dates sorting & operator

Christopher Lam clam at code.gnucash.org
Thu Mar 26 07:00:06 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/447de7f6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/33902a67 (commit)



commit 447de7f64dc644be9b0684c5beaebe2db90cc3c9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Mar 24 23:53:00 2020 +0800

    [report-utilities] fix gnc:account-accumulate-at-dates sorting & operator
    
    This commit performs 2 important fixes.
    
    1. the account splitlist walking assumes that the split->date always
    increases. This is now enforced by sorting the splitlist, *only* if a
    custom split->date is offered. By default the splits are sorted by
    posted_date, and if a custom split->date is used, will be
    stable-sorted to ensure the algorithm works.
    
    2. the handling of splits *ON* date boundaries is fixed. Previously if
    a split->date was equal to a date boundary, it would be considered
    part of the "after" date section. It is more intuitive that a date
    boundary includes all splits on and before the date. In regular use
    the dates are normalised to canonicaldaytime or end-day-time and is
    not important. However when comparing reconciled dates, the statement
    dates be exactly equal to the reconciled dates, therefore this
    difference is crucial. In other words, the date boundaries mean we
    include all splits before or on the date (to the exact second).
    
    Add a test to verify above.



Summary of changes:
 gnucash/report/report-system/report-utilities.scm  | 13 +++++--
 .../report-system/test/test-report-utilities.scm   | 44 +++++++++++++++++++++-
 2 files changed, 52 insertions(+), 5 deletions(-)



More information about the gnucash-patches mailing list