Re: [GNC] Budget report fails in multiple currencies

2023-01-09 Thread ml enquirer
Here is a pull request that demonstrates a "better" handling of the
exchange. Basically, conversion to the report currency should happen
*after* the balance change has been computed, not before. If it happens
before, it makes the historical, cumulative total's exchange-rate
fluctuation during the budget period part of the result.

In the language of my last e-mail, this pull request computes "ES_12*X_1"
(but perhaps it should be "ES_12*X_2"... to be discussed).

https://github.com/Gnucash/gnucash/pull/1497

On Sun, Jan 8, 2023 at 9:34 AM ml enquirer  wrote:

> Yes, it's cumulative, which is a problem I think.
>
> Let:
> 0 indicate the opening of the book
> 1 indicate the start of the budget period in question
> 2 indicate the end of that period
> S_i indicates the sum of transactions since 0 at marker i, in the currency
> of the sub-account
> P_i indicates the sum of transactions since 0 at marker i, in the currency
> of the parent account
> ES_ij indicates the sum of transactions during a period bounded by i and
> j, in sub-account currency
> X_i gives the exchange rate between sub-account and parent-account
>
> The trouble is that the report prints out:
>
> P_2 - P_1
> = S_2*X_2 - S_1*X_1
> = (S_1+ES_12) * X_2 - S_1 * X_1
> = ES_12 * X_2 +  S_1( X_2 - X_1)
>
> My problem is that I only really care about the first term, that contains
> ES_12. But as the years go by, S_1 >> ES_12, so the second term
> increasingly dominates. This becomes particularly visible when X_2-X_1 is
> significant, which has certainly been the case looking at GBP and EUR in
> recent years ;)
>
> By the way, I agree that "ES_12*X_2" is a bit trivial, and it would be
> nice to account for the variation of exchange rates during the year, but
> that's a second-order effect compared to this bug.
>
>
>
>
> To show this in the code:
>
> The "Actual" column in the budget report is populated by
> "gnc:get-account-periodlist-actual-value"
>
> https://github.com/Gnucash/gnucash/blob/master/gnucash/report/reports/standard/budget.scm#L404
>
> which just calls "gnc-budget-get-account-period-actual-value budget acct
> period"
>
> https://github.com/Gnucash/gnucash/blob/master/gnucash/report/reports/standard/budget.scm#L313
>
> which calls "gnc_budget_get_account_period_actual_value"
>
> https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/gnc-budget.cpp#L671gnc_budget_get_account_period_actual_value
>
> which calls "recurrenceGetAccountPeriodValue"
>
> https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/Recurrence.c#L421
> where the documentation says "@return the amount that an Account's value
> changed between the beginning  and end of the nth instance of the
> Recurrence."
>
> The problem is that this does:
>
> https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/Account.cpp#L3992
> gnc_numeric b1, b2;
> b1 = xaccAccountGetNoclosingBalanceAsOfDateInCurrency(acc, t1, NULL,
> recurse);
> b2 = xaccAccountGetNoclosingBalanceAsOfDateInCurrency(acc, t2, NULL,
> recurse);
> return gnc_numeric_sub(b2, b1, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Budget report fails in multiple currencies

2023-01-08 Thread ml enquirer
Yes, it's cumulative, which is a problem I think.

Let:
0 indicate the opening of the book
1 indicate the start of the budget period in question
2 indicate the end of that period
S_i indicates the sum of transactions since 0 at marker i, in the currency
of the sub-account
P_i indicates the sum of transactions since 0 at marker i, in the currency
of the parent account
ES_ij indicates the sum of transactions during a period bounded by i and j,
in sub-account currency
X_i gives the exchange rate between sub-account and parent-account

The trouble is that the report prints out:

P_2 - P_1
= S_2*X_2 - S_1*X_1
= (S_1+ES_12) * X_2 - S_1 * X_1
= ES_12 * X_2 +  S_1( X_2 - X_1)

My problem is that I only really care about the first term, that contains
ES_12. But as the years go by, S_1 >> ES_12, so the second term
increasingly dominates. This becomes particularly visible when X_2-X_1 is
significant, which has certainly been the case looking at GBP and EUR in
recent years ;)

