Re: [GNC] Trading accounts

2022-07-26 Thread David T. via gnucash-user
David C.

Trading accounts are not the same as lots. Different concept, different code. 
Just a for instance: trading accounts are turned on by book; lots can be 
enabled by account. 

David T. 

On July 27, 2022 3:33:37 AM GMT+03:00, David Carlson 
 wrote:
>I believe that you are witnessing first hand why trading accounts are not
>enabled by default,  i.e. they create a royal mess in your trading history.
>
>You might want to re-read the recent thread about evil trading accounts.
> They may work ok for some users who's documentation goals align with the
>design parameters of TA's.
>
>Other users will prefer to continue either manually tracking lots in
>external spreadsheets or trusting their brokers back rooms to do it for
>them.
>
>Oh, I am neither a developer nor an accountant, just a long term user.
>
>On Tue, Jul 26, 2022, 5:47 PM Fred Tydeman  wrote:
>
>> Over the past several months, I have been importing Quicken data into
>> GnuCash.  There is about 6 years of data and lots of transactions.  Besides
>> normal income and expenses, that data involved many different stocks and
>> many different currencies.  Recently, I saw a reference to "Trading"
>> accounts.  I have now enabled that feature.  Based on reading
>> https://www.mathstat.dal.ca/~selinger/accounting/tutorial, I believe that
>> my old transactions that involve currencies (and maybe stocks and other
>> assets whose value varies) were done wrong.
>>
>> Do I need to redo old transactions involving currencies?
>> Do I need to redo old transactions involving stocks?
>> Do I need to redo old transactions involving any assets whose price
>> varies?  This probably depends upon the asset, eg. no for Real Estate.
>>
>> Is there an easy way to fix the mess I have created?
>>
>> Aside:  I do not recall any mention of trading accounts in the Tutorial
>> early on when it talked about setting up the Chart of Accounts.
>>
>> What is the reason that Trading accounts are not turned on by default?
>> ___
>> 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.
___
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] tutorials or examples for connecting/programming for GnuCash data access

2022-07-26 Thread Eric Hammond
Thank you, I will check it out

All the best,
Eric

From: john 
Sent: Monday, July 25, 2022 11:07 AM
To: Eric Hammond 
Cc: gnucash-user@gnucash.org
Subject: Re: [GNC] tutorials or examples for connecting/programming for GnuCash 
data access




On Jul 25, 2022, at 9:30 AM, Eric Hammond 
mailto:e...@jehammond.net>> wrote:

Are there tutorial examples / videos for using Python and/or Sqlite3 to work 
with GnuCash.
I have never used Sqlite, and my Python experience is mostly industrial, and 
outdated.
(Like, what are bindings?)

Google found no GnuCash programming tutorials, though it did find some Piecash 
ones.

There's https://wiki.gnucash.org/wiki/SQL-Requests_For_Direct_Database_Access 
for SQL. It's not specifically about SQLite3 but you can read their docs for 
using the command-line tool.
Bindings are wrapper functions, in our case created by SWIG, that translate 
between e.g. Python and the C/C++ in which the GnuCash engine is written.
There's some information in https://wiki.gnucash.org/wiki/Python_Bindings and a 
brief mention in 
https://www.gnucash.org/docs/v4/C/gnucash-guide/ch_python_bindings.html. There 
are some examples in 
https://github.com/Gnucash/gnucash/tree/maint/bindings/python/example_scripts.


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] Trading accounts

2022-07-26 Thread David Carlson
I forgot to address fixing the mess.

I think there are two ways to fix it.  The easiest is to restore your last
backup from before turning on TA's.
The other, iirc, is to manually delete all those TA's.

On Tue, Jul 26, 2022, 7:24 PM  wrote:

