Bug 341100 - QIF import date format missing
Summary: QIF import date format missing
Status: CONFIRMED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.7.1
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 13:50 UTC by Christian González
Modified: 2018-09-08 14:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of QIF settings (45.61 KB, image/png)
2014-11-19 14:23 UTC, Christian González
Details
QIF test file (65 bytes, application/x-qw)
2017-08-02 09:08 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian González 2014-11-19 13:50:14 UTC
I try to import a QIF file (Austrian Bank), which is impossible due to a "missing" date format.
In kmymoney settings, I can only select from predefined date strings like %d.%m.%yyyy - my date format seems to be like %dd%mm%yyyy like 10052013, meaning 10th of May 2013.
Here is a part of my QIF file:
^
D30122013
T-800.00
MUMBUCHUNG   INTERNET AM 2013-12-30
MATxxxxxxxxxxxxxxxxxxxx/BWXXXXXXXXXX/my name,
MDescription
^


Reproducible: Always

Steps to Reproduce:
1. open file->import->QIF file, 
2.select qif file
3.choose a profile or leave default.
4. click "import"

then I have to choose a date format - but none of these seems to match my format in the QIF file. The closest is "%d %m %y". 

Actual Results:  
Next dialog message tells me:

'Der Datumseintrag „10052013“, der aus der Datei gelesen wurde, kann mit dem momentan eingestellten Datumsfilter „“ nicht interpretiert werden.'

It seems that the date filter gets lost somewhere: „“ is nothing.

Expected Results:  
QIF should import normally ;-)

Without importing QIF, I can't use kmymoney. BTW. CSV seems to be broken too, therefore I'm lost here somehow.
Comment 1 allan 2014-11-19 14:15:52 UTC
On 19/11/14 13:50, Christian Gonzalez wrote:
> https://bugs.kde.org/show_bug.cgi?id=341100
>
>              Bug ID: 341100
>             Summary: QIF import date format missing
>             Product: kmymoney4
>             Version: 4.7.1
>            Platform: Archlinux Packages
>                  OS: Linux
>              Status: UNCONFIRMED
>            Severity: major
>            Priority: NOR
>           Component: general
>            Assignee: kmymoney-devel@kde.org
>            Reporter: christian.gonzalez@medworx.at
>
> I try to import a QIF file (Austrian Bank), which is impossible due to a
> "missing" date format.
> In kmymoney settings, I can only select from predefined date strings like
> %d.%m.%yyyy - my date format seems to be like %dd%mm%yyyy like 10052013,
> meaning 10th of May 2013.
> Here is a part of my QIF file:
> ^
> D30122013
> T-800.00
> MUMBUCHUNG   INTERNET AM 2013-12-30
> MATxxxxxxxxxxxxxxxxxxxx/BWXXXXXXXXXX/my name,
> MDescription
> ^
>
>
> Reproducible: Always
>
> Steps to Reproduce:
> 1. open file->import->QIF file,
> 2.select qif file
> 3.choose a profile or leave default.
> 4. click "import"
>
> then I have to choose a date format - but none of these seems to match my
> format in the QIF file. The closest is "%d %m %y".
>
> Actual Results:
> Next dialog message tells me:
>
> 'Der Datumseintrag „10052013“, der aus der Datei gelesen wurde, kann mit dem
> momentan eingestellten Datumsfilter „“ nicht interpretiert werden.'
>
> It seems that the date filter gets lost somewhere: „“ is nothing.
>
> Expected Results:
> QIF should import normally ;-)
>
> Without importing QIF, I can't use kmymoney. BTW. CSV seems to be broken too,
> therefore I'm lost here somehow.
>

If you go to Tools > QIF Profile editor, select Default, then Date.  You 
should see a whole bunch of option, including the one you need.

If you want to keep that as your default, just click OK.  Otherwise, to 
make a new filter, first select New, enter a new name the select the 
date format as above.  Then click OK.  When importing, make sure you 
select that new filter.

What's the problem with CSV?

Allan
Comment 2 Christian González 2014-11-19 14:23:58 UTC
Created attachment 89636 [details]
Screenshot of QIF settings
Comment 3 Christian González 2014-11-19 14:24:09 UTC
That was exactly what I wanted to state. As you can see in the attached screenshot, ther is no option to get a "D30122013" as an input for date. there are only options with dots and slashes.

