Re: [GNC] Account Types -- what are the implications of getting them wrong?

2023-02-21 Thread ml
Thank you David.

Would it be correct for me to assume that *any* account type can be edited 
prior to the addition of any data?

Either way, it sounds like this can be an iterative process to an extent. And 
that most negative consequences can be reversed with a little creativity.

Tim

> On Feb 20, 2023, at 20:56, David Cousens  wrote:
> 
> Tim ,
> 
> In most cases if you get an account type wrong you can edit the account type 
> and
> its parent account from the account tree structure. There may be some
> limitations associated with the type of the parent account which may have to 
> be
> worked around. In the worst case scenario you can create an account of the
> correct type and then delete the account of the wrong type. If there are
> transactions to the account you are deleting the dialogue will ask which 
> account
> you wish them transferred to and here you specify the new account of the 
> correct
> type. Apart from the basic top level account types Asset, Liability, Equity,
> Income and Expenses there are a number of account sub-types which are usually
> tied to aspects of the business features, stock trading etc
> 
> David Cousens
> 
>> On Mon, 2023-02-20 at 19:25 -0600, m...@tgr66.me wrote:
>> Thanks Jim for the reply.
>> 
 On Feb 20, 2023, at 15:49, Jim DeLaHunt  wrote:
>>> 
>>> It sounds like you are trying to answer two questions:
>>> 
>>> 1. How do you extract meaning from account name strings in incoming
>>> migration data, such that you can pick the appropriate GnuCash account type?
>> 
>> Ummm, sort of. Yes, I am asking myself that because I have to make decisions.
>> But I was really providing the scenarios to help shape the reader's thinking
>> about the implications.
>> 
>> Yes, the question I’m asking is in the subject line. I should have included 
>> it
>> more in the body. I did ask specifically in the body though if there was "any
>> negative implications of assigning too general of an account type to an
>> account?” I’m inclined to err on the side of general and tell the user they
>> need to review all of them and edit appropriately based on GnuCash’s
>> documentation. But, it is still a good challenge to get them as close to 
>> right
>> as possible.  
>> 
>> The decisions I’m making are naturally heavily influenced by my personal
>> account and categories structure in Quicken along with my understanding about
>> how GnuCash structures accounts and defines types. There are undoubtedly
>> members of this mailing list who migrated data from some other app to 
>> GnuCash.
>> They made decisions about account types, perhaps after creating their chart 
>> of
>> accounts, and they may have found adjustments were necessary because 
>> something
>> didn’t work as expected. I believe hearing that would be helpful to me and
>> others. 
>> 
>>> 
>>> 2. What are the GnuCash account types, and what are their meanings (or,
>>> purposes, or semantics)?
>>> 
>>> I think question 1 is up to you. It is not a GnuCash question.
>>> 
>>> The place to start for question 2 is the GnuCash /Help/ documentation, 5.1.
>>> *Types of GnuCash Accounts*[1]. You might find it helpful to consult the
>>> notes about what kinds of child account type each parent account type
>>> accepts.  Missing from this page is the Trading Account type.
>>> 
>> 
>> I had read
>> https://code.gnucash.org/docs/MAINT/group__Account.html#ga398c5d6f7a5127db7b81789e05262908
>> <
>> https://code.gnucash.org/docs/MAINT/group__Account.html#ga398c5d6f7a5127db7b81789e05262908
>>> but will make sure to go back and read section 5.1. I appreciate that you’ve
>> highlighted that there can be child-parent mismatches as that is a real
>> implication. I realize that if a user migrating to GnuCash using the tool I’m
>> developing had a Credit Card under an Asset account, they could potentially
>> have a problem. I’m using PieCash for my GnuCash writes, and I *think* it
>> checks the parent-child rules, but I might want to test that.
>> 
>> 
>>> Trading accounts are described in the GnuCash /Tutorial and Concepts Guide/,
>>> 12.3. *Automatically Recording Currency Transactions using Trading
>>> Accounts*[2], and at wiki page *Trading Accounts*[3].
>>> 
>>> You might have to resort to reading the GnuCash code[4] to answer more
>>> detailed questions. I remember doing this once to clear up some of my own
>>> questions.
>>> 
>>> Your subject: line asks, "what are the implications of getting [Account
>>> Types] wrong?" I don't see you asking that in your message body. But as far
>>> as I know, the implication can be unusability if you get the account type
>>> very wrong (e.g. an Asset type for what should be an Expense type account),
>>> or inconvenience if you get the account type a little wrong (e.g. no option
>>> to add an interest payment during the reconciliation process if you assign a
>>> Liability type for what should be a Credit type account). Note that users
>>> can, within limits, change account types for a book which is in use. That

Re: [GNC] Account Types -- what are the implications of getting them wrong?

2023-02-20 Thread ml
Thanks Jim for the reply.

> On Feb 20, 2023, at 15:49, Jim DeLaHunt  wrote:
> 
> It sounds like you are trying to answer two questions:
> 
> 1. How do you extract meaning from account name strings in incoming migration 
> data, such that you can pick the appropriate GnuCash account type?

Ummm, sort of. Yes, I am asking myself that because I have to make decisions. 
But I was really providing the scenarios to help shape the reader's thinking 
about the implications.

Yes, the question I’m asking is in the subject line. I should have included it 
more in the body. I did ask specifically in the body though if there was "any 
negative implications of assigning too general of an account type to an 
account?” I’m inclined to err on the side of general and tell the user they 
need to review all of them and edit appropriately based on GnuCash’s 
documentation. But, it is still a good challenge to get them as close to right 
as possible.  

The decisions I’m making are naturally heavily influenced by my personal 
account and categories structure in Quicken along with my understanding about 
how GnuCash structures accounts and defines types. There are undoubtedly 
members of this mailing list who migrated data from some other app to GnuCash. 
They made decisions about account types, perhaps after creating their chart of 
accounts, and they may have found adjustments were necessary because something 
didn’t work as expected. I believe hearing that would be helpful to me and 
others. 

> 
> 2. What are the GnuCash account types, and what are their meanings (or, 
> purposes, or semantics)?
> 
> I think question 1 is up to you. It is not a GnuCash question.
> 
> The place to start for question 2 is the GnuCash /Help/ documentation, 5.1. 
> *Types of GnuCash Accounts*[1]. You might find it helpful to consult the 
> notes about what kinds of child account type each parent account type 
> accepts.  Missing from this page is the Trading Account type.
> 

I had read 
https://code.gnucash.org/docs/MAINT/group__Account.html#ga398c5d6f7a5127db7b81789e05262908
 

 but will make sure to go back and read section 5.1. I appreciate that you’ve 
highlighted that there can be child-parent mismatches as that is a real 
implication. I realize that if a user migrating to GnuCash using the tool I’m 
developing had a Credit Card under an Asset account, they could potentially 
have a problem. I’m using PieCash for my GnuCash writes, and I *think* it 
checks the parent-child rules, but I might want to test that.


> Trading accounts are described in the GnuCash /Tutorial and Concepts Guide/, 
> 12.3. *Automatically Recording Currency Transactions using Trading 
> Accounts*[2], and at wiki page *Trading Accounts*[3].
> 
> You might have to resort to reading the GnuCash code[4] to answer more 
> detailed questions. I remember doing this once to clear up some of my own 
> questions.
> 
> Your subject: line asks, "what are the implications of getting [Account 
> Types] wrong?" I don't see you asking that in your message body. But as far 
> as I know, the implication can be unusability if you get the account type 
> very wrong (e.g. an Asset type for what should be an Expense type account), 
> or inconvenience if you get the account type a little wrong (e.g. no option 
> to add an interest payment during the reconciliation process if you assign a 
> Liability type for what should be a Credit type account). Note that users 
> can, within limits, change account types for a book which is in use. That 
> limits the negative implications of migration software making the wrong 
> choice of account type.
> 

Great comments. Thank you. I did notice oddities yesterday when I created a new 
book (GnuCash->File-New File) and created a full chart of accounts. In 
particular, in Investments. Under Retirement, Bond accounts have a type of 
Stock, so they have Shares/Buy/Sell, etc columns in the register. So those look 
okay (other than calling a Bond a Stock type, which feels odd to me). But as 
far as implications, I don’t see any issue. However, I realized this partially 
answers the question about implications of opting general vice specific. And 
this is reflected, I think, in GnuCash’s default account structure and types.

In the Bond, Market Index, Mutual Fund and Stock accounts under Brokerage 
Account are all type Asset while the latter is Bank. So I’m guessing the logic 
here is that *most* brokerage accounts have an associated sweep or bank 
account. But, Brokerage Account is a Placeholder so I didn’t think transactions 
would be recorded there. Admittedly, I may misunderstand so I’ll need to 
experiment. I do see that Buy/Fee/Sell show up as Actions in one of those 
registers.

My app’s logic today would assign the type Stock to an account with the word 
“brokerage” included. I’m now questioning this based on GnuCash’s default 
setup. 

So specifically, 

[GNC] Account Types -- what are the implications of getting them wrong?

2023-02-19 Thread ml
The approach I’m taking in a migration app I’m writing will be conservative, 
erring on the side of more general vice more specific. For example, ASSET, 
LIABILITY, INCOME, EXPENSE, EQUITY are pretty easy to accurately apply based on 
account names (for example, “assets:current assets:cash”). In an initial round 
of type assignments, this account would get ASSET as its type. In a deeper 
subsequent look, it should be reassigned with a type of CASH.

INCOME, EXPENSE and EQUITY types don’t have sub-types I see, so those will be 
even easier. I don’t foresee any issues with those.

LIABILITY and CREDIT don’t appear too difficult as there just aren’t that many 
options. First I’ll assign LIABILITY and if the words “credit card” or “credit 
cards” exist in the rest of the account path, I’ll switch to CREDIT, otherwise, 
leave it alone. 

Assets and Investments will be the trickiest. Let me start with Assets first.