By the way, I agree that "ES_12*X_2" is a bit trivial, and it would be nice
to account for the variation of exchange rates during the year, but that's
a second-order effect compared to this bug.




To show this in the code:

The "Actual" column in the budget report is populated by
"gnc:get-account-periodlist-actual-value"
https://github.com/Gnucash/gnucash/blob/master/gnucash/report/reports/standard/budget.scm#L404

which just calls "gnc-budget-get-account-period-actual-value budget acct
period"
https://github.com/Gnucash/gnucash/blob/master/gnucash/report/reports/standard/budget.scm#L313

which calls "gnc_budget_get_account_period_actual_value"
https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/gnc-budget.cpp#L671gnc_budget_get_account_period_actual_value

which calls "recurrenceGetAccountPeriodValue"
https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/Recurrence.c#L421
where the documentation says "@return the amount that an Account's value
changed between the beginning  and end of the nth instance of the
Recurrence."

The problem is that this does:
https://github.com/Gnucash/gnucash/blob/master/libgnucash/engine/Account.cpp#L3992
gnc_numeric b1, b2;
b1 = xaccAccountGetNoclosingBalanceAsOfDateInCurrency(acc, t1, NULL,
recurse);
b2 = xaccAccountGetNoclosingBalanceAsOfDateInCurrency(acc, t2, NULL,
recurse);
return gnc_numeric_sub(b2, b1, GNC_DENOM_AUTO, GNC_HOW_DENOM_FIXED);
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Budget report fails in multiple currencies

2023-01-07 Thread Adrien Monteleone

As long as the change in value isn't cumulative, I would want to know.

If I wanted to budget the same 'purchasing power' as last period/year, I 
would not want to budget the exact same nominal amount. (on that note, a 
feature to factor inflation for budgets would be swell!)


But I do understand that previous rates are no guarantee of future 
rates. (exchange or inflation) They provide a starting point though.


All of that would only affect my *next* budget, via Actual, not the 
current one. (it might also explain Variance) So I still think there's a 
potential bug.


Regards,
Adrien

On 1/7/23 11:35 AM, ml enquirer wrote:

Hi Fred,

Thanks for the thought! I agree the change in value is 10,000. My point is,
basically, that I don't care about currency fluctuations in money already
spent when planning *next* year's budget.

But the 'problem' (which might just be that I need someone to explain what
a 'budget' is!) is (at least) two fold:
1) When I think 'budget' I think "planning how much I can spend in this
budget period". So I want the report to tell me that. If there are no
transactions in any child account, I don't expect a non-zero total in the
parent account. I certainly don't want a non-zero total that depends how
long I've been using gnucash. In the first year of using Gnucash, this
shows the total expense. In the 100th (hopefully!) year of using Gnucash,
this mainly shows the currency fluctuation of the history of my grocery
spending in years 0-99! These are totally different things, at least for
the typical use of an expense account like 'groceries'.
2) The budget report and the budget view seem to show the totals
aggregating in different ways. I would expect correspondence.

When you think "budgetting this year's groceries", why would you care about
having to plan for the currency fluctuation in what has already been spent,
and which is no longer available to spend, and which has no impact on what
can be spent this year? Is there another report that you'd recommend that I
use?

Let me be gently provocative: I think my described use-case is more widely
relevant, at least for expense accounts if not for asset accounts ;) But as
I keep on saying, I'm very ignorant of even basic accountancy techniques,
so feel free to (gently) teach me!


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Budget report fails in multiple currencies

2023-01-07 Thread ml enquirer
Hi Fred,

Thanks for the thought! I agree the change in value is 10,000. My point is,
basically, that I don't care about currency fluctuations in money already
spent when planning *next* year's budget.

