After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 529232 - Average Balance Report: Reversing the starting balance distorts the numbers
Average Balance Report: Reversing the starting balance distorts the numbers
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.2.x
Other All
: Normal normal
: ---
Assigned To: Andreas Köhler
Andreas Köhler
Depends on:
Blocks: backport
 
 
Reported: 2008-04-21 15:31 UTC by Dan Smith
Modified: 2018-06-29 22:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
First try (567 bytes, patch)
2008-04-21 23:35 UTC, Andreas Köhler
committed Details | Review

Description Dan Smith 2008-04-21 15:31:58 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:
Comment 1 Andreas Köhler 2008-04-21 23:34:56 UTC
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.
Comment 2 Andreas Köhler 2008-04-21 23:35:15 UTC
Created attachment 109661 [details] [review]
First try
Comment 3 Andreas Köhler 2008-04-26 17:09:02 UTC
Applied to trunk as r17124 and branches/2.2 as r17138 for GnuCash 2.2.5.
Thanks.
Comment 4 John Ralls 2018-06-29 22:03:43 UTC
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.