5 Commits

Author SHA1 Message Date
dhanabalan
eb2b857aa7 Updated column position in view report 2025-07-09 18:05:11 +05:30
dhanabalan
693e3a23a4 Added serial_number minimum length should be 9 digit and notification display duration 2025-07-09 17:27:41 +05:30
dhanabalan
49d2f1088f Removed colon symbol in notifications 2025-07-09 17:03:09 +05:30
dhanabalan
34b2a05166 Added serial_number minimum length should be 9 digit 2025-07-09 16:16:47 +05:30
dhanabalan
ee99ada3e7 Added notification display duration 2025-07-09 16:15:44 +05:30
4 changed files with 302 additions and 162 deletions

View File

@@ -104,6 +104,7 @@ class LocatorInvoiceValidationResource extends Resource
Forms\Components\TextInput::make('pallet_number') Forms\Components\TextInput::make('pallet_number')
->label('Scan Pallet No') ->label('Scan Pallet No')
->reactive() ->reactive()
->minLength(10)
// ->readOnly(fn (callable $get) => !$get('plant') || !$get('invoice_number') || $get('serial_number')) // ->readOnly(fn (callable $get) => !$get('plant') || !$get('invoice_number') || $get('serial_number'))
->readOnly(function (callable $get) { ->readOnly(function (callable $get) {
$invoiceNumber = $get('invoice_number'); $invoiceNumber = $get('invoice_number');
@@ -145,6 +146,7 @@ class LocatorInvoiceValidationResource extends Resource
Forms\Components\TextInput::make('serial_number') Forms\Components\TextInput::make('serial_number')
->label('Scan Serial No') ->label('Scan Serial No')
->reactive() ->reactive()
->minLength(9)
// ->readOnly(fn (callable $get) => !$get('plant') || !$get('invoice_number') || $get('pallet_number')) // ->readOnly(fn (callable $get) => !$get('plant') || !$get('invoice_number') || $get('pallet_number'))
->readOnly(function (callable $get) { ->readOnly(function (callable $get) {
$invoiceNumber = $get('invoice_number'); $invoiceNumber = $get('invoice_number');
@@ -266,6 +268,7 @@ class LocatorInvoiceValidationResource extends Resource
Notification::make() Notification::make()
->title("Pallet number '{$palletNumber}' does not exist.") ->title("Pallet number '{$palletNumber}' does not exist.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
return; return;
} }
@@ -287,6 +290,7 @@ class LocatorInvoiceValidationResource extends Resource
Notification::make() Notification::make()
->title("Pallet number '{$palletNumber}' is not completed in masters") ->title("Pallet number '{$palletNumber}' is not completed in masters")
->danger() ->danger()
->duration(1200)
->send(); ->send();
return; return;
} }
@@ -331,6 +335,7 @@ class LocatorInvoiceValidationResource extends Resource
// Notification::make() // Notification::make()
// ->title("Pallet number '{$palletNumber}' scanned successfully") // ->title("Pallet number '{$palletNumber}' scanned successfully")
// ->success() // ->success()
// ->duration(800)
// ->send(); // ->send();
// } // }
@@ -362,6 +367,7 @@ class LocatorInvoiceValidationResource extends Resource
// Notification::make() // Notification::make()
// ->title("Pallet number '{$palletNumber}' scanned successfully") // ->title("Pallet number '{$palletNumber}' scanned successfully")
// ->success() // ->success()
// ->duration(800)
// ->send(); // ->send();
// } // }
@@ -522,6 +528,7 @@ class LocatorInvoiceValidationResource extends Resource
->title('Invalid Locator Invoice Found') ->title('Invalid Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($path)) { if ($disk->exists($path)) {
@@ -547,7 +554,7 @@ class LocatorInvoiceValidationResource extends Resource
} }
else else
{ {
if(Str::length($serialNumber) < 13 || !ctype_alnum($serialNumber)) if(Str::length($serialNumber) < 9 || !ctype_alnum($serialNumber))
{ {
$invalidSerialCodes[] = $serialNumber; $invalidSerialCodes[] = $serialNumber;
} }
@@ -570,9 +577,11 @@ class LocatorInvoiceValidationResource extends Resource
if (!empty($uniqueSerialCodes)) { if (!empty($uniqueSerialCodes)) {
Notification::make() Notification::make()
->title('Invalid Serial Numbers Found') ->title('Invalid Serial Numbers Found')
->body('The following serial numbers should contain minimum 13 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes)) ->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($path)) { if ($disk->exists($path)) {
$disk->delete($path); $disk->delete($path);
} }
@@ -586,7 +595,9 @@ class LocatorInvoiceValidationResource extends Resource
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes)) ->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($path)) { if ($disk->exists($path)) {
$disk->delete($path); $disk->delete($path);
} }
@@ -598,7 +609,9 @@ class LocatorInvoiceValidationResource extends Resource
->title('Invalid Locator Invoice Found') ->title('Invalid Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($path)) { if ($disk->exists($path)) {
$disk->delete($path); $disk->delete($path);
} }
@@ -618,9 +631,10 @@ class LocatorInvoiceValidationResource extends Resource
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials)) ->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($path))
{ if ($disk->exists($path)) {
$disk->delete($path); $disk->delete($path);
} }
return; return;
@@ -632,6 +646,7 @@ class LocatorInvoiceValidationResource extends Resource
Notification::make() Notification::make()
->title('Success: Invoice imported successfully.') ->title('Success: Invoice imported successfully.')
->success() ->success()
->duration(800)
->send(); ->send();
} }
} }

