[GNC] Budget report fails in multiple currencies

ml enquirer ml.hnel.227484 at gmail.com
Thu Jan 5 15:37:44 EST 2023


Hi!

Any clues as to where to start to understand this odd budget report
behaviour? Browsing the code, I wondered if I should start pulling the code
apart here:
https://github.com/Gnucash/gnucash/blob/master/gnucash/gnome/gnc-budget-view.c#L1011

to understand why the totals would be combined in such an
apparently-illogical (but presumably profoundly reasonable to a
better-informed person!) way...

Hints very much appreciated!

On Mon, Jan 2, 2023 at 4:10 PM ml enquirer <ml.hnel.227484 at gmail.com> wrote:

> Dear all,
>
> I spend in two currencies and, historically, I chose to create separate
> accounts under each expense line for each currency. In future I will do
> this differently, employing trading accounts, but what I'm about to
> describe should still work. I budget in my 'home' currency, and the budget
> report would combine the "sub-spends" in each currency (using the price
> database).
>
> However, the "Actual" budget totals don't behave as I expected. I've set
> up a simple scenario to explain:
> 1) I set up an assets and expense ("Groceries") account
> Under each I set up a "GBP" and a "EUR" account
> 3) On 1st Jan of 2020, 2021, 2022, 2023 I spend 10,000 EUR and 10,000 GBP
> on "Groceries"
> 4) I set up the price database with four entries, on 1st Jan:
>  - 1/1/2020 1GBP = 1EUR
>  - 1/1/2021 1GBP = 2EUR
>  - 1/1/2022 1GBP = 1EUR
>
> I've attached a simple reproducer ("bugreport.gnucash", though perhaps
> this is not a bug so filename might be inappropriate!).
>
> When I look at the default budget report, I see that the total per year is
> always 10,000 of each currency in the sub-accounts, as expected, but the
> budget's "Act" total under "Groceries" is:
> 1/1/2020: £15,000 [I expect £20,000 because EUR=GBP on 1/1/20]
> 1/1/2021: £15,000 [I expect £15,000 because 1EUR=0.5GBP on 1/1/21]
> 1/1/2022: £30,000 [I expect £20,000 because 1EUR=1GBP on 1/1/22]
> 1/1/2023: £20,000 [I expect £20,000 because 1EUR=1GBP on 1/1/23]
>
> Can someone explain where my naive expectation is wrong? Is GnuCash doing
> some strange interpolation between exchange rate values?
>
> Many thanks in advance.
>
>


More information about the gnucash-user mailing list