Added serial_number minimum length should be 9 digit and notification display duration and updated validations
This commit is contained in:
@@ -79,6 +79,7 @@ class InvoiceFinder extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Invoice number '$invoiceNo' can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||
$this->form->fill([
|
||||
@@ -100,11 +101,12 @@ class InvoiceFinder extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Invoice number '$invoiceNo' does not exist in locator invoice table!")
|
||||
->danger()
|
||||
->duration(2000)
|
||||
->send();
|
||||
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'scan_invoice' => $invoiceNo,
|
||||
'scan_invoice' => null,//$invoiceNo,
|
||||
'total_sno_quantity' => 0,
|
||||
'pending_quantity' => 0,
|
||||
'scan_quantity' => 0
|
||||
@@ -120,21 +122,22 @@ class InvoiceFinder extends Page implements HasForms
|
||||
|
||||
if(!$invoiceCompleted)
|
||||
{
|
||||
$count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||
->where('plant_id', $plantId)
|
||||
->count();
|
||||
// $count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||
// ->where('plant_id', $plantId)
|
||||
// ->count();
|
||||
Notification::make()
|
||||
->title("Invoice number '$invoiceNo' already completed the scanning process...")
|
||||
->title("Invoice number '$invoiceNo' already completed the scanning process..!")
|
||||
->success()
|
||||
->duration(2000)
|
||||
->send();
|
||||
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'scan_invoice' => $invoiceNo,
|
||||
'total_sno_quantity' => $count,
|
||||
'pending_quantity' => 0,
|
||||
'scan_quantity' => $count
|
||||
'scan_invoice' => null,//$invoiceNo,
|
||||
'total_sno_quantity' => 0,//$count,
|
||||
'pending_quantity' => 0,//0,
|
||||
'scan_quantity' => 0//$count
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
public $plantId;
|
||||
|
||||
public $scanLocator;
|
||||
|
||||
public $locators;
|
||||
|
||||
public array $filters = [];
|
||||
@@ -66,12 +67,13 @@ class LocatorValidation extends Page implements HasForms
|
||||
Section::make('')
|
||||
->schema([
|
||||
Select::make('plant_id')
|
||||
->options(Plant::pluck('name', 'id'))
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
->options(Plant::pluck('name', 'id'))
|
||||
->required(),
|
||||
TextInput::make('scan_pallet_no')
|
||||
->label('Scan Pallet No')
|
||||
->minLength(10)
|
||||
->reactive()
|
||||
// ->readonly(fn () => $this->disablePalletNo)
|
||||
->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_serial_no')) || !empty($get('scan_locator_no')))
|
||||
@@ -80,14 +82,16 @@ class LocatorValidation extends Page implements HasForms
|
||||
]),
|
||||
TextInput::make('scan_serial_no')
|
||||
->label('Scan Serial No')
|
||||
->minLength(9)
|
||||
->reactive()
|
||||
// ->readOnly(fn () => $this->disableSerialNo)
|
||||
->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no')))
|
||||
->reactive()
|
||||
->extraAttributes([
|
||||
'wire:keydown.enter' => 'processSerialNo($event.target.value)',
|
||||
]),
|
||||
TextInput::make('scan_locator_no')
|
||||
->label('Scan Locator No')
|
||||
->minLength(7)
|
||||
->reactive()
|
||||
->readOnly(fn (callable $get) => !$get('plant_id') || (!$get('scan_pallet_no') && !$get('scan_serial_no')))
|
||||
->extraAttributes([
|
||||
@@ -132,9 +136,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
if ($palletNo == null || $palletNo == '')
|
||||
{
|
||||
Notification::make()
|
||||
->title("Pallet number cannot be empty!")
|
||||
->title("Pallet number can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -148,13 +154,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($palletNo) < 10)
|
||||
else if (strlen($palletNo) < 10)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' must be at least 10 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -176,7 +183,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' does not found in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -258,6 +267,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' does not completed the master packing.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
@@ -300,6 +310,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$locatorNumber'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
|
||||
@@ -309,7 +320,6 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
public function processSerialNo($serialNo)
|
||||
{
|
||||
|
||||
$plantId = $this->form->getState()['plant_id'];
|
||||
|
||||
$plantId = trim($plantId) ?? null;
|
||||
@@ -329,12 +339,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($serialNo) < 13)
|
||||
if ($serialNo == null || $serialNo == '')
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 13 digits.")
|
||||
->title("Serial number can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -348,12 +360,33 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
if (!ctype_alnum($serialNo))
|
||||
$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;
|
||||
}
|
||||
else if (!ctype_alnum($serialNo))
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
@@ -381,6 +414,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->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
|
||||
@@ -417,6 +451,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned serial number '$serialNo' already exist in pallet number '$palletnumber'!<br>Scan the valid new serial number to proceed...")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
// $this->form->fill([
|
||||
@@ -449,6 +484,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$locatorNo'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
|
||||
@@ -497,15 +533,38 @@ class LocatorValidation extends Page implements HasForms
|
||||
$operatorName = Filament::auth()->user()->name;
|
||||
|
||||
$this->locators = PalletValidation::where('plant_id', $plantId)
|
||||
->where('locator_number', $scanLocator)
|
||||
->where('locator_number', '11111')
|
||||
->get();
|
||||
|
||||
if (strlen($scanLocator) < 7)
|
||||
if ($scanLocator == null || $scanLocator == '')
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => $serialNo,
|
||||
'scan_pallet_no' => $palletNo,
|
||||
'scan_locator_no' => $scanLocator,
|
||||
'pallet_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($scanLocator) < 7)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -529,6 +588,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '{$scanLocator}' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
// $this->form->fill([
|
||||
@@ -561,7 +621,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("No space available for locator number '{$scanLocator}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->form->fill
|
||||
@@ -577,6 +639,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
$this->locators = PalletValidation::where('plant_id', $plantId)
|
||||
->where('locator_number', $scanLocator)
|
||||
->get();
|
||||
|
||||
if ($palletNo)
|
||||
{
|
||||
if (strlen($palletNo) < 10)
|
||||
@@ -584,7 +650,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' must be at least 10 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -611,9 +679,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' does not completed the master packing.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -636,9 +705,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' is already assigned to locator number '{$locatorExist->locator_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -658,6 +728,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$scanLocator'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
else
|
||||
@@ -665,6 +736,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Add Pallet' button to add Pallet number : '$palletNo' into Locator number : '$scanLocator'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
}
|
||||
@@ -674,7 +746,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number is required to add or remove when pallet number is empty.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -688,13 +762,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($serialNo) < 13)
|
||||
else if (strlen($serialNo) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 13 digits.")
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -708,13 +783,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($serialNo))
|
||||
else if (!ctype_alnum($serialNo))
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -741,9 +817,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -767,7 +844,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' is already assigned to locator number '{$serialExist->locator_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -787,6 +866,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$scanLocator'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
else
|
||||
@@ -794,6 +874,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Press 'Add Serial Number' button to add Serial number : '$serialNo' into Locator number : '$scanLocator'..!")
|
||||
->info()
|
||||
->duration(2000)
|
||||
->send();
|
||||
}
|
||||
}
|
||||
@@ -839,9 +920,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
if ($scanLocator == null || $scanLocator == '') {
|
||||
Notification::make()
|
||||
->title("Locator number cannot be empty!")
|
||||
->title("Locator number can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -855,13 +938,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanLocator) < 7)
|
||||
else if (strlen($scanLocator) < 7)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -885,7 +969,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '{$scanLocator}' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -908,9 +994,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("No space available for locator number '{$scanLocator}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -931,9 +1018,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' must be at least 10 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -954,9 +1042,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' does not found in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -982,9 +1071,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' does not completed the master packing.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1010,9 +1100,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' is already added into locator number '{$alreadyAssigned->locator_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_no' => null,
|
||||
@@ -1031,16 +1122,18 @@ class LocatorValidation extends Page implements HasForms
|
||||
'locator_number' => $scanLocator,
|
||||
]);
|
||||
|
||||
$count = PalletValidation::where('plant_id', $plantId)
|
||||
->where('locator_number', $scanLocator)
|
||||
->count('locator_number');
|
||||
// $count = PalletValidation::where('plant_id', $plantId)
|
||||
// ->where('locator_number', $scanLocator)
|
||||
// ->count('locator_number');
|
||||
|
||||
if ($updatedRows > 0)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Scanned pallet number '$palletNo' added into locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$locator = Locator::where('locator_number', $scanLocator)
|
||||
->where('plant_id', $plantId)->first();
|
||||
$locator->increment('locator_quantity');
|
||||
@@ -1075,6 +1168,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("pallet number failed to add into locator number '$scanLocator'")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
@@ -1097,7 +1191,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number is required to add when pallet number is empty.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1111,13 +1207,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($serialNo) < 13)
|
||||
else if (strlen($serialNo) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 13 digits.")
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1131,13 +1228,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($serialNo))
|
||||
else if (!ctype_alnum($serialNo))
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1164,7 +1262,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->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
|
||||
([
|
||||
@@ -1190,7 +1290,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in pallet number '{$palletexists->pallet_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1216,7 +1318,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' already exists in locator number '{$exists->locator_number}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1256,6 +1360,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned serial number '$serialNo' added into locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
// $count = PalletValidation::where('plant_id', $plantId)
|
||||
@@ -1303,9 +1408,11 @@ class LocatorValidation extends Page implements HasForms
|
||||
|
||||
if ($scanLocator == null || $scanLocator == '') {
|
||||
Notification::make()
|
||||
->title("Locator number cannot be empty!")
|
||||
->title("Locator number can't be empty!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1319,13 +1426,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanLocator) < 7)
|
||||
else if (strlen($scanLocator) < 7)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1349,7 +1457,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '{$scanLocator}' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1371,7 +1481,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' must be at least 10 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1393,7 +1505,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' does not found in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1420,9 +1534,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' does not completed the master packing.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1447,9 +1562,10 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '$palletNo' is exists in locator number '$palletValidation->locator_number'<br>Scan the valid locator number to remove pallet number.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
$this->dispatch('loadLocator', '', $plantId);
|
||||
|
||||
$this->dispatch('loadLocator', '', $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1474,7 +1590,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Pallet number '{$palletNo}' doesn't exist in locator number.<br>Add locator number to proceed...")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1547,7 +1665,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned pallet number '{$palletNo}' removed from locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,$scanLocator,$plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1564,7 +1684,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("No matching pallet found or locator number already empty.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1583,11 +1705,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
else
|
||||
{
|
||||
|
||||
if ($serialNo == '' || $serialNo == null) {
|
||||
if ($serialNo == '' || $serialNo == null)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number is required to remove when pallet number is empty.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1601,13 +1726,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($serialNo) < 13)
|
||||
else if (strlen($serialNo) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must be at least 13 digits.")
|
||||
->title("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1621,13 +1747,14 @@ class LocatorValidation extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($serialNo))
|
||||
else if (!ctype_alnum($serialNo))
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$serialNo' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1654,7 +1781,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->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
|
||||
([
|
||||
@@ -1677,7 +1806,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '{$serialNo}' does not exist in the pallet table to remove.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1702,7 +1833,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '{$serialNo}' already exists in pallet number '$existsInPallet->pallet_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1727,7 +1860,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '{$serialNo}' exist in the locator number '$existsInPallet->locator_number'.<br>Scan the valid locator number to remove serial number.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1755,6 +1890,7 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Scanned serial number '{$serialNo}' removed from locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator', $scanLocator, $plantId);
|
||||
@@ -1773,7 +1909,9 @@ class LocatorValidation extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("No matching record found for serial number '{$serialNo}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadLocator' ,'',$plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1799,5 +1937,4 @@ class LocatorValidation extends Page implements HasForms
|
||||
{
|
||||
return Auth::check() && Auth::user()->can('create locator validation page');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
TextInput::make('scan_locator_number')
|
||||
->label('Scan Locator Number')
|
||||
->reactive()
|
||||
->minLength(7)
|
||||
->columnSpan(1)
|
||||
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_serial_number') || $get('scan_remove_sno'))
|
||||
->extraAttributes([
|
||||
@@ -101,6 +102,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
TextInput::make('scan_serial_number')
|
||||
->label('Scan Serial Number')
|
||||
->reactive()
|
||||
->minLength(9)
|
||||
->columnSpan(1)
|
||||
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_remove_sno'))
|
||||
->extraAttributes([
|
||||
@@ -109,6 +111,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
TextInput::make('scan_remove_sno')
|
||||
->label('Remove Serial Number')
|
||||
->reactive()
|
||||
->minLength(9)
|
||||
->columnSpan(1)
|
||||
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_serial_number') || count($this->records) <= 0)
|
||||
->extraAttributes([
|
||||
@@ -141,8 +144,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Scan Serial Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -159,8 +163,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Remove Serial Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -179,8 +184,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Locator Number')
|
||||
->body("Locator number can't be empty!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -198,8 +204,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Locator Number')
|
||||
->body("Locator number '$locatorNo' must be at least 7 digits.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -222,8 +229,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Unknown: Locator Number')
|
||||
->body("Locator number '$locatorNo' does not exist in the master.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -254,8 +262,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->body("Scanned locator number '$locatorNo' does not have any locator serial numbers to store into the pallet.<br>
|
||||
Please scan a valid stored locator number to proceed.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -273,8 +282,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Add: Locator Serial Numbers')
|
||||
->body("Scanned locator number '$locatorNo' has '".$serialLocator->count()."' locator serial numbers!<br>Do you want to store it into 'PALLET DATA' table?")
|
||||
->info()
|
||||
->seconds(2)
|
||||
->duration(2000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('open-confirm-modal', locatorNo: $locatorNo, plantId: $plantId);
|
||||
}
|
||||
}
|
||||
@@ -389,7 +399,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()
|
||||
->seconds(3)
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
@@ -412,7 +422,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()
|
||||
->seconds(3)
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
@@ -451,8 +461,9 @@ 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()
|
||||
->seconds(3)
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -471,8 +482,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Skipped: Locator Number')
|
||||
->body('Scan the new locator number to proceed..!')
|
||||
->info()
|
||||
->seconds(3)
|
||||
->duration(2000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -501,8 +513,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Scan Locator Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -519,8 +532,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Remove Serial Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -539,8 +553,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number can't be empty!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -552,14 +567,15 @@ class PalletFromLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNo) < 13)
|
||||
else if (strlen($serialNo) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$serialNo' must be at least 13 digits.")
|
||||
->body("Serial number '$serialNo' must be at least 9 digits.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -577,8 +593,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -606,8 +623,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->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()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -625,8 +643,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Scanned serial number: '$serialNo' already exist in pallet number '".$serialLocator->pallet_number."'.<br>Scan the valid locator-serial number to proceed..!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -657,8 +676,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Locator Serials Not Found')
|
||||
->body("Add some locator serial numbers to proceed generate pallet..!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -750,8 +770,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Success: Pallet Generated')
|
||||
->body("Pallet number '$newPalletNumber' completed the master packing successfully!")
|
||||
->success()
|
||||
->seconds(3)
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -770,8 +791,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Failed: Pallet Generated')
|
||||
->body("No locator serial number records found to generate pallet..!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -800,6 +822,7 @@ class PalletFromLocator extends Page implements HasForms
|
||||
// ->title('Pallet Generated')
|
||||
// ->body("Pallet number {$this->latestPalletNumber} assigned to all serials for locator {$locatorNo}")
|
||||
// ->success()
|
||||
// ->duration(1000)
|
||||
// ->send();
|
||||
// $this->dispatch('loadData', $this->records, $plantId);
|
||||
// $this->form->fill([
|
||||
@@ -828,8 +851,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Scan Locator Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -846,8 +870,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Press enter on "Scan Serial Number" field to proceed..!')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -866,8 +891,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number can't be empty!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -879,14 +905,15 @@ class PalletFromLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($removeSno) < 13)
|
||||
else if (strlen($removeSno) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$removeSno' must be at least 13 digits.")
|
||||
->body("Serial number '$removeSno' must be at least 9 digits.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -904,8 +931,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Invalid: Serial Number')
|
||||
->body("Serial number '$removeSno' must contain alpha-numeric values only.")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
@@ -936,8 +964,9 @@ class PalletFromLocator extends Page implements HasForms
|
||||
->title('Unknown: Serial Number')
|
||||
->body("Scanned serial number: '$removeSno' doesn't exist in 'PALLET DATA' table.<br>Scan the valid exist locator-serial number to proceed..!")
|
||||
->danger()
|
||||
->seconds(3)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $this->records, $plantId);
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
|
||||
@@ -69,6 +69,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
TextInput::make('scan_serial_number')
|
||||
->label('Scan Serial Number')
|
||||
->reactive()
|
||||
->minLength(9)
|
||||
->readOnly(fn (callable $get) => !$get('plant_id'))
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
@@ -82,6 +83,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
TextInput::make('scan_locator')
|
||||
->label('Scan Locator Number')
|
||||
->reactive()
|
||||
->minLength(7)
|
||||
->readOnly(fn (callable $get) => !$get('plant_id'))
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
@@ -122,11 +124,12 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
|
||||
$userName = Filament::auth()->user()->name;
|
||||
|
||||
if($plantId == '' || $plantId == null)
|
||||
if ($plantId == '' || $plantId == null)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -148,7 +151,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please upload a file!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -168,9 +173,11 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
{
|
||||
Notification::make()
|
||||
->title('Choose a proper Excel file')
|
||||
->danger()
|
||||
->body('The file must be an Excel file (xlsx, xls, csv).')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -190,7 +197,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('File not found after upload!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -225,7 +234,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
if ($serialNumber)
|
||||
{
|
||||
$excelSerials[] = $serialNumber;
|
||||
if (strlen($serialNumber) < 13) {
|
||||
if (strlen($serialNumber) < 9) {
|
||||
$invalidSerial[] = $serialNumber;
|
||||
} elseif (!ctype_alnum($serialNumber)) {
|
||||
$invalidSerial[] = $serialNumber;
|
||||
@@ -234,21 +243,21 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
|
||||
if ($locator) {
|
||||
$excelLocators[] = $locator;
|
||||
if (strlen($locator) > 7) {
|
||||
if (strlen($locator) < 7) {
|
||||
$invalidLocator[] = $locator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$uniqueInvalidSerial = array_unique($invalidSerial);
|
||||
$uniqueInvalidLocator = array_unique($invalidLocator);
|
||||
|
||||
if (count($uniqueInvalidSerial) > 0) {
|
||||
Notification::make()
|
||||
->title('Invalid Serial Numbers Found')
|
||||
->body('The following serial numbers are invalid, length should contain minimum of 13 digits alpha numeric values:<br>' . implode(', ', $uniqueInvalidSerial))
|
||||
->body('The following serial numbers are invalid, length should contain minimum of 9 digits alpha numeric values:<br>' . implode(', ', $uniqueInvalidSerial))
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -260,12 +269,15 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
$uniqueInvalidLocator = array_unique($invalidLocator);
|
||||
if (count($uniqueInvalidLocator) > 0) {
|
||||
Notification::make()
|
||||
->title('Invalid Locator Numbers Found')
|
||||
->body('The following locator numbers are invalid, length should contain minimum of 13 digits alpha numeric values:<br>' . implode(', ', $uniqueInvalidLocator))
|
||||
->body('The following locator numbers are invalid, length should contain minimum of 7 digits alpha numeric values:<br>' . implode(', ', $uniqueInvalidLocator))
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -298,7 +310,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Duplicate Serial Numbers in Excel')
|
||||
->body('The following serial numbers are duplicated in the file:<br>' . implode(', ', $duplicates))
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -310,8 +324,6 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$excelLocators = array_unique($excelLocators);
|
||||
$locatorsWithQuantityTwo = Locator::whereIn('locator_number', $excelLocators)
|
||||
->where('plant_id',$plantId)
|
||||
@@ -324,7 +336,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Locators with Insufficient Space')
|
||||
->body('The following locators does not have space:<br>' . implode(', ', $locatorsWithQuantityTwo))
|
||||
->warning()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('open-confirm-modal', locatorNo: $locator, plantId: $plantId);
|
||||
return;
|
||||
}
|
||||
@@ -342,7 +356,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Duplicate Serial Numbers Found')
|
||||
->body('The following serial numbers already exist and cannot be imported:<br>' . implode(', ', $existingSerials))
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId);
|
||||
return;
|
||||
}
|
||||
@@ -384,7 +400,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported successfully!')
|
||||
->body("{$insertedCount} locator serial number(s) have been imported.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -401,7 +419,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported Failed!')
|
||||
->body('No new serial number(s) found in the uploaded excel file..!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -420,11 +440,12 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
|
||||
$userName = Filament::auth()->user()->name;
|
||||
|
||||
if($plantId == '' || $plantId == null)
|
||||
if ($plantId == '' || $plantId == null)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -446,7 +467,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please upload a file!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -466,9 +489,11 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
{
|
||||
Notification::make()
|
||||
->title('Choose a proper Excel file')
|
||||
->danger()
|
||||
->body('The file must be an Excel file (xlsx, xls, csv).')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -488,7 +513,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('File not found after upload!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -544,8 +571,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Duplicate Serial Numbers Found')
|
||||
->body('The following serial numbers already exist and cannot be imported: ' . implode(', ', $existingSerials))
|
||||
->danger()
|
||||
->seconds(10)
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId);
|
||||
return;
|
||||
}
|
||||
@@ -587,7 +615,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported successfully!')
|
||||
->body("{$insertedCount} locator serial number(s) have been imported.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -604,7 +634,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported Failed!')
|
||||
->body('No new serial number(s) found in the uploaded excel file..!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -636,11 +668,12 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
|
||||
$userName = Filament::auth()->user()->name;
|
||||
|
||||
if($plantId == '' || $plantId == null)
|
||||
if ($plantId == '' || $plantId == null)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -662,7 +695,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please upload a file!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -682,9 +717,11 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
{
|
||||
Notification::make()
|
||||
->title('Choose a proper Excel file')
|
||||
->danger()
|
||||
->body('The file must be an Excel file (xlsx, xls, csv).')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -704,7 +741,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('File not found after upload!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -789,7 +828,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported successfully!')
|
||||
->body("{$insertedCount} locator serial number(s) have been imported.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -804,7 +845,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title('Serial Locators imported Failed!')
|
||||
->body('No new serial number(s) found in the uploaded excel file..!')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -841,6 +884,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -854,12 +898,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanSno && !$scanLocator)
|
||||
if (!$scanSno && !$scanLocator)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter serial number and locator number to add data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -871,12 +917,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanSno)
|
||||
if (!$scanSno)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter serial number to add data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -887,13 +935,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanSno) < 13)
|
||||
else if (strlen($scanSno) < 9)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 13 digits.")
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -904,12 +953,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if (!ctype_alnum($scanSno))
|
||||
else if (!ctype_alnum($scanSno))
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number must contain alpha-numeric values only.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -921,12 +972,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanLocator)
|
||||
if (!$scanLocator)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter locator number to add data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -937,12 +990,13 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanLocator) < 7) {
|
||||
else if (strlen($scanLocator) < 7) {
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -963,7 +1017,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -980,7 +1036,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("No space available for locator number '{$scanLocator}'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -992,7 +1050,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if($scanSno && $scanLocator)
|
||||
if ($scanSno && $scanLocator)
|
||||
{
|
||||
$palletRecord = PalletValidation::where('serial_number', $scanSno)
|
||||
->where('plant_id', $plantId)
|
||||
@@ -1005,7 +1063,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in locator number '$palletRecord->locator_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1021,7 +1081,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1037,7 +1099,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.")
|
||||
->warning()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1063,7 +1127,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1098,7 +1164,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' added into locator number '$scanLocator' successfully!")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1112,7 +1180,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Failed to add serial number '$scanSno' into locator number '$scanLocator'!")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
@@ -1139,6 +1209,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -1152,12 +1223,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanSno && !$scanLocator)
|
||||
if (!$scanSno && !$scanLocator)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter atleast a serial number or locator number to view data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1168,13 +1241,15 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if($scanSno && $scanLocator)
|
||||
else if ($scanSno && $scanLocator)
|
||||
{
|
||||
if (strlen($scanSno) < 13) {
|
||||
if (strlen($scanSno) < 9) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 13 digits.")
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1185,13 +1260,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($scanSno))
|
||||
else if (!ctype_alnum($scanSno))
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number must contain alpha-numeric values only.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1202,13 +1278,22 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanLocator) < 7) {
|
||||
else if (strlen($scanLocator) < 7)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1220,7 +1305,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1244,7 +1331,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1265,7 +1354,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' and locator number '$scanLocator' does not exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1283,7 +1374,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$serialNumberExists->pallet_number' with locator number '$serialNumberExists->locator_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1299,43 +1392,48 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' exists in locator number '$serialNumberExists->locator_number'.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($scanSno)
|
||||
{
|
||||
if (strlen($scanSno) < 13) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 13 digits.")
|
||||
->danger()
|
||||
->send();
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($scanSno))
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($scanSno)
|
||||
{
|
||||
if (strlen($scanSno) < 9) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
'plant_id' => $plantId,
|
||||
'scan_serial_number' => $scanSno,
|
||||
'scan_locator' => $scanLocator,
|
||||
'upload_serial_locator' => null,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (!ctype_alnum($scanSno))
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number must contain alpha-numeric values only.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1359,7 +1457,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' exists in locator number '$palletRecord->locator_number'.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1375,7 +1475,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1391,7 +1493,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1417,7 +1521,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1433,7 +1539,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' does not exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1446,13 +1554,15 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($scanLocator)
|
||||
else if ($scanLocator)
|
||||
{
|
||||
if (strlen($scanLocator) < 7) {
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1472,7 +1582,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1491,7 +1603,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' does not exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1507,7 +1621,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1533,6 +1649,7 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title('Please select a plant first.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', 0);
|
||||
@@ -1546,12 +1663,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanSno && !$scanLocator)
|
||||
if (!$scanSno && !$scanLocator)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter serial number and locator number to delete data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1562,13 +1681,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanSno)
|
||||
else if (!$scanSno)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter serial number to delete data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1579,12 +1699,13 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanSno) < 13) {
|
||||
else if (strlen($scanSno) < 9) {
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' must be at least 13 digits.")
|
||||
->title("Serial number '$scanSno' must be at least 9 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1595,13 +1716,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($scanSno))
|
||||
else if (!ctype_alnum($scanSno))
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number must contain alpha-numeric values only.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1612,13 +1734,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$scanLocator)
|
||||
else if (!$scanLocator)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Please enter locator number to delete data.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1629,12 +1752,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($scanLocator) < 7) {
|
||||
else if (strlen($scanLocator) < 7)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' must be at least 7 digits.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1647,13 +1772,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
}
|
||||
|
||||
$locator = Locator::where('locator_number', $scanLocator)->where('plant_id',$plantId)->first();
|
||||
|
||||
if (!$locator)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Locator number '$scanLocator' does not exist in the master.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1677,7 +1803,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1696,12 +1824,14 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->where('pallet_number', '!=',null)
|
||||
->first();
|
||||
|
||||
if($palletExists)
|
||||
if ($palletExists)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' already exists in pallet number '$palletExists->pallet_number'!<br>Please enter locator serial number to remove data.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1722,7 +1852,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
Notification::make()
|
||||
->title("Serial number '$scanSno' removed from locator number '$scanLocator' successfully.")
|
||||
->success()
|
||||
->duration(1000)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', '', '', $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
@@ -1739,7 +1871,9 @@ class UploadSerialLocator extends Page implements HasForms
|
||||
->title("Failed to remove serial number '$scanSno' from locator number '$scanLocator'!")
|
||||
//->title("Serial number '{$scanSno}' and Locator number '{$scanLocator}' does not exist in pallet table.")
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
|
||||
$this->form->fill
|
||||
([
|
||||
|
||||
Reference in New Issue
Block a user