Bug 497144

Summary: Balance column shows unrelated values in an investment depot
Product: [Applications] kmymoney Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.2
Sentry Crash Report:
Attachments: Screenshot showing ledger with kmymoney 4.8.5
Screenshot showing ledger with kmymoney 5.1.80
test file
Report - Transactions by account (Customised)
test file (updated)
Screenshot showing shown share name as unit

Description Ralf Habacker 2024-12-06 21:26:46 UTC
Created attachment 176402 [details]
Screenshot showing ledger with kmymoney 4.8.5

SUMMARY


STEPS TO REPRODUCE
1. download kmymoney snapshot from master branch
2. start kmymoney
3. open appended file

OBSERVED RESULT
As shown at the screenshot appended the ‘Balance’ column displays a total of the quantities. 

EXPECTED RESULT
Normally, the current account balance is displayed in the ‘Balance’ column, which should be corrected in the application.
 If this is not expected here, the column title should be renamed to reflect the actual values.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.5
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
The display of the general ledger with the kmymoney from the previous major version shows an empty balance column (see attached screenshot), which may also be an option is the account balance could not be displayed
Comment 1 Ralf Habacker 2024-12-06 21:27:09 UTC
Created attachment 176403 [details]
Screenshot showing ledger with kmymoney 5.1.80
Comment 2 Ralf Habacker 2024-12-06 21:28:28 UTC
Created attachment 176404 [details]
test file
Comment 3 Ralf Habacker 2024-12-06 21:46:44 UTC
Created attachment 176405 [details]
Report - Transactions by account (Customised)

(In reply to Ralf Habacker from comment #0)
...
> If this is not expected here, the column title should be renamed to reflect the actual values.

The attached report with the accounts and categories displayed in the general ledger screenshots shows the account balance in the ‘Balance’ column, so the display in the ledger is incorrect.
Comment 4 Ralf Habacker 2024-12-06 21:47:27 UTC
Created attachment 176406 [details]
test file (updated)

The test file has been updated with the mentioned report.
Comment 5 Ralf Habacker 2024-12-07 07:05:19 UTC
Git commit 60dc6bac84fce46ca3b05557e3d373b9d0e65e55 by Ralf Habacker.
Committed on 07/12/2024 at 07:04.
Pushed by habacker into branch 'master'.

Add note on displaying the investment value in the general ledger

The investment value is shown in the general ledger for investments.
It is calculated on the basis of the last available prices, may
therefore not be up-to-date and may differ from the account balance.

To make this clear, a corresponding tooltip is now displayed.

M  +3    -0    kmymoney/views/ledgerviewpage_p.h

https://invent.kde.org/office/kmymoney/-/commit/60dc6bac84fce46ca3b05557e3d373b9d0e65e55
Comment 6 Ralf Habacker 2024-12-10 18:20:50 UTC
(In reply to Ralf Habacker from comment #0)
> OBSERVED RESULT
> As shown at the screenshot appended the ‘Balance’ column displays a total of  the quantities. 

The figures shown are probably security units as they are shown in Gnucash.
Comment 7 Ralf Habacker 2024-12-10 19:37:11 UTC
Git commit 5e9abdaebe1e53c247f4a7b78a7d19e8428a862b by Ralf Habacker.
Committed on 10/12/2024 at 19:36.
Pushed by habacker into branch 'master'.

Add tooltip to the balance column of the general ledger view

For investment accounts, the securities units are displayed in
the balance column, otherwise the account balance. To give the
user a hint, a corresponding tooltip is now displayed.
FIXED-IN:5.2

M  +7    -0    kmymoney/mymoney/storage/journalmodel.cpp

https://invent.kde.org/office/kmymoney/-/commit/5e9abdaebe1e53c247f4a7b78a7d19e8428a862b
Comment 8 Ralf Habacker 2024-12-16 12:24:12 UTC
Created attachment 176678 [details]
Screenshot showing shown share name as unit

(In reply to Ralf Habacker from comment #7)
> For investment accounts, the securities units are displayed in
> the balance column, otherwise the account balance. .

Another approach would be to use the name of the share as a unit, as shown in the attached screenshot (see also https://www.gnucash.org/viewdoc.phtml?lang=en_US)