View File

@@ -62,6 +62,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Plant Not Found') ->title('Plant Not Found')
->body("Plant can't be empty!") ->body("Plant can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
@@ -103,6 +104,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Locator invoice '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Locator invoice '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
@@ -147,7 +149,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invoice File Not Found') ->title('Invoice File Not Found')
->body("Import the scanned 'Invoice' file to proceed..!") ->body("Import the scanned 'Invoice' file to proceed..!")
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -175,6 +177,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invalid Locator Invoice Found') ->title('Invalid Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
@@ -212,7 +215,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
} }
else else
{ {
if(Str::length($serialNumber) < 13 || !ctype_alnum($serialNumber)) if(Str::length($serialNumber) < 9 || !ctype_alnum($serialNumber))
{ {
$invalidSerialCodes[] = $serialNumber; $invalidSerialCodes[] = $serialNumber;
} }
@@ -235,9 +238,11 @@ class CreateLocatorInvoiceValidation extends CreateRecord
if (!empty($uniqueSerialCodes)) { if (!empty($uniqueSerialCodes)) {
Notification::make() Notification::make()
->title('Invalid Serial Numbers Found') ->title('Invalid Serial Numbers Found')
->body('The following serial numbers should contain minimum 13 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes)) ->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -262,7 +267,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes)) ->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -284,7 +291,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invalid Locator Invoice Found') ->title('Invalid Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -315,7 +324,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials)) ->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
{ {
$disk->delete($filePath); $disk->delete($filePath);
@@ -387,10 +398,12 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title('Success: Invoice inserted successfully.') ->title('Success: Invoice inserted successfully.')
->success() ->success()
->duration(800)
->send(); ->send();
Notification::make() Notification::make()
->title("Start the scanning process for imported invoice number '$invoiceNumber'!") ->title("Start the scanning process for imported invoice number '$invoiceNumber'!")
->info() ->info()
->duration(1000)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
{ {
@@ -441,7 +454,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Updated Invoice File Not Found') ->title('Updated Invoice File Not Found')
->body("Import the updated 'Invoice' file to proceed..!") ->body("Import the updated 'Invoice' file to proceed..!")
->danger() ->danger()
->seconds(2) ->duration(1200)
->send(); ->send();
$this->form->fill([ $this->form->fill([
@@ -476,6 +489,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invalid Updated Locator Invoice Found') ->title('Invalid Updated Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
@@ -513,7 +527,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
} }
else else
{ {
if(Str::length($serialNumber) < 13 || !ctype_alnum($serialNumber)) if(Str::length($serialNumber) < 9 || !ctype_alnum($serialNumber))
{ {
$invalidSerialCodes[] = $serialNumber; $invalidSerialCodes[] = $serialNumber;
} }
@@ -536,9 +550,11 @@ class CreateLocatorInvoiceValidation extends CreateRecord
if (!empty($uniqueSerialCodes)) { if (!empty($uniqueSerialCodes)) {
Notification::make() Notification::make()
->title('Invalid Serial Numbers Found') ->title('Invalid Serial Numbers Found')
->body('The following serial numbers should contain minimum 13 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes)) ->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>' . implode(', ', $uniqueSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -563,7 +579,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes)) ->body('The following serial numbers are already exist in imported excel:<br>' . implode(', ', $duplicateSerialCodes))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
{ {
$disk->delete($filePath); $disk->delete($filePath);
@@ -587,7 +605,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invalid Updated Locator Invoice Found') ->title('Invalid Updated Locator Invoice Found')
->body('Uploaded excel sheet is empty or<br>contains no valid data.') ->body('Uploaded excel sheet is empty or<br>contains no valid data.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -618,7 +638,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Duplicate Serial Numbers Found') ->title('Duplicate Serial Numbers Found')
->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials)) ->body('The following serial numbers already exist with a different invoice number:<br>' . implode(', ', $existingSerials))
->danger() ->danger()
->duration(1200)
->send(); ->send();
if ($disk->exists($filePath)) { if ($disk->exists($filePath)) {
$disk->delete($filePath); $disk->delete($filePath);
} }
@@ -666,12 +688,14 @@ class CreateLocatorInvoiceValidation extends CreateRecord
if ($createdAny) if ($createdAny)
{ {
Notification::make() Notification::make()
->title('Success: Locator invoice updated successfully.') ->title('Success: Invoice updated successfully.')
->success() ->success()
->duration(800)
->send(); ->send();
Notification::make() Notification::make()
->title("Start the scanning process for updated invoice number '$invoiceNumber'!") ->title("Start the scanning process for updated invoice number '$invoiceNumber'!")
->info() ->info()
->duration(1000)
->send(); ->send();
if ($disk->exists($filePath)) if ($disk->exists($filePath))
{ {
@@ -703,6 +727,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Start the scanning process for scanned invoice number '$invoiceNumber'!") ->title("Start the scanning process for scanned invoice number '$invoiceNumber'!")
->info() ->info()
->duration(1000)
->send(); ->send();
$snoCount = LocatorInvoiceValidation::where('plant_id', $plantId) $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)
@@ -730,6 +755,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Error: Locator invoice insertion (or updation).') ->title('Error: Locator invoice insertion (or updation).')
->body($e->getMessage()) ->body($e->getMessage())
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$snoCount = LocatorInvoiceValidation::where('plant_id', $plantId) $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)
@@ -786,7 +812,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Found') ->title('Invoice Not Found')
->body("Scanned invoice number '$invoiceNumber' does not exist in invoice table!<br>Import the scanned 'Invoice' file to proceed..!") ->body("Scanned invoice number '$invoiceNumber' does not exist in invoice table!<br>Import the scanned 'Invoice' file to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -821,7 +849,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -842,11 +872,12 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number can't be empty!") ->title("Pallet number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId);
$snoCount = LocatorInvoiceValidation::where('plant_id', $plantId) $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)
->where('invoice_number', $invoiceNumber)
->count(); ->count();
$this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'plant' => $plantId, 'plant' => $plantId,
@@ -867,7 +898,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '$palletNumber' must be at least 10 digits.") ->title("Pallet number '$palletNumber' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -892,7 +925,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '{$palletNumber}' does not exist in pallet table.") ->title("Pallet number '{$palletNumber}' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -925,7 +960,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '{$palletNumber}' does not completed the master packing!") ->title("Pallet number '{$palletNumber}' does not completed the master packing!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -965,7 +1002,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Scanned pallet number '$palletNumber' does not have invoice serial numbers.<br>Scan the valid exist pallet number to start the scanning process..!") ->title("Scanned pallet number '$palletNumber' does not have invoice serial numbers.<br>Scan the valid exist pallet number to start the scanning process..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1004,7 +1043,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Partial Pallet Serial Numbers Found") ->title("Partial Pallet Serial Numbers Found")
->body($missingSerialsString) ->body($missingSerialsString)
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1069,6 +1110,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("All Serial numbers are moved into invoice from the pallet number '$palletNumber'.<br>Scan the next exist pallet number to start the scanning process..!") ->title("All Serial numbers are moved into invoice from the pallet number '$palletNumber'.<br>Scan the next exist pallet number to start the scanning process..!")
->success() ->success()
->duration(800)
->send(); ->send();
$records = LocatorInvoiceValidation::where('plant_id', $plantId) $records = LocatorInvoiceValidation::where('plant_id', $plantId)
@@ -1089,6 +1131,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
@@ -1157,6 +1200,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title($succMsgStr) ->title($succMsgStr)
->success() ->success()
->duration(800)
->send(); ->send();
$records = LocatorInvoiceValidation::where('plant_id', $plantId) $records = LocatorInvoiceValidation::where('plant_id', $plantId)
@@ -1177,6 +1221,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
@@ -1250,7 +1295,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Found') ->title('Invoice Not Found')
->body("Scanned invoice number '$invoiceNumber' does not exist in invoice table!<br>Import the scanned 'Invoice' file to proceed..!") ->body("Scanned invoice number '$invoiceNumber' does not exist in invoice table!<br>Import the scanned 'Invoice' file to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'plant' => $plantId, 'plant' => $plantId,
@@ -1284,7 +1331,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1306,7 +1355,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Serial Number") ->title("Invalid: Serial Number")
->body("Serial number can't be empty!") ->body("Serial number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count(); $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -1324,13 +1375,38 @@ class CreateLocatorInvoiceValidation extends CreateRecord
} }
$snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count(); $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count();
if (strlen($serialNumber) < 13) if (strlen($serialNumber) < 9)
{ {
Notification::make() Notification::make()
->title("Invalid: Serial Number") ->title("Invalid: Serial Number")
->body("Serial number '$serialNumber' must be at least 13 digits and alpha-numeric value only allowed!") ->body('Serial number should contain minimum 9 digits.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => $invoiceNumber,
'pallet_number' => null,
'serial_number' => null,
'sno_quantity' => $snoCount,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (!ctype_alnum($serialNumber))
{
Notification::make()
->title("Invalid: Serial Number")
->body('Serial number must contain alpha-numeric values only.')
// ->body("Serial number '$serialNumber' must be at least 9 digits and alpha-numeric value only allowed!")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1353,7 +1429,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Unknown: Serial Number") ->title("Unknown: Serial Number")
->body("Serial number '{$serialNumber}' does not exist in invoice number '$invoiceNumber'.") ->body("Serial number '{$serialNumber}' does not exist in invoice number '$invoiceNumber'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1373,7 +1451,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Completed: Serial Number") ->title("Completed: Serial Number")
->body("Serial number '{$serialNumber}' already completed the scanning process for the invoice number '$invoiceNumber'.") ->body("Serial number '{$serialNumber}' already completed the scanning process for the invoice number '$invoiceNumber'.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1403,7 +1483,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Unknown: Serial Number") ->title("Unknown: Serial Number")
->body("Serial number '{$serialNumber}' does not exist in pallet table.") ->body("Serial number '{$serialNumber}' does not exist in pallet table.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1434,7 +1516,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title("Incompleted Pallet: Serial Number")//Pallet number '{$existPallNum}' does not completed the master packing! ->title("Incompleted Pallet: Serial Number")//Pallet number '{$existPallNum}' does not completed the master packing!
->body("Serial number '{$serialNumber}' exist in pallet number '$existPallNum' and it does not completed the master packing!") ->body("Serial number '{$serialNumber}' exist in pallet number '$existPallNum' and it does not completed the master packing!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1502,6 +1586,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title($succMsg) ->title($succMsg)
->success() ->success()
->duration(800)
->send(); ->send();
$records = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->get(); $records = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->get();
@@ -1520,6 +1605,7 @@ class CreateLocatorInvoiceValidation extends CreateRecord
->title('Completed: Locator Invoice') ->title('Completed: Locator Invoice')
->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!") ->body("Invoice number '$invoiceNumber' completed the scanning process.<br>Scan the next 'Locator Invoice' to proceed..!")
->info() ->info()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
@@ -1557,7 +1643,9 @@ class CreateLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Failed to check Serial number '{$serialNumber}' existence.<br>Scan the valid serial number to proceed...") ->title("Failed to check Serial number '{$serialNumber}' existence.<br>Scan the valid serial number to proceed...")
->success() ->success()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNumber, $plantId); $this->dispatch('loadData', $invoiceNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,

View File

@@ -112,6 +112,7 @@ class PalletValidationResource extends Resource
Forms\Components\TextInput::make('serial_number') Forms\Components\TextInput::make('serial_number')
->label('Scan Serial No') ->label('Scan Serial No')
->reactive() ->reactive()
->minLength(9)
->readOnly(fn (callable $get) => !$get('pallet_number') || $get('removeSno_number')) ->readOnly(fn (callable $get) => !$get('pallet_number') || $get('removeSno_number'))
->extraAttributes([ ->extraAttributes([
'x-on:keydown.enter.prevent' => '$wire.processPalletSNo()', 'x-on:keydown.enter.prevent' => '$wire.processPalletSNo()',
@@ -119,6 +120,7 @@ class PalletValidationResource extends Resource
Forms\Components\TextInput::make('removeSno_number') Forms\Components\TextInput::make('removeSno_number')
->label('Remove Serial No') ->label('Remove Serial No')
->reactive() ->reactive()
->minLength(9)
->readOnly(fn (callable $get) => !$get('pallet_number') || $get('serial_number')) ->readOnly(fn (callable $get) => !$get('pallet_number') || $get('serial_number'))
->extraAttributes([ ->extraAttributes([
'x-data' => '{ value: "" }', 'x-data' => '{ value: "" }',
@@ -220,24 +222,24 @@ class PalletValidationResource extends Resource
->label('Created By') ->label('Created By')
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('scanned_by')
->label('Scanned By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('created_at') Tables\Columns\TextColumn::make('created_at')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('updated_at') Tables\Columns\TextColumn::make('scanned_by')
->label('Scanned By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('scanned_at')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('scanned_at') Tables\Columns\TextColumn::make('updated_by')
->label('Updated By')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('updated_at')
->dateTime() ->dateTime()
->alignCenter() ->alignCenter()
->sortable() ->sortable()

View File

@@ -57,12 +57,12 @@ class CreatePalletValidation extends CreateRecord
$clickedBy = session('pallet_created_by'); $clickedBy = session('pallet_created_by');
if (!$palletNumber)
if(!$palletNumber)
{ {
Notification::make() Notification::make()
->title('Pallet number cannot be empty') ->title("Pallet number can't be empty")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -76,17 +76,15 @@ class CreatePalletValidation extends CreateRecord
return; return;
} }
$count = PalletValidation::where('plant_id', $plantId) $count = PalletValidation::where('plant_id', $plantId)
->where('pallet_number', $palletNumber) ->where('pallet_number', $palletNumber)
->count('pallet_number'); ->count('pallet_number');
if (!$serialNumber)
if(!$serialNumber)
{ {
Notification::make() Notification::make()
->title('Serial number cannot be empty') ->title('Serial number is required to add.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -100,11 +98,12 @@ class CreatePalletValidation extends CreateRecord
]); ]);
return; return;
} }
if(strlen($serialNumber) < 13) else if (strlen($serialNumber) < 9)
{ {
Notification::make() Notification::make()
->title('Serial number should contain minimum 13 digits.') ->title('Serial number should contain minimum 9 digits.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -118,11 +117,12 @@ class CreatePalletValidation extends CreateRecord
]); ]);
return; return;
} }
if (!ctype_alnum($serialNumber)) else if (!ctype_alnum($serialNumber))
{ {
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', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -143,11 +143,12 @@ class CreatePalletValidation extends CreateRecord
->first(); ->first();
$invoiceNumber = $existInvoiceSno?->invoice_number; $invoiceNumber = $existInvoiceSno?->invoice_number;
if($existInvoiceSno) if ($existInvoiceSno)
{ {
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNumber}' already completed the scanning process and exist in invoice number : {$invoiceNumber}.<br>Scan the new serial number to add!") ->title("Scanned serial number '{$serialNumber}' already completed the scanning process and exist in invoice number : {$invoiceNumber}.<br>Scan the new serial number to add!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -173,6 +174,7 @@ class CreatePalletValidation extends CreateRecord
// Notification::make() // Notification::make()
// ->title("Scanned serial number '{$serialNumber}' exists in pallet table .<br>scan the valid serial number to proceed...") // ->title("Scanned serial number '{$serialNumber}' exists in pallet table .<br>scan the valid serial number to proceed...")
// ->danger() // ->danger()
// ->duration(1200)
// ->send(); // ->send();
// $this->form->fill([ // $this->form->fill([
// 'serial_number' => null, // 'serial_number' => null,
@@ -191,6 +193,7 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNumber}' is already exists in pallet number '{$palletNumber}'.<br>Scan the new serial number to proceed...") ->title("Scanned serial number '{$serialNumber}' is already exists in pallet number '{$palletNumber}'.<br>Scan the new serial number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
} }
else if ($existingRecord && $existingRecord->pallet_number && $existingRecord->pallet_number != $palletNumber) else if ($existingRecord && $existingRecord->pallet_number && $existingRecord->pallet_number != $palletNumber)
@@ -198,6 +201,7 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNumber}' already exists in pallet number '{$existingRecord->pallet_number}'.<br>Scan the new serial number to proceed...") ->title("Scanned serial number '{$serialNumber}' already exists in pallet number '{$existingRecord->pallet_number}'.<br>Scan the new serial number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
} }
else if ($existingRecord && $existingRecord->locator_number) else if ($existingRecord && $existingRecord->locator_number)
@@ -205,6 +209,7 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNumber}' is already exists in locator number '{$existingRecord->locator_number}'.<br>Scan the new serial number to proceed...") ->title("Scanned serial number '{$serialNumber}' is already exists in locator number '{$existingRecord->locator_number}'.<br>Scan the new serial number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
} }
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
@@ -249,14 +254,16 @@ class CreatePalletValidation extends CreateRecord
if ($record) if ($record)
{ {
Notification::make() Notification::make()
->title("Scanned serial number : '{$serialNumber}' successfully inserted into pallet table!<br>Scan the next new serial number to proceed...") ->title("Scanned serial number '{$serialNumber}' successfully inserted into pallet table!<br>Scan the next new serial number to proceed...")
->success() ->success()
->duration(600)
->send(); ->send();
$this->snoCount = PalletValidation::where('plant_id', $plantId) $this->snoCount = PalletValidation::where('plant_id', $plantId)
->where('pallet_number', $palletNumber) ->where('pallet_number', $palletNumber)
->count(); ->count();
$this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'pallet_number' => $palletNumber, 'pallet_number' => $palletNumber,
@@ -266,15 +273,15 @@ class CreatePalletValidation extends CreateRecord
'created_by' => $operatorName, 'created_by' => $operatorName,
'scanned_by' => $operatorName, 'scanned_by' => $operatorName,
]); ]);
$this->dispatch('loadData', $palletNumber, $plantId);
} }
else else
{ {
Notification::make() Notification::make()
->title('Pallet validation not inserted.') ->title("Failed to insert scanned serial number '$serialNumber' into pallet table!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -290,10 +297,12 @@ class CreatePalletValidation extends CreateRecord
catch (\Exception $e) catch (\Exception $e)
{ {
Notification::make() Notification::make()
->title('Error: Pallet validation not inserted.') ->title('Error: Serial not inserted.')
->body("Something went wrong while inserting serial number : '{$serialNumber}' into pallet table!\nScan the new serial number to proceed...") ->body("Something went wrong while inserting serial number '{$serialNumber}' into pallet table!\nScan the new serial number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -362,12 +371,14 @@ class CreatePalletValidation extends CreateRecord
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->first(); ->first();
if(!$palletExist) if (!$palletExist)
{ {
Notification::make() Notification::make()
->title("Pallet number '$palletNumber' does not have serial numbers to save!<br>Add the valid serial number into pallet number to proceed...") ->title("Pallet number '$palletNumber' does not have serial numbers to save!<br>Add the valid serial number into pallet number to proceed...")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -391,7 +402,9 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '$palletNumber' already completed the master packing!<br>Generate the new pallet number or choose from pending pallet list!") ->title("Pallet number '$palletNumber' already completed the master packing!<br>Generate the new pallet number or choose from pending pallet list!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -420,7 +433,8 @@ class CreatePalletValidation extends CreateRecord
if ($updated > 0) if ($updated > 0)
{ {
Notification::make()->title("Pallet number '$palletNumber' records saved successfully!")->success()->send(); Notification::make()->title("Pallet number '$palletNumber' records saved successfully!")->success()->duration(800)->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -446,7 +460,8 @@ class CreatePalletValidation extends CreateRecord
if ($updated > 0) if ($updated > 0)
{ {
Notification::make()->title("Pallet number '$palletNumber' completed the master packing successfully!")->success()->send(); Notification::make()->title("Pallet number '$palletNumber' completed the master packing successfully!")->success()->duration(800)->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -487,6 +502,7 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title('Pallet number is required to remove.') ->title('Pallet number is required to remove.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
return; return;
} }
@@ -501,7 +517,9 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title('Serial number is required to remove.') ->title('Serial number is required to remove.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -514,12 +532,14 @@ class CreatePalletValidation extends CreateRecord
]); ]);
return; return;
} }
if(strlen($serialNumber) < 13) else if (strlen($serialNumber) < 9)
{ {
Notification::make() Notification::make()
->title('Serial number should contain minimum 13 digits.') ->title('Serial number should contain minimum 9 digits.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -537,7 +557,9 @@ class CreatePalletValidation extends CreateRecord
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', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -556,12 +578,14 @@ class CreatePalletValidation extends CreateRecord
->where('scanned_status', '=', 'Scanned') ->where('scanned_status', '=', 'Scanned')
->first(); ->first();
if($invoiceExist) if ($invoiceExist)
{ {
Notification::make() Notification::make()
->title("Scanned serial number '{$serialNumber}' already completed the scanning process and exist in invoice number : '{$invoiceExist->invoice_number}'.<br>Scan the valid exist serial number to remove!") ->title("Scanned serial number '{$serialNumber}' already completed the scanning process and exist in invoice number '{$invoiceExist->invoice_number}'.<br>Scan the valid exist serial number to remove!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -578,12 +602,14 @@ class CreatePalletValidation extends CreateRecord
$serialexist = PalletValidation::where('plant_id', $plantId) $serialexist = PalletValidation::where('plant_id', $plantId)
->where('serial_number', $serialNumber) ->where('serial_number', $serialNumber)
->first(); ->first();
if(!$serialexist) if (!$serialexist)
{ {
Notification::make() Notification::make()
->title('Serial number not exists in pallet table.') ->title('Serial number not exists in pallet table.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -603,11 +629,12 @@ class CreatePalletValidation extends CreateRecord
->where('pallet_number', '!=', null) ->where('pallet_number', '!=', null)
->first(); ->first();
if($palletExist && $palletExist->pallet_number != $palletNumber) if ($palletExist && $palletExist->pallet_number != $palletNumber)
{ {
Notification::make() Notification::make()
->title("Scanned serial number exist in pallet number '$palletExist->pallet_number'.<br>Scan the valid exist serial number to remove!") ->title("Scanned serial number exist in pallet number '$palletExist->pallet_number'.<br>Scan the valid exist serial number to remove!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -628,11 +655,12 @@ class CreatePalletValidation extends CreateRecord
->where('locator_number', '!=', null) ->where('locator_number', '!=', null)
->first(); ->first();
if($locatorExist && $locatorExist->locator_number) if ($locatorExist && $locatorExist->locator_number)
{ {
Notification::make() Notification::make()
->title("Scanned serial number exist in locator number '$locatorExist->locator_number'.<br>Scan the valid exist serial number to remove!") ->title("Scanned serial number exist in locator number '$locatorExist->locator_number'.<br>Scan the valid exist serial number to remove!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
@@ -656,8 +684,9 @@ class CreatePalletValidation extends CreateRecord
if ($deleted) if ($deleted)
{ {
Notification::make() Notification::make()
->title("Scanned serial number : '$serialNumber' successfully removed from pallet table!<br>Scan the next exist serial number to remove...") ->title("Scanned serial number '$serialNumber' successfully removed from pallet table!<br>Scan the next exist serial number to remove...")
->success() ->success()
->duration(600)
->send(); ->send();
$this->snoCount = PalletValidation::where('plant_id', $plantId) $this->snoCount = PalletValidation::where('plant_id', $plantId)
@@ -679,9 +708,11 @@ class CreatePalletValidation extends CreateRecord
else else
{ {
Notification::make() Notification::make()
->title('Failed to delete serial number.') ->title("Failed to remove scanned serial number '$serialNumber' from pallet table!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -696,7 +727,6 @@ class CreatePalletValidation extends CreateRecord
} }
//$this->dispatch('removeSno', $serialNumber, $palletNumber, $plantId); //$this->dispatch('removeSno', $serialNumber, $palletNumber, $plantId);
} }
public function processPalletNo() public function processPalletNo()
@@ -735,7 +765,9 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title('Pallet number is required.') ->title('Pallet number is required.')
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $plantId); $this->dispatch('loadData', '', $plantId);
$this->form->fill([ $this->form->fill([
'serial_number' => null, 'serial_number' => null,
@@ -754,7 +786,9 @@ class CreatePalletValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '$palletNumber' must be at least 10 digits.") ->title("Pallet number '$palletNumber' 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([
'serial_number' => null, 'serial_number' => null,
@@ -782,8 +816,9 @@ class CreatePalletValidation extends CreateRecord
if (!$palletNotCompleted) if (!$palletNotCompleted)
{ {
Notification::make() Notification::make()
->title("Already completed for pallet number $palletNumber") ->title("Already completed for pallet number $palletNumber!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $palletNumber, $plantId); $this->dispatch('loadData', $palletNumber, $plantId);