feat: bootstrap JOBcard CRM foundation

This commit is contained in:
Marco0300
2026-09-01 18:54:47 +02:00
commit 480494c5ed
31 changed files with 1300 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
function calculate_duration_hours(?string $start, ?string $end, ?float $manualHours = null): ?float
{
if ($manualHours !== null) {
return $manualHours >= 0 ? round($manualHours, 2) : null;
}
if ($start === null || $end === null || !preg_match('/^\d{2}:\d{2}$/', $start) || !preg_match('/^\d{2}:\d{2}$/', $end)) {
return null;
}
[$startHour, $startMinute] = array_map('intval', explode(':', $start));
[$endHour, $endMinute] = array_map('intval', explode(':', $end));
if ($startHour > 23 || $endHour > 23 || $startMinute > 59 || $endMinute > 59) return null;
$minutes = ($endHour * 60 + $endMinute) - ($startHour * 60 + $startMinute);
return $minutes > 0 ? round($minutes / 60, 2) : null;
}