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 19:35:39 +05:30
parent eb2b857aa7
commit 4ac1823e5b
2 changed files with 234 additions and 41 deletions

View File

@@ -86,6 +86,7 @@ class ReworkLocatorInvoiceValidationResource extends Resource
->label('Scan Pallet No') ->label('Scan Pallet No')
->required( fn ($get) => $get('rework_type') == 'pallet') ->required( fn ($get) => $get('rework_type') == 'pallet')
->readOnly(fn ($get) => $get('rework_type') == 'invoice') ->readOnly(fn ($get) => $get('rework_type') == 'invoice')
->minLength(10)
->reactive() ->reactive()
->readOnly(fn (callable $get) => (!$get('plant') || !$get('rework_type') || ($get('rework_type') == 'invoice' && !$get('invoice_number')) || $get('scan_serial_no'))) ->readOnly(fn (callable $get) => (!$get('plant') || !$get('rework_type') || ($get('rework_type') == 'invoice' && !$get('invoice_number')) || $get('scan_serial_no')))
->extraAttributes([ ->extraAttributes([
@@ -93,8 +94,9 @@ class ReworkLocatorInvoiceValidationResource extends Resource
]), ]),
Forms\Components\TextInput::make('scan_serial_no') Forms\Components\TextInput::make('scan_serial_no')
->label('Scan Serial No') ->label('Scan Serial No')
->reactive()
->readOnly(fn (callable $get) => (!$get('plant') || !$get('rework_type') || ($get('rework_type') == 'invoice' && !$get('invoice_number')) || ($get('rework_type') == 'invoice' && $get('scan_pallet_no')) || ($get('rework_type') == 'pallet' && !$get('scan_pallet_no')))) ->readOnly(fn (callable $get) => (!$get('plant') || !$get('rework_type') || ($get('rework_type') == 'invoice' && !$get('invoice_number')) || ($get('rework_type') == 'invoice' && $get('scan_pallet_no')) || ($get('rework_type') == 'pallet' && !$get('scan_pallet_no'))))
->minLength(9)
->reactive()
->extraAttributes([ ->extraAttributes([
'wire:keydown.enter' => 'processSno($event.target.value)', 'wire:keydown.enter' => 'processSno($event.target.value)',
]), ]),
@@ -145,21 +147,21 @@ class ReworkLocatorInvoiceValidationResource extends Resource
$invoiceNumber = $get('invoice_number'); $invoiceNumber = $get('invoice_number');
$rows = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber) $rows = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->get(); ->get();
$notCompletedCount = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber) $notCompletedCount = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->where(function($query) { ->where(function($query) {
$query->whereNull('scanned_status') $query->whereNull('scanned_status')
->orWhere('scanned_status', ''); ->orWhere('scanned_status', '');
}) })
->count(); ->count();
$isScanningComplete = true; $isScanningComplete = true;
foreach ($rows as $row) foreach ($rows as $row)
{ {
if ($row->scanned_status !== 'Scanned') { if ($row->scanned_status != 'Scanned') {
$isScanningComplete = false; $isScanningComplete = false;
break; break;
} }
@@ -168,9 +170,12 @@ class ReworkLocatorInvoiceValidationResource extends Resource
if (!$isScanningComplete) if (!$isScanningComplete)
{ {
Notification::make() Notification::make()
->title("Scanned invoice number: '$invoiceNumber' does not completed the scanning process!<br>Has '$notCompletedCount' pending serial number to scan!<br>Please, scan the valid completed invoice number to proceed...") ->title("Scanned invoice number: '$invoiceNumber' does not completed the scanning process!<br>Has '$notCompletedCount' pending serial number to scan!<br>Please, scan the valid completed invoice number to proceed...")
->danger() ->danger()
->send(); ->duration(1200)
->send();
$set('invoice_number', null);
$set('update_invoice', null);
return; return;
} }
}), }),
@@ -184,24 +189,16 @@ class ReworkLocatorInvoiceValidationResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get, $livewire) { ->afterStateUpdated(function ($state, callable $set, callable $get, $livewire) {
$plantId = $get('plant'); $plantId = $get('plant');
$invoiceNumber = $get('invoice_number'); $palletNumber = $get('scan_pallet_no');
$rows = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber) $rows = PalletValidation::where('pallet_number', $palletNumber)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->get(); ->get();
$notCompletedCount = LocatorInvoiceValidation::where('invoice_number', $invoiceNumber)
->where('plant_id', $plantId)
->where(function($query) {
$query->whereNull('scanned_status')
->orWhere('scanned_status', '');
})
->count();
$isScanningComplete = true; $isScanningComplete = true;
foreach ($rows as $row) foreach ($rows as $row)
{ {
if ($row->scanned_status !== 'Scanned') { if ($row->pallet_status != 'Completed') {
$isScanningComplete = false; $isScanningComplete = false;
break; break;
} }
@@ -210,9 +207,12 @@ class ReworkLocatorInvoiceValidationResource extends Resource
if (!$isScanningComplete) if (!$isScanningComplete)
{ {
Notification::make() Notification::make()
->title("Scanned invoice number: '$invoiceNumber' does not completed the scanning process!<br>Has '$notCompletedCount' pending serial number to scan!<br>Please, scan the valid completed invoice number to proceed...") ->title("Scanned pallet number '$palletNumber' does not completed the master packing!<br>Please, scan the valid completed pallet number to proceed...")
->danger() ->danger()
->send(); ->duration(1200)
->send();
$set('scan_pallet_no', null);
$set('update_pallet', null);
return; return;
} }
}), }),

