Removed commented text in shift resource

This commit is contained in:
dhanabalan
2025-03-31 21:23:21 +05:30
parent 9ce3b34f75
commit d107f1be18

View File

@@ -41,7 +41,6 @@ class ShiftResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
$set('block_id', null); $set('block_id', null);
// Ensure `linestop_id` is not cleared
if (!$plantId) { if (!$plantId) {
$set('sPlantError', 'Please select a plant first.'); $set('sPlantError', 'Please select a plant first.');
return; return;
@@ -79,7 +78,6 @@ class ShiftResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$blockId = $get('block_id'); $blockId = $get('block_id');
$set('name', null); $set('name', null);
// Ensure `linestop_id` is not cleared
if (!$blockId) { if (!$blockId) {
$set('sBlockError', 'Please select a block first.'); $set('sBlockError', 'Please select a block first.');
return; return;
@@ -101,7 +99,6 @@ class ShiftResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$nameId = $get('name'); $nameId = $get('name');
$set('start_time', null); $set('start_time', null);
// Ensure `linestop_id` is not cleared
if (!$nameId) { if (!$nameId) {
$set('sNameError', 'Scan the valid name.'); $set('sNameError', 'Scan the valid name.');
return; return;
@@ -128,7 +125,6 @@ class ShiftResource extends Resource
$nameId = $get('start_time'); $nameId = $get('start_time');
// $set('duration', null); // $set('duration', null);
$set('end_time', self::calculateEndTime($state, $get('duration'))); $set('end_time', self::calculateEndTime($state, $get('duration')));
// Ensure `linestop_id` is not cleared
if (!$nameId) { if (!$nameId) {
$set('sStartTimeError', 'Choose the valid start time.'); $set('sStartTimeError', 'Choose the valid start time.');
return; return;
@@ -158,7 +154,6 @@ class ShiftResource extends Resource
$duration = $get('duration'); $duration = $get('duration');
// $set('end_time', null); // $set('end_time', null);
$set('end_time', self::calculateEndTime($get('start_time'), $state)); $set('end_time', self::calculateEndTime($get('start_time'), $state));
// Ensure `linestop_id` is not cleared
if (!$duration) { if (!$duration) {
$set('sDurationError', 'Scan the valid duration.'); $set('sDurationError', 'Scan the valid duration.');
return; return;
@@ -182,7 +177,6 @@ class ShiftResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$endTime = $get('end_time'); $endTime = $get('end_time');
$set('end_time', self::calculateEndTime($get('start_time'), $state)); $set('end_time', self::calculateEndTime($get('start_time'), $state));
// Ensure `linestop_id` is not cleared
if (!$endTime) { if (!$endTime) {
$set('sEndTimeError', 'Choose the valid start time & duration.'); $set('sEndTimeError', 'Choose the valid start time & duration.');
return; return;