Assume an imported account has the path and name of “assets:savings:family 
savings”. Getting this typed as an ASSET is pretty straightforward. Ideally, 
however, it would be typed as BANK. 

Or SHOULD it? Perhaps this family puts its savings in old coffee cans under the 
back porch. So, I’d be inclined to leave this as ASSET. The user can change it, 
but are there any negative implications of assigning too general of an account 
type to an account?

However, if the name has the word “account” in it, well, then I’d be confident 
assigning a type of BANK.

Investment accounts will be the trickiest I believe. Heck, I’m not sure I 
understand the differences.

When I create a new account in GnuCash, I’m surprised at some of the 
assignments made when creating the hierarchy. For example, 
“Assets:Investments:Brokerage Account” is a placeholder with type of BANK. I 
would be inclined to assign any placeholder accounts a more generic type. In 
this case, ASSET. Again, are there any negative implications of me taking this 
approach? 

Regardless, I will direct the user to review all of them once created in 
GnuCash to ensure they align with their exceptions, but are there consequences 
if I get them wrong?

And finally, TRADING. I don’t see any of those in the initial account list 
created when I make a new file. So, for now, I’ll ignore this. Is that okay?
___
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] Entered Date, UX Question

2023-02-05 Thread ml
Thank you! 

Yeah, the more I’ve been thinking about this and researching what Quicken does, 
I think it makes more sense to have the `entered_date` be the timestamp the 
transaction is imported.

Where I’m finding I still have to investigate, discuss and ponder is that 
Quicken has a Date field, and a Posted field (in addition to the Entered). In 
may data, there are a few times where the technical Posted date is the 30th or 
31st of the month, but I will change it to be the 1st of the following month 
because that is when I want it recorded. 

GnuCash, afaik, only has posted and entered for the dates. Entered we’ve 
already discussed.

I’m leaning toward testing the equality of the Date and Posted for each 
transaction coming from Quicken. If they are equal, easy. If not, I’ll take the 
Date field since it means the user probably wanted to override the Posted date 
for some reason. 

I could then add the Posted date to the memo/notes. Would that be useful or 
just clutter things up? 

> On Feb 5, 2023, at 13:11, R. Victor Klassen  wrote:
> 
> For the business features there is the entered date and the posted date, and 
> they may differ in either direction.  That way I can enter something in 
> January, but post in last December because it really belonged then, but I 
> hadn’t gotten to it, and it shows up correctly under the rules accrual based 
> accounting.  And I can fake it by posting it to the first of January if it is 
> paid in January and I’m using cash based accounting for tax purposes.   In 
> this case I could see having the entered date the date of import, so long as 
> the posted date is the date I had set when I posted it.  Not sure what 
> Quicken does here or allows me to do (been well over a decade).
> 
> If I just enter the transaction directly in a register and I want to get it 
> connected to the right date for cash or accrual basis, I want the date that 
> appears to be in the register to match what it was when I put it in.  Because 
> to me that is the posted date. 
> If GnuCash has a separate entered date for all transactions (and I think it 
> does), and that date is not visible (except for when probing the database 
> directly), I would be happy to have the entered date be the imported date, so 
> long as the posted date isn’t mucked with.  But that’s just my two cents.
> 
>> On Feb 4, 2023, at 8:00 AM, m...@tgr66.me wrote:
>> 
>> Hello!
>> 
>> I’m writing an app to help people migrate to GnuCash (primarily from 
>> Quicken, in my case Quicken for Mac), and I’m using PieCash to write sqlite3 
>> file. I’ve read/searched the docs, and so I believe I understand the concept 
>> of a transaction entry date into an accounting system, and that users 
>> generally won’t ever see it, or perhaps I should just say “edit it”.
>> 
>> I’ve realized that I can export entered dates from Quicken, and so here is 
>> my question.
>> 
>> As a user of GnuCash, if you were to migrate data from another system, would 
>> you expect the entry/entered date to be when you migrated the data or when 
>> you first entered it into your personal financial management system?
>> 
>> I know some of you are experts in the field of accounting AIS, and so I 
>> welcome your thoughts too. If, one of the two approaches *must* be followed 
>> because of accounting rule (especially for businesses), please let me know.
>> 
>> Thank you for your help.
>> 
>> Tim
>> ___
>> 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.
> 

___
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] Entered Date, UX Question

2023-02-04 Thread ml
Hello!

I’m writing an app to help people migrate to GnuCash (primarily from Quicken, 
in my case Quicken for Mac), and I’m using PieCash to write sqlite3 file. I’ve 
read/searched the docs, and so I believe I understand the concept of a 
transaction entry date into an accounting system, and that users generally 
won’t ever see it, or perhaps I should just say “edit it”.

I’ve realized that I can export entered dates from Quicken, and so here is my 
question.

As a user of GnuCash, if you were to migrate data from another system, would 
you expect the entry/entered date to be when you migrated the data or when you 
first entered it into your personal financial management system?

I know some of you are experts in the field of accounting AIS, and so I welcome 
your thoughts too. If, one of the two approaches *must* be followed because of 
accounting rule (especially for businesses), please let me know.

Thank you for your help.

Tim
___
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] Website Down?

2023-02-02 Thread ml
Excellent. So discovered. Thank you.

> On Feb 2, 2023, at 14:17, Derek Atkins  wrote:
> 
> You can get to the docs through the wiki (which IS up).
> 
> -derek
> 
> On Thu, February 2, 2023 3:12 pm, m...@tgr66.me wrote:
>> Thanks! I was just trying to get to the docs to understand the account
>> types, but I pulled them from the app which is close enough for now.
>> 
>> I appreciate you and Linas.
>> 
>>> On Feb 2, 2023, at 14:10, Derek Atkins  wrote:
>>> 
>>> Hi,
>>> 
>>> The www.gnucash.org server is hosted out of Austin, TX.
>>> With the Ice Storms the other day, the hosting location had a power
>>> outage, and unfortunately the machine did not boot up when the power
>>> came
>>> back.
>>> 
>>> Linas is working on the issue.
>>> 
>>> -derek
>>> 
>>> On Thu, February 2, 2023 2:59 pm, m...@tgr66.me wrote:
 Here in the US, Texas, I’m not able to reach the gnucash.org. I’m able
 to
 reach other websites.
 
 Anyone else experience this?
 
 Tim
 ___
 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.
 
>>> 
>>> 
>>> --
>>>  Derek Atkins 617-623-3745
>>>  de...@ihtfp.com www.ihtfp.com
>>>  Computer and Internet Security Consultant
>>> 
>> 
>> 
> 
> 
> -- 
>   Derek Atkins 617-623-3745
>   de...@ihtfp.com www.ihtfp.com
>   Computer and Internet Security Consultant
> 

___
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] Website Down?

2023-02-02 Thread ml
Thanks! I was just trying to get to the docs to understand the account types, 
but I pulled them from the app which is close enough for now.

I appreciate you and Linas.

> On Feb 2, 2023, at 14:10, Derek Atkins  wrote:
> 
> Hi,
> 
> The www.gnucash.org server is hosted out of Austin, TX.
> With the Ice Storms the other day, the hosting location had a power
> outage, and unfortunately the machine did not boot up when the power came
> back.
> 
> Linas is working on the issue.
> 
> -derek
> 
> On Thu, February 2, 2023 2:59 pm, m...@tgr66.me wrote:
>> Here in the US, Texas, I’m not able to reach the gnucash.org. I’m able to
>> reach other websites.
>> 
>> Anyone else experience this?
>> 
>> Tim
>> ___
>> 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.
>> 
> 
> 
> -- 
>   Derek Atkins 617-623-3745
>   de...@ihtfp.com www.ihtfp.com
>   Computer and Internet Security Consultant
> 

___
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] Website Down?

2023-02-02 Thread ml
Here in the US, Texas, I’m not able to reach the gnucash.org. I’m able to reach 
other websites.

Anyone else experience this?

Tim
___
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-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] OFX Requirements

2023-01-07 Thread ml
I’ll check it out. Thanks.

> On Jan 7, 2023, at 17:54, Jean L  wrote:
> 
> Also, this
> 
> https://github.com/jrwrigh/csv2cash 
> Could be the answer to what you're trying to do?
> 
> Jean
> 
> On 1/7/2023 12:51 PM, Tim Rohrer wrote:
>> 
>> 
>>> On Jan 7, 2023, at 2:32 PM, Jean L  
>>>  wrote:
>>> 
>>> 
>>> OK so I found that GC fais to import this ofx because the account name is 
>>> too long. This is probably a bug, but I'm not sure what the specs are for 
>>> account names in the OFX specifications.
>>> 
>> Nice find! Thank you. So yeah, `csv2ofx` generates those randomly. Why the 
>> author made them so long is a little unclear; maybe the same code as the 
>> autogenerated FITD?
>>> About the rest of your questions:
>>> 
>>> You're right that you can't specify the "other" account (like 
>>> expense:dining) in the OFX file. That's specifically a GC thing. When you 
>>> import your OFX, you have to specify the "other" account for each 
>>> transaction, but GC learns to automatically assign it after a little while 
>>> so you no longer have to assign it manually.
>>> 
>>> In your case it's not super helpful if you save *all* your migrated 
>>> transactions into a single OFX then try to import that in one shot you'll 
>>> have to specify the other account for each transaction, which would be 
>>> super tedious.
>>> 
>>> Instead, you could import only the first N transactions, the re-import and 
>>> deals with the N next ones, etc. Each time you import, GC learns the 
>>> association between transactions and splits. But that too could be tedious.
>>> 
>>> Perhaps you can make it work better with the CSV idea. Even better would be 
>>> to write a script that takes the CSV export, and generates the complete xml 
>>> file that GC uses to represent your account tree. I.e., a tool to 
>>> automatically create a GC account file from a csv export. Perhaps 
>>> somebody's written that already?
>>> 
>> 
>> This last idea is exactly what I was starting to think about. I don't know 
>> C/C++, but I can figure out XML. And I've not done a lot of Internet 
>> searching yet for others who've worked this migration (other than in our 
>> mailing list). 
>> 
>> Again, thank you!
>> 
>> Tim
>> 
>>> Jean
>>> 
>>> On 1/7/2023 10:59 AM, Tim Rohrer wrote:
 Correct. And the errors and warnings I pasted earlier are logged.
 
 Linux GnuCash 4.11
 Build ID: 4.11+(2022-06-25)
 
