Added plant code validation logic in resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 22s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 22s
Laravel Pint / pint (pull_request) Successful in 1m48s
Laravel Larastan / larastan (pull_request) Failing after 3m25s

This commit is contained in:
dhanabalan
2026-07-08 09:58:02 +05:30
parent fa10ea14fe
commit 5fe8eeaeee

View File

@@ -178,6 +178,8 @@ class PanelBoxValidationResource extends Resource
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
$pId = $get('line_id');
$plantId = $get('plant_id');
$plaCode = Plant::find($plantId)?->code;
$set('part_validation_type', null);
$set('show_validation_image', false);
$set('validation1_image_url', null);
@@ -384,7 +386,17 @@ class PanelBoxValidationResource extends Resource
$set('item_id', null);
return;
}
} else {
else if($plantCode != $plaCode){
Notification::make()
->title('Invalid Plant Code')
->body("Scanned plant code doesn't match the selected plant.")
->danger()
->send();
$set('item_id', null);
return;
}
}
else {
Notification::make()
->title('Invalid QR Format')
@@ -478,6 +490,7 @@ class PanelBoxValidationResource extends Resource
// $set('serial_number', null);
// $set('serial_number', $serialNumber);
}
// Check if user input matches the database values
foreach ($partValidationColumns as $field) {
if ($get("{$field}_visible")) {