GNOME Bugzilla – Bug 529232
Average Balance Report: Reversing the starting balance distorts the numbers
Last modified: 2018-06-29 22:03:43 UTC
Please describe the problem: When I try to create an Average Balance report using an account that has a reverse balance (Preferences->Accounts->Reverse Balanced Accounts), the report does not seem to be aware of reverse balances. As a result, the numbers it calculates for a running balance can be way off: the *initial* balance for the graph incorporates the reversal, while the *changes* in balance do not. Steps to reproduce: 1. Turn on Preferences->Accounts->Reverse Balanced Accounts for some accounts. 2. Create a sample account of the Reverse Balance type. 3. Enter some sample data. 4. Create an Average Balance report with date range starting where the sample account has a 0 balance. 5. Create an Average Balance report with date range starting where the sample account has a non-zero balance. Actual results: Running balance for sample account (step 3): Apr 1: 0.00 May 1: 0.00 Jun 1: 0.70 Jul 1: 1.05 Aug 1: 1.22 Step 4: Reported account balance (daily step size), 4/1-8/1: Apr 1: 0.00 May 1: 0.00 Jun 1: -0.70 Jul 1: -1.05 Aug 1: -1.22 Step 5: Reported account balance (daily step size), 6/1-8/1: Jun 1: 0.70 Jul 1: 0.35 Aug 1: 0.18 Expected results: Ideally, a balance report only involving reversed-balance accounts should also reverse its balance (in the Step 4 data, all numbers should be positive). As a cruftier solution, the numbers from Step 4 should match those of Step 5 -- the starting amount should be -0.70. Does this happen every time? Yes. Other information:
Please check whether the attached patch fixes this issue for you. If you did not build from a tarball, edit $prefix/share/gnucash/guile-modules/gnucash/report/average-balance.scm and apply the changes as showed in the patch.
Created attachment 109661 [details] [review] First try
Applied to trunk as r17124 and branches/2.2 as r17138 for GnuCash 2.2.5. Thanks.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=529232. Please update any external references or bookmarks.