> On Jan 7, 2023, at 12:53 PM, Jean L  
>  wrote:
> 
> 
> And you're saying that when you import this into a blank account, nothing 
> shows up?
> 
> On 1/7/2023 10:52 AM, Tim Rohrer wrote:
>> Thanks, Jean.
>> 
>> Here is the entire file (attached and pasted). For testing, I was simply 
>> trying to get one transaction to work first.
>> 
>> 
>> DATA:OFXSGML <>
>> ENCODING:UTF-8
>> 
>> 
>> 
>> 
>> 0
>> INFO
>> 
>> 20230107105800
>> ENG
>> 
>> 
>> 
>> 
>> 
>> 
>> 0
>> INFO
>> 
>> 
>> USD
>> 
>> b9fc6ca936ba09958d5076dd5ebfac69
>> 384d7d0b77b259606be9c29de2e05b45
>> CHECKING
>> 
>> 
>> 19700101
>> 20230107
>> 
>> CREDIT
>> 2022010100
>> 500.00
>> 743df964dc21309d6d8a7c0ca5eaa657
>> Tim
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> On Jan 7, 2023, at 12:41 PM, Jean L  
>>>  wrote:
>>> 
>>> 
>>> Can you post a small OFX file that's generated that way? I'll take a 
>>> quick look.
>>> 
>>> Jean
>>> 
>>> On 1/7/2023 10:18 AM, Tim Rohrer wrote:
 I'm continuing my experimentation to migrate my Quicken for Mac data. 
 I believe I'm on track for the investments, so I've switched back to 
 regular accounts.
 
 Originally, I was going to use the Quicken Mac 2007 Transfer File 
 (QMTF aka QIF) but I started seeing some issues with how GnuCash 
 handles splits, plus I'd lose tags and much of my notes.
 
 Now I'm trying to usehttps://github.com/reubano/csv2ofx <> 
 > to generate OFX files from 
 exported csv.
 
 A dummy csv transaction:
 
 Date,Payee/Security,Category,Amount,Account
 1/1/2022,Tim,Income:Salary,500,Family Checking
 
 Using csv2ox with a custom mapper, I get an ofx with guts of the 
 transaction like this:
 
 
 
 
 0
 INFO
 
 
 USD
 
 b9fc6ca936ba09958d5076dd5ebfac69
 384d7d0b77b259606be9c29de2e05b45
 CHECKING
 
 
 19700101
 20230107
 
 CREDIT
 2022010100
 500.00

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 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,
>> >
&g

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
> > tha

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 

Re: [GNC] Register column sizing

2023-01-06 Thread ml
I’m new to GnuCash so I admit I’m not sure I fully understand the question’s 
impacts.

I have figured out I can resize each column manually, but what does confuse me 
is why (at least on macOS) a double click (as opposed to a right-click) 
activates what I believe you’re referring to as autosizing. 

Nonetheless, I can get used to that. But, I would expect that if I double click 
on the column a second time, it should revert to the earlier size, no?

Why ditch the price column?
> On Jan 5, 2023, at 21:40, john  wrote:
> 
> Users,
> 
> There have been occasional complaints for many years about column width 
> sizing. See for e.g. https://bugs.gnucash.org/show_bug.cgi?id=563588. Most 
> users seem to eventually get used to it, but I wonder if anybody really likes 
> it.
> 
> The problem boils down to the auto-sizing behavior of the Description column, 
> which causes that column to grow or shrink when you adjust the window's 
> width, and to make a horizontal scrollbar appear when you widen another 
> column. Occasionally someone will complain about the normally hidden price 
> column because it's possible to catch its handle and widen it when you mean 
> to widen the balance column.
> 
> It would be really easy to turn off autosizing on the Description field and 
> only a little work to figure out another way to handle the price and ditch 
> that column. Would anyone miss it?
> 
> Regards,
> John Ralls
> 
> ___
> 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.

___
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] QIF format for StkSplit

2023-01-06 Thread ml
Yes. In my GnuCash the original shares are removed in one transaction, and the 
newly calculated amount (based on the split) is added in a second transaction.

In my Quicken, when I recorded a split, the additional shares (in this case, a 
4 for 1 of APPL) were recorded. 

But my original question has more to do with what ratio I should put into the 
gif to properly record the split. What I’m getting to work is to multiply the 
ratio by 10 and that is what should be in the QIF.

For example, with Apple’s 4 for 1 split in 2020, the line in the QIF should be 
Q40.

> On Jan 5, 2023, at 19:24, Ken Farley  wrote:
> 
> When I was doing a bunch of Quicken conversions using QIF files, what 
> happened was pretty much what you described here, I think. My original shares 
> were removed in one transaction, while the split amount was added back. For 
> example, 200 shares that needed at 2 for 1 resulted in a 200 share removal 
> with a subsequent 400 share addition. Maybe this is how Quicken handled 
> splits "behind the scenes"?
> ___
> 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.

___
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] QIF format for StkSplit

2023-01-06 Thread ml
I appreciate the analysis of the code, and the confirmation of what I found 
through experimentation. I had tried searching the code for the answer, but I 
do not know C/C++ and I would not have been able to figure it out. 

I’d be happy to write a paragraph documenting how a QIF entry for a StkSplit 
import should be built, but I’m not sure where this should be included?

Tim


> On Jan 5, 2023, at 22:23, john  wrote:
> 
> gnc_numeric_create is a C function implemented in 
> libgnucash/engine/gnc-numeric.cpp and made available to Scheme by SWIG which 
> changes its name to gnc-numeric-create. It takes two int64_t arguments, 
> numerator and denominator.
> 
> There's a general convention that public functions defined in Scheme are 
> named gnc:foo. SWIG-wrapped functions have their same name in Scheme except 
> that underscores are replaced with hyphens. Aside from the original xacc  
> camel-case functions we generally follow the Gnome practice of beginning C 
> and C++ free functions with the gnc namespace followed by the class name, 
> separated by underscores. With only seven exceptions if the name is like 
> gnc-foo-bar then it's a wrapped C function while (with no exceptions) 
> gnc:foo-bar is defined in Scheme.
> 
> Note that n/ is defined in qif-to-gnc.scm: (define (n/ a b) (gnc-numeric-div 
> a b 0 GNC-DENOM-REDUCE)) and n* as (define (n* a b) (gnc-numeric-mul a b 0 
> GNC-DENOM-REDUCE)).
> 
> So in normal arithmetic notation, out_shares = inshares * (split_ratio / 10). 
>  That code was added in 
> https://github.com/Gnucash/gnucash/commit/00972f52311b3641c0bd4474334ff846501a3019#diff-fe1b1f57a35caf6ec4d0916b27f888c9bec88a4264248e4d1687d97cbabcc963
>  
> 
>  with no explanation of why the provided split ratio should be divided by 10.
> 
> Regards,
> John Ralls
> 
> 
> 
>> On Jan 5, 2023, at 6:05 PM, David Reiser via gnucash-user 
>>  wrote:
>> 
>> bug, maybe?
>> 
>> import-export/qif-imp/qif-to-gnc.scm says:
>> 
>> ((stksplit)
>> (let* ((splitratio (n/ num-shares (gnc-numeric-create 10 1)))
>>(in-shares
>> (xaccAccountGetBalance near-acct))
>>(out-shares (n* in-shares splitratio)))
>>   (xaccSplitSetAmount gnc-near-split out-shares)
>>   (xaccSplitSetAmount gnc-far-split (n- in-shares))
>>   (xaccSplitSetValue gnc-near-split (n- split-amt))
>>   (xaccSplitSetValue gnc-far-split split-amt
>> 
>> 
>> num-shares is the value of the qif Q line, so it looks like the entered 
>> split ratio is being divided by 10. But I can’t find a definition of 
>> gnc-numeric-create. And my scheme (well, LISP, in my case) is so rusty it 
>> almost might be worse than not knowing it in the first place...
>> --
>> Dave Reiser
>> dbrei...@icloud.com
>> 
>> 
>> 
>> 
>> 
>>> On Jan 5, 2023, at 6:13 PM, m...@tgr66.me wrote:
>>> 
>>> So, the ratio * 10 does seem to be working. :man_shrugging:
>>> 
>>> For example, if it is a 4 for 1 split, 40
>>> If it is a 1 for 10 split, 1
>>> 
 On Jan 5, 2023, at 14:17, m...@tgr66.me wrote:
 
 Yes. I missed adding that to the list I’ve tried.
 
 In the full work minimal example below, the share balance ends up at 1.2
 
 !Account
 NAssets:Investments:Brokerage Account:Joint Brokerage
 TInvst
 ^
 !Type:Bank
 D01/11/2020
 NPayment/Deposit
 PTrf My Bank
 CX
 T1,000.00
 MDeposit
 LAssets:Current Assets:My Bank
 ^
 !Type:Invst
 D12/2/2021
 NBuy
 PXYZ, INC
 YXYZ
 I150
 T450
 Q3
 CR
 M3 shares @ 150; Nothing to see here
 ^
 !Type:Invst
 D1/1/2022
 NStkSplit
 PXYZ, INC
 YXYZ
 CR
 Q4
 M4 for 1 split
 ^
 
 Then I changed Q to 40 and while I end up with the correct balance 
 (GnuCash creates two transactions, one removing the original three shares, 
 and the second adding 12 shares), I have no idea if that is just luck or 
 if I’ve stumbled on new math :-)
 
 I’ll experiment some more.
 
 
> On Jan 5, 2023, at 14:02, David Reiser  wrote:
> 
> I’ve never used QIF for stock splits, but the obvious question is “Have 
> you tried Q4?” After all, 4/1 is numerically equal to 4 (a ratio reduced 
> to a single number).
> --
> Dave Reiser
> dbrei...@icloud.com
> 
> 
> 
> 
> 
>> On Jan 5, 2023, at 2:51 PM, m...@tgr66.me wrote:
>> 
>> I’ve searched considerably, but if I missed it, I apologize.
>> 
>> Docs for QIF say the Q field should contain the split ratio. I’ve tried 
>> various options, but I’m not getting the expected results after import.
>> 
>> !Type:Invst
>> D8/31/2020
>> NStkSplit
>> PAPPLE INC
>> YAAPL
>> CR
>> M4 for 1 split; 

Re: [GNC] QIF format for StkSplit

2023-01-05 Thread ml
So, the ratio * 10 does seem to be working. :man_shrugging:

For example, if it is a 4 for 1 split, 40
If it is a 1 for 10 split, 1

> On Jan 5, 2023, at 14:17, m...@tgr66.me wrote:
> 
> Yes. I missed adding that to the list I’ve tried.
> 
> In the full work minimal example below, the share balance ends up at 1.2
> 
> !Account
> NAssets:Investments:Brokerage Account:Joint Brokerage
> TInvst
> ^
> !Type:Bank
> D01/11/2020
> NPayment/Deposit
> PTrf My Bank
> CX
> T1,000.00
> MDeposit
> LAssets:Current Assets:My Bank
> ^
> !Type:Invst
> D12/2/2021
> NBuy
> PXYZ, INC
> YXYZ
> I150
> T450
> Q3
> CR
> M3 shares @ 150; Nothing to see here
> ^
> !Type:Invst
> D1/1/2022
> NStkSplit
> PXYZ, INC
> YXYZ
> CR
> Q4
> M4 for 1 split
> ^
> 
> Then I changed Q to 40 and while I end up with the correct balance (GnuCash 
> creates two transactions, one removing the original three shares, and the 
> second adding 12 shares), I have no idea if that is just luck or if I’ve 
> stumbled on new math :-)
> 
> I’ll experiment some more.
> 
> 
>> On Jan 5, 2023, at 14:02, David Reiser  wrote:
>> 
>> I’ve never used QIF for stock splits, but the obvious question is “Have you 
>> tried Q4?” After all, 4/1 is numerically equal to 4 (a ratio reduced to a 
>> single number).
>> --
>> Dave Reiser
>> dbrei...@icloud.com
>> 
>> 
>> 
>> 
>> 
>>> On Jan 5, 2023, at 2:51 PM, m...@tgr66.me wrote:
>>> 
>>> I’ve searched considerably, but if I missed it, I apologize.
>>> 
>>> Docs for QIF say the Q field should contain the split ratio. I’ve tried 
>>> various options, but I’m not getting the expected results after import.
>>> 
>>> !Type:Invst
>>> D8/31/2020
>>> NStkSplit
>>> PAPPLE INC
>>> YAAPL
>>> CR
>>> M4 for 1 split; 
>>> Q36 // Have also tried 4:1, 4/1 and simply 48
>>> ^
>>> 
>>> GnuCash 4.13 on macOS. I’ve not tried yet on my Linux box.
>>> 
>>> Thanks.
>>> ___
>>> 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.
>> 
> 
> ___
> 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.

___
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-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.


Re: [GNC] QIF format for StkSplit

2023-01-05 Thread ml
Yes. I missed adding that to the list I’ve tried.

In the full work minimal example below, the share balance ends up at 1.2

!Account
NAssets:Investments:Brokerage Account:Joint Brokerage
TInvst
^
!Type:Bank
D01/11/2020
NPayment/Deposit
PTrf My Bank
CX
T1,000.00
MDeposit
LAssets:Current Assets:My Bank
^
!Type:Invst
D12/2/2021
NBuy
PXYZ, INC
YXYZ
I150
T450
Q3
CR
M3 shares @ 150; Nothing to see here
^
!Type:Invst
D1/1/2022
NStkSplit
PXYZ, INC
YXYZ
CR
Q4
M4 for 1 split
^

Then I changed Q to 40 and while I end up with the correct balance (GnuCash 
creates two transactions, one removing the original three shares, and the 
second adding 12 shares), I have no idea if that is just luck or if I’ve 
stumbled on new math :-)

