removed unwanted logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 1m50s
Laravel Larastan / larastan (pull_request) Failing after 3m36s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 1m50s
Laravel Larastan / larastan (pull_request) Failing after 3m36s
This commit is contained in:
@@ -296,10 +296,17 @@ class PanelBoxValidationResource extends Resource
|
||||
}
|
||||
else
|
||||
{
|
||||
$parts = explode('/', $state);
|
||||
// $parts = explode('/', $state);
|
||||
|
||||
$itemCode = trim($parts[1] ?? ''); // item code
|
||||
$serialNumber = trim($parts[2] ?? ''); // serial number
|
||||
// $itemCode = trim($parts[1] ?? ''); // item code
|
||||
// $serialNumber = trim($parts[2] ?? ''); // serial number
|
||||
|
||||
$parts = array_map('trim', explode('/', $state));
|
||||
|
||||
$serialNumber = end($parts); // last part
|
||||
|
||||
// item code depends on format
|
||||
$itemCode = $parts[1] ?? '';
|
||||
}
|
||||
|
||||
// Store serial number before resetting fields
|
||||
@@ -324,31 +331,35 @@ class PanelBoxValidationResource extends Resource
|
||||
$set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
} elseif ($serialNumber == '') {
|
||||
$set('validationError', 'Waiting for full QR scan...');
|
||||
}
|
||||
//elseif ($serialNumber == '') {
|
||||
// $set('validationError', 'Waiting for full QR scan...');
|
||||
|
||||
return;
|
||||
} elseif (strlen($serialNumber) < 9) {
|
||||
$set('validationError', 'Serial Number must be at least 9 digits.');
|
||||
$set('part_validation_type', null);
|
||||
$set('show_validation_image', false);
|
||||
$set('part_validation_type_options', []);
|
||||
$set('validation1_image_url', null);
|
||||
// return;
|
||||
// } elseif (strlen($serialNumber) < 9) {
|
||||
// $set('validationError', 'Serial Number must be at least 9 digits.');
|
||||
// $set('part_validation_type', null);
|
||||
// $set('show_validation_image', false);
|
||||
// $set('part_validation_type_options', []);
|
||||
// $set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
} elseif (! ctype_alnum($serialNumber)) {
|
||||
$set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||
$set('item_id', null);
|
||||
$set('part_validation_type', null);
|
||||
$set('show_validation_image', false);
|
||||
$set('part_validation_type_options', []);
|
||||
$set('validation1_image_url', null);
|
||||
// return;
|
||||
// } elseif (! ctype_alnum($serialNumber)) {
|
||||
// $set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||
// $set('item_id', null);
|
||||
// $set('part_validation_type', null);
|
||||
// $set('show_validation_image', false);
|
||||
// $set('part_validation_type_options', []);
|
||||
// $set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
} else {
|
||||
// return;
|
||||
// }
|
||||
|
||||
else {
|
||||
$set('validationError', null);
|
||||
}
|
||||
|
||||
|
||||
$plantId = $get('plant_id'); // Get selected plant
|
||||
|
||||
if (! $plantId) {
|
||||
|
||||
Reference in New Issue
Block a user