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

Reviewed-on: #1055
This commit was merged in pull request #1055.
This commit is contained in:
2026-09-18 13:38:02 +00:00

View File

@@ -871,7 +871,6 @@ 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');
@@ -939,18 +938,17 @@ 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}', process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Coil number '{$coilMain}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404);
} elseif ($existingCoil->rework_status == 0) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Rework coil number '{$coilMain}' not exist against plant code '{$plantCode}', process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Rework coil number '{$coilMain}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404);
}
@@ -965,7 +963,6 @@ class PdfController extends Controller
->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId)
->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first();
if (! $existingCoil) {
@@ -1013,13 +1010,12 @@ 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}', process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404);
}
}
@@ -1027,14 +1023,13 @@ 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}' , process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Coil number '{$coilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404);
}
@@ -1042,7 +1037,6 @@ 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) {
@@ -1056,7 +1050,6 @@ 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,
@@ -1091,13 +1084,12 @@ 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}', process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Coil number '{$coilNo}' already exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
// "Process order '{$processOrder}' with coil number '{$coilNo}' already exist for the plant code '{$plantCode}'!",
], 404);
}
@@ -1107,13 +1099,12 @@ 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}', process order '{$processOrder}' and machine name '{$machineId}'!",
'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404);
}
}