Bug 346009 - Expenses of a credit card account belonging to an institution or not appears as a credit in the institution pannel
Summary: Expenses of a credit card account belonging to an institution or not appears ...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-09 01:48 UTC by Rej
Modified: 2023-08-18 18:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments
Demo file to duplicate the problem on master (964 bytes, application/x-kmymoney)
2017-07-30 10:43 UTC, Thomas Baumgart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rej 2015-04-09 01:48:16 UTC
Under the same Institution I have two accounts: one is a current Bank account and the second one is a credit card account. Let us say I have 2000 in the current account and I owe 50 on my credit card. On the home pannel all is fine; I find 2000 in the assets and -50 in the liabilities for a balance of 1950. However if I open the Institution Account I find two positive values 2000 and 50 for a total of 2050 for the Institution; however the final balance at the bottom of the panel shows 1950.

Reproducible: Always

Steps to Reproduce:
1. Create an Institution
2. Create a current account belonging to that Institution
3. Create a credit card account belonging to that same Institution
4. Deposit 2000 in the current account
5. Enter expenses of 50 in the credit card account
6. Open the Institutions pannel

Actual Results:  
The total amount of the two accounts in the Institution pannel gives 2050
The total balance at the bottom gives the correct amount of 1950

Expected Results:  
The total amount of the two accounts in the Institution paqnnel should give 1950 since this should be the correct balance of these two accounts as it is found in the Home Pannel.
Comment 1 Thomas Baumgart 2015-04-09 07:20:33 UTC
Problem is reproducible on master as of today
Comment 2 NSLW 2017-07-30 05:36:24 UTC
(In reply to Thomas Baumgart from comment #1)
> Problem is reproducible on master as of today

Thomas,
can you check if it's still reproducible on master?

I cannot reproduce it, but I'm not sure I understand the issue here.
BTW. I tested with not yet committed https://phabricator.kde.org/D6954

Thanks
Comment 3 Thomas Baumgart 2017-07-30 10:43:20 UTC
Created attachment 106968 [details]
Demo file to duplicate the problem on master

No special institution needed, the "accounts with no institutions assigned" has the same problem. Could be that your referenced patch solves the problem. I did not verify this.
Comment 4 NSLW 2017-08-02 15:54:43 UTC
Git commit db6b3ec4a489fadfac64cd6606bce234ba83c7de by Łukasz Wojniłowicz.
Committed on 02/08/2017 at 15:52.
Pushed by wojnilowicz into branch 'master'.

Make view columns user selectable

Purpose of this patch is to speed up set up of accounts model. It
involves deduplication of data loaded into model, configuring columns to
be displayed and deferring load of data.
Changes:
1) Context menu per view for selecting columns to be displayed. Views
can have different columns set. If column isn't displayed in any view,
then it is released from AccountsModel thus freeing resources.
2) During KMM start only Account column is loaded. The rest is loaded on
demand.
3) Signals for views using KMyMoneyAccountTreeView are connected in
ctors of those views, so no need for proxy signals.
4) KAccountsView is loaded on demand just like other views.
5) Signals blocked in AccountsModel::load to not emit lots of
dataChanged signals.
6) AccountsModel::loadPreferredAccount for copying preferred account and
not recalculating it from the beginning.
7) QStandardItemModel::setChild instead of
QStandardItemModel::setData(index, value) to lessen overhead.
8) AccountsModel::setAccountData takes minimal arguments needed for
correctness.
9) AccountsModel::setAccountData can update data selectively thus
shortening time to update.
10) AccountsModel::Columns::*DisplayRole are useless (There is already
Qt::DisplayRole), so they were removed significantly.
11) AccountsModel::Columns::Account used instead of 0 for correctness.
12) KMyMoneyView::slotNetBalProChanged deduplicates common code from
views using KMyMoneyAccountTreeView
Related: bug 315747
FIXED-IN:5.0

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

Differential Revision: https://phabricator.kde.org/D6954

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

M  +6    -8    kmymoney/converter/mymoneystatementreader.cpp
M  +5    -5    kmymoney/dialogs/kexportdlg.cpp
M  +9    -12   kmymoney/dialogs/knewaccountdlg.cpp
M  +2    -1    kmymoney/dialogs/konlinetransferform.cpp
M  +624  -431  kmymoney/models/accountsmodel.cpp
M  +16   -5    kmymoney/models/accountsmodel.h
M  +5    -4    kmymoney/models/onlinebankingaccountsfilterproxymodel.cpp
M  +2    -2    kmymoney/mymoney/mymoneyaccount.cpp
M  +86   -79   kmymoney/views/kaccountsview.cpp
M  +26   -33   kmymoney/views/kaccountsview.h
M  +111  -122  kmymoney/views/kbudgetview.cpp
M  +9    -2    kmymoney/views/kbudgetview.h
M  +52   -60   kmymoney/views/kcategoriesview.cpp
M  +9    -23   kmymoney/views/kcategoriesview.h
M  +11   -11   kmymoney/views/kgloballedgerview.cpp
M  +53   -64   kmymoney/views/kinstitutionsview.cpp
M  +12   -27   kmymoney/views/kinstitutionsview.h
M  +4    -3    kmymoney/views/kinvestmentview.cpp
M  +100  -34   kmymoney/views/kmymoneyview.cpp
M  +14   -4    kmymoney/views/kmymoneyview.h
M  +4    -7    kmymoney/views/kpayeesview.cpp
M  +3    -6    kmymoney/views/ktagsview.cpp
M  +6    -8    kmymoney/views/newspliteditor.cpp
M  +7    -9    kmymoney/views/newtransactioneditor.cpp
M  +5    -5    kmymoney/views/simpleledgerview.cpp
M  +5    -5    kmymoney/widgets/kmymoneyaccountcombo.cpp
M  +121  -52   kmymoney/widgets/kmymoneyaccounttreeview.cpp
M  +18   -7    kmymoney/widgets/kmymoneyaccounttreeview.h
M  +9    -11   kmymoney/wizards/newaccountwizard/knewaccountwizard.cpp

https://commits.kde.org/kmymoney/db6b3ec4a489fadfac64cd6606bce234ba83c7de