Merge pull request 'added duplicate logic in panel box validation' (#943) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #943
This commit was merged in pull request #943.
This commit is contained in:
@@ -817,21 +817,21 @@ class PanelBoxValidationResource extends Resource
|
||||
|
||||
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->latest()->first();
|
||||
|
||||
if ($serialExists) {
|
||||
$set('serial_exists', true);
|
||||
} else {
|
||||
$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) {
|
||||
// $set('serial_exists', true);
|
||||
// } else {
|
||||
// $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;
|
||||
}
|
||||
|
||||
$set('validationError', null);
|
||||
|
||||
foreach ($serialFields as $column) {
|
||||
@@ -1027,7 +1027,7 @@ class PanelBoxValidationResource extends Resource
|
||||
Notification::make()
|
||||
->title('Invalid Rework')
|
||||
->body(
|
||||
'This document number and inspection lot number have already been used for this serial number. Please provide a new document number and inspection lot number.'
|
||||
'This document number and inspection lot number have already been used for this serial number. Please provide a new document number and inspection lot number for rework..'
|
||||
)
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
Reference in New Issue
Block a user