But the 'problem' (which might just be that I need someone to explain what
a 'budget' is!) is (at least) two fold:
1) When I think 'budget' I think "planning how much I can spend in this
budget period". So I want the report to tell me that. If there are no
transactions in any child account, I don't expect a non-zero total in the
parent account. I certainly don't want a non-zero total that depends how
long I've been using gnucash. In the first year of using Gnucash, this
shows the total expense. In the 100th (hopefully!) year of using Gnucash,
this mainly shows the currency fluctuation of the history of my grocery
spending in years 0-99! These are totally different things, at least for
the typical use of an expense account like 'groceries'.
2) The budget report and the budget view seem to show the totals
aggregating in different ways. I would expect correspondence.

When you think "budgetting this year's groceries", why would you care about
having to plan for the currency fluctuation in what has already been spent,
and which is no longer available to spend, and which has no impact on what
can be spent this year? Is there another report that you'd recommend that I
use?

Let me be gently provocative: I think my described use-case is more widely
relevant, at least for expense accounts if not for asset accounts ;) But as
I keep on saying, I'm very ignorant of even basic accountancy techniques,
so feel free to (gently) teach me!

D

On Sat, Jan 7, 2023 at 6:08 PM Fred Bone  wrote:

> On 07 January 2023 at 10:21, ml enquirer said:
>
> > Just to add that I was wrong that this could be solved by making budgets
> > with a single period. I *think* this problem arises for any
> multi-currency
> > sub-accounts and becomes visible when you have a book which has been
> > running for many years. In that circumstance, the 'actual' column is only
> > incrementally affected by spends during the actual reporting period
> (which
> > are small compared to the cumulative spending over the years).
> >
> > Imagine a case where there is *no* spend on any sub-account in a
> reporting
> > period, but the years prior total 1,000,000 EUR and 1,000,000 GBP.
> Imagine
> > the exchange rate is 1 EUR to GBP at the start of this new 'empty' period
> > and 1 EUR to 1.01 GBP at the end. 1) The computed total at the start will
> > be 1,000,000 EUR + 1,000,000 GBP = 2,000,000 GBP. 2) The computed total
> at
> > the end will be 1,000,000 EUR + 1,000,000 GBP = 2,010,000 GBP and the
> > reported "Actual" spend will be 10,000 GBP despite nothing having been
> > spent.
>
> The change in value is indeed 10,000. What's the problem?
>
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Budget report fails in multiple currencies

2023-01-07 Thread Fred Bone
On 07 January 2023 at 10:21, ml enquirer said:

> Just to add that I was wrong that this could be solved by making budgets
> with a single period. I *think* this problem arises for any multi-currency
> sub-accounts and becomes visible when you have a book which has been
> running for many years. In that circumstance, the 'actual' column is only
> incrementally affected by spends during the actual reporting period (which
> are small compared to the cumulative spending over the years).
> 
> Imagine a case where there is *no* spend on any sub-account in a reporting
> period, but the years prior total 1,000,000 EUR and 1,000,000 GBP. Imagine
> the exchange rate is 1 EUR to GBP at the start of this new 'empty' period
> and 1 EUR to 1.01 GBP at the end. 1) The computed total at the start will
> be 1,000,000 EUR + 1,000,000 GBP = 2,000,000 GBP. 2) The computed total at
> the end will be 1,000,000 EUR + 1,000,000 GBP = 2,010,000 GBP and the
> reported "Actual" spend will be 10,000 GBP despite nothing having been
> spent.

The change in value is indeed 10,000. What's the problem?


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Budget report fails in multiple currencies

2023-01-07 Thread ml enquirer
Just to add that I was wrong that this could be solved by making budgets
with a single period. I *think* this problem arises for any multi-currency
sub-accounts and becomes visible when you have a book which has been
running for many years. In that circumstance, the 'actual' column is only
incrementally affected by spends during the actual reporting period (which
are small compared to the cumulative spending over the years).

