Merge pull request 'Added machine name in process order post api' (#1048) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s

Reviewed-on: #1048
This commit was merged in pull request #1048.
This commit is contained in:
2026-09-18 08:32:07 +00:00

View File

@@ -869,6 +869,7 @@ class PdfController extends Controller
$alreadyReceived = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('machine_name', $machineId)
->where('item_id', $itemId)
->sum('received_quantity');
@@ -936,17 +937,18 @@ class PdfController extends Controller
->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId)
->where('coil_number', $coilMain)
->where('machine_name', $machineId)
->first();
if (! $existingCoil) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Coil number '{$coilMain}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Coil number '{$coilMain}' not exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
], 404);
} elseif ($existingCoil->rework_status == 0) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Rework coil number '{$coilMain}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Rework coil number '{$coilMain}' not exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
], 404);
}
@@ -961,6 +963,7 @@ class PdfController extends Controller
->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId)
->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first();
if (! $existingCoil) {
@@ -1008,12 +1011,13 @@ class PdfController extends Controller
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('coil_number', $prevCoilNo)
->where('machine_name', $machineId)
->first();
if (! $existPrevCoil) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
], 404);
}
}
@@ -1021,13 +1025,14 @@ class PdfController extends Controller
$existingCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId)
->where('machine_name', $machineId)
->where('coil_number', $coilNo)
->first();
if (! $existingCoil) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Coil number '{$coilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Coil number '{$coilNo}' not exist against plant code '{$plantCode}' , process order '{$processOrder}' and machine name '{$machineId}'!",
], 404);
}
@@ -1035,6 +1040,7 @@ class PdfController extends Controller
->where('process_order', $processOrder)
->where('item_id', $itemId)
->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first();
if ($existPrevCoil->received_quantity < $receivedQty) {
@@ -1048,6 +1054,7 @@ class PdfController extends Controller
->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId)
->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->update([
// 'order_quantity' => $orderQty,
'received_quantity' => $receivedQty,
@@ -1082,12 +1089,13 @@ class PdfController extends Controller
$existing = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first();
if ($existing) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Coil number '{$coilNo}' already exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Coil number '{$coilNo}' already exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
// "Process order '{$processOrder}' with coil number '{$coilNo}' already exist for the plant code '{$plantCode}'!",
], 404);
}
@@ -1097,12 +1105,13 @@ class PdfController extends Controller
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('coil_number', $prevCoilNo)
->where('machine_name', $machineId)
->first();
if (! $existPrevCoil) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
], 404);
}
}