kevinpapst / importbundle Goto Github PK
View Code? Open in Web Editor NEWA Kimai plugin to import data from the Web UI
Home Page: https://www.kimai.org/store/keleo-importer-bundle.html
License: Other
A Kimai plugin to import data from the Web UI
Home Page: https://www.kimai.org/store/keleo-importer-bundle.html
License: Other
I found a lot of "TODOs" in the importer documentation at https://www.kimai.org/documentation/plugin-import.html#timesheets and as I couldn't find a documentation repository where a pull request could have been made I contribute as follows:
Attribute | Supported field names |
---|---|
Duration | Timesheet duration in seconds |
Tags | Comma separated list of tag-names |
Exported | Whether the timesheet should be marked as exported or not (1 or 0) |
Rate | The rate as an integer |
HourlyRate | The hourly rate as an integer |
InternalRate | The internal rate as an integer |
FixedRate | The fixed rate as an integer |
Billable | Whether the entry should be marked as billable or not (1 or 0) |
Description | Description of the entry as string |
Project | Name of the project as string |
Customer | Name of the customer as string |
Activity | Name of the activity as string |
Begin | Start time in the following format: HH:MM:SS |
End | End time in the following format: HH:MM:SS |
Date | Date in the following format: YYYY-MM-DD |
From | TODO … |
To | TODO … |
User | Username |
User email (required when creating users) |
Also for copy & paste:
| Attribute | Supported field names |
| --- | --- |
| Duration | Timesheet duration in seconds |
| Tags | Comma separated list of tag-names |
| Exported | Whether the timesheet should be marked as exported or not (1 or 0) |
| Rate | The rate as an integer |
| HourlyRate | The hourly rate as an integer |
| InternalRate | The internal rate as an integer |
| FixedRate | The fixed rate as an integer |
| Billable | Whether the entry should be marked as billable or not (1 or 0) |
| Description | Description of the entry as string |
| Project | Name of the project as string |
| Customer | Name of the customer as string |
| Activity | Name of the activity as string |
| Begin | Start time in the following format: `HH:MM:SS` |
| End | End time in the following format: `HH:MM:SS` |
| Date | Date in the following format: `YYYY-MM-DD` |
| From | TODO … |
| To | TODO … |
| User | Username |
| Email | User email (required when creating users) |
Unfortunately I don't know hat the To and From fields are for so I couldn't explain them. Also the Tags
field was mentioned twice in the documentation – I removed one of them.
This is just a small bug which I tested with a recent installation of Kimai Docker, with the newest Importer plugin version and with the CSV import. Don't know if the JSON import is affected too.
If the project name contains a dash (e.g. like in the German word IT-Dienstleistungen
) the Importer plugin always creates a new project for all timesheet entries with this name on each import.
What I did:
I precreated a project named IT-Dienstleistungen
in Kimai and specified the same project name in my CSV file. But the Importer always creates a new project named IT-Dienstleistungen
which is linked to the specific customer for every import (not every record).
As soon as I remove the dash from the precreated project name and adjust the CSV file accordingly it behaves correctly and appends the records to the already existing project in Kimai.
2.9.0
Docker
Full error message shown while reloading Kimai :
[ERROR] Cannot autowire service "KimaiPlugin\ImportBundle\Command\KimaiImporterCommand": argument "$passwordHasher" of method "__construct()" has type "Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface" but this class was not found.
Hi Kevin,
I've tried too many times to import a .csv and .json file with Timesheet data and I can't make it work.
Kimai version: 1.30.0 stable
Plugin version: 1.22 (I understand this is the correct version with my Kimai version).
I get three errors consistently.
I have also download the sample file Kimai offers and it upload fine as a preview, than took my data and placed it in the sample file and it throws Error 2.
In the sample file I have written new data from scratch and I get the same Error 2.
I use LibreOffice, I have also placed the data modified several way in Google Spreadsheets and downloaded the .csv and I get the same error.
I have stopped many times troubleshooting this whilst I was writing this issue and I'm sorry to say, I had no luck in solving it.
By the way, in the sample file, the "Tag" data is written over the next two columns so the the info of the "rate columns" are pushed to the right, like so:
When this sample file is uploaded with data and column not coinciding it throws no error and I have noticed that it writes the info correctly in the Preview, which shouldn't actually be correct and should throw an error.
The sample file works only if used as is originally, as soon as I save it, even when only duplicated the data contained in the sample file, it throws Error 1.
I've kept the shift in the columns where the tags were spread over 3 columns and didn't work either.
I can only think there must be an error in my data, but I'm too tired to look through it now. There are 398 rows with entries. This data I have exported from Kimai 1.11
Thanks for reading.
I'm using ImportBundle version 2.5.0.
When I import timesheet entries from a CSV file and some of them contain errors, the correct rows are imported into Kimai nonetheless.
The import should not be committed to the database when any rows contain errors.
If the database transaction is rolled back, I can fix the errors in the CSV file and re-upload it.
Otherwise I either
While I'm preparing the migration of my old time sheets to Kimai I came across the fact that the rate is not being calculated automatically during import.
So my current workflow looks like this:
duration
in seconds from the From
and To
fields (=RUNDEN(ZAHLWERT(C2-B2)*86400)
), taking the value from this field and the hourlyrate
field to calculate the rate
field (=D2/60/60*M2
). As this value needs to be in the US format (.
instead of ,
) I have to change the display format accordingly tooIf I don't specify the field rate
, it is set to 0 in Kimai. The same goes for the hourlyrate
field. My expectation (and also my hope) was, that those values would be picked from the customer / project / activity automatically like how Kimai behaves when I create a new time entry from the GUI.
If I edit the imported entry (where the rate
field was set to 0 automatically because it was not specified) and change something the rate field gets (re)calculated automatically. But that's not a solution for me because I don't want to touch each entry manually.
So the question is:
Is there a way to prevent the necessity to precalculate the rate before importing the timesheet into Kimai and letting Kimai calculate this field automatically like it does if I create a new entry using the GUI?
I have an existing installation of Kimai running on CentOS 6.7 with PHP 7.1 and MySQL 5.1.73.
I recently installed Kimai 2.15 on Debian 12 with PHP 8.2.18 and MariaDB 10.11.6.
Using the instructions found here: https://www.kimai.org/documentation/installation.html I installed kimai using the SSH method.
I then used the instructions found here: https://www.kimai.org/documentation/migration-v1.html to migrate the data over.
Took a couple tries, but I finally got the data migrated. With each attempt I did drop and re-install the Kimai DB schema.
After the data migrated without any errors, I found that two, sometimes three, Activities were created for each activity that existed on the old system. It would appear that all related Timesheet entries are associated to only one instance of the duplicated Activities and the duplicate entries appear to have zero time being tracked.
Any suggestions on where to look start looking in the ImportBundle code base to fix this would be greatly appreciated?
git clone https://github.com/kevinpapst/ImportBundle.git ImportBundle
bin/console kimai:reload --env=prod
And then I see the following error:
[ERROR] Cannot autowire service
"KimaiPlugin\ImportBundle\Command\KimaiImporterCommand": argument
"$passwordHasher" of method "__construct()" has type
"Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface"
but this class was not found.
I have some different Customers and they have the same Project Name, e.g.
Customer | Project | Activities
Customer1 | Service | Remote Support
Customer2 | Service | Remote Support
Customer3 | Service | Remote Support
As i understand, i can set the Activities as Global. But the Projects are always Customer related, but I can use the same name multiple times. The Project ID is different from each one.
Unfortunately, this circumstance causes an error during import.
The importer cannot assign the Project and then wants to create a new Project for this Customer. Also with the same name as the existing Project.
I also tried to import the CSV file with the Project ID shown in the URL, but the importer doesn't seem to recognize the Project ID.
In my case the importer cannot be used because I have to use the same Project names for multiple Customers.
Maybee it's possible to import in the future via Project ID and not only with the Project Name.
Then I upload a CSV timesheet, I can only see the "raw" values as they are stored in the file in the preview.
This, unfortunately, makes some errors like kimai/kimai#4398 only visible after all rows have been imported into Kimai.
When importing many entries at once into a non-empty database this can lead to a lot of manual corrective effort.
Please consider improving the preview to show the processed values of the columns instead.
Hello, thanks for the great work on kimai!
I have a problem installing ImportBundle (using git).
After cloning the repo and running
/opt/RZphp81/bin/php-cli bin/console cache:clear --env=prod
I get this error:
Cannot autowire service "KimaiPlugin\ImportBundle\Command\KimaiImporterCommand": argument "$passwordHasher" of method "__construct()" has type "Symfony\Co
mponent\PasswordHasher\Hasher\UserPasswordHasherInterface" but this class was not found.
I'm using a Strato webspace
Example file attached
DetailedExport_2023-05-27.csv
Kimai 2.0.0
CSV Importer 2.0.1
Download the CSV example files from the importer page. Try to upload them. It does not work:
Unsupported file given
JSON does work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.