Compare commits
2 Commits
1ebada1787
...
a383aa00ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a383aa00ed | ||
|
|
f96667ee26 |
@@ -170,6 +170,22 @@ class ProductionPlanResource extends Resource
|
|||||||
$set('ppLineError', 'Production plan already updated.');
|
$set('ppLineError', 'Production plan already updated.');
|
||||||
return;
|
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);
|
$set('ppLineError', null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,18 @@ class ShiftResource extends Resource
|
|||||||
}
|
}
|
||||||
else
|
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);
|
$set('sDurationError', null);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user