2 Commits

Author SHA1 Message Date
dhanabalan
a383aa00ed Shift hidden id column added to update 2025-03-31 22:08:31 +05:30
dhanabalan
f96667ee26 Shift duration 24 hour exceeds warning added 2025-03-31 22:05:35 +05:30
2 changed files with 28 additions and 0 deletions

View File

@@ -170,6 +170,22 @@ class ProductionPlanResource extends Resource
$set('ppLineError', 'Production plan already updated.');
return;
}
else
{
$shiftId = \App\Models\Shift::where('id', $get('shift_id'))
->first();
if($shiftId->start_time > $shiftId->end_time)
{
$set('ppLineError', 'End time goes tomorrow...');
return;
}
else
{
$set('ppLineError', 'End time is within today...');
return;
}
}
}
$set('ppLineError', null);
}

View File

@@ -160,6 +160,18 @@ class ShiftResource extends Resource
}
else
{
[$hRs, $miNs] = explode('.', $duration) + [0, 0]; // Ensure two parts
$hRs = (int) $hRs;
$miNs = (int) $miNs;
$totalMinutes = $hRs * 60 + $miNs;
if ($totalMinutes > 1440) {
$set('sDurationError', 'Duration exceeds 24 hours.');
$set('duration', null);
$set('end_time', null);
return;
}
$set('sDurationError', null);
}
})