fix billable calculation on timesheet restart (#3225)

This commit is contained in:
Kevin Papst
2022-03-29 23:24:22 +02:00
committed by GitHub
parent 2c2ba2e32c
commit 31743cf962
5 changed files with 204 additions and 32 deletions

View File

@@ -61,7 +61,8 @@ final class TimesheetLongRunningValidator extends ConstraintValidator
}
$duration = $timesheet->getEnd()->getTimestamp() - $timesheet->getBegin()->getTimestamp();
$minutes = (int) $duration / 60;
// float on purpose, because one second more than the configured minutes is already too long
$minutes = $duration / 60;
if ($minutes < $maxMinutes) {
return;