Updated validations and success durations and added serial_number maximum length should be 20 digit and clear field if invalid input
This commit is contained in:
@@ -128,7 +128,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
if ($serialNo && $scanLocator )
|
||||
if ($serialNo && $scanLocator)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -146,8 +146,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -167,8 +167,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -191,8 +191,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -269,14 +269,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -334,7 +334,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
if ($palletNo && $scanLocator )
|
||||
if ($palletNo && $scanLocator)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if ($palletNo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -351,19 +355,19 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
else if (strlen($serialNo) < 9 || strlen($serialNo) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -372,9 +376,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -388,13 +392,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -412,22 +417,23 @@ class LocatorValidation extends Page implements HasForms
|
||||
if ($invoicesnoexists)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$existingRecord = PalletValidation::where('plant_id', $plantId)
|
||||
@@ -464,9 +470,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -532,9 +538,12 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
$this->locators = PalletValidation::where('plant_id', $plantId)
|
||||
->where('locator_number', '11111')
|
||||
->get();
|
||||
$this->locators = PalletValidation::where('plant_id', $plantId)->where('locator_number', '11111')->get();
|
||||
|
||||
if (!$palletNo && !$serialNo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($scanLocator == null || $scanLocator == '')
|
||||
{
|
||||
@@ -550,7 +559,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -571,7 +580,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -603,7 +612,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -631,7 +640,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -658,8 +667,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -687,8 +696,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -714,7 +723,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -762,10 +771,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
else if (strlen($serialNo) < 9 || strlen($serialNo) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -774,9 +783,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -795,9 +804,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -815,7 +824,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
if ($invoicesnoexists)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -824,14 +833,13 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -851,15 +859,38 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if ($serialExist && $serialExist->pallet_number && $serialExist->pallet_number != null && $serialExist->pallet_number != '')
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in pallet number '{$serialExist->pallet_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
//heretocontinue
|
||||
|
||||
if ($serialExist && $serialExist->locator_number == $scanLocator)
|
||||
{
|
||||
@@ -918,6 +949,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
if (!$palletNo && !$serialNo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($scanLocator == null || $scanLocator == '') {
|
||||
Notification::make()
|
||||
->title("Locator number can't be empty!")
|
||||
@@ -931,7 +967,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -978,7 +1014,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1003,7 +1039,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1026,8 +1062,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1050,8 +1086,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1079,8 +1115,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1107,8 +1143,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1131,7 +1167,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned pallet number '$palletNo' added into locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$locator = Locator::where('locator_number', $scanLocator)
|
||||
@@ -1170,13 +1206,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1186,7 +1223,6 @@ class LocatorValidation extends Page implements HasForms
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($serialNo == '' || $serialNo == null) {
|
||||
Notification::make()
|
||||
->title("Serial number is required to add when pallet number is empty.")
|
||||
@@ -1198,19 +1234,19 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
else if (strlen($serialNo) < 9 || strlen($serialNo) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1219,9 +1255,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1240,9 +1276,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1251,16 +1287,16 @@ class LocatorValidation extends Page implements HasForms
|
||||
}
|
||||
|
||||
$invoicesnoexists = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||
->where('serial_number', $serialNo)
|
||||
->where('scanned_status', '=','Scanned')
|
||||
->first();
|
||||
->where('serial_number', $serialNo)
|
||||
->where('scanned_status', '=','Scanned')
|
||||
->first();
|
||||
|
||||
$invoiceNo = $invoicesnoexists?->invoice_number;
|
||||
|
||||
if ($invoicesnoexists)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1269,9 +1305,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1280,10 +1316,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
}
|
||||
|
||||
$palletexists = PalletValidation::where('plant_id', $plantId)
|
||||
->where('serial_number', $serialNo)
|
||||
->where('pallet_number', '!=', '')
|
||||
->where('pallet_number', '!=', null)
|
||||
->first();
|
||||
->where('serial_number', $serialNo)
|
||||
->where('pallet_number', '!=', '')
|
||||
->where('pallet_number', '!=', null)
|
||||
->first();
|
||||
|
||||
if($palletexists)
|
||||
{
|
||||
@@ -1297,9 +1333,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1325,9 +1361,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1360,7 +1396,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned serial number '$serialNo' added into locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
// $count = PalletValidation::where('plant_id', $plantId)
|
||||
@@ -1406,6 +1442,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
if (!$palletNo && !$serialNo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($scanLocator == null || $scanLocator == '') {
|
||||
Notification::make()
|
||||
->title("Locator number can't be empty!")
|
||||
@@ -1419,7 +1460,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1440,7 +1481,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1466,7 +1507,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1489,8 +1530,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1499,7 +1540,6 @@ class LocatorValidation extends Page implements HasForms
|
||||
}
|
||||
|
||||
$Palletexists = PalletValidation::where('pallet_number', $palletNo)->where('plant_id', $plantId)->first();
|
||||
|
||||
if(!$Palletexists)
|
||||
{
|
||||
Notification::make()
|
||||
@@ -1513,8 +1553,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1542,8 +1582,8 @@ class LocatorValidation extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1571,7 +1611,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1665,7 +1705,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned pallet number '{$palletNo}' removed from locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,$scanLocator,$plantId);
|
||||
@@ -1704,7 +1744,6 @@ class LocatorValidation extends Page implements HasForms
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($serialNo == '' || $serialNo == null)
|
||||
{
|
||||
Notification::make()
|
||||
@@ -1717,19 +1756,19 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
else if (strlen($serialNo) < 9 || strlen($serialNo) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1738,9 +1777,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1759,9 +1798,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1775,11 +1814,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
->first();
|
||||
|
||||
$invoiceNo = $invoicesnoexists?->invoice_number;
|
||||
|
||||
if ($invoicesnoexists)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1788,9 +1826,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1804,7 +1842,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
if (!$exists) {
|
||||
Notification::make()
|
||||
->title("Serial number '{$serialNo}' does not exist in the pallet table to remove.")
|
||||
->title("Serial number '{$serialNo}' doesn't exist in the pallet table to remove.<br>Add serial number to proceed...")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1840,9 +1878,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1869,7 +1907,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -1890,7 +1928,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned serial number '{$serialNo}' removed from locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator', $scanLocator, $plantId);
|
||||
@@ -1907,7 +1945,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
else
|
||||
{
|
||||
Notification::make()
|
||||
->title("No matching record found for serial number '{$serialNo}'.")
|
||||
->title("Serial number failed to remove from locator number '$scanLocator'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1916,9 +1954,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_serial_no' => null,
|
||||
'scan_pallet_no' => null,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'scan_locator_no' => null,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Models\Locator;
|
||||
use App\Models\LocatorInvoiceValidation;
|
||||
use App\Models\PalletValidation;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
@@ -399,7 +400,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Add: Locator Serial Number')
|
||||
->body("Scanned locator serial number '$serialNo' successfully added into 'PALLET DATA' table.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
@@ -422,7 +423,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Remove: Locator Serial Number')
|
||||
->body("Scanned locator serial number '$removeserial' removed successfully from 'PALLET DATA' table.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
@@ -461,7 +462,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Add: Locator Serial Numbers')
|
||||
->body("Scanned locator number '$locatorNo' has '$serialLocator' locator serial numbers!<br>Successfully added into 'PALLET DATA' table.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(500)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
@@ -567,11 +568,11 @@ class PalletFromLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
else if (strlen($serialNo) < 9 || strlen($serialNo) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->body("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -619,23 +620,53 @@ class PalletFromLocator extends Page implements HasForms
|
||||
|
||||
if ($serialLocator == '' || $serialLocator == null)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Unknown: Serial Number')
|
||||
->body("Scanned serial number: '$serialNo' doesn't exist in pallet table.<br>Scan the valid exist locator-serial number to proceed..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$invoicesnoexists = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||
->where('serial_number', $serialNo)
|
||||
->where('scanned_status', '=','Scanned')
|
||||
->first();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'plant' => $plantId,
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => null,
|
||||
]);
|
||||
return;
|
||||
$invoiceNo = $invoicesnoexists?->invoice_number;
|
||||
|
||||
if ($invoicesnoexists)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'plant' => $plantId,
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => $count,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Notification::make()
|
||||
->title('Unknown: Serial Number')
|
||||
->body("Scanned serial number: '$serialNo' doesn't exist in pallet table.<br>Scan the valid exist locator-serial number to proceed..!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'plant' => $plantId,
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => $count,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
elseif ($serialLocator->pallet_number != '' && $serialLocator->pallet_number != null)
|
||||
{
|
||||
@@ -653,7 +684,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => null,
|
||||
'sno_quantity' => $count,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
@@ -770,16 +801,16 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Success: Pallet Generated')
|
||||
->body("Pallet number '$newPalletNumber' completed the master packing successfully!")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->duration(600)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'plant' => $plantId,
|
||||
'scan_locator_number' => $locatorNo,
|
||||
'scan_serial_number' => $serialNo,
|
||||
'scan_remove_sno' => $removeSerial,
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => 0,
|
||||
]);
|
||||
return;
|
||||
@@ -798,9 +829,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'plant' => $plantId,
|
||||
'scan_locator_number' => $locatorNo,
|
||||
'scan_serial_number' => $serialNo,
|
||||
'scan_remove_sno' => $removeSerial,
|
||||
'scan_locator_number' => null,
|
||||
'scan_serial_number' => null,
|
||||
'scan_remove_sno' => null,
|
||||
'sno_quantity' => 0,
|
||||
]);
|
||||
return;
|
||||
@@ -905,11 +936,11 @@ class PalletFromLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($removeSno) < 9)
|
||||
else if (strlen($removeSno) < 9 || strlen($removeSno) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$removeSno' must be at least 9 digits.")
|
||||
->body("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
@@ -234,7 +234,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
if ($serialNumber)
|
||||
{
|
||||
$excelSerials[] = $serialNumber;
|
||||
if (strlen($serialNumber) < 9) {
|
||||
if (strlen($serialNumber) < 9 || strlen($serialNumber) > 20) {
|
||||
$invalidSerial[] = $serialNumber;
|
||||
} elseif (!ctype_alnum($serialNumber)) {
|
||||
$invalidSerial[] = $serialNumber;
|
||||
@@ -253,7 +253,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
if (count($uniqueInvalidSerial) > 0) {
|
||||
Notification::make()
|
||||
->title('Invalid Serial Numbers Found')
|
||||
->body('The following serial numbers are invalid, length should contain minimum of 9 digits alpha numeric values:<br>' . implode(', ', $uniqueInvalidSerial))
|
||||
->body('The following serial numbers are invalid, length should contain minimum of 9 digits (and maximum 20 digits) alpha numeric values:<br>' . implode(', ', $uniqueInvalidSerial))
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -607,7 +607,6 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Storage::delete($fullPath);
|
||||
|
||||
if ($insertedCount > 0) {
|
||||
@@ -910,8 +909,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -929,16 +928,16 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($scanSno) < 9)
|
||||
else if (strlen($scanSno) < 9 || strlen($scanSno) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -947,7 +946,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -965,7 +964,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -985,7 +984,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1002,7 +1001,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1025,7 +1024,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1044,7 +1043,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1070,7 +1069,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1088,7 +1087,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1106,7 +1105,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1134,7 +1133,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1142,6 +1141,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$locatorQuantity = Locator::where('plant_id',$plantId)->where('locator_number', $scanLocator)->first();
|
||||
|
||||
$userName = Filament::auth()->user()->name;
|
||||
@@ -1170,8 +1170,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
}
|
||||
@@ -1196,8 +1196,6 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function viewLocator()
|
||||
{
|
||||
$plantId = $this->filters['plant_id'] ?? null;
|
||||
@@ -1243,9 +1241,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
else if ($scanSno && $scanLocator)
|
||||
{
|
||||
if (strlen($scanSno) < 9) {
|
||||
if (strlen($scanSno) < 9 || strlen($scanSno) > 20) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1254,7 +1252,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1272,7 +1270,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1291,7 +1289,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1313,7 +1311,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1338,7 +1336,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1361,8 +1359,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1381,8 +1379,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1399,8 +1397,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1409,9 +1407,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
else if ($scanSno)
|
||||
{
|
||||
if (strlen($scanSno) < 9) {
|
||||
if (strlen($scanSno) < 9 || strlen($scanSno) > 20) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1420,7 +1418,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1438,7 +1436,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1464,8 +1462,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1482,8 +1480,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1500,8 +1498,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1528,7 +1526,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1546,7 +1544,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1568,7 +1566,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1590,7 +1588,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1611,7 +1609,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1620,16 +1618,16 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1675,8 +1673,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1693,15 +1691,15 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($scanSno) < 9) {
|
||||
else if (strlen($scanSno) < 9 || strlen($scanSno) > 20) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->title("Serial number should contain minimum 9 digits and maximum 20 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
@@ -1710,7 +1708,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1728,7 +1726,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1747,7 +1745,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1765,7 +1763,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1785,7 +1783,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
@@ -1810,7 +1808,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1836,7 +1834,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
@@ -1859,8 +1857,8 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'scan_serial_number' => null,
|
||||
'scan_locator' => null,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user