Giter Club home page Giter Club logo

deductiontimebundle's Introduction

Deduction time plugin for Kimai

Allows to configure activities as being a "deduction time". A deduction time means that the timesheet duration will be negative.

Deduction times can be edited, but the negative duration is not used in the UI and not saved!

It is always the calculated duration of end - start, which is then converted to its negative value.

Configure an activity

When editing any activity, you will see a new checkbox Deduction time. If this is checked, every future timesheet using this activity, will have negative durations.

When to use this plugin

If you are too lazy to create multiple records per day, but instead want to record entire days (attendance) and use those to create invoices/exports, you find yourself with too many hours on the clock.

You could manually subtract breaks from every day OR you use this plugin.

  1. Allow overlapping records in System > Configuration
  2. Create a global activity "break time" and activate the Deduction time checkbox
  3. Use that new activity to record your employees break times, e.g. via calendar
  4. Safely export or invoice your times: due to the negative duration the break times will be subtracted from the attendance time

Installation

This plugin is compatible with the following Kimai releases:

Bundle version Minimum Kimai version
2.0 - 2.0.1 2.0.0
1.0 1.27.0

You find the most notable changes between the versions in the file CHANGELOG.md.

Download and extract the compatible release in var/plugins/ (see plugin docs).

The file structure needs to look like this afterwards:

var/plugins/
├── DeductionTimeBundle
│   ├── DeductionTimeBundle.php
|   └ ... more files and directories follow here ... 

And then rebuild the cache:

bin/console kimai:reload --env=prod

deductiontimebundle's People

Contributors

kevinpapst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deductiontimebundle's Issues

can't install / latest version

Hi,
I tried to install this bundle within two kimai installations and it neither showed up in extensions nor does the checkbox appear within any activities.
The folder DeductionTimeBundle and all files are visible within the var/plugins/ directory and the cache was reloaded.
kimai v2.4.1 (prod)
Any ideas?

compile error

while trying to install the plugin in a docker in environment with kimai 1.30.2

I got following message:

PHP Fatal error:  Declaration of KimaiPlugin\DeductionTimeBundle\Timesheet\Calculator\DeductionTimeCalculator::calculate(App\Entity\Timesheet $record, array $changeset): void must be compatible with App\Timesheet\CalculatorInterface::calculate(App\Entity\Timesheet $record) in /opt/kimai/var/plugins/DeductionTimeBundle/Timesheet/Calculator/DeductionTimeCalculator.php on line 19
07:54:25 CRITICAL  [php] Fatal Compile Error: Declaration of KimaiPlugin\DeductionTimeBundle\Timesheet\Calculator\DeductionTimeCalculator::calculate(App\Entity\Timesheet $record, array $changeset): void must be compatible with App\Timesheet\CalculatorInterface::calculate(App\Entity\Timesheet $record) ["exception" => Symfony\Component\ErrorHandler\Error\FatalError { …}]

In DeductionTimeCalculator.php line 19:

  Compile Error: Declaration of KimaiPlugin\DeductionTimeBundle\Timesheet\Cal
  culator\DeductionTimeCalculator::calculate(App\Entity\Timesheet $record, ar
  ray $changeset): void must be compatible with App\Timesheet\CalculatorInter
  face::calculate(App\Entity\Timesheet $record)

drag&drop in calendar not possible

Drag&Drop is not possible in the calendar view because the duration has stored a negative value.
An attempt leads to an error message: Validation Failed This value should be greater than or equal to 0.

image

Automatically deduct time based on how long you worked

First of all I wanted to drop a massive thanks to the Kimai project. It works great for me!

It would be helpful for me and my colleagues, if the time would be deducted automatically.

For example:
I have a 6 hour workday, I would like it to automatically deduct a 30 minute break from that day. I would then have worked for 5 hours and 30 minutes that day.

If I have a 8 hour workday, it should deduct a 45 minute break from that day. Basically I would work 7 hours and 15 minutes plus a 45 minute break.

Colleagues would be encouraged to take their breaks, since it would be deducted at the end of the day from their actual working hours.

Reporting for all users shows only total amount of deducted time

Much like #8, the time displayed in the Reporting -> Weekly view for all users page doesn't show negative time.

After reading this comment I've looked at Kimai's code and it seems that user_list_period_data.html.twig still has a > 0 check but I'm not sure if this is the right file for that specific reporting page.

I'm currently running Kimai's and the plugin's latest versions: 2.13.0 and 2.0.1, respectively.

Any help would be appreciated.

Thanks!

Reporting shows only total amount of deducted time

It would be great, if under Reporting the deducted time, would also be displayed under the day.
Right now I can only see how much time I spend in total on breaks but I cannot see, how long my break was for a certain day.

Working Hours Total Day 1 Day 2 Day 3 Day 4 Day 5
Working 40 9 7 8 8 8
Breaks -5
Working Hours Total 35 8 6 7 7 7

Deduction times XLSX export formatting.

Hi,

Exporting to XLSX with deduction times seems to be broken. In Kimai v1 there was a separate column for a deduction activity suck as "break"

In v2 now "break" is added into the row, and has an invalid time, it does not subtract the time as it does in the PDF

image

Installation Error Version: 1.30.1 stable (prod)

Hi,
I've installed this plugin on 1.29.1 stable (prod) for testing ... because of some issues I made a new installation the actual release 1.30.1 stable (prod).
The difference between two environment is, that 1.29 is running with php8.1 on ubuntu 20.04 and 1.30.1 with php8.2 on ubuntu 22.04.
The installation fails with following error ..

<<
PHP Fatal error: Declaration of KimaiPlugin\DeductionTimeBundle\Timesheet\Calculator\DeductionTimeCalculator::calculate(App\Entity\Timesheet $record, array $changeset): void must be compatible with App\Timesheet\CalculatorInterface::calculate(App\Entity\Timesheet $record) in /var/www/html/kimai/var/plugins/DeductionTimeBundle/Timesheet/Calculator/DeductionTimeCalculator.php on line 19'

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.