I’ll experiment some more.


> On Jan 5, 2023, at 14:02, David Reiser  wrote:
> 
> I’ve never used QIF for stock splits, but the obvious question is “Have you 
> tried Q4?” After all, 4/1 is numerically equal to 4 (a ratio reduced to a 
> single number).
> --
> Dave Reiser
> dbrei...@icloud.com
> 
> 
> 
> 
> 
>> On Jan 5, 2023, at 2:51 PM, m...@tgr66.me wrote:
>> 
>> I’ve searched considerably, but if I missed it, I apologize.
>> 
>> Docs for QIF say the Q field should contain the split ratio. I’ve tried 
>> various options, but I’m not getting the expected results after import.
>> 
>> !Type:Invst
>> D8/31/2020
>> NStkSplit
>> PAPPLE INC
>> YAAPL
>> CR
>> M4 for 1 split; 
>> Q36 // Have also tried 4:1, 4/1 and simply 48
>> ^
>> 
>> GnuCash 4.13 on macOS. I’ve not tried yet on my Linux box.
>> 
>> Thanks.
>> ___
>> 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.
> 

___
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] QIF format for StkSplit

2023-01-05 Thread ml
I’ve searched considerably, but if I missed it, I apologize.

Docs for QIF say the Q field should contain the split ratio. I’ve tried various 
options, but I’m not getting the expected results after import.

!Type:Invst
D8/31/2020
NStkSplit
PAPPLE INC
YAAPL
CR
M4 for 1 split; 
Q36 // Have also tried 4:1, 4/1 and simply 48
^

GnuCash 4.13 on macOS. I’ve not tried yet on my Linux box.

Thanks.
___
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] Missing "Buy" action after import of QIF file

2023-01-04 Thread ml
Thank you both. I’ll work on a report.

> On Jan 4, 2023, at 07:00, Kalpesh Patel  wrote:
> 
> I stand corrected as well. The Action column is never updated with the action 
> denoted in the qif file. Nonetheless the right side buy and sell columns do 
> reflect correct transaction (which Derek confirmed by walking the code), 
> which is what I was looking at it before, albeit it is not easy on the eyes 
> to decipher what transaction is what. Since Action column never had any 
> information in it (since at least going back 3.4 version), I have gotten used 
> to looking at the right side columns.
> 
> As a follow on, it does not populate for OFX imports either so might be 
> absent for all import methods.
> 
> That should be a bug IMHO; not a RFE.
> 
> 
> -Original Message-
> From: Derek Atkins  
> Sent: Wednesday, January 04, 2023 7:32 AM
> To: m...@tgr66.me
> Cc: Kalpesh Patel ; gnucash-user@gnucash.org
> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
> 
> Looking at the code, you are correct; the importer never calls 
> xaccSplitSetAction.
> 
> It USES the action to figure out how to process the transaction, but it never 
> actually saves it.
> 
> Feel free to file an RFE in Bugzilla.
> 
> -derek
> 
> On Tue, January 3, 2023 8:14 pm, m...@tgr66.me wrote:
>> This is what I would expect to see. Note the “Buy” in the Action field.
>> 
>> 
>> 
>> However, I had to add that as the QIF import process doesn’t appear to 
>> be doing it.
>> 
>> 
>> 
>> Thank you.
>> 
>>> On Jan 3, 2023, at 18:50, Derek Atkins  wrote:
>>> 
>>> Screen cap came through (at least to me) -- but you cut out too much 
>>> info so I can't tell what I'm supposed to be seeing or not.
>>> 
>>> -derek
>>> 
>>> On Tue, January 3, 2023 7:35 pm, m...@tgr66.me wrote:
 Yes. Trying again to paste a screen cap.
 
 
 
 I also tried on my Linux box and got the same result. No action 
 showing.
 
 
> On Jan 3, 2023, at 18:27, Derek Atkins  wrote:
> 
> Are you in double-line mode?  If not, try turning that on..
> 
> -derek
> 
> On Tue, January 3, 2023 7:16 pm, m...@tgr66.me wrote:
>> I only included the snippet relevant to the question; my real file 
>> has the header lines and carets. The back ticks were included 
>> because I’m used to using those to show a code block :-) They’re 
>> not in the real file.
>> I’ll
>> include the entire test file at the end of this message.
>> 
>> So I just double checked, and the Buy action is not selected in 
>> either the `XYZ` account or in “Joint Brokerage” account. I don’t 
>> know where else I should be looking.
>> 
>> I’m on Mac with GnuCash v4.13.
>> 
>> I can also try on a Linux box.
>> 
>> !Account
>> NAssets:Investments:Brokerage Account:Joint Brokerage TInvst ^ 
>> !Type:Bank
>> D01/11/2020
>> NPayment/Deposit
>> PTrf My Bank
>> CX
>> T1,000.00
>> MDeposit
>> LAssets:Current Assets:My Bank
>> ^
>> !Type:Invst
>> D12/2/2022
>> NBuy
>> PXYZ, INC
>> YXYZ
>> I150
>> T450
>> Q3
>> CR
>> M3 shares @ 150; Nothing to see here ^ !Type:Invst
>> D1/1/2023
>> NDiv
>> PXYZ, INC
>> YXYZ
>> T16.23
>> CR
>> MInvestments:Dividend Income; Still nothing ^
>> 
>> 
>>> On Jan 3, 2023, at 16:09, Kalpesh Patel 
>>> wrote:
>>> 
>>> Your QIF may not be complete. I believe it is not documented but 
>>> need first four lines and the last line as shown in the below 
>>> example; carets are important in qif format as well! This would 
>>> be the minimal example:
>>> 
>>> !Account
>>> NTest
>>> TInvst
>>> ^
>>> !Type:Invst
>>> D12/2/2022
>>> NBuy
>>> PXYZ, INC
>>> YXYZ
>>> I150
>>> T450
>>> Q3
>>> CR
>>> M3 shares @ 150; Nothing to see here ^
>>> 
>>> 
>>> With that qif file contents, a top level 'Test' account created,
>>> child
>>> account called 'XYZ' created under 'Test' account, a buy entry for 3
>>> shares
>>> created and a new security called XYZ under NONCURRENCY namespace
>>> created. I
>>> also think back ticks at beginning and end of the one you provided
>>> in
>>> the
>>> message are extraneous when included.
>>> 
>>> I am on Windows 11 running GNC v4.11.
>>> 
>>> --
>>> 
>>> Message: 2
>>> Date: Tue, 3 Jan 2023 09:37:05 -0600
>>> From: m...@tgr66.me
>>> To: gnucash-user@gnucash.org
>>> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
>>> Message-ID: <84e2bf01-d789-4f0d-a16e-065358bbf...@tgr66.me>
>>> Content-Type: text/plain;   charset=utf-8
>>> 
>>> Oops, I guess the mailing list doesn?t show attached images.
>>> 
 On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
 
 In my import file:
 

