Bug 338684

Summary: Cleared amount is incorrect for liability accounts
Product: [Applications] kmymoney Reporter: David Houlden <djhoulden>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description David Houlden 2014-08-30 18:16:47 UTC
The cleared amount shown at the bottom of the ledger view shows an incorrect value for liability accounts (credit card).

Git bisect shows that

6307b3034c86c21f18ecf03f9b7aa97037456b29 is the first bad commit
commit 6307b3034c86c21f18ecf03f9b7aa97037456b29
Author: Alvaro Soliverez <asoliverez@kde.org>
Date:   Sun Jun 1 18:43:17 2014 -0300

    Added method to MyMoneyFile to calculate cleared balance
    REVIEW:118107

Reproducible: Always
Comment 1 Cristian Oneț 2014-08-31 18:45:23 UTC
Git commit 850b95c19fad793f7a5e5b1011161e7883aa7636 by Cristian Oneț.
Committed on 31/08/2014 at 18:41.
Pushed by conet into branch 'master'.

Fix the cleared balance of liability accounts.

The problem was caused by the fact that when refactored, the code
didn't consider the fact that previously the balance was also being
multiplied by factor. Instead of using factor at each step use it
only at the end when the result is returned since it's faster this
way.

M  +3    -4    kmymoney/mymoney/mymoneyfile.cpp

http://commits.kde.org/kmymoney/850b95c19fad793f7a5e5b1011161e7883aa7636
Comment 2 Cristian Oneț 2014-08-31 18:46:01 UTC
Git commit 93afc106c9a861349b3fe6f71f7351f26aab3d92 by Cristian Oneț.
Committed on 31/08/2014 at 18:41.
Pushed by conet into branch 'frameworks'.

Fix the cleared balance of liability accounts.

The problem was caused by the fact that when refactored, the code
didn't consider the fact that previously the balance was also being
multiplied by factor. Instead of using factor at each step use it
only at the end when the result is returned since it's faster this
way.
(cherry picked from commit 850b95c19fad793f7a5e5b1011161e7883aa7636)

M  +3    -4    kmymoney/mymoney/mymoneyfile.cpp

http://commits.kde.org/kmymoney/93afc106c9a861349b3fe6f71f7351f26aab3d92
Comment 3 Christian David 2014-09-24 19:42:09 UTC
Git commit 0d66dc42d97e29cd38bd706c1b77d4ccb19efb3c by Christian Dávid, on behalf of Cristian Oneț.
Committed on 31/08/2014 at 18:41.
Pushed by christiand into branch 'add-onlinebanking'.

Fix the cleared balance of liability accounts.

The problem was caused by the fact that when refactored, the code
didn't consider the fact that previously the balance was also being
multiplied by factor. Instead of using factor at each step use it
only at the end when the result is returned since it's faster this
way.

M  +3    -4    kmymoney/mymoney/mymoneyfile.cpp

http://commits.kde.org/kmymoney/0d66dc42d97e29cd38bd706c1b77d4ccb19efb3c