1
0
forked from poc/pds

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

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff