rounding rules via admin screen, round begin when starting record (#1229)

This commit is contained in:
Kevin Papst
2019-11-10 13:57:05 +01:00
committed by GitHub
parent fa1c79e15c
commit c6c4098759
47 changed files with 1100 additions and 185 deletions

View File

@@ -10,10 +10,21 @@
namespace App\Timesheet\TrackingMode;
use App\Entity\Timesheet;
use App\Timesheet\UserDateTimeFactory;
use Symfony\Component\HttpFoundation\Request;
class PunchInOutMode implements TrackingModeInterface
final class PunchInOutMode implements TrackingModeInterface
{
/**
* @var UserDateTimeFactory
*/
private $dateTime;
public function __construct(UserDateTimeFactory $dateTime)
{
$this->dateTime = $dateTime;
}
public function canEditBegin(): bool
{
return false;
@@ -36,6 +47,9 @@ class PunchInOutMode implements TrackingModeInterface
public function create(Timesheet $timesheet, Request $request): void
{
if (null === $timesheet->getBegin()) {
$timesheet->setBegin($this->dateTime->createDateTime());
}
}
public function getId(): string