Added serial_number minimum length should be 9 digit and notification display duration
This commit is contained in:
@@ -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');
|
||||||
@@ -264,9 +266,10 @@ class LocatorInvoiceValidationResource extends Resource
|
|||||||
if (!$palletRecord)
|
if (!$palletRecord)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title("Pallet number '{$palletNumber}' does not exist.")
|
->title("Pallet number '{$palletNumber}' does not exist.")
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,8 +290,9 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ($allCompleted)
|
// if ($allCompleted)
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -569,10 +576,12 @@ 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()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->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,10 +609,12 @@ 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)) {
|
|
||||||
$disk->delete($path);
|
if ($disk->exists($path)) {
|
||||||
}
|
$disk->delete($path);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,20 +631,22 @@ 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;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Save full file path to session
|
// Save full file path to session
|
||||||
session(['uploaded_invoice_path' => $fullPath]);
|
session(['uploaded_invoice_path' => $fullPath]);
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Success: Invoice imported successfully.')
|
->title('Success: Invoice imported successfully.')
|
||||||
->success()
|
->success()
|
||||||
|
->duration(800)
|
||||||
->send();
|
->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
if(!$plantId)
|
if(!$plantId)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Plant Not Found')
|
->title('Plant Not Found')
|
||||||
->body("Plant can't be empty!")
|
->body("Plant can't be empty!")
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->send();
|
||||||
$this->dispatch('loadData', '', $plantId);
|
$this->dispatch('loadData', '', $plantId);
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -234,10 +237,12 @@ 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()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->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;
|
||||||
}
|
}
|
||||||
@@ -535,10 +549,12 @@ 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()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->send();
|
||||||
|
|
||||||
if ($disk->exists($filePath)) {
|
if ($disk->exists($filePath)) {
|
||||||
$disk->delete($filePath);
|
$disk->delete($filePath);
|
||||||
}
|
}
|
||||||
@@ -560,10 +576,12 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
|
|
||||||
if (!empty($duplicateSerialCodes)) {
|
if (!empty($duplicateSerialCodes)) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->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()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->send();
|
||||||
|
|
||||||
if ($disk->exists($filePath))
|
if ($disk->exists($filePath))
|
||||||
{
|
{
|
||||||
$disk->delete($filePath);
|
$disk->delete($filePath);
|
||||||
@@ -587,10 +605,12 @@ 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)) {
|
|
||||||
$disk->delete($filePath);
|
if ($disk->exists($filePath)) {
|
||||||
}
|
$disk->delete($filePath);
|
||||||
|
}
|
||||||
$this->dispatch('loadData', '', $plantId);
|
$this->dispatch('loadData', '', $plantId);
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -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,
|
||||||
@@ -865,9 +896,11 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
if (strlen($palletNumber) < 10)
|
if (strlen($palletNumber) < 10)
|
||||||
{
|
{
|
||||||
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()
|
||||||
->send();
|
->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,
|
||||||
@@ -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,
|
||||||
@@ -944,28 +981,30 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
if ($allCompleted)
|
if ($allCompleted)
|
||||||
{
|
{
|
||||||
$PalletSerialNumbers = $palletRecords->pluck('serial_number')
|
$PalletSerialNumbers = $palletRecords->pluck('serial_number')
|
||||||
->map(function ($serial) {
|
->map(function ($serial) {
|
||||||
return trim($serial);
|
return trim($serial);
|
||||||
})
|
})
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
$InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)
|
$InvoiceSerialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||||
->where('invoice_number', $invoiceNumber)
|
->where('invoice_number', $invoiceNumber)
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('scanned_status', '=', '')
|
$query->where('scanned_status', '=', '')
|
||||||
->orWhereNull('scanned_status');
|
->orWhereNull('scanned_status');
|
||||||
})
|
})
|
||||||
->pluck('serial_number')
|
->pluck('serial_number')
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
$matchedSerialNumbers = array_intersect($PalletSerialNumbers, $InvoiceSerialNumbers);
|
$matchedSerialNumbers = array_intersect($PalletSerialNumbers, $InvoiceSerialNumbers);
|
||||||
|
|
||||||
if (empty($matchedSerialNumbers))
|
if (empty($matchedSerialNumbers))
|
||||||
{
|
{
|
||||||
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()
|
||||||
->send();
|
->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,
|
||||||
@@ -1001,10 +1040,12 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
// $body = "Scanned pallet number '$palletNumber' has ".$missingSerialsString."<br>Do you want to skip missing serial numbers?<br>Then Press 'Yes' and Click 'Enter'.";
|
// $body = "Scanned pallet number '$palletNumber' has ".$missingSerialsString."<br>Do you want to skip missing serial numbers?<br>Then Press 'Yes' and Click 'Enter'.";
|
||||||
|
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title("Partial Pallet Serial Numbers Found")
|
->title("Partial Pallet Serial Numbers Found")
|
||||||
->body($missingSerialsString)
|
->body($missingSerialsString)
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->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,
|
||||||
@@ -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,
|
||||||
@@ -1303,10 +1352,12 @@ class CreateLocatorInvoiceValidation extends CreateRecord
|
|||||||
if ($serialNumber == '' || $serialNumber == null)
|
if ($serialNumber == '' || $serialNumber == null)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title("Invalid: Serial Number")
|
->title("Invalid: Serial Number")
|
||||||
->body("Serial number can't be empty!")
|
->body("Serial number can't be empty!")
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->duration(1200)
|
||||||
|
->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,
|
||||||
|
|||||||
Reference in New Issue
Block a user