Added logic in rework of panel box validation #1022
@@ -1003,16 +1003,14 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->where('inspection_lot_number', $inspecLotNo)
|
->where('inspection_lot_number', $inspecLotNo)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$alreadyExistsSupplier = PanelBoxValidation::where('serial_number', $serialNumber)
|
$alreadyExistsSupplier = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)
|
||||||
->where('plant_id', $plantId)
|
->where('panel_box_supplier', $supplierNo)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($alreadyExists) {
|
if ($alreadyExists) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Duplicate Found')
|
->title('Duplicate Found')
|
||||||
->body(
|
->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 for rework...')
|
||||||
'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()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user