Re: [GNC] Missing "Buy" action after import of QIF file

2023-01-03 Thread ml
This is what I would expect to see. Note the “Buy” in the Action field.



However, I had to add that as the QIF import process doesn’t appear to be doing 
it.



Thank you.

> On Jan 3, 2023, at 18:50, Derek Atkins  wrote:
> 
> Screen cap came through (at least to me) -- but you cut out too much info
> so I can't tell what I'm supposed to be seeing or not.
> 
> -derek
> 
> On Tue, January 3, 2023 7:35 pm, m...@tgr66.me wrote:
>> Yes. Trying again to paste a screen cap.
>> 
>> 
>> 
>> I also tried on my Linux box and got the same result. No action showing.
>> 
>> 
>>> On Jan 3, 2023, at 18:27, Derek Atkins  wrote:
>>> 
>>> Are you in double-line mode?  If not, try turning that on..
>>> 
>>> -derek
>>> 
>>> On Tue, January 3, 2023 7:16 pm, m...@tgr66.me wrote:
 I only included the snippet relevant to the question; my real file has
 the
 header lines and carets. The back ticks were included because I’m used
 to
 using those to show a code block :-) They’re not in the real file. I’ll
 include the entire test file at the end of this message.
 
 So I just double checked, and the Buy action is not selected in either
 the
 `XYZ` account or in “Joint Brokerage” account. I don’t know where else
 I
 should be looking.
 
 I’m on Mac with GnuCash v4.13.
 
 I can also try on a Linux box.
 
 !Account
 NAssets:Investments:Brokerage Account:Joint Brokerage
 TInvst
 ^
 !Type:Bank
 D01/11/2020
 NPayment/Deposit
 PTrf My Bank
 CX
 T1,000.00
 MDeposit
 LAssets:Current Assets:My Bank
 ^
 !Type:Invst
 D12/2/2022
 NBuy
 PXYZ, INC
 YXYZ
 I150
 T450
 Q3
 CR
 M3 shares @ 150; Nothing to see here
 ^
 !Type:Invst
 D1/1/2023
 NDiv
 PXYZ, INC
 YXYZ
 T16.23
 CR
 MInvestments:Dividend Income; Still nothing
 ^
 
 
> On Jan 3, 2023, at 16:09, Kalpesh Patel  wrote:
> 
> Your QIF may not be complete. I believe it is not documented but need
> first
> four lines and the last line as shown in the below example; carets are
> important in qif format as well! This would be the minimal example:
> 
> !Account
> NTest
> TInvst
> ^
> !Type:Invst
> D12/2/2022
> NBuy
> PXYZ, INC
> YXYZ
> I150
> T450
> Q3
> CR
> M3 shares @ 150; Nothing to see here
> ^
> 
> 
> With that qif file contents, a top level 'Test' account created, child
> account called 'XYZ' created under 'Test' account, a buy entry for 3
> shares
> created and a new security called XYZ under NONCURRENCY namespace
> created. I
> also think back ticks at beginning and end of the one you provided in
> the
> message are extraneous when included.
> 
> I am on Windows 11 running GNC v4.11.
> 
> --
> 
> Message: 2
> Date: Tue, 3 Jan 2023 09:37:05 -0600
> From: m...@tgr66.me
> To: gnucash-user@gnucash.org
> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
> Message-ID: <84e2bf01-d789-4f0d-a16e-065358bbf...@tgr66.me>
> Content-Type: text/plain; charset=utf-8
> 
> Oops, I guess the mailing list doesn?t show attached images.
> 
>> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
>> 
>> In my import file:
>> 
>> ```
>> !Type:Invst
>> D12/2/2022
>> NBuy
>> PXYZ, INC
>> YXYZ
>> I150
>> T450
>> Q3
>> CR
>> M3 shares @ 150; Nothing to see here
>> ```
>> 
>> Import and GnuCash creates the correct account, but notice the lack
>> of
>> a
> ?Buy? action:
>> 
>> 
>> 
>> Is this a known issue or am I misunderstanding the need for the
>> action
>> to
> be shown there?
>> ___
>> 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.
> 
> 
> 
> --
> 
> Message: 3
> Date: Tue, 3 Jan 2023 10:46:56 -0500
> From: "Derek Atkins" 
> To: m...@tgr66.me
> Cc: gnucash-user@gnucash.org
> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
> Message-ID: <9a802229f90f37a850599830d27ce46a.squir...@mail.ihtfp.org>
> Content-Type: text/plain;charset=utf-8
> 
> Hi,
> 
> On Tue, January 3, 2023 10:37 am, m...@tgr66.me wrote:
>> Oops, I guess the mailing list doesn?t show attached images.
> 
> You need to attach it as a file, not embed it in HTML.
> 
>> 
>>> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
>>> 
>>> In my import file:
>>> 

Re: [GNC] Missing "Buy" action after import of QIF file

2023-01-03 Thread ml
Yes. Trying again to paste a screen cap.



I also tried on my Linux box and got the same result. No action showing.


> On Jan 3, 2023, at 18:27, Derek Atkins  wrote:
> 
> Are you in double-line mode?  If not, try turning that on..
> 
> -derek
> 
> On Tue, January 3, 2023 7:16 pm, m...@tgr66.me wrote:
>> I only included the snippet relevant to the question; my real file has the
>> header lines and carets. The back ticks were included because I’m used to
>> using those to show a code block :-) They’re not in the real file. I’ll
>> include the entire test file at the end of this message.
>> 
>> So I just double checked, and the Buy action is not selected in either the
>> `XYZ` account or in “Joint Brokerage” account. I don’t know where else I
>> should be looking.
>> 
>> I’m on Mac with GnuCash v4.13.
>> 
>> I can also try on a Linux box.
>> 
>> !Account
>> NAssets:Investments:Brokerage Account:Joint Brokerage
>> TInvst
>> ^
>> !Type:Bank
>> D01/11/2020
>> NPayment/Deposit
>> PTrf My Bank
>> CX
>> T1,000.00
>> MDeposit
>> LAssets:Current Assets:My Bank
>> ^
>> !Type:Invst
>> D12/2/2022
>> NBuy
>> PXYZ, INC
>> YXYZ
>> I150
>> T450
>> Q3
>> CR
>> M3 shares @ 150; Nothing to see here
>> ^
>> !Type:Invst
>> D1/1/2023
>> NDiv
>> PXYZ, INC
>> YXYZ
>> T16.23
>> CR
>> MInvestments:Dividend Income; Still nothing
>> ^
>> 
>> 
>>> On Jan 3, 2023, at 16:09, Kalpesh Patel  wrote:
>>> 
>>> Your QIF may not be complete. I believe it is not documented but need
>>> first
>>> four lines and the last line as shown in the below example; carets are
>>> important in qif format as well! This would be the minimal example:
>>> 
>>> !Account
>>> NTest
>>> TInvst
>>> ^
>>> !Type:Invst
>>> D12/2/2022
>>> NBuy
>>> PXYZ, INC
>>> YXYZ
>>> I150
>>> T450
>>> Q3
>>> CR
>>> M3 shares @ 150; Nothing to see here
>>> ^
>>> 
>>> 
>>> With that qif file contents, a top level 'Test' account created, child
>>> account called 'XYZ' created under 'Test' account, a buy entry for 3
>>> shares
>>> created and a new security called XYZ under NONCURRENCY namespace
>>> created. I
>>> also think back ticks at beginning and end of the one you provided in
>>> the
>>> message are extraneous when included.
>>> 
>>> I am on Windows 11 running GNC v4.11.
>>> 
>>> --
>>> 
>>> Message: 2
>>> Date: Tue, 3 Jan 2023 09:37:05 -0600
>>> From: m...@tgr66.me
>>> To: gnucash-user@gnucash.org
>>> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
>>> Message-ID: <84e2bf01-d789-4f0d-a16e-065358bbf...@tgr66.me>
>>> Content-Type: text/plain;   charset=utf-8
>>> 
>>> Oops, I guess the mailing list doesn?t show attached images.
>>> 
 On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
 
 In my import file:
 
 ```
 !Type:Invst
 D12/2/2022
 NBuy
 PXYZ, INC
 YXYZ
 I150
 T450
 Q3
 CR
 M3 shares @ 150; Nothing to see here
 ```
 
 Import and GnuCash creates the correct account, but notice the lack of
 a
>>> ?Buy? action:
 
 
 
 Is this a known issue or am I misunderstanding the need for the action
 to
>>> be shown there?
 ___
 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.
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Message: 3
>>> Date: Tue, 3 Jan 2023 10:46:56 -0500
>>> From: "Derek Atkins" 
>>> To: m...@tgr66.me
>>> Cc: gnucash-user@gnucash.org
>>> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
>>> Message-ID: <9a802229f90f37a850599830d27ce46a.squir...@mail.ihtfp.org>
>>> Content-Type: text/plain;charset=utf-8
>>> 
>>> Hi,
>>> 
>>> On Tue, January 3, 2023 10:37 am, m...@tgr66.me wrote:
 Oops, I guess the mailing list doesn?t show attached images.
