GNOME Bugzilla – Bug 682800
Generated balances on Report different than calculated balances on Ledger when using "open subaccounts"
Last modified: 2018-06-29 23:10:18 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.
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
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 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.
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.
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.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
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.