Imagine a case where there is *no* spend on any sub-account in a reporting
period, but the years prior total 1,000,000 EUR and 1,000,000 GBP. Imagine
the exchange rate is 1 EUR to GBP at the start of this new 'empty' period
and 1 EUR to 1.01 GBP at the end.
1) The computed total at the start will be 1,000,000 EUR + 1,000,000 GBP =
2,000,000 GBP.
2) The computed total at the end will be 1,000,000 EUR + 1,000,000 GBP =
2,010,000 GBP
and the reported "Actual" spend will be 10,000 GBP despite nothing having
been spent.

This reporting bug gets worse the longer gnucash is used.

Thanks,
D

On Sat, Jan 7, 2023 at 9:52 AM ml enquirer  wrote:

> Hi Adrien,
>
> Thanks for the mental bandwidth on this. I don't like replying inline, but
> I'm going to grit my teeth and do it here - forgive me!
>
> Cheers,
> D
>
> On Sat, Jan 7, 2023 at 12:47 AM Adrien Monteleone <
> adrien.montele...@lusfiber.net> wrote:
>
>> Christopher Lamm had been working on various aspects of the Budget
>> Report not long ago. He may be able to squeeze in a look at this. He'll
>> likely be the one to see your bug report and maybe shed light on the
>> math logic.
>>
> Great: https://bugs.gnucash.org/show_bug.cgi?id=798716
>
>
>> If I can find some time this weekend I'll test as well. I normally don't
>> budget with multiple currencies, but I do use the Budget feature and
>> report. (looking at your screenshot, I've never done a multi-year
>> budget, so that will be interesting. I'll test too with a single year.)
>>
> The pragmatic way around this is to only use budget reports with a single
> budget period when multiple currencies are used in sub-accounts. Things
> then work because the starting "actual" value is always zero.
>
>
>> Concerning the 'roll-up', if you leave the parent blank, it should work.
>> (at least it does with a single currency) *But*, you can also put in a
>> different value manually for the parent. I'm not sure if that is in play
>> here or not. The parent has to be entirely blank, not just a "0" or "0.00"
>>
>> *note, this is for the Budget itself, your screenshot showed the report
>> result, but does the parent roll-up not work on the budget tab either?
>>
> Interesting. Here the budget and the budget report behave differently. The
> roll-up *does* acknowledge the change in FX rate, but behaves as I'd expect
> (see screenshot attached)
>
>>
>> With respect to the 'past-period memory', it could be buggy, but I'd be
>> inclined to first look really carefully at my report options, *and* the
>> budget period setup. (Edit > Budget Options, or Options toolbar button
>> once a budget is already open - different from Options button on the
>> report tab) I once made an odd mess here myself that produced strange
>> numbers that didn't make sense.
>>
>> Specifically with the Report Options, the General tab can make things
>> messy with respect to custom ranges, and Accounts > Account Depth can
>> produce odd results if not sufficiently deep, or if flattened.
>>
> Depth was enough to capture all sub-accounts and ranges were sensible (and
> covered all transactions). I admit it is possible to screw this up as you
> warn - and perhaps I still have - but I think I've picked it simply
>
>>
>> Additionally, did you simply manually enter all budget values, or did
>> you perhaps use the Estimate feature?
>>
> Manually entered.
>
>>
>> Finally, does this book have Trading Accounts enabled by chance? I think
>> I understood from your first post that you aren't using them yet. (mine
>> does, so I'll test with and without to see if there is difference)
>>
> No trading accounts.
>
>>
>> -
>> I've been in the habit of hazarding guesses lately, so here's one for
>> this topic:
>>
>> Since the Budget Report does not have an option for commodity price
>> source like other reports cognizant of other currencies, I'll
>> hypothesize that budgets simply aren't (yet) capable of properly working
>> with more than one, or any currency other than the book currency.
>>
>> Regards,
>> Adrien
>>
>> On 1/6/23 4:48 PM, ml enquirer wrote:
>> > Dear all,
>> >
>> > I've done some digging, and Gnucash totals seem to be wrongly reported
>> for
>> > budget reports with multi-currency sub-accounts. But I'm not an
>> accountancy
>> > expert at all, so perhaps someone can explain the accounting logic
>> behind
>> > it? Perhaps a report that can imply 1+1=3 should have a warning note?
>> > Should we be ensuring that accounts add up across budget periods, or
>> down
>> > hierarchies within budget periods? Gnucash is doing the former, but it's
>> > 

Re: [GNC] Budget report fails in multiple currencies

2023-01-07 Thread ml enquirer
Hi Adrien,

Thanks for the mental bandwidth on this. I don't like replying inline, but
I'm going to grit my teeth and do it here - forgive me!

Cheers,
D

On Sat, Jan 7, 2023 at 12:47 AM Adrien Monteleone <
adrien.montele...@lusfiber.net> wrote:

> Christopher Lamm had been working on various aspects of the Budget
> Report not long ago. He may be able to squeeze in a look at this. He'll
> likely be the one to see your bug report and maybe shed light on the
> math logic.
>
Great: https://bugs.gnucash.org/show_bug.cgi?id=798716


> If I can find some time this weekend I'll test as well. I normally don't
> budget with multiple currencies, but I do use the Budget feature and
> report. (looking at your screenshot, I've never done a multi-year
> budget, so that will be interesting. I'll test too with a single year.)
>
The pragmatic way around this is to only use budget reports with a single
budget period when multiple currencies are used in sub-accounts. Things
then work because the starting "actual" value is always zero.


> Concerning the 'roll-up', if you leave the parent blank, it should work.
> (at least it does with a single currency) *But*, you can also put in a
> different value manually for the parent. I'm not sure if that is in play
> here or not. The parent has to be entirely blank, not just a "0" or "0.00"
>
> *note, this is for the Budget itself, your screenshot showed the report
> result, but does the parent roll-up not work on the budget tab either?
>
Interesting. Here the budget and the budget report behave differently. The
roll-up *does* acknowledge the change in FX rate, but behaves as I'd expect
(see screenshot attached)

>
> With respect to the 'past-period memory', it could be buggy, but I'd be
> inclined to first look really carefully at my report options, *and* the
> budget period setup. (Edit > Budget Options, or Options toolbar button
> once a budget is already open - different from Options button on the
> report tab) I once made an odd mess here myself that produced strange
> numbers that didn't make sense.
>
> Specifically with the Report Options, the General tab can make things
> messy with respect to custom ranges, and Accounts > Account Depth can
> produce odd results if not sufficiently deep, or if flattened.
>
Depth was enough to capture all sub-accounts and ranges were sensible (and
covered all transactions). I admit it is possible to screw this up as you
warn - and perhaps I still have - but I think I've picked it simply

>
> Additionally, did you simply manually enter all budget values, or did
> you perhaps use the Estimate feature?
>
Manually entered.

>
> Finally, does this book have Trading Accounts enabled by chance? I think
> I understood from your first post that you aren't using them yet. (mine
> does, so I'll test with and without to see if there is difference)
>
No trading accounts.

>
> -
> I've been in the habit of hazarding guesses lately, so here's one for
> this topic:
>
> Since the Budget Report does not have an option for commodity price
> source like other reports cognizant of other currencies, I'll
> hypothesize that budgets simply aren't (yet) capable of properly working
> with more than one, or any currency other than the book currency.
>
> Regards,
> Adrien
>
> On 1/6/23 4:48 PM, ml enquirer wrote:
> > Dear all,
> >
> > I've done some digging, and Gnucash totals seem to be wrongly reported
> for
> > budget reports with multi-currency sub-accounts. But I'm not an
> accountancy
> > expert at all, so perhaps someone can explain the accounting logic behind
> > it? Perhaps a report that can imply 1+1=3 should have a warning note?
> > Should we be ensuring that accounts add up across budget periods, or down
> > hierarchies within budget periods? Gnucash is doing the former, but it's
> > confusing since the display can imply only the latter is in action.
> >
> > I built a local copy of gnucash and tracked the calls through budget.scm
> > back to the totalling and currency-conversion that happens in Account.cpp
> > and I see where the confusion arises. There is memory of previous budget
> > periods built into the reported totals under each asset class (see the
> > detail below and the picture attached).
> >
> > Isn't it a bit counter-intuitive that the budget reports for 'parent'
> > account values in a given budget period, don't need to add up to the sum
> of
> > the 'child' account values when converted by the exchange rate relevant
> for
> > that budget period? I give lots of detail below, where it's clear the
> > report is not "buggy", but it is borderline misleading, particularly
> given
> > that the report can be restricted to a single budget period within which
> it
> > appears to say that 30,000 GBP is the sum of 10,000 GBP and 10,000 EUR,
> > when the exchange rate is 1GBP = 1EUR. 1+1=3?
> >
> > Would love some expert input. Maybe I should report this as a bug and let
> > someone set me right there? :)
> >
> > Cheers,
> > D
> >
> > PS: Here's the 

Re: [GNC] Budget report fails in multiple currencies

2023-01-06 Thread Adrien Monteleone
Christopher Lamm had been working on various aspects of the Budget 
Report not long ago. He may be able to squeeze in a look at this. He'll 
likely be the one to see your bug report and maybe shed light on the 
math logic.


If I can find some time this weekend I'll test as well. I normally don't 
budget with multiple currencies, but I do use the Budget feature and 
report. (looking at your screenshot, I've never done a multi-year 
budget, so that will be interesting. I'll test too with a single year.)


Concerning the 'roll-up', if you leave the parent blank, it should work. 
(at least it does with a single currency) *But*, you can also put in a 
different value manually for the parent. I'm not sure if that is in play 
here or not. The parent has to be entirely blank, not just a "0" or "0.00"


*note, this is for the Budget itself, your screenshot showed the report 
result, but does the parent roll-up not work on the budget tab either?


With respect to the 'past-period memory', it could be buggy, but I'd be 
inclined to first look really carefully at my report options, *and* the 
budget period setup. (Edit > Budget Options, or Options toolbar button 
once a budget is already open - different from Options button on the 
report tab) I once made an odd mess here myself that produced strange 
numbers that didn't make sense.


Specifically with the Report Options, the General tab can make things 
messy with respect to custom ranges, and Accounts > Account Depth can 
produce odd results if not sufficiently deep, or if flattened.


Additionally, did you simply manually enter all budget values, or did 
you perhaps use the Estimate feature?


Finally, does this book have Trading Accounts enabled by chance? I think 
I understood from your first post that you aren't using them yet. (mine 
does, so I'll test with and without to see if there is difference)


-
I've been in the habit of hazarding guesses lately, so here's one for 
this topic:


Since the Budget Report does not have an option for commodity price 
source like other reports cognizant of other currencies, I'll 
hypothesize that budgets simply aren't (yet) capable of properly working 
with more than one, or any currency other than the book currency.


Regards,
Adrien

On 1/6/23 4:48 PM, ml enquirer wrote:

Dear all,

I've done some digging, and Gnucash totals seem to be wrongly reported for
budget reports with multi-currency sub-accounts. But I'm not an accountancy
expert at all, so perhaps someone can explain the accounting logic behind
it? Perhaps a report that can imply 1+1=3 should have a warning note?
Should we be ensuring that accounts add up across budget periods, or down
hierarchies within budget periods? Gnucash is doing the former, but it's
confusing since the display can imply only the latter is in action.

I built a local copy of gnucash and tracked the calls through budget.scm
back to the totalling and currency-conversion that happens in Account.cpp
and I see where the confusion arises. There is memory of previous budget
periods built into the reported totals under each asset class (see the
detail below and the picture attached).

Isn't it a bit counter-intuitive that the budget reports for 'parent'
account values in a given budget period, don't need to add up to the sum of
the 'child' account values when converted by the exchange rate relevant for
that budget period? I give lots of detail below, where it's clear the
report is not "buggy", but it is borderline misleading, particularly given
that the report can be restricted to a single budget period within which it
appears to say that 30,000 GBP is the sum of 10,000 GBP and 10,000 EUR,
when the exchange rate is 1GBP = 1EUR. 1+1=3?

Would love some expert input. Maybe I should report this as a bug and let
someone set me right there? :)

Cheers,
D

PS: Here's the detail:
I expected:
- reported actual "Groceries" total would be the sum of the reported "GBP"
and "EUR" account spends in that budget period, according to the relevant
FX rate.

But in reality:
- it's actually this year's change in the balance for that account compared
to the last budget period. That means that while the GBP or EUR rows always
change by 10,000 each year, and thus always show 10,000 in the budget
report, the sum of the two - the "Groceries" row - is not necessarily equal
to 10,000 GBP + 10,000 EUR. In my example, 1EUR = 0.5 GBP for the first two
budget periods, so the balance of "Groceries" by the end of the second
period was (10,000GBP+5,000GBP) + (10,000 GBP + 5,000 GBP) = 30,000 GBP.
But at the end of the third period, the three years' of spending meant that
the balance of "Groceries" was
(10,000GBP+10,000GBP)+(10,000GBP+10,000GBP)+(10,000GBP+10,000GBP) = 60,000
GBP. Difference 30,000 GBP.

so 1 + 1 = 3.


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:

Re: [GNC] Budget report fails in multiple currencies

2023-01-06 Thread ml enquirer
Dear all,

I've done some digging, and Gnucash totals seem to be wrongly reported for
budget reports with multi-currency sub-accounts. But I'm not an accountancy
expert at all, so perhaps someone can explain the accounting logic behind
it? Perhaps a report that can imply 1+1=3 should have a warning note?
Should we be ensuring that accounts add up across budget periods, or down
hierarchies within budget periods? Gnucash is doing the former, but it's
confusing since the display can imply only the latter is in action.

I built a local copy of gnucash and tracked the calls through budget.scm
back to the totalling and currency-conversion that happens in Account.cpp
and I see where the confusion arises. There is memory of previous budget
periods built into the reported totals under each asset class (see the
detail below and the picture attached).

Isn't it a bit counter-intuitive that the budget reports for 'parent'
account values in a given budget period, don't need to add up to the sum of
the 'child' account values when converted by the exchange rate relevant for
that budget period? I give lots of detail below, where it's clear the
report is not "buggy", but it is borderline misleading, particularly given
that the report can be restricted to a single budget period within which it
appears to say that 30,000 GBP is the sum of 10,000 GBP and 10,000 EUR,
when the exchange rate is 1GBP = 1EUR. 1+1=3?

Would love some expert input. Maybe I should report this as a bug and let
someone set me right there? :)