>>> 
>>> You need to attach it as a file, not embed it in HTML.
>>> 
 
> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
> 
> In my import file:
> 
> ```
> !Type:Invst
> D12/2/2022
> NBuy
> PXYZ, INC
> YXYZ
> I150
> T450
> Q3
> CR
> M3 shares @ 150; Nothing to see here
> ```
> 
> Import and GnuCash creates the correct account, but notice the lack
> of a ?Buy? action:
>>> 
>>> The QIF Importer should set the Action field, but it's possible it only
>>> sets
>>> it on "one side" (which may not be the side you're looking at).
>>> 
>>> -derek
>>> 
> 
> 
> 
> Is this a known issue or am I misunderstanding the need for the
> action to be shown there?
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> 

Re: [GNC] Missing "Buy" action after import of QIF file

2023-01-03 Thread ml
I only included the snippet relevant to the question; my real file has the 
header lines and carets. The back ticks were included because I’m used to using 
those to show a code block :-) They’re not in the real file. I’ll include the 
entire test file at the end of this message.

So I just double checked, and the Buy action is not selected in either the 
`XYZ` account or in “Joint Brokerage” account. I don’t know where else I should 
be looking.

I’m on Mac with GnuCash v4.13. 

I can also try on a Linux box.

!Account
NAssets:Investments:Brokerage Account:Joint Brokerage
TInvst
^
!Type:Bank
D01/11/2020
NPayment/Deposit
PTrf My Bank
CX
T1,000.00
MDeposit
LAssets:Current Assets:My Bank
^
!Type:Invst
D12/2/2022
NBuy
PXYZ, INC
YXYZ
I150
T450
Q3
CR
M3 shares @ 150; Nothing to see here
^
!Type:Invst
D1/1/2023
NDiv
PXYZ, INC
YXYZ
T16.23
CR
MInvestments:Dividend Income; Still nothing
^


> On Jan 3, 2023, at 16:09, Kalpesh Patel  wrote:
> 
> Your QIF may not be complete. I believe it is not documented but need first
> four lines and the last line as shown in the below example; carets are
> important in qif format as well! This would be the minimal example:
> 
> !Account
> NTest
> TInvst
> ^
> !Type:Invst
> D12/2/2022
> NBuy
> PXYZ, INC
> YXYZ
> I150
> T450
> Q3
> CR
> M3 shares @ 150; Nothing to see here
> ^
> 
> 
> With that qif file contents, a top level 'Test' account created, child
> account called 'XYZ' created under 'Test' account, a buy entry for 3 shares
> created and a new security called XYZ under NONCURRENCY namespace created. I
> also think back ticks at beginning and end of the one you provided in the
> message are extraneous when included.
> 
> I am on Windows 11 running GNC v4.11.
> 
> --
> 
> Message: 2
> Date: Tue, 3 Jan 2023 09:37:05 -0600
> From: m...@tgr66.me
> To: gnucash-user@gnucash.org
> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
> Message-ID: <84e2bf01-d789-4f0d-a16e-065358bbf...@tgr66.me>
> Content-Type: text/plain; charset=utf-8
> 
> Oops, I guess the mailing list doesn?t show attached images.
> 
>> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
>> 
>> In my import file:
>> 
>> ```
>> !Type:Invst
>> D12/2/2022
>> NBuy
>> PXYZ, INC
>> YXYZ
>> I150
>> T450
>> Q3
>> CR
>> M3 shares @ 150; Nothing to see here
>> ```
>> 
>> Import and GnuCash creates the correct account, but notice the lack of a
> ?Buy? action:
>> 
>> 
>> 
>> Is this a known issue or am I misunderstanding the need for the action to
> be shown there?
>> ___
>> 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.
> 
> 
> 
> --
> 
> Message: 3
> Date: Tue, 3 Jan 2023 10:46:56 -0500
> From: "Derek Atkins" 
> To: m...@tgr66.me
> Cc: gnucash-user@gnucash.org
> Subject: Re: [GNC] Missing "Buy" action after import of QIF file
> Message-ID: <9a802229f90f37a850599830d27ce46a.squir...@mail.ihtfp.org>
> Content-Type: text/plain;charset=utf-8
> 
> Hi,
> 
> On Tue, January 3, 2023 10:37 am, m...@tgr66.me wrote:
>> Oops, I guess the mailing list doesn?t show attached images.
> 
> You need to attach it as a file, not embed it in HTML.
> 
>> 
>>> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
>>> 
>>> In my import file:
>>> 
>>> ```
>>> !Type:Invst
>>> D12/2/2022
>>> NBuy
>>> PXYZ, INC
>>> YXYZ
>>> I150
>>> T450
>>> Q3
>>> CR
>>> M3 shares @ 150; Nothing to see here
>>> ```
>>> 
>>> Import and GnuCash creates the correct account, but notice the lack 
>>> of a ?Buy? action:
> 
> The QIF Importer should set the Action field, but it's possible it only sets
> it on "one side" (which may not be the side you're looking at).
> 
> -derek
> 
>>> 
>>> 
>>> 
>>> Is this a known issue or am I misunderstanding the need for the 
>>> action to be shown there?
>>> ___
>>> 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.
>> 
>> ___
>> 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.
>> 
> 
> 
> -- 
>   Derek Atkins 617-623-3745
>   de...@ihtfp.com www.ihtfp.com
>   Computer and Internet Security Consultant
> 
> 
> 
> --
> 


Re: [GNC] Missing "Buy" action after import of QIF file

2023-01-03 Thread ml
Oops, I guess the mailing list doesn’t show attached images.

> On Jan 2, 2023, at 19:51, m...@tgr66.me wrote:
> 
> In my import file:
> 
> ```
> !Type:Invst
> D12/2/2022
> NBuy
> PXYZ, INC
> YXYZ
> I150
> T450
> Q3
> CR
> M3 shares @ 150; Nothing to see here
> ```
> 
> Import and GnuCash creates the correct account, but notice the lack of a 
> “Buy” action:
> 
> 
> 
> Is this a known issue or am I misunderstanding the need for the action to be 
> shown there?
> ___
> 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.

___
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] Missing "Buy" action after import of QIF file

2023-01-02 Thread ml
In my import file:

```
!Type:Invst
D12/2/2022
NBuy
PXYZ, INC
YXYZ
I150
T450
Q3
CR
M3 shares @ 150; Nothing to see here
```

Import and GnuCash creates the correct account, but notice the lack of a “Buy” 
action:



Is this a known issue or am I misunderstanding the need for the action to be 
shown there?
___
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] Date format for QIF file

2023-01-02 Thread ml
Thanks Kalpesh—

I’m on a Mac and Quicken doesn’t have a QIF export, only CSV. 

I’m writing a NodeJS app/lib to convert csv exports to QIF. The dates in the 
csv are consistently M/D/. 

I can export non investment accounts to QMTF which is a QIF but certain fields 
(like tags) aren’t included so I’ll be working that one too.

This migration might take most of this year to accomplish :-)

