Added rework logic in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s

This commit is contained in:
dhanabalan
2026-08-28 10:32:49 +05:30
parent 88e6b83487
commit 95d70fbdca

View File

@@ -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) {