Added serial_number minimum length should be 9 digit and notification display duration and updated validations

This commit is contained in:
dhanabalan
2025-07-09 20:57:06 +05:30
parent 4ac1823e5b
commit b8738a2f6a
4 changed files with 845 additions and 542 deletions

View File

@@ -79,6 +79,7 @@ class InvoiceFinder extends Page implements HasForms
Notification::make() Notification::make()
->title("Invoice number '$invoiceNo' can't be empty!") ->title("Invoice number '$invoiceNo' can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', [], [], [], [], $plantId); $this->dispatch('loadData', '', [], [], [], [], $plantId);
$this->form->fill([ $this->form->fill([
@@ -100,11 +101,12 @@ class InvoiceFinder extends Page implements HasForms
Notification::make() Notification::make()
->title("Invoice number '$invoiceNo' does not exist in locator invoice table!") ->title("Invoice number '$invoiceNo' does not exist in locator invoice table!")
->danger() ->danger()
->duration(2000)
->send(); ->send();
$this->dispatch('loadData', '', [], [], [], [], $plantId); $this->dispatch('loadData', '', [], [], [], [], $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'scan_invoice' => $invoiceNo, 'scan_invoice' => null,//$invoiceNo,
'total_sno_quantity' => 0, 'total_sno_quantity' => 0,
'pending_quantity' => 0, 'pending_quantity' => 0,
'scan_quantity' => 0 'scan_quantity' => 0
@@ -120,21 +122,22 @@ class InvoiceFinder extends Page implements HasForms
if(!$invoiceCompleted) if(!$invoiceCompleted)
{ {
$count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo) // $count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
->where('plant_id', $plantId) // ->where('plant_id', $plantId)
->count(); // ->count();
Notification::make() Notification::make()
->title("Invoice number '$invoiceNo' already completed the scanning process...") ->title("Invoice number '$invoiceNo' already completed the scanning process..!")
->success() ->success()
->duration(2000)
->send(); ->send();
$this->dispatch('loadData', '', [], [], [], [], $plantId); $this->dispatch('loadData', '', [], [], [], [], $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'scan_invoice' => $invoiceNo, 'scan_invoice' => null,//$invoiceNo,
'total_sno_quantity' => $count, 'total_sno_quantity' => 0,//$count,
'pending_quantity' => 0, 'pending_quantity' => 0,//0,
'scan_quantity' => $count 'scan_quantity' => 0//$count
]); ]);
return; return;
} }

View File

@@ -46,6 +46,7 @@ class LocatorValidation extends Page implements HasForms
public $plantId; public $plantId;
public $scanLocator; public $scanLocator;
public $locators; public $locators;
public array $filters = []; public array $filters = [];
@@ -66,12 +67,13 @@ class LocatorValidation extends Page implements HasForms
Section::make('') Section::make('')
->schema([ ->schema([
Select::make('plant_id') Select::make('plant_id')
->options(Plant::pluck('name', 'id'))
->label('Plant') ->label('Plant')
->reactive() ->reactive()
->options(Plant::pluck('name', 'id'))
->required(), ->required(),
TextInput::make('scan_pallet_no') TextInput::make('scan_pallet_no')
->label('Scan Pallet No') ->label('Scan Pallet No')
->minLength(10)
->reactive() ->reactive()
// ->readonly(fn () => $this->disablePalletNo) // ->readonly(fn () => $this->disablePalletNo)
->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_serial_no')) || !empty($get('scan_locator_no'))) ->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') TextInput::make('scan_serial_no')
->label('Scan Serial No') ->label('Scan Serial No')
->minLength(9)
->reactive()
// ->readOnly(fn () => $this->disableSerialNo) // ->readOnly(fn () => $this->disableSerialNo)
->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no'))) ->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no')))
->reactive()
->extraAttributes([ ->extraAttributes([
'wire:keydown.enter' => 'processSerialNo($event.target.value)', 'wire:keydown.enter' => 'processSerialNo($event.target.value)',
]), ]),
TextInput::make('scan_locator_no') TextInput::make('scan_locator_no')
->label('Scan Locator No') ->label('Scan Locator No')
->minLength(7)
->reactive() ->reactive()
->readOnly(fn (callable $get) => !$get('plant_id') || (!$get('scan_pallet_no') && !$get('scan_serial_no'))) ->readOnly(fn (callable $get) => !$get('plant_id') || (!$get('scan_pallet_no') && !$get('scan_serial_no')))
->extraAttributes([ ->extraAttributes([
@@ -132,9 +136,11 @@ class LocatorValidation extends Page implements HasForms
if ($palletNo == null || $palletNo == '') if ($palletNo == null || $palletNo == '')
{ {
Notification::make() Notification::make()
->title("Pallet number cannot be empty!") ->title("Pallet number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -148,13 +154,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($palletNo) < 10)
if (strlen($palletNo) < 10)
{ {
Notification::make() Notification::make()
->title("Pallet number '$palletNo' must be at least 10 digits.") ->title("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -176,7 +183,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' does not found in pallet table.") ->title("Pallet number '$palletNo' does not found in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -258,6 +267,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' does not completed the master packing.") ->title("Pallet number '{$palletNo}' does not completed the master packing.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
@@ -300,6 +310,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$locatorNumber'..!") ->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$locatorNumber'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
@@ -309,7 +320,6 @@ class LocatorValidation extends Page implements HasForms
public function processSerialNo($serialNo) public function processSerialNo($serialNo)
{ {
$plantId = $this->form->getState()['plant_id']; $plantId = $this->form->getState()['plant_id'];
$plantId = trim($plantId) ?? null; $plantId = trim($plantId) ?? null;
@@ -329,12 +339,14 @@ class LocatorValidation extends Page implements HasForms
return; return;
} }
if (strlen($serialNo) < 13) if ($serialNo == null || $serialNo == '')
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must be at least 13 digits.") ->title("Serial number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -348,12 +360,33 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; 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() Notification::make()
->title("Serial number '$serialNo' must contain alpha-numeric values only.") ->title("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
@@ -381,6 +414,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() 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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
@@ -417,6 +451,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Scanned serial number '$serialNo' already exist in pallet number '$palletnumber'!<br>Scan the valid new serial number to proceed...") ->title("Scanned serial number '$serialNo' already exist in pallet number '$palletnumber'!<br>Scan the valid new serial number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
// $this->form->fill([ // $this->form->fill([
@@ -449,6 +484,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$locatorNo'..!") ->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$locatorNo'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
@@ -497,15 +533,38 @@ class LocatorValidation extends Page implements HasForms
$operatorName = Filament::auth()->user()->name; $operatorName = Filament::auth()->user()->name;
$this->locators = PalletValidation::where('plant_id', $plantId) $this->locators = PalletValidation::where('plant_id', $plantId)
->where('locator_number', $scanLocator) ->where('locator_number', '11111')
->get(); ->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() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -529,6 +588,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '{$scanLocator}' does not exist in the master.") ->title("Locator number '{$scanLocator}' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
// $this->form->fill([ // $this->form->fill([
@@ -561,7 +621,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("No space available for locator number '{$scanLocator}'.") ->title("No space available for locator number '{$scanLocator}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
@@ -577,6 +639,10 @@ class LocatorValidation extends Page implements HasForms
return; return;
} }
$this->locators = PalletValidation::where('plant_id', $plantId)
->where('locator_number', $scanLocator)
->get();
if ($palletNo) if ($palletNo)
{ {
if (strlen($palletNo) < 10) if (strlen($palletNo) < 10)
@@ -584,7 +650,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' must be at least 10 digits.") ->title("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -611,9 +679,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' does not completed the master packing.") ->title("Pallet number '{$palletNo}' does not completed the master packing.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -636,9 +705,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' is already assigned to locator number '{$locatorExist->locator_number}'.") ->title("Pallet number '$palletNo' is already assigned to locator number '{$locatorExist->locator_number}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -658,6 +728,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$scanLocator'..!") ->title("Press 'Remove Pallet' button to remove Pallet number : '$palletNo' from Locator number : '$scanLocator'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
else else
@@ -665,6 +736,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Add Pallet' button to add Pallet number : '$palletNo' into Locator number : '$scanLocator'..!") ->title("Press 'Add Pallet' button to add Pallet number : '$palletNo' into Locator number : '$scanLocator'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
} }
@@ -674,7 +746,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number is required to add or remove when pallet number is empty.") ->title("Serial number is required to add or remove when pallet number is empty.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -688,13 +762,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($serialNo) < 9)
if (strlen($serialNo) < 13)
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must be at least 13 digits.") ->title("Serial number '$serialNo' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -708,13 +783,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($serialNo))
if (!ctype_alnum($serialNo))
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must contain alpha-numeric values only.") ->title("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -741,9 +817,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() 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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -767,7 +844,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$serialNo' is already assigned to locator number '{$serialExist->locator_number}'.") ->title("Serial number '$serialNo' is already assigned to locator number '{$serialExist->locator_number}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -787,6 +866,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$scanLocator'..!") ->title("Press 'Remove Serial Number' button to remove Serial number : '$serialNo' from Locator number : '$scanLocator'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
else else
@@ -794,6 +874,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Press 'Add Serial Number' button to add Serial number : '$serialNo' into Locator number : '$scanLocator'..!") ->title("Press 'Add Serial Number' button to add Serial number : '$serialNo' into Locator number : '$scanLocator'..!")
->info() ->info()
->duration(2000)
->send(); ->send();
} }
} }
@@ -839,9 +920,11 @@ class LocatorValidation extends Page implements HasForms
if ($scanLocator == null || $scanLocator == '') { if ($scanLocator == null || $scanLocator == '') {
Notification::make() Notification::make()
->title("Locator number cannot be empty!") ->title("Locator number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -855,13 +938,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanLocator) < 7)
if (strlen($scanLocator) < 7)
{ {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -885,7 +969,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '{$scanLocator}' does not exist in the master.") ->title("Locator number '{$scanLocator}' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -908,9 +994,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("No space available for locator number '{$scanLocator}'.") ->title("No space available for locator number '{$scanLocator}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -931,9 +1018,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' must be at least 10 digits.") ->title("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -954,9 +1042,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' does not found in pallet table.") ->title("Pallet number '$palletNo' does not found in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -982,9 +1071,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' does not completed the master packing.") ->title("Pallet number '{$palletNo}' does not completed the master packing.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1010,9 +1100,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' is already added into locator number '{$alreadyAssigned->locator_number}'.") ->title("Pallet number '{$palletNo}' is already added into locator number '{$alreadyAssigned->locator_number}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'scan_serial_no' => null, 'scan_serial_no' => null,
@@ -1031,16 +1122,18 @@ class LocatorValidation extends Page implements HasForms
'locator_number' => $scanLocator, 'locator_number' => $scanLocator,
]); ]);
$count = PalletValidation::where('plant_id', $plantId) // $count = PalletValidation::where('plant_id', $plantId)
->where('locator_number', $scanLocator) // ->where('locator_number', $scanLocator)
->count('locator_number'); // ->count('locator_number');
if ($updatedRows > 0) if ($updatedRows > 0)
{ {
Notification::make() Notification::make()
->title("Scanned pallet number '$palletNo' added into locator number '$scanLocator' successfully.") ->title("Scanned pallet number '$palletNo' added into locator number '$scanLocator' successfully.")
->success() ->success()
->duration(1000)
->send(); ->send();
$locator = Locator::where('locator_number', $scanLocator) $locator = Locator::where('locator_number', $scanLocator)
->where('plant_id', $plantId)->first(); ->where('plant_id', $plantId)->first();
$locator->increment('locator_quantity'); $locator->increment('locator_quantity');
@@ -1075,6 +1168,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("pallet number failed to add into locator number '$scanLocator'") ->title("pallet number failed to add into locator number '$scanLocator'")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
@@ -1097,7 +1191,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number is required to add when pallet number is empty.") ->title("Serial number is required to add when pallet number is empty.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1111,13 +1207,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($serialNo) < 9)
if (strlen($serialNo) < 13)
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must be at least 13 digits.") ->title("Serial number '$serialNo' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1131,13 +1228,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($serialNo))
if (!ctype_alnum($serialNo))
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must contain alpha-numeric values only.") ->title("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1164,7 +1262,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() 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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1190,7 +1290,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$serialNo' already exists in pallet number '{$palletexists->pallet_number}'.") ->title("Serial number '$serialNo' already exists in pallet number '{$palletexists->pallet_number}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1216,7 +1318,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$serialNo' already exists in locator number '{$exists->locator_number}'.") ->title("Serial number '$serialNo' already exists in locator number '{$exists->locator_number}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1256,6 +1360,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Scanned serial number '$serialNo' added into locator number '$scanLocator' successfully.") ->title("Scanned serial number '$serialNo' added into locator number '$scanLocator' successfully.")
->success() ->success()
->duration(1000)
->send(); ->send();
// $count = PalletValidation::where('plant_id', $plantId) // $count = PalletValidation::where('plant_id', $plantId)
@@ -1303,9 +1408,11 @@ class LocatorValidation extends Page implements HasForms
if ($scanLocator == null || $scanLocator == '') { if ($scanLocator == null || $scanLocator == '') {
Notification::make() Notification::make()
->title("Locator number cannot be empty!") ->title("Locator number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1319,13 +1426,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanLocator) < 7)
if (strlen($scanLocator) < 7)
{ {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1349,7 +1457,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '{$scanLocator}' does not exist in the master.") ->title("Locator number '{$scanLocator}' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1371,7 +1481,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' must be at least 10 digits.") ->title("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1393,7 +1505,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' does not found in pallet table.") ->title("Pallet number '$palletNo' does not found in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1420,9 +1534,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' does not completed the master packing.") ->title("Pallet number '{$palletNo}' does not completed the master packing.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId);
$this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1447,9 +1562,10 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '$palletNo' is exists in locator number '$palletValidation->locator_number'<br>Scan the valid locator number to remove pallet number.") ->title("Pallet number '$palletNo' is exists in locator number '$palletValidation->locator_number'<br>Scan the valid locator number to remove pallet number.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator', '', $plantId);
$this->dispatch('loadLocator', '', $plantId);
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1474,7 +1590,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Pallet number '{$palletNo}' doesn't exist in locator number.<br>Add locator number to proceed...") ->title("Pallet number '{$palletNo}' doesn't exist in locator number.<br>Add locator number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1547,7 +1665,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Scanned pallet number '{$palletNo}' removed from locator number '$scanLocator' successfully.") ->title("Scanned pallet number '{$palletNo}' removed from locator number '$scanLocator' successfully.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadLocator' ,$scanLocator,$plantId); $this->dispatch('loadLocator' ,$scanLocator,$plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1564,7 +1684,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("No matching pallet found or locator number already empty.") ->title("No matching pallet found or locator number already empty.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1583,11 +1705,14 @@ class LocatorValidation extends Page implements HasForms
else else
{ {
if ($serialNo == '' || $serialNo == null) { if ($serialNo == '' || $serialNo == null)
{
Notification::make() Notification::make()
->title("Serial number is required to remove when pallet number is empty.") ->title("Serial number is required to remove when pallet number is empty.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1601,13 +1726,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($serialNo) < 9)
if (strlen($serialNo) < 13)
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must be at least 13 digits.") ->title("Serial number '$serialNo' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1621,13 +1747,14 @@ class LocatorValidation extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($serialNo))
if (!ctype_alnum($serialNo))
{ {
Notification::make() Notification::make()
->title("Serial number '$serialNo' must contain alpha-numeric values only.") ->title("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1654,7 +1781,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() 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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1677,7 +1806,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '{$serialNo}' does not exist in the pallet table to remove.") ->title("Serial number '{$serialNo}' does not exist in the pallet table to remove.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1702,7 +1833,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '{$serialNo}' already exists in pallet number '$existsInPallet->pallet_number'.") ->title("Serial number '{$serialNo}' already exists in pallet number '$existsInPallet->pallet_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1727,7 +1860,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '{$serialNo}' exist in the locator number '$existsInPallet->locator_number'.<br>Scan the valid locator number to remove serial number.") ->title("Serial number '{$serialNo}' exist in the locator number '$existsInPallet->locator_number'.<br>Scan the valid locator number to remove serial number.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1755,6 +1890,7 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNo}' removed from locator number '$scanLocator' successfully.") ->title("Scanned serial number '{$serialNo}' removed from locator number '$scanLocator' successfully.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadLocator', $scanLocator, $plantId); $this->dispatch('loadLocator', $scanLocator, $plantId);
@@ -1773,7 +1909,9 @@ class LocatorValidation extends Page implements HasForms
Notification::make() Notification::make()
->title("No matching record found for serial number '{$serialNo}'.") ->title("No matching record found for serial number '{$serialNo}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadLocator' ,'',$plantId); $this->dispatch('loadLocator' ,'',$plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1799,5 +1937,4 @@ class LocatorValidation extends Page implements HasForms
{ {
return Auth::check() && Auth::user()->can('create locator validation page'); return Auth::check() && Auth::user()->can('create locator validation page');
} }
} }

View File

@@ -93,6 +93,7 @@ class PalletFromLocator extends Page implements HasForms
TextInput::make('scan_locator_number') TextInput::make('scan_locator_number')
->label('Scan Locator Number') ->label('Scan Locator Number')
->reactive() ->reactive()
->minLength(7)
->columnSpan(1) ->columnSpan(1)
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_serial_number') || $get('scan_remove_sno')) ->readOnly(fn (callable $get) => !$get('plant') || $get('scan_serial_number') || $get('scan_remove_sno'))
->extraAttributes([ ->extraAttributes([
@@ -101,6 +102,7 @@ class PalletFromLocator extends Page implements HasForms
TextInput::make('scan_serial_number') TextInput::make('scan_serial_number')
->label('Scan Serial Number') ->label('Scan Serial Number')
->reactive() ->reactive()
->minLength(9)
->columnSpan(1) ->columnSpan(1)
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_remove_sno')) ->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_remove_sno'))
->extraAttributes([ ->extraAttributes([
@@ -109,6 +111,7 @@ class PalletFromLocator extends Page implements HasForms
TextInput::make('scan_remove_sno') TextInput::make('scan_remove_sno')
->label('Remove Serial Number') ->label('Remove Serial Number')
->reactive() ->reactive()
->minLength(9)
->columnSpan(1) ->columnSpan(1)
->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_serial_number') || count($this->records) <= 0) ->readOnly(fn (callable $get) => !$get('plant') || $get('scan_locator_number') || $get('scan_serial_number') || count($this->records) <= 0)
->extraAttributes([ ->extraAttributes([
@@ -141,8 +144,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Scan Serial Number" field to proceed..!') ->title('Press enter on "Scan Serial Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -159,8 +163,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Remove Serial Number" field to proceed..!') ->title('Press enter on "Remove Serial Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -179,8 +184,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Locator Number') ->title('Invalid: Locator Number')
->body("Locator number can't be empty!") ->body("Locator number can't be empty!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -198,8 +204,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Locator Number') ->title('Invalid: Locator Number')
->body("Locator number '$locatorNo' must be at least 7 digits.") ->body("Locator number '$locatorNo' must be at least 7 digits.")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -222,8 +229,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Unknown: Locator Number') ->title('Unknown: Locator Number')
->body("Locator number '$locatorNo' does not exist in the master.") ->body("Locator number '$locatorNo' does not exist in the master.")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, '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> ->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.") Please scan a valid stored locator number to proceed.")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -273,8 +282,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Add: Locator Serial Numbers') ->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?") ->body("Scanned locator number '$locatorNo' has '".$serialLocator->count()."' locator serial numbers!<br>Do you want to store it into 'PALLET DATA' table?")
->info() ->info()
->seconds(2) ->duration(2000)
->send(); ->send();
$this->dispatch('open-confirm-modal', locatorNo: $locatorNo, plantId: $plantId); $this->dispatch('open-confirm-modal', locatorNo: $locatorNo, plantId: $plantId);
} }
} }
@@ -389,7 +399,7 @@ class PalletFromLocator extends Page implements HasForms
->title('Add: Locator Serial Number') ->title('Add: Locator Serial Number')
->body("Scanned locator serial number '$serialNo' successfully added into 'PALLET DATA' table.") ->body("Scanned locator serial number '$serialNo' successfully added into 'PALLET DATA' table.")
->success() ->success()
->seconds(3) ->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
@@ -412,7 +422,7 @@ class PalletFromLocator extends Page implements HasForms
->title('Remove: Locator Serial Number') ->title('Remove: Locator Serial Number')
->body("Scanned locator serial number '$removeserial' removed successfully from 'PALLET DATA' table.") ->body("Scanned locator serial number '$removeserial' removed successfully from 'PALLET DATA' table.")
->success() ->success()
->seconds(3) ->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
@@ -451,8 +461,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Add: Locator Serial Numbers') ->title('Add: Locator Serial Numbers')
->body("Scanned locator number '$locatorNo' has '$serialLocator' locator serial numbers!<br>Successfully added into 'PALLET DATA' table.") ->body("Scanned locator number '$locatorNo' has '$serialLocator' locator serial numbers!<br>Successfully added into 'PALLET DATA' table.")
->success() ->success()
->seconds(3) ->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -471,8 +482,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Skipped: Locator Number') ->title('Skipped: Locator Number')
->body('Scan the new locator number to proceed..!') ->body('Scan the new locator number to proceed..!')
->info() ->info()
->seconds(3) ->duration(2000)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -501,8 +513,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Scan Locator Number" field to proceed..!') ->title('Press enter on "Scan Locator Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -519,8 +532,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Remove Serial Number" field to proceed..!') ->title('Press enter on "Remove Serial Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -539,8 +553,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Serial Number') ->title('Invalid: Serial Number')
->body("Serial number can't be empty!") ->body("Serial number can't be empty!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -552,14 +567,15 @@ class PalletFromLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($serialNo) < 13) else if (strlen($serialNo) < 9)
{ {
Notification::make() Notification::make()
->title('Invalid: Serial Number') ->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() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -577,8 +593,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Serial Number') ->title('Invalid: Serial Number')
->body("Serial number '$serialNo' must contain alpha-numeric values only.") ->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -606,8 +623,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Unknown: Serial Number') ->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..!") ->body("Scanned serial number: '$serialNo' doesn't exist in pallet table.<br>Scan the valid exist locator-serial number to proceed..!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -625,8 +643,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Serial Number') ->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..!") ->body("Scanned serial number: '$serialNo' already exist in pallet number '".$serialLocator->pallet_number."'.<br>Scan the valid locator-serial number to proceed..!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -657,8 +676,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Locator Serials Not Found') ->title('Locator Serials Not Found')
->body("Add some locator serial numbers to proceed generate pallet..!") ->body("Add some locator serial numbers to proceed generate pallet..!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -750,8 +770,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Success: Pallet Generated') ->title('Success: Pallet Generated')
->body("Pallet number '$newPalletNumber' completed the master packing successfully!") ->body("Pallet number '$newPalletNumber' completed the master packing successfully!")
->success() ->success()
->seconds(3) ->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -770,8 +791,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Failed: Pallet Generated') ->title('Failed: Pallet Generated')
->body("No locator serial number records found to generate pallet..!") ->body("No locator serial number records found to generate pallet..!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -800,6 +822,7 @@ class PalletFromLocator extends Page implements HasForms
// ->title('Pallet Generated') // ->title('Pallet Generated')
// ->body("Pallet number {$this->latestPalletNumber} assigned to all serials for locator {$locatorNo}") // ->body("Pallet number {$this->latestPalletNumber} assigned to all serials for locator {$locatorNo}")
// ->success() // ->success()
// ->duration(1000)
// ->send(); // ->send();
// $this->dispatch('loadData', $this->records, $plantId); // $this->dispatch('loadData', $this->records, $plantId);
// $this->form->fill([ // $this->form->fill([
@@ -828,8 +851,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Scan Locator Number" field to proceed..!') ->title('Press enter on "Scan Locator Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -846,8 +870,9 @@ class PalletFromLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Press enter on "Scan Serial Number" field to proceed..!') ->title('Press enter on "Scan Serial Number" field to proceed..!')
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -866,8 +891,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Serial Number') ->title('Invalid: Serial Number')
->body("Serial number can't be empty!") ->body("Serial number can't be empty!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -879,14 +905,15 @@ class PalletFromLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($removeSno) < 13) else if (strlen($removeSno) < 9)
{ {
Notification::make() Notification::make()
->title('Invalid: Serial Number') ->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() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -904,8 +931,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Invalid: Serial Number') ->title('Invalid: Serial Number')
->body("Serial number '$removeSno' must contain alpha-numeric values only.") ->body("Serial number '$removeSno' must contain alpha-numeric values only.")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -936,8 +964,9 @@ class PalletFromLocator extends Page implements HasForms
->title('Unknown: Serial Number') ->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..!") ->body("Scanned serial number: '$removeSno' doesn't exist in 'PALLET DATA' table.<br>Scan the valid exist locator-serial number to proceed..!")
->danger() ->danger()
->seconds(3) ->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $this->records, $plantId); $this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,

View File

@@ -69,6 +69,7 @@ class UploadSerialLocator extends Page implements HasForms
TextInput::make('scan_serial_number') TextInput::make('scan_serial_number')
->label('Scan Serial Number') ->label('Scan Serial Number')
->reactive() ->reactive()
->minLength(9)
->readOnly(fn (callable $get) => !$get('plant_id')) ->readOnly(fn (callable $get) => !$get('plant_id'))
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
@@ -82,6 +83,7 @@ class UploadSerialLocator extends Page implements HasForms
TextInput::make('scan_locator') TextInput::make('scan_locator')
->label('Scan Locator Number') ->label('Scan Locator Number')
->reactive() ->reactive()
->minLength(7)
->readOnly(fn (callable $get) => !$get('plant_id')) ->readOnly(fn (callable $get) => !$get('plant_id'))
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$plantId = $get('plant_id'); $plantId = $get('plant_id');
@@ -127,6 +129,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -148,7 +151,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please upload a file!') ->title('Please upload a file!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -168,9 +173,11 @@ class UploadSerialLocator extends Page implements HasForms
{ {
Notification::make() Notification::make()
->title('Choose a proper Excel file') ->title('Choose a proper Excel file')
->danger()
->body('The file must be an Excel file (xlsx, xls, csv).') ->body('The file must be an Excel file (xlsx, xls, csv).')
->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -190,7 +197,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('File not found after upload!') ->title('File not found after upload!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -225,7 +234,7 @@ class UploadSerialLocator extends Page implements HasForms
if ($serialNumber) if ($serialNumber)
{ {
$excelSerials[] = $serialNumber; $excelSerials[] = $serialNumber;
if (strlen($serialNumber) < 13) { if (strlen($serialNumber) < 9) {
$invalidSerial[] = $serialNumber; $invalidSerial[] = $serialNumber;
} elseif (!ctype_alnum($serialNumber)) { } elseif (!ctype_alnum($serialNumber)) {
$invalidSerial[] = $serialNumber; $invalidSerial[] = $serialNumber;
@@ -234,21 +243,21 @@ class UploadSerialLocator extends Page implements HasForms
if ($locator) { if ($locator) {
$excelLocators[] = $locator; $excelLocators[] = $locator;
if (strlen($locator) > 7) { if (strlen($locator) < 7) {
$invalidLocator[] = $locator; $invalidLocator[] = $locator;
} }
} }
} }
$uniqueInvalidSerial = array_unique($invalidSerial); $uniqueInvalidSerial = array_unique($invalidSerial);
$uniqueInvalidLocator = array_unique($invalidLocator);
if (count($uniqueInvalidSerial) > 0) { if (count($uniqueInvalidSerial) > 0) {
Notification::make() Notification::make()
->title('Invalid Serial Numbers Found') ->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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -260,12 +269,15 @@ class UploadSerialLocator extends Page implements HasForms
return; return;
} }
$uniqueInvalidLocator = array_unique($invalidLocator);
if (count($uniqueInvalidLocator) > 0) { if (count($uniqueInvalidLocator) > 0) {
Notification::make() Notification::make()
->title('Invalid Locator Numbers Found') ->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() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -298,7 +310,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Duplicate Serial Numbers in Excel') ->title('Duplicate Serial Numbers in Excel')
->body('The following serial numbers are duplicated in the file:<br>' . implode(', ', $duplicates)) ->body('The following serial numbers are duplicated in the file:<br>' . implode(', ', $duplicates))
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -310,8 +324,6 @@ class UploadSerialLocator extends Page implements HasForms
return; return;
} }
$excelLocators = array_unique($excelLocators); $excelLocators = array_unique($excelLocators);
$locatorsWithQuantityTwo = Locator::whereIn('locator_number', $excelLocators) $locatorsWithQuantityTwo = Locator::whereIn('locator_number', $excelLocators)
->where('plant_id',$plantId) ->where('plant_id',$plantId)
@@ -324,7 +336,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Locators with Insufficient Space') ->title('Locators with Insufficient Space')
->body('The following locators does not have space:<br>' . implode(', ', $locatorsWithQuantityTwo)) ->body('The following locators does not have space:<br>' . implode(', ', $locatorsWithQuantityTwo))
->warning() ->warning()
->duration(1200)
->send(); ->send();
$this->dispatch('open-confirm-modal', locatorNo: $locator, plantId: $plantId); $this->dispatch('open-confirm-modal', locatorNo: $locator, plantId: $plantId);
return; return;
} }
@@ -342,7 +356,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers already exist and cannot be imported:<br>' . implode(', ', $existingSerials)) ->body('The following serial numbers already exist and cannot be imported:<br>' . implode(', ', $existingSerials))
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId); $this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId);
return; return;
} }
@@ -384,7 +400,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported successfully!') ->title('Serial Locators imported successfully!')
->body("{$insertedCount} locator serial number(s) have been imported.") ->body("{$insertedCount} locator serial number(s) have been imported.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -401,7 +419,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported Failed!') ->title('Serial Locators imported Failed!')
->body('No new serial number(s) found in the uploaded excel file..!') ->body('No new serial number(s) found in the uploaded excel file..!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -425,6 +445,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -446,7 +467,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please upload a file!') ->title('Please upload a file!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -466,9 +489,11 @@ class UploadSerialLocator extends Page implements HasForms
{ {
Notification::make() Notification::make()
->title('Choose a proper Excel file') ->title('Choose a proper Excel file')
->danger()
->body('The file must be an Excel file (xlsx, xls, csv).') ->body('The file must be an Excel file (xlsx, xls, csv).')
->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -488,7 +513,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('File not found after upload!') ->title('File not found after upload!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -544,8 +571,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers already exist and cannot be imported: ' . implode(', ', $existingSerials)) ->body('The following serial numbers already exist and cannot be imported: ' . implode(', ', $existingSerials))
->danger() ->danger()
->seconds(10) ->duration(1200)
->send(); ->send();
$this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId); $this->dispatch('open-confirm-serial', locatorNo: $locator, plantId: $plantId);
return; return;
} }
@@ -587,7 +615,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported successfully!') ->title('Serial Locators imported successfully!')
->body("{$insertedCount} locator serial number(s) have been imported.") ->body("{$insertedCount} locator serial number(s) have been imported.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -604,7 +634,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported Failed!') ->title('Serial Locators imported Failed!')
->body('No new serial number(s) found in the uploaded excel file..!') ->body('No new serial number(s) found in the uploaded excel file..!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -641,6 +673,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -662,7 +695,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please upload a file!') ->title('Please upload a file!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -682,9 +717,11 @@ class UploadSerialLocator extends Page implements HasForms
{ {
Notification::make() Notification::make()
->title('Choose a proper Excel file') ->title('Choose a proper Excel file')
->danger()
->body('The file must be an Excel file (xlsx, xls, csv).') ->body('The file must be an Excel file (xlsx, xls, csv).')
->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -704,7 +741,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('File not found after upload!') ->title('File not found after upload!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -789,7 +828,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported successfully!') ->title('Serial Locators imported successfully!')
->body("{$insertedCount} locator serial number(s) have been imported.") ->body("{$insertedCount} locator serial number(s) have been imported.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -804,7 +845,9 @@ class UploadSerialLocator extends Page implements HasForms
->title('Serial Locators imported Failed!') ->title('Serial Locators imported Failed!')
->body('No new serial number(s) found in the uploaded excel file..!') ->body('No new serial number(s) found in the uploaded excel file..!')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
$this->form->fill $this->form->fill
([ ([
@@ -841,6 +884,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -859,7 +903,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please enter serial number and locator number to add data.') ->title('Please enter serial number and locator number to add data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -876,7 +922,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please enter serial number to add data.') ->title('Please enter serial number to add data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -887,13 +935,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanSno) < 9)
if (strlen($scanSno) < 13)
{ {
Notification::make() Notification::make()
->title("Serial number '$scanSno' must be at least 13 digits.") ->title("Serial number '$scanSno' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -904,12 +953,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
if (!ctype_alnum($scanSno)) else if (!ctype_alnum($scanSno))
{ {
Notification::make() Notification::make()
->title('Serial number must contain alpha-numeric values only.') ->title('Serial number must contain alpha-numeric values only.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -926,7 +977,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please enter locator number to add data.') ->title('Please enter locator number to add data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -937,12 +990,13 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanLocator) < 7) {
if (strlen($scanLocator) < 7) {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -963,7 +1017,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' does not exist in the master.") ->title("Locator number '$scanLocator' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -980,7 +1036,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("No space available for locator number '{$scanLocator}'.") ->title("No space available for locator number '{$scanLocator}'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1005,7 +1063,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in locator number '$palletRecord->locator_number'.") ->title("Serial number '$scanSno' already exists in locator number '$palletRecord->locator_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1021,7 +1081,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.") ->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1037,7 +1099,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.") ->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.")
->warning() ->warning()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1063,7 +1127,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in invoice number '$invoiceNo' and completed the scanning process.") ->title("Serial number '$scanSno' already exists in invoice number '$invoiceNo' and completed the scanning process.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1098,7 +1164,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' added into locator number '$scanLocator' successfully!") ->title("Serial number '$scanSno' added into locator number '$scanLocator' successfully!")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1112,7 +1180,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Failed to add serial number '$scanSno' into locator number '$scanLocator'!") ->title("Failed to add serial number '$scanSno' into locator number '$scanLocator'!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->form->fill $this->form->fill
([ ([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1139,6 +1209,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -1157,7 +1228,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please enter atleast a serial number or locator number to view data.') ->title('Please enter atleast a serial number or locator number to view data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1168,13 +1241,15 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
if($scanSno && $scanLocator) else if ($scanSno && $scanLocator)
{ {
if (strlen($scanSno) < 13) { if (strlen($scanSno) < 9) {
Notification::make() Notification::make()
->title("Serial number '$scanSno' must be at least 13 digits.") ->title("Serial number '$scanSno' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1185,13 +1260,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($scanSno))
if (!ctype_alnum($scanSno))
{ {
Notification::make() Notification::make()
->title('Serial number must contain alpha-numeric values only.') ->title('Serial number must contain alpha-numeric values only.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1202,13 +1278,22 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanLocator) < 7)
if (strlen($scanLocator) < 7) { {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill
([
'plant_id' => $plantId,
'scan_serial_number' => $scanSno,
'scan_locator' => $scanLocator,
'upload_serial_locator' => null,
]);
return; return;
} }
@@ -1220,7 +1305,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' does not exist in the master.") ->title("Locator number '$scanLocator' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1244,7 +1331,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.") ->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1265,7 +1354,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' and locator number '$scanLocator' does not exist in pallet table.") ->title("Serial number '$scanSno' and locator number '$scanLocator' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1283,7 +1374,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$serialNumberExists->pallet_number' with locator number '$serialNumberExists->locator_number'.") ->title("Serial number '$scanSno' already exists in pallet number '$serialNumberExists->pallet_number' with locator number '$serialNumberExists->locator_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1299,7 +1392,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' exists in locator number '$serialNumberExists->locator_number'.") ->title("Serial number '$scanSno' exists in locator number '$serialNumberExists->locator_number'.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1314,11 +1409,13 @@ class UploadSerialLocator extends Page implements HasForms
} }
else if ($scanSno) else if ($scanSno)
{ {
if (strlen($scanSno) < 13) { if (strlen($scanSno) < 9) {
Notification::make() Notification::make()
->title("Serial number '$scanSno' must be at least 13 digits.") ->title("Serial number '$scanSno' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1329,13 +1426,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($scanSno))
if (!ctype_alnum($scanSno))
{ {
Notification::make() Notification::make()
->title('Serial number must contain alpha-numeric values only.') ->title('Serial number must contain alpha-numeric values only.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1359,7 +1457,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' exists in locator number '$palletRecord->locator_number'.") ->title("Serial number '$scanSno' exists in locator number '$palletRecord->locator_number'.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1375,7 +1475,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.") ->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1391,7 +1493,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.") ->title("Serial number '$scanSno' already exists in pallet number '$palletRecord->pallet_number' with locator number '$palletRecord->locator_number'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1417,7 +1521,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.") ->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1433,7 +1539,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' does not exist in pallet table.") ->title("Serial number '$scanSno' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1452,7 +1560,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1472,7 +1582,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' does not exist in the master.") ->title("Locator number '$scanLocator' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1491,7 +1603,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' does not exist in pallet table.") ->title("Locator number '$scanLocator' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1507,7 +1621,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Locator number '$scanLocator' exist in pallet table.") ->title("Locator number '$scanLocator' exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1533,6 +1649,7 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please select a plant first.') ->title('Please select a plant first.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', 0); $this->dispatch('loadData', '', '', 0);
@@ -1551,7 +1668,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title('Please enter serial number and locator number to delete data.') ->title('Please enter serial number and locator number to delete data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1562,13 +1681,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (!$scanSno)
if(!$scanSno)
{ {
Notification::make() Notification::make()
->title('Please enter serial number to delete data.') ->title('Please enter serial number to delete data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1579,12 +1699,13 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanSno) < 9) {
if (strlen($scanSno) < 13) {
Notification::make() Notification::make()
->title("Serial number '$scanSno' must be at least 13 digits.") ->title("Serial number '$scanSno' must be at least 9 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1595,13 +1716,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (!ctype_alnum($scanSno))
if (!ctype_alnum($scanSno))
{ {
Notification::make() Notification::make()
->title('Serial number must contain alpha-numeric values only.') ->title('Serial number must contain alpha-numeric values only.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1612,13 +1734,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (!$scanLocator)
if(!$scanLocator)
{ {
Notification::make() Notification::make()
->title('Please enter locator number to delete data.') ->title('Please enter locator number to delete data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1629,12 +1752,14 @@ class UploadSerialLocator extends Page implements HasForms
]); ]);
return; return;
} }
else if (strlen($scanLocator) < 7)
if (strlen($scanLocator) < 7) { {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' must be at least 7 digits.") ->title("Locator number '$scanLocator' must be at least 7 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1647,13 +1772,14 @@ class UploadSerialLocator extends Page implements HasForms
} }
$locator = Locator::where('locator_number', $scanLocator)->where('plant_id',$plantId)->first(); $locator = Locator::where('locator_number', $scanLocator)->where('plant_id',$plantId)->first();
if (!$locator) if (!$locator)
{ {
Notification::make() Notification::make()
->title("Locator number '$scanLocator' does not exist in the master.") ->title("Locator number '$scanLocator' does not exist in the master.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1677,7 +1803,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.") ->title("Serial number '$scanSno' exists in invoice number '$invoiceNo' and completed the scanning process.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1701,7 +1829,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' already exists in pallet number '$palletExists->pallet_number'!<br>Please enter locator serial number to remove data.") ->title("Serial number '$scanSno' already exists in pallet number '$palletExists->pallet_number'!<br>Please enter locator serial number to remove data.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([
@@ -1722,7 +1852,9 @@ class UploadSerialLocator extends Page implements HasForms
Notification::make() Notification::make()
->title("Serial number '$scanSno' removed from locator number '$scanLocator' successfully.") ->title("Serial number '$scanSno' removed from locator number '$scanLocator' successfully.")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId); $this->dispatch('loadData', '', '', $plantId);
$this->form->fill $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("Failed to remove serial number '$scanSno' from locator number '$scanLocator'!")
//->title("Serial number '{$scanSno}' and Locator number '{$scanLocator}' does not exist in pallet table.") //->title("Serial number '{$scanSno}' and Locator number '{$scanLocator}' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $scanLocator, $scanSno, $plantId); $this->dispatch('loadData', $scanLocator, $scanSno, $plantId);
$this->form->fill $this->form->fill
([ ([