> On Jan 2, 2023, at 16:51, Kalpesh Patel  wrote:
> 
> I over looked format described by Wiki at 
> https://en.wikipedia.org/wiki/Quicken_Interchange_Format 
>  and it denoted 
> that in date field leading zeroes on month and day can be skipped and year 
> can be either 4 digits or 2 digits or '6 (=2006).
>  
> From: Kalpesh Patel  
> Sent: Monday, January 02, 2023 5:18 PM
> To: 'm...@tgr66.me' 
> Cc: 'gnucash-user@gnucash.org' 
> Subject: RE: Date format for QIF file
>  
> Tim –
>  
> This might be a bit late (I had to hunt down old Quicken QIF migration files 
> that I did back in 2020 to check), nonetheless I figure I respond in case if 
> there is any value.
>  
> If you are exporting out data in QIF format from Quicken (Windows 2017 
> version but this is likely to be true for any Quicken version), the format of 
> the date field is all over the place and it will definitely get barfed by GNC 
> QIF importer.
>  
> Bunch of *NIX shell sed commands worked like a charm to normalize them into 
> consistent form of MM/dd/ so that GNC would be happy (here is script that 
> did the dirty work – modified to include for year 2021 and 2022):
>  
>  
>  
> #!/bin/bash
> # first parameter to the script is the file name that needs to be normalized 
> and will be modified in place. 
>  
> iam=${1}
>  
> if [ -z ${iam} ] ; then
>  echo “Please pass in the file name as the first parameter.”
>   exit 255
> fi
>  
> if [ -e ${iam} ] ; then
>  echo “${iam} does not exist. Please provide a file that already exist.”
>   exit 254
> fi
>  
> cat $(iam} > ${iam}.bak
>  
>  
> #-##cat $iam | while read a ; do
> #-##
> #-##case $a in
> #-##*\'[0-2][0-9]*)
> #-##echo $a |sed -e "s+'+/20+g" ;;
> #-##*\'[3-9][0-9]*)
> #-##echo $a |sed -e "s+'+/19+g" ;;
> #-##*\'\ [0-9]*)
> #-##echo $a |sed -e "s+' +/200+g" ;;
> #-##*/[9][0-9]*)
> #-##echo $a |sed -e "s+/9+/199+g" ;;
> #-##*/[8][0-9]*)
> #-##echo $a |sed -e "s+/8+/198+g" ;;
> #-##*/[7][0-9]*)
> #-##echo $a |sed -e "s+/7+/197+g" ;;
> #-##*)
> #-##echo $a ;;
> #-##esac
> #-##
> #-##done >> ${iam}_mod
>  
> set -x
>  
> sed -i.tmp -e "s+' 0+/2000+g" ${iam}
> sed -i.tmp -e "s+' 1+/2001+g" ${iam}
> sed -i.tmp -e "s+' 2+/2002+g" ${iam}
> sed -i.tmp -e "s+' 3+/2003+g" ${iam}
> sed -i.tmp -e "s+' 4+/2004+g" ${iam}
> sed -i.tmp -e "s+' 5+/2005+g" ${iam}
> sed -i.tmp -e "s+' 6+/2006+g" ${iam}
> sed -i.tmp -e "s+' 7+/2007+g" ${iam}
> sed -i.tmp -e "s+' 8+/2008+g" ${iam}
> sed -i.tmp -e "s+' 9+/2009+g" ${iam}
> sed -i.tmp -e "s+'10+/2010+g" ${iam}
> sed -i.tmp -e "s+'11+/2011+g" ${iam}
> sed -i.tmp -e "s+'12+/2012+g" ${iam}
> sed -i.tmp -e "s+'13+/2013+g" ${iam}
> sed -i.tmp -e "s+'14+/2014+g" ${iam}
> sed -i.tmp -e "s+'15+/2015+g" ${iam}
> sed -i.tmp -e "s+'16+/2016+g" ${iam}
> sed -i.tmp -e "s+'17+/2017+g" ${iam}
> sed -i.tmp -e "s+'18+/2018+g" ${iam}
> sed -i.tmp -e "s+'19+/2019+g" ${iam}
> sed -i.tmp -e "s+'20+/2020+g" ${iam}
> sed -i.tmp -e "s+'21+/2021+g" ${iam}
> sed -i.tmp -e "s+'22+/2022+g" ${iam}
>  
> sed -i.tmp -e "s+/81+/1981+g" ${iam}
> sed -i.tmp -e "s+/82+/1982+g" ${iam}
> sed -i.tmp -e "s+/83+/1983+g" ${iam}
> sed -i.tmp -e "s+/84+/1984+g" ${iam}
> sed -i.tmp -e "s+/85+/1985+g" ${iam}
> sed -i.tmp -e "s+/86+/1986+g" ${iam}
> sed -i.tmp -e "s+/87+/1987+g" ${iam}
> sed -i.tmp -e "s+/88+/1988+g" ${iam}
> sed -i.tmp -e "s+/89+/1989+g" ${iam}
> sed -i.tmp -e "s+/90+/1990+g" ${iam}
> sed -i.tmp -e "s+/91+/1991+g" ${iam}
> sed -i.tmp -e "s+/92+/1992+g" ${iam}
> sed -i.tmp -e "s+/93+/1993+g" ${iam}
> sed -i.tmp -e "s+/94+/1994+g" ${iam}
> sed -i.tmp -e "s+/95+/1995+g" ${iam}
> sed -i.tmp -e "s+/96+/1996+g" ${iam}
> sed -i.tmp -e "s+/97+/1997+g" ${iam}
> sed -i.tmp -e "s+/98+/1998+g" ${iam}
> sed -i.tmp -e "s+/99+/1999+g" ${iam}.
>  
> # End of Script
>  
>  
>  
> For what it is worth, there is an actual documentation that Intuit 
> (predecessor owner and original publisher of the QIF file format) published 
> it in 1997 at 
> http://www.intuit.com/quicken/technical-support/quicken/old-faqs/dosfaqs/60006.html
>  
> 
>  which no longer exists but cached copy by Google can be found at 
> https://www.w3.org/2000/10/swap/pim/qif-doc/QIF-doc.htm#:~:text=A%3A%20The%20Quicken%20interchange%20format,that%20supports%20the%20QIF%20format
>  
> 

Re: [GNC] How to "Get Quotes" for a specific day?

2023-01-02 Thread ml enquirer
Hi Michael,

I've faced the same problem. I use the gnucash python bindings and the
following script, to import prices from a text file which has date
(-MM-DD) and price with a new date on each line.

Hope it could be some use. As always, test it before deploying! Best wishes.

```python
import datetime
from gnucash import Session, Account, Split, GncCommodity, GncPrice

url = "personal.gnucash"

# Initialize Gnucash session
session = Session(url, True, False, False)
book = session.book
pdb = book.get_price_db()
comm_table = book.get_table()

# Define commodities
sec_gbp = GncCommodity(book,"Pound Sterling", "CURRENCY", "GBP", "826", 100)
sec_chf = GncCommodity(book,"Swiss Franc", "CURRENCY", "CHF", "756", 100)

def extractFXrateFromFile(filename,book,pdb,sec_base,sec_curr):
  with open(filename) as myFile :
for line in myFile.readlines() :
  splitLine = line.split(' ')
  y,m,d = (int(x) for x in splitLine[0].split("-"))

  price = GncPrice(book)
  price.set_time64( datetime.datetime(y,m,d) )
  value = price.get_value()
  value.denom = int( 1e10 )
  rate = float(splitLine[1])
  value.num = int( rate * 1e10 )
  price.set_value(value)
  price.set_currency( sec_curr )
  price.set_commodity( sec_base )
  pdb.add_price(price)

extractFXrateFromFile("chf_per_gbp.txt", book, pdb, sec_chf, sec_gbp)

session.save()
session.end()
session.destroy()
```

On Fri, Dec 30, 2022 at 5:19 AM  wrote:

> How can I tell GNU Cash to update its "Price Database" for all known
> currencies, stocks, bonds, mutual funds, etc for a *specific* day?
>
> I'm trying trying to prepare a report for a date in the past. I've set the
> `Options` for the report to `nearest in time` so that it will grab the
> prices for the commodities from the Price Database that are closest to the
> date of the report as possible.
>
>  *
> https://gnucash-docs-rst.readthedocs.io/en/latest/guide/C/ch_invest.html?highlight=price%20database#the-price-source-in-reports
>
> Well, I checked the Price Database, and I have gaps in the prices for some
> of my stocks. For many stocks, I don't have any prices defined for the day
> of the report. Therefore, my report may be inaccurate.
>
> I know that I can go to `Tools` -> `Price Database` and click the `Get
> Quotes` button. This will fetch the current quote (price) and add it to the
> Price Database for all defined currencies, stocks, bonds, mutual funds,
> etc. But that will fetch and add the prices for *today's date* only.
>
> How can I do the equivalent of `Get Quotes` but for a specific day in the
> *past*?
>
> (see also
> https://superuser.com/questions/1760157/how-to-get-quotes-for-all-currencies-and-stocks-for-a-specific-day-gnu-cash
> )
> ___
> 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.
>
___
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.


Re: [GNC] Scrubbing workflow

2022-12-29 Thread ml
Assuming one creates a separate account to track each stock (for example, 
“Joint Brokerage:AAPL” and “Joint Brokerage:AMZN” doesn’t a user have to scrub 
for each symbol? Or am I misunderstanding and it *should* work at the “Joint 
Brokerage” level?

> On Dec 29, 2022, at 20:04, Geoff  wrote:
> 
> Hi Tim
> 
> Lot scrubbing has nothing to do with internationali[sz]ation.  It is just one 
> possible method** to match your buys and sells for a particular stock account 
> and thus calculate your gains and losses.
> 
> Each sale transaction is applied consecutively to each buy transaction, and 
> the capital gain (or loss) on each such match is calculated and stored as a 
> separate transaction in the stock account.
> 
> Note that scrubbing works on a "FIFO" basis (first in , first out) which may 
> or may not be what you want to do.
> 
> If you have three stock accounts, you will have to scrub each of them 
> separately.  There is no "easier way".
> 
> Note that the process is completely reversible - you can manually delete the 
> capital gain/loss transactions and start over.
> 
> You don't have to remember which sales have been scrubbed, the scrubbing 
> process will just pick up any unapplied sales next time you run it.
> 
> 
> **The other method is to manually match your sales to your buys one lot at a 
> time.
> 
> 
> Hope this helps.
> 
> Regards
> 
> Geoff
> =
> 
> 
> On 30/12/2022 11:00 am, m...@tgr66.me wrote:
>> I searched the mailing list and didn’t really get any hits from the past six 
>> years, so I’m starting a new thread.
>> I understand the concept of lots, and I *think* I understand _why_ GnuCash 
>> uses the scrubbing concept (i.e., internationalization?).
>> In any case, I’m a little worried about the work flow as I implement GnuCash.
>> Let’s say I perform a number of trades of stocks in any given month, but I 
>> don’t remember when sells I’ve scrubbed, and which I haven’t. How do I tell 
>> which ones need to be done? Go through each symbol (could easily be 30 or 
>> more total over three accounts)?
>> Just curious if I”m missing an easier way?
>> Tim
>> ___
>> 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.

___
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] Scrubbing workflow

2022-12-29 Thread ml
I searched the mailing list and didn’t really get any hits from the past six 
years, so I’m starting a new thread.

I understand the concept of lots, and I *think* I understand _why_ GnuCash uses 
the scrubbing concept (i.e., internationalization?).

In any case, I’m a little worried about the work flow as I implement GnuCash.

Let’s say I perform a number of trades of stocks in any given month, but I 
don’t remember when sells I’ve scrubbed, and which I haven’t. How do I tell 
which ones need to be done? Go through each symbol (could easily be 30 or more 
total over three accounts)?

Just curious if I”m missing an easier way?

Tim
___
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] Date format for QIF file

2022-12-29 Thread ml
Thank you Derek,

I understood *why* it was happening, and I do realize that in reality, as the 
file size grows, the chance of having all days <= 12 is pretty darn slim :-)

I appreciate the quick response.

Tim

