Bug 348490 - Split with almost 0 operation
Summary: Split with almost 0 operation
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 1.12
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-31 09:49 UTC by vicnet
Modified: 2015-06-09 20:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vicnet 2015-05-31 09:49:03 UTC
On a split operation, when a sub-operation is added, the difference is automatically added with the difference a global amount and sum of other amounts.
Skrooge one time add a 1€-14 (or something like that) sub-operation.
Deleting this strange operation is OK and no one is added again nor error message.

Reproducible: Didn't try

Steps to Reproduce:
1. Split an operation
2. Add sub-operations that sum equals total amount value


Actual Results:  
A automatic sub-operation with an amount of 1€-14 is added

Expected Results:  
Nothing should be added

Removed almost null sub-operation is OK.
Comment 1 Stephane MANKOWSKI 2015-06-05 07:23:55 UTC
Hi vicnet,

A new line is created in split panel ONLY when the amount of the last line is modified.
This new line is created with amount=global amount-SUM(amount of all other split).

So, the scenario I can see is this one:
1-Create an operation with amount=10
2-Open split panel
3-Modify amount of 1st split to  6 ==> a new split is created with amount =4
4-Modify amount of 1st split to 10 ==> the amount of last split is modified to 0

Sometimes, due to error in computation the 0 can be displayed 1e-14.

What do you think of this scenario? Is it aligned with your feeling?
Comment 2 Stephane MANKOWSKI 2015-06-09 14:02:05 UTC
Hi Vicnet,

Do you have an answer?

Regards.
Comment 3 vicnet 2015-06-09 18:47:21 UTC
I found a way to reproduce it every time:
1) enter global: -10.57
2) split with -5.48, -5.08
=> creation of operation 0.01
3) correct 5.08 to 5.09
=> the last operation is automatically modified from  0.01 to 1E-16

It should be deleted

Something similar: global 10, split 5 and 5, correct first 5 to 10 last operation set to 0 instead removed.
Comment 4 Stephane MANKOWSKI 2015-06-09 20:29:00 UTC
Git commit 42a98568b41da24e4ce01484d7e1db19c497f73e by Stephane Mankowski.
Committed on 09/06/2015 at 20:28.
Pushed by smankowski into branch 'kf5'.

Split with almost 0 operation

M  +1    -0    CHANGELOG
M  +10   -3    plugins/skrooge/skrooge_operation/skgoperationpluginwidget.cpp

http://commits.kde.org/skrooge/42a98568b41da24e4ce01484d7e1db19c497f73e