Kimai2: Ex- and import with timelogs crossing day-edges results in inconsistent state

Created on 3 Nov 2020  路  5Comments  路  Source: kevinpapst/kimai2

Describe the bug
In order to switch from SQLite to MariaDB I exported all entries via the web form and imported the generated CSV with the bin/console command. The result of the import task was successful. I have a small Python script to calculate my overtime hours and I noticed a difference of > 13 hours. Diffing the generted CSV files (with my overtime hours) pointed me to a time entry starting at 02.07.2020 22:00 and reaching until 03.07.2020 00:45. On the old database (entry created via web) it was correct. After importing all timesheets via the bin/console command this one entry overlapping two days resulted in just displaying a question mark (?) with effectively no duration.

To Reproduce

  1. Create a time entry overlapping two days via the web page
  2. Export the entry (entries)
  3. Import the entry/entries (on e.g. another server) via bin/console command

Logfile
Unfortunateily there is nothing in the log file.

Additional context

  • Kimai version: 1.10.2
  • PHP version: 7.4.11
  • Device: Fedora notebook
  • Browser Firefox 82.0
bug

All 5 comments

The importer was massively changed in 1.11.
Please try 1.11 and if the behavior still exist: please share the CSV and I will have a look.

I can reproduce on a new installation with Kimai 1.11 (Docker image: kimai/kimai2:apache-debian-1.11-prod).
The line in question is as follows.

"Date","From","To","Duration","Rate","Internal rate","User","Name","Customer","Project","Activity","Description","Exported","Tags","Hourly rate","Fixed rate"
"2020-07-02","22:00","00:45","9900","0","0","My Name","my.username","Customer Name","Project name","Activity Name","Bla bla","Open","","0",""

By the way - could it be that "User" and "Name" are interchanged in export and import? I had to do some manual adjustments here. If this is the case I'll gladly create a new ticket.

I'll have a look, thanks for the details

Can you please test the change in #2098 - seems to do the trick with the test row.
But maybe there are other combinations which I didn't see.

I just realized I commented on the PR instead of the issue. Confirmed my problem is fixed, thank you very much!

Was this page helpful?
0 / 5 - 0 ratings