Bug 350903

Summary: Consistency check fails after changing base currency
Product: [Applications] kmymoney Reporter: Francois Marier <francois>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: lukasz.wojnilowicz, ralf.habacker
Priority: NOR    
Version: 4.6.6   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.0
Attachments: Error messsage after doing a consistency check
Simple KMyMoney file demonstrating the problem
Result of consistency check with master version and the testfile attached here

Description Francois Marier 2015-08-03 05:17:43 UTC
Changing the base currency leads to consistency check failures because accounts are missing some needed historical exchange rates.

Reproducible: Always

Steps to Reproduce:
Steps to reproduce:

1. Create a new file with EUR as the base currency.
2. Create a new cash account called "Cash Account" in AUD with 2014-01-01 as the opening date and $0 as the opening balance.
3. Add a transaction in that account for 20 AUD on 2015-08-02 with "Meal" as the category.
4. Select "Tools | Consistency Check" and notice it works fine.
5. Set the base currency to USD using "Tools | Currencies".
6. Select "Tools | Consistency Check" and notice it now fails with the attached error message.
Comment 1 Francois Marier 2015-08-03 05:18:15 UTC
Created attachment 93853 [details]
Error messsage after doing a consistency check
Comment 2 Francois Marier 2015-08-03 05:19:09 UTC
Created attachment 93854 [details]
Simple KMyMoney file demonstrating the problem

I have attached a simple file which demonstrates this problem. All you need
to do is open it, change the base currency and then run the consistency
check.
Comment 3 Francois Marier 2015-08-03 05:19:29 UTC
The work-around I found is to:

1. Change the base currency to USD.
2. Create a new checking account called "Bank Account" in USD.
3. Open the "Cash Account" settings and set an opening balance of 1 AUD.
4. Edit the "Opening Balances (AUD)" transaction and change it to be a transfer from "Bank Account" to "Cash Account" for 1 AUD with an exchange rate of 0.5 USD to 1 AUD.
5. Select "Tools | Consistency Check" and notice it now works fine.
Comment 4 Thomas Baumgart 2015-08-08 19:48:57 UTC
4.6.6 is rather old. I cannot duplicate this problem with current master. In master, the consistency check had been overhauled, that is probably why.

BTW: the correct fix would be to enter a price for AUD-EUR conversion as suggested by the consistency check warning message.
Comment 5 Thomas Baumgart 2015-08-08 19:50:10 UTC
Created attachment 93951 [details]
Result of consistency check with master version and the testfile attached here
Comment 6 NSLW 2017-07-02 08:57:17 UTC
Marking fixed as per comment #5.