> Fred,
>
> Not early in the guide, but in the section dealing with multiple currencies
> https://www.gnucash.org/docs/v4/C/gnucash-guide/currency_trading_accts.html
> and
> discussed on the wiki (https://wiki.gnucash.org/wiki/Trading_Accounts).
>
> I don't think anyone has yet written anything about any application to
> trading
> stocks and I don't think they are intended to be applied there.
>
> It is recommended to read the guide and help manual fully  before using
> GnuCash.
> I didn't, like many other users, but I did have a general accounting
> background
> coming in. You will find a lot of discussion in the mailing list archives
> re
> stock trading and unrealized gains and losses..
>
> If they were mentioned earlier it is likely they would confuse new users
> with
> limited experience of double entry accounting and accounting practice. It
> is a
> compromise to get new users in the door.
>
> Trading counts are about providing information in the accounts for
> unrealized
> gains and losses involving currency transactions.
>
> It is not normal accounting practice to recognize unrealized gains or
> losses in
> the books as income/expenses and the circumstances under which they may be
> recognized in some jurisdictions are likely to be highly variable. They
> are not
> normally taxable until the gains are actually realized in the majority of
> jurisdictions. That is why they aren't a default option.
>
> I wouldn't think there is any need to redo past transactions unless the
> information re unrealized gains and losses through currency exchange
> transactions is necessary for some specific reporting process.
>
> David Cousens
>
> On Tue, 2022-07-26 at 18:46 -0400, Fred Tydeman wrote:
> > Over the past several months, I have been importing Quicken data into
> > GnuCash.  There is about 6 years of data and lots of transactions.
> Besides
> > normal income and expenses, that data involved many different stocks and
> > many different currencies.  Recently, I saw a reference to "Trading"
> > accounts.  I have now enabled that feature.  Based on reading
> > https://www.mathstat.dal.ca/~selinger/accounting/tutorial, I believe
> that
> > my old transactions that involve currencies (and maybe stocks and other
> > assets whose value varies) were done wrong.
> >
> > Do I need to redo old transactions involving currencies?
> > Do I need to redo old transactions involving stocks?
> > Do I need to redo old transactions involving any assets whose price
> > varies?  This probably depends upon the asset, eg. no for Real Estate.
> >
> > Is there an easy way to fix the mess I have created?
> >
> > Aside:  I do not recall any mention of trading accounts in the Tutorial
> > early on when it talked about setting up the Chart of Accounts.
>
> >
> > What is the reason that Trading accounts are not turned on by default?
>
>
> > ___
> > 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.
>
___
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] Trading accounts

2022-07-26 Thread David Carlson
I believe that you are witnessing first hand why trading accounts are not
enabled by default,  i.e. they create a royal mess in your trading history.

You might want to re-read the recent thread about evil trading accounts.
 They may work ok for some users who's documentation goals align with the
design parameters of TA's.

Other users will prefer to continue either manually tracking lots in
external spreadsheets or trusting their brokers back rooms to do it for
them.

Oh, I am neither a developer nor an accountant, just a long term user.

On Tue, Jul 26, 2022, 5:47 PM Fred Tydeman  wrote:

> Over the past several months, I have been importing Quicken data into
> GnuCash.  There is about 6 years of data and lots of transactions.  Besides
> normal income and expenses, that data involved many different stocks and
> many different currencies.  Recently, I saw a reference to "Trading"
> accounts.  I have now enabled that feature.  Based on reading
> https://www.mathstat.dal.ca/~selinger/accounting/tutorial, I believe that
> my old transactions that involve currencies (and maybe stocks and other
> assets whose value varies) were done wrong.
>
> Do I need to redo old transactions involving currencies?
> Do I need to redo old transactions involving stocks?
> Do I need to redo old transactions involving any assets whose price
> varies?  This probably depends upon the asset, eg. no for Real Estate.
>
> Is there an easy way to fix the mess I have created?
>
> Aside:  I do not recall any mention of trading accounts in the Tutorial
> early on when it talked about setting up the Chart of Accounts.
>
> What is the reason that Trading accounts are not turned on by default?
> ___
> 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] Trading accounts

