added rounding rules and hourly rates factor #112 (#128)

* added unit tests and documentation #112
* fixed DashboardController
* added CONTRIBUTION guidelines
* fixed license year
This commit is contained in:
Kevin Papst
2018-02-07 12:51:00 +01:00
committed by GitHub
parent 65790f1fb7
commit 2e60e14132
22 changed files with 925 additions and 76 deletions

View File

@@ -1,6 +1,24 @@
kimai:
timesheet:
rounding: 15
# Rounding rules are used to round the begin & end dates and the duration for timesheet records.
# The "default" rule will round "begin" down and "end" up to the full minute, the "duration" will not be rounded.
# Please read var/docs/configurations.md to find out more about rounding rules
rounding:
default:
days: ['monday','tuesday','wednesday','thursday','friday','saturday','sunday']
begin: 1
end: 1
duration: 0
# If you want to apply different hourly rates for specific weekdays, you can uncomment the "rates" configuration.
# The "weekend" rule will add 50% to each timesheet entry that will be recorded on "saturdays" or "sundays".
# Please read var/docs/configurations.md to find out more about rates rules
# rates:
# weekend:
# days: ['saturday','sunday']
# factor: 1.5
invoice:
renderer:
default: 'App\Controller\InvoiceController::invoiceAction'

View File

@@ -33,7 +33,7 @@ services:
App\Invoice\ServiceInvoice:
class: App\Invoice\ServiceInvoice
arguments: ['%kimai.invoice%', '@service_container']
arguments: ['%kimai.invoice%']
# a route listener, that injects the locale through a URL directory
App\EventSubscriber\RedirectToLocaleSubscriber:
@@ -53,20 +53,14 @@ services:
tags:
- { name: doctrine.event_subscriber }
# updates timesheet records, to make sure they are calculated and can't be manipulated by the users
# updates timesheet records and apply configured rate & rounding rules
App\Doctrine\TimesheetSubscriber:
class: App\Doctrine\TimesheetSubscriber
arguments: [!tagged timesheet.calculator]
tags:
- { name: doctrine.event_listener, event: prePersist, lazy: true }
- { name: doctrine.event_listener, event: preUpdate, lazy: true }
# Uncomment the following lines to define a service for the Timesheet Doctrine repository
#
# app.timesheet_repository:
# class: Doctrine\ORM\EntityRepository
# factory: ['@doctrine.orm.entity_manager', getRepository]
# arguments: [App\Entity\Timesheet]
# ================================================================================
# FORMS
# ================================================================================
@@ -85,17 +79,12 @@ services:
App\Twig\Extensions:
arguments: ['%app_locales%']
# avanzu_admin_theme.navbar_task_listener:
# class: "%avanzu_admin_theme.navbar_task_listener.class%"
# tags:
# - { name: kernel.event_listener, event: theme.tasks, method: onListTasks }
#
# avanzu_admin_theme.navbar_notify_listener:
# class: "%avanzu_admin_theme.navbar_notify_listener.class%"
# tags:
# - { name: kernel.event_listener, event: theme.notifications, method: onListNotifications }
#
# avanzu_admin_theme.navbar_msg_listener:
# class: "%avanzu_admin_theme.navbar_msg_listener.class%"
# tags:
# - { name: kernel.event_listener, event: theme.messages, method: onListMessages }
# ================================================================================
# TIMESHEET RECORD CALCULATOR
# ================================================================================
App\Timesheet\Calculator\DurationCalculator:
arguments: ["%kimai.timesheet.rounding%"]
App\Timesheet\Calculator\RateCalculator:
arguments: ["%kimai.timesheet.rates%"]