Added rework logic in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
This commit is contained in:
@@ -810,21 +810,21 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
|
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
// if ($serialExists) {
|
if ($serialExists) {
|
||||||
// $set('serial_exists', true);
|
$set('serial_exists', true);
|
||||||
// } else {
|
} else {
|
||||||
// $set('serial_exists', false);
|
$set('serial_exists', false);
|
||||||
// }
|
|
||||||
|
|
||||||
if ($serialExists && ! $get('id')) {
|
|
||||||
$set('validationError', 'Serial number already exists in panel box validation.');
|
|
||||||
$set('sticker_master_id', null);
|
|
||||||
$set('uom', null);
|
|
||||||
$set('serial_number', null);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if ($serialExists && ! $get('id')) {
|
||||||
|
// $set('validationError', 'Serial number already exists in panel box validation.');
|
||||||
|
// $set('sticker_master_id', null);
|
||||||
|
// $set('uom', null);
|
||||||
|
// $set('serial_number', null);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
$set('validationError', null);
|
$set('validationError', null);
|
||||||
|
|
||||||
foreach ($serialFields as $column) {
|
foreach ($serialFields as $column) {
|
||||||
|
|||||||
Reference in New Issue
Block a user