Bug 449580

Summary: All operations imported from OFX file have 07/02/2106 as date
Product: [Applications] skrooge Reporter: Marco Sanchotene <marco.sanchotene>
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: RESOLVED DOWNSTREAM    
Severity: major CC: stephane
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: 25.1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Sample file to reproduce issue
Screen capture
OFX imported
traces

Description Marco Sanchotene 2022-02-04 00:53:48 UTC
SUMMARY
When importing an OFX file into Skrooge 2.27.0, all operations have 07/02/2106 as date. The same behaviour occurred with three different files.

STEPS TO REPRODUCE
1. Click on File -> Import -> Import...
2. Select an OFX file

OBSERVED RESULT
All operations have 07/02/2106 as date.

EXPECTED RESULT
The operations should have their correct dates.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.23
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
N/A
Comment 1 Stephane MANKOWSKI 2022-02-06 20:58:41 UTC
Could you attach a sample file here to reproduce the issue ?
Comment 2 Marco Sanchotene 2022-02-06 22:26:31 UTC
Created attachment 146360 [details]
Sample file to reproduce issue
Comment 3 Stephane MANKOWSKI 2022-02-07 19:36:47 UTC
Created attachment 146403 [details]
Screen capture

Hi Marco,

As you can see in the attached screen capture, the import is done correctly.
Comment 4 Marco Sanchotene 2022-02-07 23:01:40 UTC
Created attachment 146410 [details]
OFX imported

Hi Stephane,

Well, here the same file is imported like the image attached...
Comment 5 Marco Sanchotene 2022-02-07 23:02:56 UTC
Created attachment 146411 [details]
traces

I'm attaching also the traces.txt file after importing that OFX file.
Comment 6 Stephane MANKOWSKI 2022-02-08 17:24:25 UTC
Hi,
The parsing of the OFX file is done by a third party library: libofx.
What is the version of libofx library ?
My version is 1:0.9.15-3build1

Could you try this ofxdump ~/Bureau/449580.ofx (of course on your file) ?
You should see that:
ofx_proc_statement():
    Currency: BRL
    Account ID: 0300  0000000000
    Start date of this statement: Wed Jan  5 10:00:00 2022 CET
    End date of this statement: Fri Jan 28 10:00:00 2022 CET
    Ledger balance: 643.69
    Ledger balance date: Thu Feb  3 10:00:00 2022 CET

If the date is incorrect here, it means that the issue is in your libofx library.
Comment 7 Marco Sanchotene 2022-02-09 15:05:33 UTC
I have the same package version here:

libofx7:amd64                                 1:0.9.15-3build1

But the ofxdump command on the sample file produces the following here:

ofx_proc_statement():
    Currency: BRL
    Account ID: 0300  0000000000
    Start date of this statement: Wed Dec 31 20:59:59 1969 -03
    End date of this statement: Wed Dec 31 20:59:59 1969 -03
    Ledger balance: 643.69
    Ledger balance date: Wed Dec 31 20:59:59 1969 -03
Comment 8 Stephane MANKOWSKI 2022-02-09 17:19:59 UTC
(In reply to Marco Sanchotene from comment #7)
> I have the same package version here:
> 
> libofx7:amd64                                 1:0.9.15-3build1
> 
> But the ofxdump command on the sample file produces the following here:
> 
> ofx_proc_statement():
>     Currency: BRL
>     Account ID: 0300  0000000000
>     Start date of this statement: Wed Dec 31 20:59:59 1969 -03
>     End date of this statement: Wed Dec 31 20:59:59 1969 -03
>     Ledger balance: 643.69
>     Ledger balance date: Wed Dec 31 20:59:59 1969 -03

I don't know why, but there is something wrong on your system because the date is not the good one.
This is not due to Skrooge.
This could be due to libofx or something in your system or locale.
I don't know how to help you more.
I will close this ticket.
Comment 9 Marco Sanchotene 2022-02-09 21:22:14 UTC
Yes, it was something related to locale. After experimenting with the settings I was able to import the OFX file with the correct date.

This is what I did:

1. I changed the region from en_US.UTF-8 to pt_BR.UTF-8 as the numbers, time, currency and measurement settings were all pt_BR.UTF-8.
2. I rebooted.
3. I imported the OFX file.
4. The date was still wrong.
5. I changed the region setting back to en_US.UTF-8 and left the others with pt_BR.UTF-8.
6. I rebooted.
7. I imported the OFX file.
8. The date was correct.

Thanks for all the help and apologies for not thinking this could be related to my settings. In any case, this can be useful if someone faces the same issue in the future.