> On Dec 29, 2022, at 12:55, Derek Atkins  wrote:
> 
> Not particularly. 
> The issue is that 11/12 is ambiguous.  Is it November 12 or December 11?  
> Using a 2-digit year doesn't help. 
> The best way is to ensure you have a day > 12 in the mix (and a year > 31).  
> So using 12/29/2022 should give you a unique format. 
> You cannot use month names, only numbers. 
> -derek
> Sent using my mobile device. Please excuse any typos.
> 
> On December 29, 2022 14:35:09 m...@tgr66.me wrote:
> 
>> I’m developing QIF files to import my old investments. I get asked every 
>> time to confirm the date format (the entire import process is a bit long 
>> imo). The QIF specification says I ought to be able to enter a date using 
>> `dd month year`; for example: 29 December 2022. However, this results in an 
>> error in GnuCash.
>> 
>> Is there a format I can use in the files that GnuCash will accurately 
>> autodetect the correct format?
>> 
>> Thanks.
>> 
>> Tim
>> ___
>> 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.
> 
> 

___
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] Date format for QIF file

2022-12-29 Thread ml
I’m developing QIF files to import my old investments. I get asked every time 
to confirm the date format (the entire import process is a bit long imo). The 
QIF specification says I ought to be able to enter a date using `dd month 
year`; for example: 29 December 2022. However, this results in an error in 
GnuCash.

Is there a format I can use in the files that GnuCash will accurately 
autodetect the correct format?

Thanks.

Tim
___
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] Unable to retrieve currency quotes

2018-05-20 Thread ml enquirer
Hi John,

Thanks. Executing that command gives:

ALPHAVANTAGE_API_KEY=
/Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump currency "CHF"
"USD"

1 CHF = 1.00156244 USD
so all looks good on the alphavantage side.

Thanks for the bug-link. Indeed, I have a number of securities (but no
other currencies, I think) set up. I'll try debugging by disabling one by
one and let you know how I get on.

All the best,


On Sat, May 19, 2018 at 7:39 PM, John Ralls <jra...@ceridwen.us> wrote:

>
>
> On May 19, 2018, at 9:10 AM, ml enquirer <ml.hnel.227...@gmail.com> wrote:
>
> Hi all,
>
> @shaq32: thanks for the idea, but no, this is not the problem, I already
> have a valid API key (that's a very old FAQ...)
>
> Any luck debugging, John? Anything I can do to provide more useful info?
>
>
> Well, I just tried again and it failed, so I checked the Alphavantage key
> setting in Preferences>Online Banking and found it not set. After setting
> it with my key retrieving CHF->USD and EUR->USD quotes worked. I’m afraid
> that’s not much help.
>
> If you run from the command line (ALPHAVANAGE_API_KEY=xxx
> /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump currency
> “CHF” “USD”) do you get a valid result?
>
> It occurs to me that your problem might be similar to
> https://bugzilla.gnome.org/show_bug.cgi?id=795564. Try disabling quote
> retrieval on all securities and see if that changes anything. Are there any
> currencies in your book besides CHF, EUR, and USD?
>
> Regards,
> John Ralls
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Re: [GNC] Unable to retrieve currency quotes

2018-05-19 Thread ml enquirer
Hi all,

@shaq32: thanks for the idea, but no, this is not the problem, I already
have a valid API key (that's a very old FAQ...)

Any luck debugging, John? Anything I can do to provide more useful info?

Best regards,

On Tue, May 8, 2018 at 7:31 PM, shaq32  wrote:

> Hi,
>
> I had the same problem and fund the solution for it.
>
> 1) go this website https://www.alphavantage.co
>
> chose "Get your free API Key today"
>
> register and get an Alpha Vantage API Key.
>
> Copy the key and go to step no. 2
>
>
>
> 2) In Gnucash menu go to Preferences -> Online Quotes
>
> paste the API key there
>
> you are all set to go !
>
> Regards
>
>
>
> --
> Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Unable to retrieve currency quotes

2018-04-30 Thread ml enquirer
Thanks - it's reassuring to know it's not just me...

all the best,

On Mon, Apr 30, 2018 at 10:18 PM, John Ralls <jra...@ceridwen.us> wrote:

>
>
> > On Apr 30, 2018, at 1:05 PM, ml enquirer <ml.hnel.227...@gmail.com>
> wrote:
> >
> > Sorry, that should have read GnuCash 3.1...
> >
> > D
> >
> > On Mon, Apr 30, 2018 at 9:59 PM, ml enquirer <ml.hnel.227...@gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> I have GnuCash 2.6.21 for Mac (running 10.13.4). I have set up
> >> Finance::Quote properly, with my alphavantage key. When I press "Get
> >> quotes" in the Price Editor, I expect updates for CHF, EUR and several
> >> stock quotes. The stock quotes come back fine each time, but the two
> >> currency updates fail every time:
> >>
> >> Unable to retrieve quotes for these items:
> >>  CURRENCY:CHF
> >>  CURRENCY:EUR
> >> Continue using only the good quotes?
> >>
> >> Why are the currency updates failing, when the stock quotes succeed? How
> >> can I debug? (I already tried looking at the gnucash.trace file, but
> >> there's nothing obvious appearing there. ./gnc-fq-dump works fine...
> >>
> >> Please help! :(
>
> Hmm. Oddly, it works fine in Windows but fails on MacOS. Unfortunately I'm
> traveling for the rest of the week and won't be able to investigate further
> until I return.
>
> Regards,
> John Ralls
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Unable to retrieve currency quotes

2018-04-30 Thread ml enquirer
I've tried making a copy of the account and deleting hundreds (or
thousands) of transactions. This didn't make much difference (though just
now one of the two currency requests seemed to succeed). Immediately
afterwards, though, the same "Get Quotes" reverted to its standard error
message.

Is AlphaVantage really very unstable? I tried with a new API key but with
no luck.

On Mon, Apr 30, 2018 at 10:05 PM, ml enquirer <ml.hnel.227...@gmail.com>
wrote:

> Sorry, that should have read GnuCash 3.1...
>
> D
>
>
> On Mon, Apr 30, 2018 at 9:59 PM, ml enquirer <ml.hnel.227...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have GnuCash 2.6.21 for Mac (running 10.13.4). I have set up
>> Finance::Quote properly, with my alphavantage key. When I press "Get
>> quotes" in the Price Editor, I expect updates for CHF, EUR and several
>> stock quotes. The stock quotes come back fine each time, but the two
>> currency updates fail every time:
>>
>> Unable to retrieve quotes for these items:
>>   CURRENCY:CHF
>>   CURRENCY:EUR
>> Continue using only the good quotes?
>>
>> Why are the currency updates failing, when the stock quotes succeed? How
>> can I debug? (I already tried looking at the gnucash.trace file, but
>> there's nothing obvious appearing there. ./gnc-fq-dump works fine...
>>
>> Please help! :(
>>
>> D
>>
>>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Unable to retrieve currency quotes

2018-04-30 Thread ml enquirer
Sorry, that should have read GnuCash 3.1...

D

On Mon, Apr 30, 2018 at 9:59 PM, ml enquirer <ml.hnel.227...@gmail.com>
wrote:

> Hi,
>
> I have GnuCash 2.6.21 for Mac (running 10.13.4). I have set up
> Finance::Quote properly, with my alphavantage key. When I press "Get
> quotes" in the Price Editor, I expect updates for CHF, EUR and several
> stock quotes. The stock quotes come back fine each time, but the two
> currency updates fail every time:
>
> Unable to retrieve quotes for these items:
>   CURRENCY:CHF
>   CURRENCY:EUR
> Continue using only the good quotes?
>
> Why are the currency updates failing, when the stock quotes succeed? How
> can I debug? (I already tried looking at the gnucash.trace file, but
> there's nothing obvious appearing there. ./gnc-fq-dump works fine...
>
> Please help! :(
>
> D
>
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] Unable to retrieve currency quotes

2018-04-30 Thread ml enquirer
Hi,

I have GnuCash 2.6.21 for Mac (running 10.13.4). I have set up
Finance::Quote properly, with my alphavantage key. When I press "Get
quotes" in the Price Editor, I expect updates for CHF, EUR and several
stock quotes. The stock quotes come back fine each time, but the two
currency updates fail every time:

Unable to retrieve quotes for these items:
  CURRENCY:CHF
  CURRENCY:EUR
Continue using only the good quotes?

Why are the currency updates failing, when the stock quotes succeed? How
can I debug? (I already tried looking at the gnucash.trace file, but
there's nothing obvious appearing there. ./gnc-fq-dump works fine...

Please help! :(

D
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: yahoo as json stock quotes pounds/pence

2018-01-27 Thread ml enquirer
OK, I guess this is not a solved problem, then? I don't see this on the
GnuCash FAQ page... and I figure these 2008/2009 threads are quite likely
to be outdated.

I did the following:
- checkout financequote: "git clone
https://github.com/finance-quote/finance-quote.git
- edit lib/Finance/Quote/YahooJSON.pm to change:
<<

$info{ $stocks, "last" }   = $json_price;
>>

$info{ $stocks, "last" }   = $json_price/100.;
- edit the gnc-fq-helper script to add at the top the line:

use lib '/lib';


This isn't a great/elegant solution. I'd be very interested to hear what
more experienced people have to say!


Thanks,

Dan


On Thu, Jan 25, 2018 at 11:55 PM, ml enquirer <ml.hnel.227...@gmail.com>
wrote:

> Hi,
>
> I'm aware this is not a new question:
> - https://lists.gnucash.org/pipermail/gnucash-user/2008-
> November/027224.html
> - https://lists.gnucash.org/pipermail/gnucash-user/2008-April/024688.html
> - https://lists.gnucash.org/pipermail/gnucash-user/2009-
> February/028602.html
>
> but I recently found the "get quotes" feature stopped working with a very
> generic error message (more or less the same time as the change of currency
> quotes from yahoo to alphaVantage). So I switched my "Type of quote source"
> in the "Securities Editor" to "Yahoo as JSON" instead of "Yahoo Europe".
>
> However, now I see the returned values are in GBP *pence* not *pounds*, so
> 100 times larger than GnuCash expects.
>
> Most previous fixes discussed here (as far as I can see all >2 years old)
> involve various hacks at different levels in the source. Is this a solved
> problem, or do I need to follow their lead and dig around in the code?
>
> Thanks in advance!
>
___
gnucash-user mailing list
gnucash-user@gnucash.org
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.