View File

@@ -54,7 +54,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Invoice Number") ->title("Invalid: Invoice Number")
->body("Invoice number can't be empty!") ->body("Invoice number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -81,6 +83,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Found') ->title('Invoice Not Found')
->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!") ->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -126,7 +129,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number '$palletNo' must be at least 10 digits.") ->body("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -143,13 +148,40 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
]); ]);
return; return;
} }
else if (strlen($serialNo) > 0 && strlen($serialNo) < 13) else if (strlen($serialNo) > 0 && 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()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => $invoiceNo,
'scan_pallet_no' => null,
'scan_serial_no' => null,
'rework_type' => $reworkType,
'reworkType' => $reworkType,
'update_invoice' => 0,
'update_pallet' => 0,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (strlen($serialNo) > 0 && !ctype_alnum($serialNo))
{
Notification::make()
->title("Invalid: Serial Number")
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -196,6 +228,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Rework Invoice') ->title('Completed: Rework Invoice')
->body("Scanned invoice number '$invoiceNo' successfully moved into rework invoice table.<br><br>Please, scan the next completed invoice number to proceed..!") ->body("Scanned invoice number '$invoiceNo' successfully moved into rework invoice table.<br><br>Please, scan the next completed invoice number to proceed..!")
->success() ->success()
->duration(800)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -219,6 +252,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Invoice Found') ->title('Completed: Invoice Found')
->body("Press 'Yes' and Press 'Enter' in Scan Invoice No to do rework for entire invoice.<br><br>Press 'No' to do rework against 'Pallet or Serial Number'..!") ->body("Press 'Yes' and Press 'Enter' in Scan Invoice No to do rework for entire invoice.<br><br>Press 'No' to do rework against 'Pallet or Serial Number'..!")
->info() ->info()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
@@ -244,6 +278,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Completed') ->title('Invoice Not Completed')
->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!") ->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -269,15 +304,18 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Choosed: Pallet Rework Type") ->title("Choosed: Pallet Rework Type")
->body("Scan valid pallet number to proceed..!") ->body("Scan valid pallet number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
return; return;
} }
else else
{ {
Notification::make() Notification::make()
->title("Rework Type Not Found") ->title("Rework Type Not Found")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -331,7 +369,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Invoice Number") ->title("Invalid: Invoice Number")
->body("Invoice number can't be empty!") ->body("Invoice number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -358,6 +398,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Found') ->title('Invoice Not Found')
->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!") ->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -403,7 +444,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number can't be empty!") ->body("Pallet number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -427,7 +470,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number '$palletNo' must be at least 10 digits.") ->body("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -453,6 +498,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Pallet Not Found') ->title('Pallet Not Found')
->body("Pallet number '$palletNo' doesn't exist in scanned invoice number '$invoiceNo'!<br><br>Scan the valid exist 'Pallet Number' to proceed..!") ->body("Pallet number '$palletNo' doesn't exist in scanned invoice number '$invoiceNo'!<br><br>Scan the valid exist 'Pallet Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
@@ -472,13 +518,40 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
return; return;
} }
if (strlen($serialNo) > 0 && strlen($serialNo) < 13) if (strlen($serialNo) > 0 && 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()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, $palletNo, $plantId, $reworkType);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => $invoiceNo,
'scan_pallet_no' => $palletNo,
'scan_serial_no' => null,
'rework_type' => $reworkType,
'reworkType' => $reworkType,
'update_invoice' => 0,
'update_pallet' => 0,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (strlen($serialNo) > 0 && !ctype_alnum($serialNo))
{
Notification::make()
->title("Invalid: Serial Number")
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', $invoiceNo, $palletNo, $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, $palletNo, $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -526,6 +599,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Rework Pallet from Invoice') ->title('Completed: Rework Pallet from Invoice')
->body("Scanned pallet number '$palletNo' successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next pallet number to proceed..!") ->body("Scanned pallet number '$palletNo' successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next pallet number to proceed..!")
->success() ->success()
->duration(800)
->send(); ->send();
$InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->first(); $InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->first();
@@ -535,6 +609,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("All available serial numbers are successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next invoice number to proceed..!") ->title("All available serial numbers are successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next invoice number to proceed..!")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -576,6 +651,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Completed') ->title('Invoice Not Completed')
->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!") ->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -603,7 +679,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number can't be empty!") ->body("Pallet number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -627,7 +705,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number '$palletNo' must be at least 10 digits.") ->body("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -653,6 +733,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Pallet Not Found') ->title('Pallet Not Found')
->body("Pallet number '$palletNo' doesn't exist in pallet table!<br><br>Scan the valid exist 'Pallet Number' to proceed..!") ->body("Pallet number '$palletNo' doesn't exist in pallet table!<br><br>Scan the valid exist 'Pallet Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -692,6 +773,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Locator Pallet Found') ->title('Locator Pallet Found')
->body("Scanned pallet number '$palletNo' exist in locator number '$locatExist'.<br><br>Remove scanned 'Pallet' from 'Locator' to proceed re-master packing..!") ->body("Scanned pallet number '$palletNo' exist in locator number '$locatExist'.<br><br>Remove scanned 'Pallet' from 'Locator' to proceed re-master packing..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -712,13 +794,40 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
} }
else else
{ {
if (strlen($serialNo) > 0 && strlen($serialNo) < 13) if (strlen($serialNo) > 0 && 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()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => null,
'scan_pallet_no' => $palletNo,
'scan_serial_no' => null,
'rework_type' => $reworkType,
'reworkType' => $reworkType,
'update_invoice' => 0,
'update_pallet' => 0,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (strlen($serialNo) > 0 && !ctype_alnum($serialNo))
{
Notification::make()
->title("Invalid: Serial Number")
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType); $this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -747,6 +856,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Rework Pallet') ->title('Completed: Rework Pallet')
->body("Scanned pallet number '$palletNo' successfully removed from pallet table.<br><br>Please, scan the next pallet number to re-master packing..!") ->body("Scanned pallet number '$palletNo' successfully removed from pallet table.<br><br>Please, scan the next pallet number to re-master packing..!")
->success() ->success()
->duration(800)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -771,6 +881,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Pallet Found') ->title('Completed: Pallet Found')
->body("Press 'Yes' and Press 'Enter' in Scan Pallet No to do re-master packing for entire pallet.<br><br>Press 'No' to do partial re-master packing against 'Serial Number'..!") ->body("Press 'Yes' and Press 'Enter' in Scan Pallet No to do re-master packing for entire pallet.<br><br>Press 'No' to do partial re-master packing against 'Serial Number'..!")
->info() ->info()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType); $this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
@@ -797,6 +908,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Pallet Not Completed') ->title('Pallet Not Completed')
->body("Scanned pallet number '$palletNo' doesn't completed the master packing!<br><br>Please, scan the valid completed pallet number to proceed..!") ->body("Scanned pallet number '$palletNo' doesn't completed the master packing!<br><br>Please, scan the valid completed pallet number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -821,7 +933,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Rework Type Not Found") ->title("Rework Type Not Found")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -875,7 +989,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Invoice Number") ->title("Invalid: Invoice Number")
->body("Invoice number can't be empty!") ->body("Invoice number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -902,6 +1018,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Found') ->title('Invoice Not Found')
->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!") ->body("Invoice number '$invoiceNo' doesn't exist in invoice table!<br><br>Scan the valid exist 'Invoice Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -947,7 +1064,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number '$palletNo' must be at least 10 digits.") ->body("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -970,7 +1089,9 @@ class CreateReworkLocatorInvoiceValidation 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();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -988,13 +1109,40 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
]); ]);
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()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => $invoiceNo,
'scan_pallet_no' => null,
'scan_serial_no' => null,
'rework_type' => $reworkType,
'reworkType' => $reworkType,
'update_invoice' => 0,
'update_pallet' => 0,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (!ctype_alnum($serialNo))
{
Notification::make()
->title("Invalid: Serial Number")
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1020,6 +1168,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Serial Not Found') ->title('Serial Not Found')
->body("Serial number '$serialNo' doesn't exist in scanned invoice number '$invoiceNo'!<br><br>Scan the valid exist 'Serial Number' to proceed..!") ->body("Serial number '$serialNo' doesn't exist in scanned invoice number '$invoiceNo'!<br><br>Scan the valid exist 'Serial Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType); $this->dispatch('loadData', $invoiceNo, '', $plantId, $reworkType);
@@ -1069,6 +1218,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Rework Serial from Invoice') ->title('Completed: Rework Serial from Invoice')
->body("Scanned serial number '$serialNo' successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next serial number to proceed..!") ->body("Scanned serial number '$serialNo' successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next serial number to proceed..!")
->success() ->success()
->duration(800)
->send(); ->send();
$InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->first(); $InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->first();
@@ -1078,6 +1228,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("All available serial numbers are successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next invoice number to proceed..!") ->title("All available serial numbers are successfully moved into rework invoice table from invoice number '$invoiceNo'.<br><br>Please, scan the next invoice number to proceed..!")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -1119,6 +1270,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Invoice Not Completed') ->title('Invoice Not Completed')
->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!") ->body("Scanned invoice number '$invoiceNo' doesn't completed the scanning process!<br><br>Has '$notCompletedCount' pending serial number to scan!<br><br>Please, scan the valid completed invoice number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -1146,7 +1298,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number can't be empty!") ->body("Pallet number can't be empty!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -1170,7 +1324,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title("Invalid: Pallet Number") ->title("Invalid: Pallet Number")
->body("Pallet number '$palletNo' must be at least 10 digits.") ->body("Pallet number '$palletNo' must be at least 10 digits.")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1196,6 +1352,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Pallet Not Found') ->title('Pallet Not Found')
->body("Pallet number '$palletNo' doesn't exist in pallet table!<br><br>Scan the valid exist 'Pallet Number' to proceed..!") ->body("Pallet number '$palletNo' doesn't exist in pallet table!<br><br>Scan the valid exist 'Pallet Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -1235,6 +1392,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Locator Pallet Found') ->title('Locator Pallet Found')
->body("Scanned pallet number '$palletNo' exist in locator number '$locatExist'.<br><br>Remove scanned 'Pallet' from 'Locator' to proceed re-master packing..!") ->body("Scanned pallet number '$palletNo' exist in locator number '$locatExist'.<br><br>Remove scanned 'Pallet' from 'Locator' to proceed re-master packing..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '' , '', $plantId, $reworkType); $this->dispatch('loadData', '' , '', $plantId, $reworkType);
@@ -1261,7 +1419,9 @@ class CreateReworkLocatorInvoiceValidation 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();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType); $this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
// $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count(); // $snoCount = LocatorInvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNo)->count();
$this->form->fill([ $this->form->fill([
@@ -1279,13 +1439,40 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
]); ]);
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()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'invoice_number' => null,
'scan_pallet_no' => $palletNo,
'scan_serial_no' => null,
'rework_type' => $reworkType,
'reworkType' => $reworkType,
'update_invoice' => 0,
'update_pallet' => 0,
'created_by' => $operatorName,
'scanned_by' => $operatorName,
]);
return;
}
else if (!ctype_alnum($serialNo))
{
Notification::make()
->title("Invalid: Serial Number")
->body("Serial number '$serialNo' must contain alpha-numeric values only.")
->danger()
->duration(1200)
->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType); $this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -1311,6 +1498,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Serial Not Found') ->title('Serial Not Found')
->body("Serial number '$serialNo' doesn't exist in pallet number '$palletNo'!<br><br>Scan the valid exist 'Serial Number' to proceed..!") ->body("Serial number '$serialNo' doesn't exist in pallet number '$palletNo'!<br><br>Scan the valid exist 'Serial Number' to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', $palletNo, $plantId, $reworkType); $this->dispatch('loadData', '', $palletNo, $plantId, $reworkType);
@@ -1347,6 +1535,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Completed: Rework Serial from Pallet') ->title('Completed: Rework Serial from Pallet')
->body("Scanned serial number '$serialNo' successfully removed from pallet number '$palletNo'.<br><br>Please, scan the next pallet number to re-master packing..!") ->body("Scanned serial number '$serialNo' successfully removed from pallet number '$palletNo'.<br><br>Please, scan the next pallet number to re-master packing..!")
->success() ->success()
->duration(800)
->send(); ->send();
$PalletSerialNumbers = PalletValidation::where('plant_id', $plantId)->where('pallet_number', $palletNo)->first(); $PalletSerialNumbers = PalletValidation::where('plant_id', $plantId)->where('pallet_number', $palletNo)->first();
@@ -1356,6 +1545,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Pallet number '$palletNo' successfully re-master packed.<br><br>Please, scan the next pallet number to re-master packing..!") ->title("Pallet number '$palletNo' successfully re-master packed.<br><br>Please, scan the next pallet number to re-master packing..!")
->success() ->success()
->duration(1000)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
@@ -1398,6 +1588,7 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
->title('Pallet Not Completed') ->title('Pallet Not Completed')
->body("Pallet number '$palletNo' doesn't completed the master packing for scanned serial number '$serialNo'!<br><br>Please, scan the valid completed pallet number to proceed..!") ->body("Pallet number '$palletNo' doesn't completed the master packing for scanned serial number '$serialNo'!<br><br>Please, scan the valid completed pallet number to proceed..!")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '' , '', $plantId, $reworkType); $this->dispatch('loadData', '' , '', $plantId, $reworkType);
@@ -1422,7 +1613,9 @@ class CreateReworkLocatorInvoiceValidation extends CreateRecord
Notification::make() Notification::make()
->title("Rework Type Not Found") ->title("Rework Type Not Found")
->danger() ->danger()
->duration(1200)
->send(); ->send();
$this->dispatch('loadData', '', '', $plantId, $reworkType); $this->dispatch('loadData', '', '', $plantId, $reworkType);
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,