automatic billable calculation (#3200)

This commit is contained in:
Kevin Papst
2022-03-18 22:31:50 +01:00
committed by GitHub
parent f7480902b4
commit 30c7782d6e
34 changed files with 409 additions and 53 deletions

View File

@@ -455,6 +455,7 @@ abstract class TimesheetAbstractController extends AbstractController
'action' => $this->generateUrl($this->getMultiUpdateRoute(), []),
'method' => 'POST',
'include_exported' => $this->isGranted($this->getPermissionEditExport()),
'include_billable' => $this->isGranted($this->getPermissionEditBillable()),
'include_rate' => $this->isGranted($this->getPermissionEditRate()),
'include_user' => $this->includeUserInForms('multi'),
]);
@@ -482,6 +483,7 @@ abstract class TimesheetAbstractController extends AbstractController
'action' => $action,
'include_rate' => $this->isGranted('edit_rate', $entry),
'include_exported' => $this->isGranted('edit_export', $entry),
'include_billable' => $this->isGranted('edit_billable', $entry),
'include_user' => $this->includeUserInForms('create'),
'allow_begin_datetime' => $mode->canEditBegin(),
'allow_end_datetime' => $mode->canEditEnd(),
@@ -510,6 +512,7 @@ abstract class TimesheetAbstractController extends AbstractController
]),
'include_rate' => $this->isGranted('edit_rate', $entry),
'include_exported' => $this->isGranted('edit_export', $entry),
'include_billable' => $this->isGranted('edit_billable', $entry),
'include_user' => $this->includeUserInForms('edit'),
'allow_begin_datetime' => $mode->canEditBegin(),
'allow_end_datetime' => $mode->canEditEnd(),
@@ -549,6 +552,11 @@ abstract class TimesheetAbstractController extends AbstractController
return 'edit_export_own_timesheet';
}
protected function getPermissionEditBillable(): string
{
return 'edit_billable_own_timesheet';
}
protected function getPermissionEditRate(): string
{
return 'edit_rate_own_timesheet';