GnuCash
Contact   Instructions
Bug 797519 - Budget Viewer Totals do not redraw upon to Sign-Reversal changes
Summary: Budget Viewer Totals do not redraw upon to Sign-Reversal changes
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Budgets (show other bugs)
Version: git-maint
Hardware: PC All
: Normal minor
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-06 19:56 EST by Christopher Lam
Modified: 2019-12-12 03:46 EST (History)
3 users (show)

See Also:


Attachments
A book with feature unreversed-budgets enabled (52.07 KB, application/x-gnucash)
2019-12-07 09:22 EST, Christopher Lam
no flags Details

Description Christopher Lam 2019-12-06 19:56:45 EST
Following work https://github.com/Gnucash/gnucash/pull/592 completed, the current behaviour in git-maint:

* budget viewer is sensitive to sign-reversal policy
* budget viewer is also sensitive to sign-reversal policy.

To illustrate, open the budget editor, then open the global Preferences window, and modify the Sign Reversal Policy.

EXPECTED:
* all numbers in the budget editor/viewer follow the new sign policy immediately

OBTAINED:
* only the spreadsheet numbers follow the sign policy, e.g. Income and Equity budget amounts flip from positive to negative or vice-versa.
* budget totals are not immediately redrawn
* clicking OK to the Preferences window to signify acceptance will actually redraw the budget totals to reflect sign policy.
Comment 1 Bob 2019-12-07 09:17:57 EST
Chris,

I must be blind, what exact preference option?
Comment 2 Christopher Lam 2019-12-07 09:22:23 EST
Created attachment 373472 [details]
A book with feature unreversed-budgets enabled

Bob, not blind - I forgot to clarify and attached a featured book.
Comment 3 Christopher Lam 2019-12-07 09:24:45 EST
global preference is Accounts > Reversed Balance Accounts
Comment 4 Bob 2019-12-07 09:52:56 EST
OK, opened your file and the top 4 collapsed rows change sign and colour when I change the above preference option including the column with Title 'Total'. All the bottom totals have 0.0
Comment 5 Bob 2019-12-07 09:55:37 EST
OK, Changed all the accounts from USD to GBP and now the bottom totals change but only when I exit the preference window so I guess that is the problem.
Comment 6 Geert Janssens 2019-12-07 11:09:28 EST
Yep, that's exactly the problem. Chris and I ran into this while testing his budget improvement work.

The bottom totals should get an update trigger if the preference changes, just like the budget details do. My first guess would be this needs some digging into the account_tree widget to check where it listens for such changes and implement something similar for the budget view widget.
Comment 7 Bob 2019-12-07 12:15:48 EST
Turns out they have been updated, just wipe your mouse over the columns in the totals tree view. I can fix this by registering three pref call backs which do a gtk_widget_queue_draw on the totals tree view.

Will think some more but may be the only way.
Comment 8 Bob 2019-12-08 11:06:19 EST
I can do this differently by connecting to the row-changed signal of the account tree model and then doing a redraw on the bottom tree view, this will also fix when you change the preference for using negative amounts in red.
Comment 9 Geert Janssens 2019-12-08 11:15:59 EST
Yep, sounds like a good plan. The bottom tree view is a slave of the account tree model anyway. All changes to the account tree model affect the bottom tree view in some way.
Comment 10 Bob 2019-12-11 10:48:57 EST
I have pushed my fix to maint and hopefully works for you.
Close if OK or report back if still not working.
Comment 11 Christopher Lam 2019-12-12 03:46:03 EST
As usual, thank you for the fix!

Note You need to log in before you can comment on or make changes to this bug.