Updated warning message if locator serial numbers not exist

This commit is contained in:
dhanabalan
2025-07-02 15:12:53 +05:30
parent a33c73c2f2
commit 8f95147a30

View File

@@ -649,7 +649,25 @@ class PalletFromLocator extends Page implements HasForms
// $this->Checking = session('latestPalletSerials');
$operatorName = Filament::auth()->user()->name;
$plantId = trim($plantId) ?? null;
if (count($this->records) <= 0)
{
Notification::make()
->title('Locator Serials Not Found')
->body("Add some locator serial numbers to proceed generate pallet..!")
->danger()
->seconds(3)
->send();
$this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'scan_locator_number' => $locatorNo,
'scan_serial_number' => $serialNo,
'scan_remove_sno' => $removeSerial,
'sno_quantity' => 0,
]);
return;
}
$year = now()->format('y');
$month = now()->format('m');
@@ -678,26 +696,6 @@ class PalletFromLocator extends Page implements HasForms
}));
JS);
if (count($this->records) <= 0)
{
Notification::make()
->title('Locator Serials Not Found')
->body("Add some locator serial numbers to proceed generate pallet..!")
->danger()
->seconds(3)
->send();
$this->dispatch('loadData', $this->records, $plantId);
$this->form->fill([
'plant_id' => $plantId,
'plant' => $plantId,
'scan_locator_number' => $locatorNo,
'scan_serial_number' => $serialNo,
'scan_remove_sno' => $removeSerial,
'sno_quantity' => 0,
]);
return;
}
// $affected = PalletValidation::where('locator_number', $locatorNo)
// ->where('plant_id', $plantId)
// ->whereIn('serial_number', $this->Checking)