Bug 419113

Summary: Data displayed in scheduled transaction and home page are sometimes not consistent
Product: [Applications] kmymoney Reporter: antoine <antoine>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: me
Priority: NOR    
Version: 5.0.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.0
Sentry Crash Report:
Attachments: example
anonymous file

Description antoine 2020-03-22 15:00:02 UTC
Created attachment 126944 [details]
example

SUMMARY

Data in the scheduled transaction and in the home page are not consistent
See the example picture

STEPS TO REPRODUCE
- Random behavior !

OBSERVED RESULT
Data in the scheduled transaction and in the home page are not consistent

EXPECTED RESULT
Consistent information


SOFTWARE/OS VERSIONS

Ubuntu 18.04
Kmymoney 5.0.1-2
Comment 1 Thomas Baumgart 2020-03-22 16:14:10 UTC
Are you able to duplicate the problem with a more recent version (current is 5.0.8)? You can easily try that using the AppImage version of KMyMoney. See https://kmymoney.org/appimage.html for details on how to obtain and run it.
Comment 2 antoine 2020-03-22 17:55:26 UTC
Same result with KMyMoney-5.0.8-029de47-x86_64.AppImage
Comment 3 Thomas Baumgart 2020-03-22 18:36:20 UTC
Very strange. I have 50+ scheduled transactions and none of them shows such a behavior.

Can you try to reproduce the problem with an anonymized version of your data and then provide us the file so that we can check what is going on? See https://docs.kde.org/stable5/en/extragear-office/kmymoney/details.formats.anonymous.html howto create such a version.
Comment 4 antoine 2020-03-22 19:30:45 UTC
I agree, this is strange. I have been using KMM for 7 years and this is the first time I see that. Only one scheduled transaction is concerned and it has always been displayed correctly before.

I am not really lucky today. I can not create an anonymous file.
https://bugs.kde.org/show_bug.cgi?id=419120
Comment 5 Thomas Baumgart 2020-03-23 06:56:00 UTC
Did you try to use the AppImage version to create the anonymous file? I just verified that the AppImage can save an anon.xml file (did you select the right file type?). Could also be, that 5.0.1 has a problem writing them.
Comment 6 antoine 2020-03-23 08:50:56 UTC
Yes, I tried with the app image, same result
Comment 7 antoine 2020-03-23 17:47:31 UTC
I have been able to produce an anonymous file but the bug disappeared once the file became anonymous.
Comment 8 antoine 2020-03-23 18:02:50 UTC
When I open the file with the app image, the bug is still here.

But when I save the file with app image, close the file and the reopen it, the bug is not here.
Comment 9 Jack 2020-03-23 20:23:54 UTC
Antoine - if you save the file again with the 5.0.1 version, and then reopen it, is the problem still present or does that also fix it?

It might be interesting to compare those two files.  Perhaps there is something odd in the SCHEDULED_TX record that the appimage fixes when saving.  Unfortunately, that won't help figuring out how the problem was introduced in the first place.

Antoine - can you do 'grep -A8 "SCHEDULED_TX " file.xml' for the file that shows the problem and the new one that does not?  You will get one section for each scheduled transaction, but you should be able to fairly easily identify the one of interest.  You can then compare the two versions to see if you can identify any difference.
Comment 10 antoine 2020-03-23 21:05:35 UTC
>Antoine - if you save the file again with the 5.0.1 version, and then reopen it, >is the problem still present or does that also fix it?

it does not fix it

> Antoine - can you do 'grep -A8 "SCHEDULED_TX " file.xml'

test501.xml is the xml file saved with version 5.0.1
test508.xml is the xml file saved with app image

antoine@Talos:~/Bureau$ grep -A8 "SCHEDULED_TX " test501.xml
.....
  <SCHEDULED_TX endDate="" startDate="" name="Impot BA" occurenceMultiplier="1" lastDayInMonth="0" lastPayment="" occurence="32" fixed="0" weekendOption="2" type="1" autoEnter="0" paymentType="8" id="SCH000045">
   <PAYMENTS/>
   <TRANSACTION entrydate="" postdate="2020-03-17" memo="PRLV SEPA DIRECTION GENERALE DES FINANCE" commodity="EUR" id="">
    <SPLITS>
     <SPLIT action="" bankid="" account="A000065" memo="Impot BA" reconcileflag="0" value="-9/1" shares="-9/1" reconciledate="" number="" id="S0001" payee="P000016"/>
     <SPLIT action="" bankid="" account="A000048" memo="Impot BA" reconcileflag="0" value="9/1" shares="9/1" reconciledate="" number="" id="S0002" payee=""/>
    </SPLITS>
   </TRANSACTION>
  </SCHEDULED_TX>
antoine@Talos:~/Bureau$ grep -A8 "SCHEDULED_TX " test508.xml
.....
  <SCHEDULED_TX endDate="" weekendOption="2" id="SCH000045" autoEnter="0" type="1" occurence="32" occurenceMultiplier="1" startDate="2020-03-17" fixed="0" name="Impot BA" paymentType="8" lastDayInMonth="0" lastPayment="">
   <PAYMENTS/>
   <TRANSACTION id="" postdate="2020-03-17" memo="PRLV SEPA DIRECTION GENERALE DES FINANCE" commodity="EUR" entrydate="">
    <SPLITS>
     <SPLIT action="" number="" id="S0001" value="-9/1" reconciledate="" reconcileflag="0" shares="-9/1" price="1/1" account="A000065" bankid="" memo="Impot BA" payee="P000016"/>
     <SPLIT action="" number="" id="S0002" value="9/1" reconciledate="" reconcileflag="0" shares="9/1" price="1/1" account="A000048" bankid="" memo="Impot BA" payee=""/>
    </SPLITS>
   </TRANSACTION>
  </SCHEDULED_TX>
Comment 11 Bug Janitor Service 2020-04-07 04:33:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 antoine 2020-04-07 10:21:53 UTC
Infos are here https://bugs.kde.org/show_bug.cgi?id=419113#c10
Comment 13 Thomas Baumgart 2020-04-07 13:27:51 UTC
Those SCHEDULED_TX entries are identical, at least I don't see a logical difference. Could it be, that the respective ACCOUNT entries for A000048 and A000065 cause the problem? Just thinking out loud.
Comment 14 antoine 2020-04-07 17:15:05 UTC
(In reply to Thomas Baumgart from comment #13)
> Those SCHEDULED_TX entries are identical, at least I don't see a logical
> difference. Could it be, that the respective ACCOUNT entries for A000048 and
> A000065 cause the problem? Just thinking out loud.


I am not sure about this. This scheduled transaction is ok next month. I do not know why, it only happened  in march.

I extract these infos after converting my .kmy file into .xml, can it explain why these 2 entries are identical ? The bug is maybe only in the .kmy file
Comment 15 Thomas Baumgart 2020-04-07 17:21:19 UTC
No, the .kmy is just the gzipped version of the .xml file. Nothing special.
Comment 16 antoine 2020-04-07 17:35:17 UTC
Created attachment 127362 [details]
anonymous file

Look at SCH000045, this is the scheduled transaction with the bug
Comment 17 Thomas Baumgart 2020-04-07 18:42:46 UTC
Git commit 569a3ed9179c2cca122c801242d37975b9ff4c76 by Thomas Baumgart.
Committed on 07/04/2020 at 18:42.
Pushed by tbaumgart into branch '5.0'.

Use valid start date to calculate remaining scheduled payments
FIXED-IN: 5.0.9

M  +3    -3    kmymoney/mymoney/mymoneyschedule.cpp

https://commits.kde.org/kmymoney/569a3ed9179c2cca122c801242d37975b9ff4c76