Gnucash budget report enhancement

Budget report in Gnucash allows you to control your expenses, by comparing them with planned budget values, but it's current version lacks convenience when working with budgets that have a large amount of periods. This is due to not fixed column in table that displays accounts. As a result it's pretty easy to lost yourself among numbers and hard to determine what period corresponds to concrete column and what account is this row for. You also not available to generate report for a part of periods.

It's hard to tell for what accounts and periods are all this values

Because of that problems we even had to reject annual budgets and move to budget for a half of a year. In that way we could work only with 6 periods during report evaluation.

Recently I made modifications in this report to improve it's usability: now you can run it only for a selected range of periods instead all of them. It allows you to focus on analysys of only necessary data, and hide extra information. In that way we can reduce a number of columns so that they can fit in one screen.

New options

New features are off by default, so it does not break previous standard behaviour and previously reports that current users have. To turn new features on you should make a new flag "Report for range of budget periods" active. It activates another controls for selection of periods range along with 2 additional flags that control behaviour for periods that are out of selected range.

Range selection

There are a number of options to select range borders. You can select one of the predefined values in a combobox:
  1. First
  2. Last
  3. Current
  4. Previous
  5. Next
As an alternative is nothing fits your needs you can select exact period by number. To do this you should select "Manual period selection" value in combobox and after that a spinbox will be available. Using it you can specify any period you like.

As for me exact period values are convinient for one-time reports, but for preconfigured saved reports it's not the best option: when you'll want to generate report in future again, you'll probably have to open settings and adjust range borders. A good reason to have preconfigured report is to not set up it again and again, so for this case a best values for ranges would be floating borders like "Current" and "Previous". For example you can set up a report to use range from previous to current period, always getting a report with 2 actual periods without any change in options menu.

By the way, if selected period is not correct (for example "current" period for a past year budget), then a closest correct period is selected.

Setting up out of range periods behaviour

As I mentioned before, options have two flags to control processing of periods, that are out of selected range.
  1. Include collapsed periods before selected
  2. Include collapsed periods after selected
If you activate corresponding flag, generated report will include additional column, with a sum of values (budget, real, difference) for periods not included in selected range.

This inclusion influence the Totals column, that's why if you don't include them in report, then totals will be calculated only as a sum of selected range values.
Updated report. Only one period included in range. Not included periods are present in "folded" state.

How can I enable this changes in my Gnucash installation?

sent a pull request to developers, but according to comment, they would not be included in branch 2.6.x. That's why it'll take a long time to this changes appear in Gnucash release build.

But it does not mean that you can't try this changes. Our family use this modified version for a couple of month and IMO it's pretty stable to use in "production" use.

To use this new features locally you just need to download this file, and replace default report file with it. 

In linux distros you should replace /usr/share/gnucash/guile-modules/gnucash/report/standard-reports/budget.scm

In windows the file is located here: %install folder%/usr/share/gnucash/guile-modules/gnucash/report/standard-reports/budget.scm

Before replacement you can backup an original (somewhere otside of the reports catalog), but I don't think that anything can break.

UPD 2015.02.19: changes are approved and merged to master branch, so they will only be available in Gnucahs 2.7.x

9 комментариев:

  1. This is pretty good enhancement. Thanks!

    Another feature it is missing (at least for me) is ability to calculate totals for the month (period).

    1. If I get your problem right, you can achieve this by turning off checkboxes for include collpased period options and selecting month (period you like).
      As the totals currently calculated only for visible data and you don't include periods that are out of range, you'll get exactly what you want.

  2. well, that would be the same as data for 1 month. What I meant was total across all expenses for the month: e.g., budget for january: food 100, car 100, gifts 100 = total 300. Same for actuals and the difference

    1. If your accounts have parent account, then including it in the report will automatically calculate this values for it.


  3. Thanks for this. This is really helpful.

    I have issues with how the budget report calculates the difference between asset accounts budget and actual columns.

    If I pay rent in advance for instance I want to save cash in an asset account.
    I can set budgets for the asset account, however if I miss a payment the difference shown is positive rather than negative. Is there a way of altering the report to allow the "sense" of the difference to be reversed?

    Thanks again.


    1. It's not possible to alter report behaviour for specific accounts for now.

      As a workaround, you can try to change the account itself: move your payments to a separate account and try to tune it's parameters, may be it can suite your needs


  4. When I replaced the "budget.scm" file in Ubuntu 17.04, and tried to run GnuCash, it throws an error:

    >;;; note: source file /usr/share/gnucash/scm/gnucash/report/standard-reports/budget.scm
    >;;; newer than compiled /usr/lib/x86_64-linux-gnu/gnucash/gnucash/scm/ccache/2.0/gnucash/report/standard-reports/budget.go

    Any idea?

    1. Could you try
      1. turn off gnucash
      2. rename/move to different dir this file: /usr/lib/x86_64-linux-gnu/gnucash/gnucash/scm/ccache/2.0/gnucash/report/standard-reports/budget.go
      3. start gnucash again

    2. I deleted that and /home/USERNAME/.cache/guile/ccache/2.0-LE-8-2.0/usr/share/gnucash/scm/gnucash/report/standard-reports/budget.scm.go and ran gnucash again. But it throws the following error. Looks like an error in the budget.scm file.