2022-07-26 Thread davidcousens49
Fred,

Not early in the guide, but in the section dealing with multiple currencies
https://www.gnucash.org/docs/v4/C/gnucash-guide/currency_trading_accts.html and
discussed on the wiki (https://wiki.gnucash.org/wiki/Trading_Accounts). 

I don't think anyone has yet written anything about any application to trading
stocks and I don't think they are intended to be applied there. 

It is recommended to read the guide and help manual fully  before using GnuCash.
I didn't, like many other users, but I did have a general accounting background
coming in. You will find a lot of discussion in the mailing list archives re
stock trading and unrealized gains and losses..

If they were mentioned earlier it is likely they would confuse new users with
limited experience of double entry accounting and accounting practice. It is a
compromise to get new users in the door. 

Trading counts are about providing information in the accounts for unrealized
gains and losses involving currency transactions.

It is not normal accounting practice to recognize unrealized gains or losses in
the books as income/expenses and the circumstances under which they may be
recognized in some jurisdictions are likely to be highly variable. They are not
normally taxable until the gains are actually realized in the majority of
jurisdictions. That is why they aren't a default option.

I wouldn't think there is any need to redo past transactions unless the
information re unrealized gains and losses through currency exchange
transactions is necessary for some specific reporting process.

David Cousens

On Tue, 2022-07-26 at 18:46 -0400, Fred Tydeman wrote:
> Over the past several months, I have been importing Quicken data into
> GnuCash.  There is about 6 years of data and lots of transactions.  Besides
> normal income and expenses, that data involved many different stocks and
> many different currencies.  Recently, I saw a reference to "Trading"
> accounts.  I have now enabled that feature.  Based on reading
> https://www.mathstat.dal.ca/~selinger/accounting/tutorial, I believe that
> my old transactions that involve currencies (and maybe stocks and other
> assets whose value varies) were done wrong.
> 
> Do I need to redo old transactions involving currencies?
> Do I need to redo old transactions involving stocks?
> Do I need to redo old transactions involving any assets whose price
> varies?  This probably depends upon the asset, eg. no for Real Estate.
> 
> Is there an easy way to fix the mess I have created?
> 
> Aside:  I do not recall any mention of trading accounts in the Tutorial
> early on when it talked about setting up the Chart of Accounts.

> 
> What is the reason that Trading accounts are not turned on by default?


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


[GNC] Trading accounts

2022-07-26 Thread Fred Tydeman
Over the past several months, I have been importing Quicken data into
GnuCash.  There is about 6 years of data and lots of transactions.  Besides
normal income and expenses, that data involved many different stocks and
many different currencies.  Recently, I saw a reference to "Trading"
accounts.  I have now enabled that feature.  Based on reading
https://www.mathstat.dal.ca/~selinger/accounting/tutorial, I believe that
my old transactions that involve currencies (and maybe stocks and other
assets whose value varies) were done wrong.

Do I need to redo old transactions involving currencies?
Do I need to redo old transactions involving stocks?
Do I need to redo old transactions involving any assets whose price
varies?  This probably depends upon the asset, eg. no for Real Estate.

Is there an easy way to fix the mess I have created?

Aside:  I do not recall any mention of trading accounts in the Tutorial
early on when it talked about setting up the Chart of Accounts.

What is the reason that Trading accounts are not turned on by default?
___
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] tutorials or examples for connecting/programming for GnuCash data access

2022-07-26 Thread john
If you mean the gnucash-x.x-setup.exe distributed as part of releases, it's 
built on Windows in the MSYS2 environment using gcc. You're correct that the 
Python bindings aren't included. That's also the case for the macOS GnuCash.app 
and flatpak. The reason is that the bindings must be linked against libpython 
so we'd have to include a full python instance in the bundle and we think that 
would add too much bloat to an already large download. Users who want to use 
the Python bindings will have to build GnuCash themselves; the recipes are 
published at https://github.com/gnucash/gnucash-on-windows, 
https://github.com/gnucash/gnucash-on-osx, and 
https://github.com/gnucash/gnucash-on-flatpak.

