Improve allowed running records (#528)

This commit is contained in:
Kevin Papst
2019-01-29 20:45:04 +01:00
committed by GitHub
parent fe4c3c10d6
commit 974806d145
4 changed files with 14 additions and 8 deletions

View File

@@ -194,10 +194,13 @@ class TimesheetController extends BaseApiController
}
}
$this->repository->stopActiveEntries(
$timesheet->getUser(),
$this->hardLimit
);
if (null === $timesheet->getEnd()) {
$this->repository->stopActiveEntries(
$timesheet->getUser(),
$this->hardLimit
);
}
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($timesheet);
$entityManager->flush();