Bug 470971 - Credit card - incorrect balance in ledger, incorrect net worth report
Summary: Credit card - incorrect balance in ledger, incorrect net worth report
Status: RESOLVED INTENTIONAL
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Other macOS
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-13 11:21 UTC by Marcin Bajor
Modified: 2023-06-18 01:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
dashboard (916.84 KB, image/png)
2023-06-13 11:25 UTC, Marcin Bajor
Details
credit card ledger (254.33 KB, image/png)
2023-06-13 11:30 UTC, Marcin Bajor
Details
net worth report (269.72 KB, image/png)
2023-06-13 11:34 UTC, Marcin Bajor
Details
net worth report chart (266.90 KB, image/png)
2023-06-13 11:35 UTC, Marcin Bajor
Details
sample KMymoney file (1022 bytes, application/gzip)
2023-06-13 11:39 UTC, Marcin Bajor
Details
checking account ledger (259.07 KB, image/png)
2023-06-13 11:47 UTC, Marcin Bajor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Bajor 2023-06-13 11:21:46 UTC
KMyMoney: Version 5.1.80-a418cd886
KMymoney shows incorrect balance values for credit cards in ledger and all net worth reports.

Steps to reproduce:
1. Create new book with checking account, balance = 0 (name = Direct)
2. Add new credit card account (name=Visa)
3. Add new deposit transaction in checking account, value=20000
3. Just transfer 10000 from checking account to credit card account.

Expected result:
1. In Assets and Liabilities Summary in the dashboard net worth should be 20000, checking account balance should be 10000, credit card account should be 10000. Result OK!
2. In credit card ledger, the balance in the row with transfer should be 10000, but the result is -10000. Result FAILED!
3. In credit card ledger total balance should be 10000. Result OK!
4. Net worth for credit card after the transfer transaction in net worth reports should be 10000, but there is -10000. Result FAILED!
Comment 1 Marcin Bajor 2023-06-13 11:25:33 UTC
Created attachment 159631 [details]
dashboard

1. In Assets and Liabilities Summary in the dashboard net worth should be 20000, checking account balance should be 10000, credit card account should be 10000. Result OK!
Comment 2 Marcin Bajor 2023-06-13 11:30:19 UTC
Created attachment 159632 [details]
credit card ledger

2. In credit card ledger, the balance in the row with transfer should be 10000, but the result is -10000. Result FAILED!
3. In credit card ledger total balance should be 10000. Result OK!
Comment 3 Marcin Bajor 2023-06-13 11:34:03 UTC
Created attachment 159633 [details]
net worth report

4. Net worth for credit card after the transfer transaction in net worth reports should be 10000, but there is -10000. Result FAILED!
Comment 4 Marcin Bajor 2023-06-13 11:35:07 UTC
Created attachment 159634 [details]
net worth report chart

4. Net worth for credit card after the transfer transaction in net worth reports should be 10000, but there is -10000. Result FAILED!
Comment 5 Marcin Bajor 2023-06-13 11:39:51 UTC
Created attachment 159635 [details]
sample KMymoney file
Comment 6 Marcin Bajor 2023-06-13 11:47:10 UTC
Created attachment 159636 [details]
checking account ledger
Comment 7 Jack 2023-06-17 19:47:52 UTC
This is just how KMyMoney works.  A Credit Card Account is a Liability, and Liability Accounts display positive numbers in the ledger - showing how much you owe - a positive liability.  In your case, you don't owe anything, you have 10000 available, essentially a negative liability.  The numbers are reversed on the home view - I suppose you could just call it convention, or for convenience of seeing both assets and liabilities together.
Comment 8 jesse 2023-06-18 00:39:49 UTC
I think this is a good reason to show both debits and credits(accounting terms) rather than use positive and negative values. 
Then the values could be absolute and never negative. Standard double accounting, but it will be a little more difficult for those not familiar with double accounting. 

From the user post, I do not think the result failed, rather it did not show what the user expected. Negatives vs positive values rather than absolute values. 


Maybe give an option to switch between both views?
Comment 9 Jack 2023-06-18 01:03:50 UTC
The new ledger (currently only seen in versions compiled from master branch, no schedule for release yet) moves in that direction with separate fields in the ledger (Payment and Deposit in asset accounts, I can't check the names in Liability accounts).  The only down side is that it takes two columns, so it's not great on smaller screens, or if ever ported to mobile.  The idea of an option to control that might be worth filing as a wishlist.