Bug 449580 - All operations imported from OFX file have 07/02/2106 as date
Summary: All operations imported from OFX file have 07/02/2106 as date
Status: RESOLVED DOWNSTREAM
Alias: None
Product: skrooge
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR major
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-04 00:53 UTC by Marco Sanchotene
Modified: 2022-02-09 21:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Sample file to reproduce issue (831 bytes, text/plain)
2022-02-06 22:26 UTC, Marco Sanchotene
Details
Screen capture (23.10 KB, image/png)
2022-02-07 19:36 UTC, Stephane MANKOWSKI
Details
OFX imported (21.51 KB, image/png)
2022-02-07 23:01 UTC, Marco Sanchotene
Details
traces (2.91 MB, text/plain)
2022-02-07 23:02 UTC, Marco Sanchotene
Details

Note You need to log in before you can comment on or make changes to this bug.
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.