GnuCash
Contact   Instructions
Bug 797016 - modifying existing entry don't allow to input zero price or zero stocks
Summary: modifying existing entry don't allow to input zero price or zero stocks
Status: REOPENED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Register (show other bugs)
Version: 3.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-06 11:01 EST by risok
Modified: 2019-01-12 10:19 EST (History)
4 users (show)

See Also:


Attachments
adding the transaction in Japanese UI (11.21 KB, application/x-gnucash)
2019-01-06 11:01 EST, risok
no flags Details
Stock sale with Japanese UI showing correct capital gains splits. (40.93 KB, image/png)
2019-01-06 13:37 EST, John Ralls
no flags Details
repro steps (677.83 KB, image/gif)
2019-01-07 04:51 EST, risok
no flags Details
Reproduce steps2 (1.42 MB, image/gif)
2019-01-12 02:56 EST, risok
no flags Details

Description risok 2019-01-06 11:01:31 EST
Created attachment 373103 [details]
adding the transaction in Japanese UI

When user use gnucash in Japanese, the user can't input zero share or zero price transaction.

This transaction is required when user want to input selling stock.
                                        share   price   buy
Assets:Brokerage Account:Stock:AMZN	0	0	1525.00
https://www.gnucash.org/docs/v3/C/gnucash-guide/invest-sell1.html

User can input such kind of input in English UI
But when user try to input the transaction in Japanese,
Number of share automatically is changed to 1525.
Price automatically is changed to 1.
Assets:Brokerage Account:Stock:AMZN	1525	1	1525.00

I confirmed it works as expected in English UI.
The attachment is the file I added a transaction in Japanese UI

I made the attachment file base on the file below
http://www.gnucash.org/docs/examples/C/GuideInvestExample.gnucash
Comment 1 John Ralls 2019-01-06 13:37:55 EST
Created attachment 373105 [details]
Stock sale with Japanese UI showing correct capital gains splits.

I'm not able to replicate this on Windows 10, see attached screen shot.
Comment 2 John Ralls 2019-01-06 13:47:50 EST
How did you set the Japanese UI, with Windows's Language and Region settings or by editing c:\Program Files (x86)\gnucash\etc\gnucash\environment? Are you using a US keyboard? If so, are you using the Japanese IME?
Comment 3 risok 2019-01-06 22:03:11 EST
I checked your screenshot. That is what I want to input it.

I selected Japanese as the language during the installation process.

So I changed the language to troubleshoot this issue with the environment file
I add the entry to the file
LANG=en_GB
Then it work as expected.

I suspect the cause of the problem is language selected during instal.
Comment 4 John Ralls 2019-01-06 23:40:37 EST
Not likely. The language selected during installation controls what translation the installer uses. It doesn't change the actual installation.

I did do it the other way: I set LANG=ja_JP. I'll try setting the Windows language and region instead to see if that makes a difference, but it seems unlikely.
Comment 5 risok 2019-01-07 04:51:44 EST
Created attachment 373107 [details]
repro steps

I double checked the issue happens on LANG=en_US as well.
To simpify the issue, I'll use English as the LANG value in this bug id

I might identify the exact reproduce steps.

steps for expected behavior
1. open GuideInvestExample.gnucash
2. select sell stock for profit
3. add a new transaction 
  account Assets:Investments:Brokerage Account:Stock:AMZN
  enter value for "Buy"
  delete or enter 0 for "Price"
  enter 0 for "share"

steps for the issue
1. open GuideInvestExample.gnucash
2. select sell stock for profit
3. make the transaction by modifying the existing transaction
 i.e. 
  modify imbalanced-USD to Assets:Investments:Brokerage Account:Stock:AMZN

So to make the transaction, we should use "adding new transaction" and should not use "modify existing transaction"

I captured the steps with GIF animation
Comment 6 risok 2019-01-11 06:34:02 EST
I changed the title to clarify the issue
Comment 7 Frank H. Ellenberger 2019-01-11 06:58:43 EST
In which way is this realted to translation, if it also happens in english?
Comment 8 risok 2019-01-11 08:21:21 EST
Sorry, I misread translation for transaction.So I changed the component to translation. This issue happens on both english and Japanese. So I think this issue is not related to the language settings.
I'm not sure which component is the best for this issue.
Comment 9 John Ralls 2019-01-11 11:03:21 EST
>   modify imbalanced-USD to Assets:Investments:Brokerage Account:Stock:AMZN

Which is wrong. You've already got the AMZN cap gain split. Modify that split (the one that used to be imbalance-USD) to Income:Capital Gain and GnuCash will clear the shares and price fields for you.
Comment 10 risok 2019-01-11 21:15:30 EST
To get transaction below, modifying the split does not work.


Account / Shares / Price / Buy
Assets:Investments:Brokerage Account:Stock:AMZN / (blank) / (blank) / (cap gain)

i.e
I inputed 
Income:Capital Gain 2000,
then,
Gnucash automatically input 
imbalance-USD 2000.

then I modify the account to "Assets:Investments:Brokerage Account:Stock:AMZN"
then Gnucash do not clear the shares and price but input 2000 as shares and 1 as price.
Please see the attachement https://bugs.gnucash.org/attachment.cgi?id=373107.

For the workaround, not to use modifying the transaction, but use newly add the transaction
Comment 11 John Ralls 2019-01-11 23:00:43 EST
Your video makes my point. You already have the no-price split in AMZN. Adding an out-of-balance split to cap gains doesn't change that.

To make it blindingly clear, a sell with cap gains needs to look like this:

        Account     |  Shares   |    Price   |   Buy      |   Sell
    ...:Stock:AMZN  |   -100    |    36.00   |            | 3600.00
    ...:Bank ABC    |           |            | 3600.00    |
    ...:Stock:AMZN  |           |            | 1600.00    |
    Income:CapGain  |           |            |            | 1600.00

and nothing more.
Comment 12 risok 2019-01-12 02:56:45 EST
Created attachment 373124 [details]
Reproduce steps2

Value 1600 is not my point.
the value 1600 was newly added line.
To show the reproduce step, I made the video.


To clarify the issue, I shoot another video.
Comment 13 John Ralls 2019-01-12 10:19:12 EST
OK, I can reproduce that. To avoid future confusion I've marked the first video obsolete to hide it.

To work around it, if you now delete the shares and price from the $2000 split and <enter> the amount on that split will zero and you'll get a new Imbalance Split. If you delete the Imbalance split, zero the price on the empty AMZN split, enter 3000 in Sell for that split, and <enter> the empty price and shares will "stick" and the transaction will be correct.

Note You need to log in before you can comment on or make changes to this bug.