gnucash maint: Followup on bug 682800 to fix row balances in register reports

Geert Janssens gjanssens at code.gnucash.org
Fri Dec 4 12:51:13 EST 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/e410e05d (commit)
	from  https://github.com/Gnucash/gnucash/commit/5a381125 (commit)



commit e410e05da7d89b8076ad953b28d0ea790b0002e6
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Fri Dec 4 18:50:49 2015 +0100

    Followup on bug 682800 to fix row balances in register reports
    
    Due to the changes done for bug 682800 the row balances for the account report
    no longer matched the row balances of the original register. This commit
    should fix that for a consistent experience.

diff --git a/src/report/standard-reports/register.scm b/src/report/standard-reports/register.scm
index ada8645..da9bd8e 100644
--- a/src/report/standard-reports/register.scm
+++ b/src/report/standard-reports/register.scm
@@ -323,6 +323,9 @@
                      (gnc:make-gnc-monetary trans-currency
                                             (gnc-numeric-neg (xaccSplitGetValue split))))
                     " ")))
+    ; For single account registers, use the split's cached balance to remain
+    ; consistent with the balances shown in the register itself
+    ; For others, use the cumulated balance from the totals-collector
     (if (balance-col column-vector)
         (addto! row-contents
                 (if transaction-info?
@@ -331,7 +334,10 @@
                      (gnc:html-split-anchor
                       split
                       (gnc:make-gnc-monetary
-                        currency (cadr (total-collector 'getpair currency #f)))))
+                        currency
+                        (if ledger-type?
+                            (cadr (total-collector 'getpair currency #f))
+                            (xaccSplitGetBalance split)))))
                     " ")))
 
     (gnc:html-table-append-row/markup! table row-style



Summary of changes:
 src/report/standard-reports/register.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list