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 682800 - Generated balances on Report different than calculated balances on Ledger when using "open subaccounts"
Generated balances on Report different than calculated balances on Ledger whe...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.4.x
Other Windows
: Normal major
: ---
Assigned To: Christian Stimming
Depends on:
Blocks:
 
 
Reported: 2012-08-27 13:03 UTC by gfreshman
Modified: 2018-06-29 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of Ledger view with correct ballances and Report with wrong values (241.35 KB, application/zip)
2012-08-27 13:03 UTC, gfreshman
  Details
patch file to be applied on register.scm in GnuCash 2.5.0 (9.77 KB, patch)
2013-04-23 09:08 UTC, Carsten Rinke
committed Details | Review

Description gfreshman 2012-08-27 13:03:50 UTC
Created attachment 222544 [details]
Screenshot of Ledger view with correct ballances and Report with wrong values

Lets say that I have account "A" with subbacounts "AA" and "AB".
When I open account A or subaccounts AA or AB then I get ledger and report with same (correct) balances.
When I select account "A" and choose "open subaccounts" then I get Ledger view with correctly calculated Balances, but Report from same account (with subaccounts) generates different Balances, because it doesn't handle subaccounts correctly.
Comment 1 gfreshman 2012-08-27 13:28:01 UTC
I'll add IRC communication which occured after my question about this problem

warlord: Internally GnuCash caches the balances, but only for the single account. In the Subaccounts view it recomputes the balances in real-time. But the report might not do that -- it might just take the actual Split Balance directly, which is why I asked the question and am waiting for your response.

me: ... Lets say that I have account "A" with subbacounts "AA" and "AB"... all balances from "AA" matches with "AA" report ... same for "AB"...but if I open "A" with "Open Subaccounts" then balances from ledger differs from generated ballances on report

warlord: ... which returns me back to my statement, that the report is using the cached Split Balance instead of computing it on the fly.
warlord: So, I would recommend you file a bug report in Bugzilla

mikee:	I think I see where the balances are from
mikee:	It's the balance of whatever account that transaction involves.
mikee:	Which I guess isn't what you(we)want.

warlord: mikee: Yeah, it's just xaccSplitGetBalance()
warlord: The running balance should be computed, just like in the register. We just need to see what the register is doing and use that same API
Comment 2 Carsten Rinke 2013-04-23 09:08:10 UTC
Created attachment 242196 [details] [review]
patch file to be applied on register.scm in GnuCash 2.5.0

Here comes a proposed patch for this bug.

This patch was developed on top of GnuCash 2.5.0

What it does (taken from the patch descsription):

Part I
- bring in some more comments to ornament the code in
function (make-split-table)

Part II
In function (make-split-table), while going through the splits
- change the order of adding splits to the result table and
and updating the total collectors
Old oder:
1. add the splits to the result table
2. update the total collectors (for display at the end of the report)
New order:
1. update the total collectors with the values of the current splits
2. add the splits to the result table
Luckily this was implemented as two separate steps anyway, so this
part of the change can be done with copy/paste.

Part III
In function (make-split-table)
- change the call to (add-split-row) to also include the total-collector
- change the call to (add-other-split-rows) to also include the total-collector
In function (add-other-split-rows)
- change the definition of (add-split-row) to also include the total-collector
- change the call to (add-split-row) to also include the total-collector
In function (add-split-row)
- add the parameter "total-collector" to the function definition
- use this new parameter to display the current balance instead
of using the balance value from the split account.
Comment 3 Geert Janssens 2013-05-10 19:12:05 UTC
Comment on attachment 242196 [details] [review]
patch file to be applied on register.scm in GnuCash 2.5.0

I have applied your patch as r22972 (trunk). Thank you very much !

As mentioned, I won't backport this to 2.4.
Comment 4 Geert Janssens 2013-05-10 19:25:07 UTC
Uhm, disregard the part on backporting to 2.4. That was meant for another bug. I'm not sure on this one. I'll ponder it some.
Comment 5 Geert Janssens 2013-05-31 13:28:16 UTC
My intention was to eventually backport this change to 2.4, but unfortunately the patch doesn't apply cleanly. It conflicts with Alex Aycinena's changes on which number field to use.

So following our backporting guidelines I will not backport it. This change will only be available in 2.5.2 and up.
Comment 6 John Ralls 2017-09-24 22:47:58 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 7 John Ralls 2018-06-29 23:10:18 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=682800. Please update any external references or bookmarks.