[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kmymoney4] [Bug 345655] Rounding problems between checking and investment account
From:       NSLW <bugzilla_noreply () kde ! org>
Date:       2017-04-01 6:19:11
Message-ID: bug-345655-17878-1BdA9jPIc3 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=345655

NSLW <lukasz.wojnilowicz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Version Fixed In|4.8.0                       |5.0
      Latest Commit|http://commits.kde.org/kmym |https://commits.kde.org/kmy
                   |oney/dd5bfdd80e64ec30ac10b1 |money/c6e31c96a03ad5a7ec5e3
                   |3c6a0dd7aa818bd1d2          |695bbfa8336181ab81c
             Status|REOPENED                    |RESOLVED

--- Comment #41 from NSLW <lukasz.wojnilowicz@gmail.com> ---
Git commit c6e31c96a03ad5a7ec5e3695bbfa8336181ab81c by Łukasz Wojniłowicz.
Committed on 01/04/2017 at 06:16.
Pushed by wojnilowicz into branch 'master'.

Fix rounding problem with investments

Patch introduces rounding rules per security for fixing bug #372163. It
seems that this broker always rounds amounts down while my broker rounds
amounts depending on the outlying digit, so it couldn't work for both of
us without rules.

Rounding is done in InvestTransactionEditor because it has all needed
informations at hand.

No rounding of shares is done in InvestTransactionEditor::setupPrice.
Transaction from bug #372163 looks as follows:
brokerage:
shares = 1,009 ; value = 1,009
investment:
shares = -1 ; value = 1,009

InvestTransactionEditor::setupPrice causes brokerage to look as follows:
shares = 1,01 ; value = 1,009
As we can see shares and value diverge, which is unacceptable here.

Patch makes assumption that transaction has only single split of
stock/mutual fund/bond.
Related: bug 357784, bug 365177, bug 372163
FIXED-IN:5.0

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

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

M  +32   -15   kmymoney/dialogs/investtransactioneditor.cpp
M  +31   -0    kmymoney/kmymoneyutils.cpp
M  +22   -0    kmymoney/kmymoneyutils.h
M  +39   -0    kmymoney/mymoney/mymoneysecurity.cpp
M  +27   -8    kmymoney/mymoney/mymoneysecurity.h
M  +1    -0    kmymoney/mymoney/storage/mymoneydbdef.cpp
M  +3    -0    kmymoney/mymoney/storage/mymoneystoragesql.cpp
M  +4    -3    kmymoney/widgets/transaction.cpp
M  +11   -0   
kmymoney/wizards/newinvestmentwizard/kinvestmentdetailswizardpage.cpp
M  +104  -90  
kmymoney/wizards/newinvestmentwizard/kinvestmentdetailswizardpagedecl.ui
M  +2    -0    kmymoney/wizards/newinvestmentwizard/knewinvestmentwizard.cpp

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

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic