[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-11-06 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #15 from Ralf Habacker  ---
Review request for bug fix:  https://phabricator.kde.org/D8678

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-11-05 Thread Thomas Baumgart
https://bugs.kde.org/show_bug.cgi?id=385857

Thomas Baumgart  changed:

   What|Removed |Added

   See Also||https://bugs.kde.org/show_b
   ||ug.cgi?id=386543

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-26 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #14 from Ralf Habacker  ---
While working on this stuff I used the pivottable test app to see if something
has been changed by the fix mentioned in comment 11 and I got differences in
testMultipleCurrencies()

The basic test data are 

  MyMoneyMoney moJpyPrice(0.010, 100);
  MyMoneyMoney moJpyPrice2(0.011, 100);
  MyMoneyMoney moJpyPrice3(0.014, 100);
  MyMoneyMoney moJpyPrice4(0.0395, 100);
  makePrice("JPY", QDate(2004, 1, 1), MyMoneyMoney(moJpyPrice));
  makePrice("JPY", QDate(2004, 5, 1), MyMoneyMoney(moJpyPrice2));
  makePrice("JPY", QDate(2004, 6, 30), MyMoneyMoney(moJpyPrice3));
  makePrice("JPY", QDate(2004, 7, 15), MyMoneyMoney(moJpyPrice4));

  MyMoneyMoney moJpyTransaction(100.0, 100);

  related transactions 
  ... t1(QDate(2004, 2, 20), .., moJpyTransaction, acJpyChecking, acJpyCash,
"JPY");
  ... t2(QDate(2004, 3, 20), .., moJpyTransaction, acJpyChecking, acJpyCash,
"JPY");
  ... t3(QDate(2004, 4, 20), .., moJpyTransaction, acJpyChecking, acJpyCash,
"JPY");

old

Account Asset   Canadian Checking   Checking AccountJapanese
Checking   Total Asset Liability   Credit Card Total Liability
Grand Total
Jan 0.000.000.000.000.000.000.00
Feb -75.00  0.00-1.00   -76.00  0.000.00-76.00
Mar -150.00 0.00-2.00   -152.00 0.000.00-152.00
Apr -225.00 0.00-3.00   -228.00 0.000.00-228.00
May -225.00 0.00-3.00   -228.00 0.000.00-228.00
Jun -225.00 0.00-3.00   -228.00 0.000.00-228.00
Jul -225.00 0.00-12.00  -237.00 0.000.00-237.00
[1]
Aug -225.00 0.00-12.00  -237.00 0.000.00-237.00
Sep -225.00 0.00-12.00  -237.00 0.000.00-237.00
Oct -225.00 0.00-12.00  -237.00 0.000.00-237.00
Nov -225.00 0.00-12.00  -237.00 0.000.00-237.00
Dec -225.00 0.00-12.00  -237.00 0.000.00-237.00

[1] caused by price moJpyPrice4

new

Account Asset   Canadian Checking   Checking AccountJapanese
Checking   Total Asset Liability   Credit Card Total Liability
Grand Total
Jan 0.000.000.000.000.000.000.00
Feb -75.00  0.00-1.00   -76.00  0.000.00-76.00
Mar -150.00 0.00-2.00   -152.00 0.000.00-152.00
Apr -225.00 0.00-3.00   -228.00 0.000.00-228.00
May -225.00 0.00-3.00   -228.00 0.000.00-228.00
Jun -225.00 0.00-3.00   -228.00 0.000.00-228.00
Jul -225.00 0.00-3.00   -228.00 0.000.00-228.00
Aug -225.00 0.00-3.00   -228.00 0.000.00-228.00
Sep -225.00 0.00-3.00   -228.00 0.000.00-228.00
Oct -225.00 0.00-3.00   -228.00 0.000.00-228.00
Nov -225.00 0.00-3.00   -228.00 0.000.00-228.00
Dec -225.00 0.00-3.00   -228.00 0.000.00-228.00

this shows that price changes after Apr 20 does not affect "Japanese Checking".

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-23 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #13 from Ralf Habacker  ---
(In reply to NSLW from comment #12)
> (In reply to Ralf Habacker from comment #11)
> > The root cause for this bug is that in PivotTable::init() the cell values
> > are collected in the accounts currency first. Then the sum is converted to
> > the file currency using the date from the report cell, which may not be the
> > same date as the transaction date the single values are coming from.
> > 
> > To have a correct sum each value from a transaction need to be converted to
> > the base currency before adding to the report cell and not to convert the
> > sum.
> 
> I'm not following this bug very dilligently, but before modifying 4.8.1
> version code paths in PivotTable::init() and then applying it on 5.0 branch,
> see if code paths in 5.0 (there were some noticeable changes there) show the
> same error 
This has been reported in bug 385900 - git master show different but also wrong
values
>and maybe backport if not.
not sure yet if this is possible - I guess this depends on how much the branch
is diverged in that area. I tried backporting already with online price update
which was not possible because the newly introduced regex classes are not
available for qt4. :-(

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-21 Thread NSLW
https://bugs.kde.org/show_bug.cgi?id=385857

NSLW  changed:

   What|Removed |Added

 CC||lukasz.wojnilow...@gmail.co
   ||m

--- Comment #12 from NSLW  ---
(In reply to Ralf Habacker from comment #11)
> The root cause for this bug is that in PivotTable::init() the cell values
> are collected in the accounts currency first. Then the sum is converted to
> the file currency using the date from the report cell, which may not be the
> same date as the transaction date the single values are coming from.
> 
> To have a correct sum each value from a transaction need to be converted to
> the base currency before adding to the report cell and not to convert the
> sum.

I'm not following this bug very dilligently, but before modifying 4.8.1 version
code paths in PivotTable::init() and then applying it on 5.0 branch, see if
code paths in 5.0 (there were some noticeable changes there) show the same
error and maybe backport if not.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-21 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #11 from Ralf Habacker  ---
The root cause for this bug is that in PivotTable::init() the cell values are
collected in the accounts currency first. Then the sum is converted to the file
currency using the date from the report cell, which may not be the same date as
the transaction date the single values are coming from.

To have a correct sum each value from a transaction need to be converted to the
base currency before adding to the report cell and not to convert the sum.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-19 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #10 from Ralf Habacker  ---
(In reply to Ralf Habacker from comment #9)
> (In reply to Tamer from comment #7)
> > Created attachment 108451 [details]
> > kmy file showing the case
> > 
> > I attached the kmy file in which the bug appears.
> > You can see the wrong summation in the report "Income and Expenses 2016" in
> > Month of Nov.
> > The report is showing 170,263.37 AED instead of 344,450 AED
> 
> Opening the mentioned reports show the following used conversion factors
> (see PivotTable::convertToBaseCurrency()) 

adding more debug information returns for monthly report interval

Debug:date QDate("Mi Nov 30 2016") conversionfactor 4.89 oldvalue 832588 new
value 170263 

and for weekly report interval

Debug:date QDate("Do Nov 17 2016") conversionfactor 2.4167 oldvalue 832588 new
value 344514 

and for daily report interval

Debug:date QDate("Do Nov 10 2016") conversionfactor 2.4175 oldvalue 107458 new
value 44450 
Debug:date QDate("So Nov 13 2016") conversionfactor 2.4171 oldvalue 725130 new
value 30 

for QDate("Mi Nov 30 2016") a price is present and has value 4.89
for QDate("Do Nov 17 2016") a price is also present and has value 2.4167
for QDate("Do Nov 10 2016") a price is present and has value 2.4175
for QDate("So Nov 13 2016") a price is present and has value 2.4171

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-19 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

Ralf Habacker  changed:

   What|Removed |Added

 Resolution|WAITINGFORINFO  |---
 Status|NEEDSINFO   |CONFIRMED
 Ever confirmed|0   |1

--- Comment #9 from Ralf Habacker  ---
(In reply to Tamer from comment #7)
> Created attachment 108451 [details]
> kmy file showing the case
> 
> I attached the kmy file in which the bug appears.
> You can see the wrong summation in the report "Income and Expenses 2016" in
> Month of Nov.
> The report is showing 170,263.37 AED instead of 344,450 AED

Opening the mentioned reports show the following used conversion factors (see
PivotTable::convertToBaseCurrency()) 

conversionfactor QDate("2016-01-01") 2.13174
conversionfactor QDate("2016-02-01") 2.13174
conversionfactor QDate("2016-03-01") 2.13311
conversionfactor QDate("2016-04-01") 2.4148
conversionfactor QDate("2016-05-01") 2.4181
conversionfactor QDate("2016-06-01") 2.4197
conversionfactor QDate("2016-07-01") 2.42131
conversionfactor QDate("2016-08-01") 2.4178
conversionfactor QDate("2016-09-01") 3.3783
conversionfactor QDate("2016-10-01") 3.3774
conversionfactor QDate("2016-11-01") 2.4172
conversionfactor QDate("2016-12-01") 4.92611

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-19 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #8 from Tamer  ---
Created attachment 108452
  --> https://bugs.kde.org/attachment.cgi?id=108452&action=edit
Updated Screen Shots

Adding two screen shots to show the list of entered transactions and showing
the report that has the wrong values.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-19 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #7 from Tamer  ---
Created attachment 108451
  --> https://bugs.kde.org/attachment.cgi?id=108451&action=edit
kmy file showing the case

I attached the kmy file in which the bug appears.
You can see the wrong summation in the report "Income and Expenses 2016" in
Month of Nov.
The report is showing 170,263.37 AED instead of 344,450 AED

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-19 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

Ralf Habacker  changed:

   What|Removed |Added

 Resolution|--- |WAITINGFORINFO
 Status|UNCONFIRMED |NEEDSINFO

--- Comment #6 from Ralf Habacker  ---
(In reply to Tamer from comment #5)
> Hi Ralf,
> I am not sure if I there is any utility that can decrypt the data so i can
> share my file with you for analysis. if so, please let me know
see
https://docs.kde.org/stable4/en/extragear-office/kmymoney/details.formats.anonymous.html
and please append such generated file to this bug.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-18 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #5 from Tamer  ---
Hi Ralf,
I created a new project to simulate the case and what you mentioned is correct.
the report shows the correct value.

The bug looks to appear only with old projects and files.
Please note that I am using this application since 2014 and I used different
versions with the same file. Maybe something wrong in the database stored in
the file or a scenario not covered in the new version.

What I have shared is real snapshots of my records and definitely there is a
problem which cannot be reproduced by simulating new projects.  

I am not sure if I there is any utility that can decrypt the data so i can
share my file with you for analysis. if so, please let me know, or I can share
my screen with you to validate my argument your self, or we can close this bug
if there no other option.

Thanks for your efforts.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-18 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

Ralf Habacker  changed:

   What|Removed |Added

 Attachment #108417|0   |1
is obsolete||

--- Comment #4 from Ralf Habacker  ---
Created attachment 108429
  --> https://bugs.kde.org/attachment.cgi?id=108429&action=edit
test case

test case updated according to the additional informations

This test case shows the mentioned sum 172260,75 AED in the sum column of the
category tab. Removing the price 4,833 from 10/16/17 shows 344457,36 AED which
is calculated by using the price from 11/13/16. This indicates that kmymoney
shows always the latest available price in the sum column of the category tab.

Opening the report "Income and expense (convert to base currency)" always shows
344457,36 AED (regardless if the price 4,833 from 10/16/17 is present or not).
This indicates that the report seems to use the last price in the reports date
range.

I'm still not able to see the mentioned value 172260,75 AED in the report you
are mentioned with KMymoney 4.8.1 on Windows

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-18 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #3 from Tamer  ---
Thanks Ralf for your prompt feedback,
I have uploaded the file "[kmymoney4] [Bug 385857] Wrong Currency conversion
rate in Reports.pdf" which contains the reproducing steps with screen shots to
demonstrate the case in real life example.

Please let me know if you need further information.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-18 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

--- Comment #2 from Tamer  ---
Created attachment 108428
  --> https://bugs.kde.org/attachment.cgi?id=108428&action=edit
[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

Reproducing steps with screen shots

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-17 Thread Ralf Habacker
https://bugs.kde.org/show_bug.cgi?id=385857

Ralf Habacker  changed:

   What|Removed |Added

 CC||ralf.habac...@freenet.de

--- Comment #1 from Ralf Habacker  ---
Created attachment 108417
  --> https://bugs.kde.org/attachment.cgi?id=108417&action=edit
test case

I tried to reproduce this issue with kmymoney version 4.8.1 on Windows and the
appended test case, but could not reproduce this issue. Loading the test case
with 4.8.0 also does not show the issue.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kmymoney4] [Bug 385857] Wrong Currency conversion rate in Reports

2017-10-17 Thread Tamer
https://bugs.kde.org/show_bug.cgi?id=385857

Tamer  changed:

   What|Removed |Added

 CC||tfa...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.