BTW: meanwhile I got CSV working, but with some problems - but I don't want to discuss it here as it seems to be another issue - I'll write another report?
Comment 4 Christian González 2014-11-19 14:27:24 UTC
There should be an option to add a bash input filter script to parsy my QIF file and bring that dates into a format kmymoney/CSV importer understands. But wouldn't it be much easier to add an option to the importer for entering string date filters? just change the combo box into an editable one for the first part. this would be the easiest, but also quick-and dirty way to get other date input filters.
Comment 5 allan 2014-11-19 14:34:50 UTC
(In reply to Christian Gonzalez from comment #3)
> That was exactly what I wanted to state. As you can see in the attached
> screenshot, ther is no option to get a "D30122013" as an input for date.
> there are only options with dots and slashes.
> 
Isn't the third on the list what you need?  No separators.

> BTW: meanwhile I got CSV working, but with some problems - but I don't want
> to discuss it here as it seems to be another issue - I'll write another
> report?

Yes please.
Comment 6 Christian González 2014-11-19 14:37:28 UTC
The third on the list is %d/%m/%yyyy - so the separator is "/". What I would need is %d%m&yyyy - what formats are these? php dateformat? own one? does %d include "1" and "01"? Is there a %dd%mm%yyyy - this would be what I expected to work...
Comment 7 allan 2014-11-19 15:42:02 UTC
(In reply to Christian Gonzalez from comment #6)
> The third on the list is %d/%m/%yyyy - so the separator is "/". What I would
> need is %d%m&yyyy - what formats are these? php dateformat? own one? does %d
> include "1" and "01"? Is there a %dd%mm%yyyy - this would be what I expected
> to work...

Apologies.  It's a while since I've been in this area and I took that to be the escape character.

However, it might still be worth a try.   I've just edited a small file and used that profile.  There was a follow-up window giving possible options where it couldn't be sure of the date.  I chose %d%m%y and the file imported.

It's not a proper solution but a possible work-around.

See how that goes.  If it gets too messy, let's know.
Comment 8 Christian González 2014-11-19 15:53:49 UTC
Thanks & no problem. Eh - which file did you edit? You meant you edited a kmymoney profile file? or the QIF file? Sorry, I just didn't get what you meant
Comment 9 allan 2014-11-19 16:40:46 UTC
(In reply to Christian Gonzalez from comment #8)
> Thanks & no problem. Eh - which file did you edit? You meant you edited a
> kmymoney profile file? or the QIF file? Sorry, I just didn't get what you
> meant

I removed the separators from a QIF file, and made sure the dates had all digits present.

With a small file, the analysis may not be able to determine the date for certain, hence the additional window asking for further guidance.
Comment 10 allan 2014-11-19 18:12:11 UTC
I had something at the back of my mind on this, and I've found reason.

Way back in 2010, I reported a problem on Bug 234215 - QIF Import Filter Issues.

The gist of it is that the QIF profile date is now used only for exporting.  On import, the format is deduced from a scan of the data.  If the is any doubt, the user is requested to decide.

So, your absence of separators is/sb. OK.
Comment 11 Christian González 2014-11-19 20:14:00 UTC
I changed my kmymoney language to EN so I can keep up/provide you with genuine error messages... :-)

Ok, this makes sense. But this 1. should be menationed in the QIF settings. Are all QIF settings only for export? Then why can I select a profile at the QIF import wizard?

Then the real bug here is that the deducing of the date format from the QIF file is buggy - because it tells me that "" is no date format - and (as you stated) kmymoney requests me to hive a hint which format should be chosen. "Pick the date format that suits your input file" is the question, and the closest possibility here is "%d %m %y" - it does not work, the next dialog in English is the already mentioned
  'The date entry "10052013" read from the file cannot
  be interpreted through the current date profile setting of "".'

And the interestingpart here, aas said already, is that "" is not a date format. So the import filter seems to swallow somebits here. If I press "Continue", it assumes today's date for all transactions, and imports everything else correctly. But that's nonsense of course.
Comment 12 allan 2014-11-19 21:36:31 UTC
OK, some nonsense here.
I added your QIF line on to my file, but my two entries were accepted and yours was rejected again.
I noticed that your year was four digits, but mine just two, so I altered mine to four, and deleted yours.  There was no dialog about the format, and the import proceeded.
The console showed both dates had been misinterpreted as 
Process on: '405-04-20', id: '405-04-20-2db2e54-1', instead  of  04052004, and 
Process on: '102-04-20', id: '102-04-20-dbb124d-1', instead of 01022004.

A bit odd.  Need to investigate.
Comment 13 Ralf Habacker 2017-08-02 09:08:51 UTC
Created attachment 107033 [details]
QIF test file

Issue is still present in recent 4.8 branch
Comment 14 Thomas Baumgart 2018-09-08 14:33:34 UTC
That is exactly where the input filter comes into play and is designed for. In your case, a simple bash script consisting of

---8<---
#!/bin/bash

sed -e "s/^D\(..\)\(..\)\(....\)/D\1.\2.\3/"
---8<---

would do the trick together with the selection of %d.%m.%yyyy as the date format. Adding another date format considered an enhancement.