[GNC] currency of "value" in stock account

Lionel Élie Mamane lionel at mamane.lu
Thu Nov 11 10:36:58 EST 2021


On Thu, Nov 11, 2021 at 07:41:13AM -0500, Derek Atkins wrote:
> On Thu, November 11, 2021 5:19 am, Lionel Élie Mamane wrote:

> The stock account uses the parent account currency for the
> TRANSACTION currency (i.e., what you see in VALUE).

By "what you see in VALUE", you mean what I see in the
"Debit"/"Credit" or "Sell"/"Buy" columns? That is factually not always
true, I have constructed examples where it differs.

> The AMOUNT is in the currency/commodity of the account in the
> particular split.

That is some internal value that is not always shown "raw as it is" in
the UI? But it would be:

 * in the register of a currency-denominated account, the split ON
   THAT SAME ACCOUNT, would show the AMOUNT in the debit/credit or
   increase/withdraw or increase/decrease columns, but NOT FOR OTHER
   SPLITS (whose account can be in a different currency).

 * in the register of a stock account, that value is shown in the
   "share" column.

Is that what you mean?

>> So if I enter a split against a USD account, sorry, that split doesn't
>> have access to all the information. The value I enter on the stock
>> register is a value in _EUR_, but the USD account must get a value in
>> _USD_, so there is an exchange going on.

> There is always an exchange going on in stock transactions.  Even if
> you're just going to one currency, there is the exchange from that
> one currency to the stock itself.

My point is that there are potentially _two_ exchanges going on, but
you, and the GnuCash UI, assume there is only one.

Go see e.g. the file attached to
https://bugs.gnucash.org/show_bug.cgi?id=636029
namely
https://bugs.gnucash.org/attachment.cgi?id=175446

On the Google stock account, there are _two_ exchanges going on:
GOOG stock against CAD (the transaction is in CAD)
CAD against USD (to pay from the cash account)

In https://bugs.gnucash.org/attachment.cgi?id=374263
I have forced GnuCash to recognise that "double conversion"
correctly.

>> The first problem is that the GnuCash stock registers silently let
>> me mix transactions in different currencies in the same register,
>> without showing _at_ _all_ what transaction is in which currency.

> This has been a long long LONG standing issue (probably going back
> 20 years, back to 1.6, when they removed the common-currency from
> accounts).  Yes, GnuCash attempts to show you the amounts in the
> "correct" currency but doesn't show you what that currency is.

I filed it as https://bugs.gnucash.org/show_bug.cgi?id=798365

>> The second problem is that, under some circumstances, GnuCash will
>> *silently* make transaction with a nil amount (value?) on the other
>> side of the split. That, in my eyes, is a bug, and should not
>> happen. I'm going to make a bug report with a precise reproduction
>> example.

That bug was actually filed 10+ years ago
https://bugs.gnucash.org/show_bug.cgi?id=636029

> This will only happen if you enter a transaction from a stock/mutual
> account into an account of a different currency than the
> stock/mutual default account.  In that case, I am *pretty* sure you
> can work around the problem by expanding the splits and manually
> entering in the "amount" for the other account split.

No, it doesn't, not from the ledger (register) of the stock
account. *But*, you can go into the "account of a different currency",
enter the amount there, and it will popup the exchange dialog for
between "different currency" and "stock/mutual default account
currency".

> You don't need the exchange-rate dialog because those are already
> represented in the stock-account view (in expanded mode).

I now discover that this indeed true, but only very partially so, and
in a way that is not very discoverable. Not sure it is documented at
all.

In a stock account register, in expanded mode, when *adding* a split
to a a currency account, the "shares" and "price" column are
active. The "price" column seems to not have _any_ effect whatever is
entered there, but the "shares" column is the amount in currency of
the currency account.

However, as soon as one leaves the line of that split (even without
saving the transaction), the "shares" and "price" columns are
displayed as BLANK and are locked; one cannot anymore enter any value
in them.

>> The problematic cases arise when I create them from the stock
>> account.

> Yes, this makes sense. Are you entering them in Basic Ledger mode or
> in expanded mode?

I tried both, but up to now I was using only the debit/credit AKA
buy/sell columns for currencies. As explained above, the "shares"
column does it... but only on initial creation.

-- 
Lionel


More information about the gnucash-user mailing list