Regards,
John Ralls


> On Jul 25, 2022, at 9:49 PM, flywire  wrote:
> 
> TLDR: GnuCash Windows version is compiled on linux so, considering the
> note below, you are unlikely to get python bindings working in
> Windows.
> 
> 
>> Important
> 
>> The Python extensions are an optional feature which creates additional 
>> dependencies. To be
>> able to use Python scripts, GnuCash must have been built with the cmake 
>> -DWITH_PYTHON=ON …
>> option enabled, otherwise all what follows won’t work. At present this 
>> option is not
>> enabled by default, so if you need this, you may have to compile GnuCash 
>> from source
>> yourself. But some distributions offer it also as a separate package with a 
>> name like
>> python[version]-GnuCash
> 
> 
> I'd happily be shown wrong about python bindings being easily
> accessible under Windows.
> 
> 
> Piecash is about the only alternative but iirc the demos are hidden in
> the code repository. Try:
> https://lists.gnucash.org/pipermail/gnucash-user/2021-July/097124.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] tutorials or examples for connecting/programming for GnuCash data access

2022-07-26 Thread john
Please remember to copy the list on all replies.

While providing a stable library for other applications to use is a long-term 
goal we've still got a fair amount of work to do before we can support it. 
Until then we make absolutely no API or ABI stability guarantees for the shared 
libraries: On the contrary, we plan extensive API changes and internal 
redesigns that will substantially affect ABI as well.

Because of the long-standing ability to write custom reports in Guile we will 
mark as deprecated changes in the Scheme API, including wrapped C/C++ 
functions. Deprecated functions will be removed at the subsequent major 
release, meaning that any Scheme function that raises a deprecation warning in 
4.x will be removed in 5.0. No such warnings will be made for C/C++ API nor for 
the Python bindings.

Regards,
John Ralls


> On Jul 26, 2022, at 7:13 AM, Esteban Maringolo  wrote:
> 
> I'm interested in this as well...
> 
> Being able to use GNUCash as an "accounting engine" for other software
> would be a great feature.
> 
> The only thing I found was PieCash [1], but it seems to write directly
> to the database and not by calling internal functions/shared libraries
> of GnuCash.
> 
> Regards,
> 
> [1] https://github.com/sdementen/piecash
> 
> Esteban A. Maringolo
> 
> On Mon, Jul 25, 2022 at 3:08 PM john  wrote:
>> 
>> 
>> 
>>> On Jul 25, 2022, at 9:30 AM, Eric Hammond  wrote:
>>> 
>>> Are there tutorial examples / videos for using Python and/or Sqlite3 to 
>>> work with GnuCash.
>>> I have never used Sqlite, and my Python experience is mostly industrial, 
>>> and outdated.
>>> (Like, what are bindings?)
>> 
>> Google found no GnuCash programming tutorials, though it did find some 
>> Piecash ones.
>> 
>> There's 
>> https://wiki.gnucash.org/wiki/SQL-Requests_For_Direct_Database_Access for 
>> SQL. It's not specifically about SQLite3 but you can read their docs for 
>> using the command-line tool.
>> Bindings are wrapper functions, in our case created by SWIG, that translate 
>> between e.g. Python and the C/C++ in which the GnuCash engine is written.
>> There's some information in https://wiki.gnucash.org/wiki/Python_Bindings 
>> and a brief mention in 
>> https://www.gnucash.org/docs/v4/C/gnucash-guide/ch_python_bindings.html. 
>> There are some examples in 
>> https://github.com/Gnucash/gnucash/tree/maint/bindings/python/example_scripts.
>> 
>> 
>> 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.

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