Bug 427114 - Capital Gains report is incorrect when stock is sold first then bought
Summary: Capital Gains report is incorrect when stock is sold first then bought
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.0.6
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-29 12:33 UTC by Suresh PB
Modified: 2020-09-29 14:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Suresh PB 2020-09-29 12:33:41 UTC
SUMMARY
KMYMONEY Version kmymoney5-mingw64-5.0.6-8.1-setup.exe dated 29-Sep-2019 18:10 

Capital Gains Report not printing "Buy Value" when date sold is less than date bought. For example, in F&O you can sell the stock, and later buy.  This scenario is not printing buy value.  Hence the report is giving incorrect value.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT
When the stock is sold first then bought (future&option scenario allowed), capital gains report marks buy value as 0, then the report value is incorrect.

EXPECTED RESULT
Report should also print Buy value.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Suresh PB 2020-09-29 12:36:13 UTC
Example:

27-Sep-2020 sold xyxcorp 10 stocks at $12
29-Sep-2020 bought xyxcorp 10 stocks at $10

Here, the profit is $2x10 = $20

Capital gains Report indicates 10* $12 = $120

Expected profit is $20
Comment 2 Jack 2020-09-29 14:18:21 UTC
KMyMoney simply does not handle this type of transaction.  You really can't sell something you don't have.  I don't claim to know the exact details, but I think it's actually done by buying a type of option to sell at an agreed price.  Then when you buy lower than that, you can sell at the previously agreed price.  KMyMoney does not handle options at all.  I also do not know if they will be included when KMM's investment handling is revised, but I don't think it's a high priority.

The current report is showing the capital gains of the sale, which is the entire sale price, since nothing had been paid for those shares.  That report (as far as I know) only reports realized gains; it does not mention the unrealized gains of the still held stock.  I'm actually tempted to call this a bug in allowing sale of shares you don't have.

I'll wait for other comments, but I believe this is a WONTFIX.
Comment 3 Suresh PB 2020-09-29 14:38:22 UTC
Yes, you are correct.  This is "option type" transaction where selling is allowed. I don't agree about considering transaction dates in chronological order of "Buy" and "Sell" in Capital gains report.  The fix is required only in Capital Gains report, otherwise product works perfectly fine.