Git Product home page Git Product logo

importbundle's People

Contributors

kevinpapst avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

laverma

importbundle's Issues

[Improvement] CSV attribute documentation for Importer

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
Email 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.

If project with same name exists multiple times, importer will create even more

Describe the issue

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.

Kimai version

2.9.0

How do you run Kimai?

Docker

Importing project creates duplicates customers?

Hello,

I want to import a list of projects with customers.
Importer shows to create 254 projects but also the same amount of customers.
But some customers have multiple projects. Will the customers really be imported multiple times?

THX and best wishes

Niels

Monosnap Kimai – Zeiterfassung 2024-04-16 08-10-52

Getting different errors when using Importer v1.22

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.

  1. "The header record contains duplicate column names." - I get this one when uploading the file without "Date, User..." headers. I thought it might be becasue many columns are empty, so I made sure that the first row with data had all cells filled in. Although the first row with data shouldn't act as a header, except if it contains the header titles (Date, User, etc.).
  2. "Something is wrong
    A critical error occurred, please try again. You may have found a software problem, please contact your administrator if the problem persists." This happens on different ocassions, I lost count of the circumstances of each edit I made to the data.
  3. "Could not find matching importer". This I can only imagine it's because it can't find any actual headers (Data, User, etc.). Which wouldn't make sense, because it throws this error having the header row in the file.

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:
image

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.
image

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.

Abort when rows contain errors

Describe the problem

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.

Describe the solution you'd like

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

  • need to delete all newly imported timesheet entries from Kimai (manually), or
  • find and separate the faulty rows from the CSV to only re-upload those again.

[Question] Is it possible that the rate gets calculated automatically on import?

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:

  • I have to turn my old time entries with a regex into a CSV template
  • I open this CSV in LibreOffice Calc (German language settings in LibreOffice) and add two formulars for calculating the 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 too
  • After all those changes the imported entries look exactly like a new entry I would have created in Kimai

If 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?

Duplicate Activities created when migrating from v1.3.1.1394 to v2.15

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?

Importing fails if two or more Customer use the same Project Name

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.

Show processed values in preview

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.

Installation problem

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

Import of CSV files not working

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.