1
0
forked from poc/pds

changed regex pattern in panel box inspection page

This commit is contained in:
dhanabalan
2026-10-23 17:24:16 +05:30
parent 92324e9f3b
commit baf41cfea1

View File

@@ -288,11 +288,11 @@ class PanelBoxInspectionStock extends Page
{ {
$parts = explode('/', $itemId); $parts = explode('/', $itemId);
if (count($parts) < 4) { if (!preg_match('/^\d+\/\d+\/\d{4}\/\d+$/', $itemId) || preg_match('/[a-zA-Z]/', $itemId)) {
Notification::make() Notification::make()
->title('Invalid QR Format') ->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber') ->body("Expected format: plantcode/itemcode/yearmm/serialnumber : Format Received : $itemId")
->danger() ->danger()
->send(); ->send();
$this->form->fill([ $this->form->fill([
@@ -358,10 +358,11 @@ class PanelBoxInspectionStock extends Page
return; return;
} }
} }
else { else
{
Notification::make() Notification::make()
->title('Invalid QR Format') ->title('Invalid QR Format')
->body('Expected format: plantcode/itemcode/yearmm/serialnumber (Or) plantcode/panelboxcode/serialnumber') ->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
->danger() ->danger()
->send(); ->send();
$this->form->fill([ $this->form->fill([