Merge pull request 'Added warning message if previous coil number not found' (#439) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #439
This commit was merged in pull request #439.
This commit is contained in:
@@ -994,6 +994,21 @@ class PdfController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if ($coilNo >= 1) {
|
||||||
|
$prevCoilNo = (string) ($coilNo - 1);
|
||||||
|
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||||
|
->where('process_order', $processOrder)
|
||||||
|
->where('coil_number', $prevCoilNo)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (! $existPrevCoil) {
|
||||||
|
return response()->json([
|
||||||
|
'status_code' => 'ERROR',
|
||||||
|
'status_description' => "Previouse coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
|
||||||
|
], 404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
||||||
->where('process_order', $processOrder)
|
->where('process_order', $processOrder)
|
||||||
->where('line_id', $lineNamePlantId)
|
->where('line_id', $lineNamePlantId)
|
||||||
@@ -1055,6 +1070,21 @@ class PdfController extends Controller
|
|||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($coilNo >= 1) {
|
||||||
|
$prevCoilNo = (string) ($coilNo - 1);
|
||||||
|
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||||
|
->where('process_order', $processOrder)
|
||||||
|
->where('coil_number', $prevCoilNo)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (! $existPrevCoil) {
|
||||||
|
return response()->json([
|
||||||
|
'status_code' => 'ERROR',
|
||||||
|
'status_description' => "Previouse coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
|
||||||
|
], 404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ProcessOrder::Create(
|
ProcessOrder::Create(
|
||||||
[
|
[
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
|
|||||||
Reference in New Issue
Block a user