fix(hr): ensure positive workedHours and robust HD detection
This commit is contained in:
@@ -915,7 +915,10 @@ class AttendanceRecordController extends Controller
|
||||
if ($out->lt($in)) {
|
||||
$out->addDay();
|
||||
}
|
||||
$workedHours = $out->diffInMinutes($in) / 60;
|
||||
$workedHours = (float)abs($out->diffInMinutes($in) / 60);
|
||||
} else {
|
||||
// Fallback to record's total hours if available
|
||||
$workedHours = (float)($record->total_hours ?? 0);
|
||||
}
|
||||
|
||||
$recordDetail = [
|
||||
|
||||
Reference in New Issue
Block a user