added one more validation in panel box
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 27s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 4m43s
Laravel Larastan / larastan (pull_request) Failing after 6m7s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 27s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 4m43s
Laravel Larastan / larastan (pull_request) Failing after 6m7s
This commit is contained in:
@@ -807,6 +807,25 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
$panelExistsPanel = PanelBoxValidation::where('plant_id', $plantId)
|
||||
->where('panel_box_serial_number', $serialNumber)
|
||||
->where('panel_box_supplier', $supplier)
|
||||
->first();
|
||||
|
||||
if ($panelExistsPanel) {
|
||||
Notification::make()
|
||||
->title('Duplicate Panel Box Serial Number')
|
||||
->body("Duplicate panel already exists.<br>Panel Box Code: $itemCode, Serial Number: $serialNumber, Supplier Number: $supplier in panel box validation")
|
||||
->danger()
|
||||
->seconds(4)
|
||||
->send();
|
||||
|
||||
$set('item_id', null);
|
||||
$set('serial_exists', false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// $plantCode = Plant::where('id', $plantId)->value('code');
|
||||
|
||||
// if($plantCode != $supplier){
|
||||
|
||||
Reference in New Issue
Block a user