Cheers,
D

PS: Here's the detail:
I expected:
- reported actual "Groceries" total would be the sum of the reported "GBP"
and "EUR" account spends in that budget period, according to the relevant
FX rate.

But in reality:
- it's actually this year's change in the balance for that account compared
to the last budget period. That means that while the GBP or EUR rows always
change by 10,000 each year, and thus always show 10,000 in the budget
report, the sum of the two - the "Groceries" row - is not necessarily equal
to 10,000 GBP + 10,000 EUR. In my example, 1EUR = 0.5 GBP for the first two
budget periods, so the balance of "Groceries" by the end of the second
period was (10,000GBP+5,000GBP) + (10,000 GBP + 5,000 GBP) = 30,000 GBP.
But at the end of the third period, the three years' of spending meant that
the balance of "Groceries" was
(10,000GBP+10,000GBP)+(10,000GBP+10,000GBP)+(10,000GBP+10,000GBP) = 60,000
GBP. Difference 30,000 GBP.

so 1 + 1 = 3.



On Thu, Jan 5, 2023 at 9:37 PM ml enquirer  wrote:

> 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 
> 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.
>>
>>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do 

Re: [GNC] Budget report fails in multiple currencies

2023-01-05 Thread ml enquirer
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  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.
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] Budget report fails in multiple currencies

2023-01-02 Thread ml enquirer
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.


bugreport.gnucash
Description: application/gnucash
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.