removed machine name logic in process order post api
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m24s
Laravel Larastan / larastan (pull_request) Failing after 6m48s

This commit is contained in:
dhanabalan
2026-09-18 19:07:48 +05:30
parent 3559c4c4ee
commit 02c7aa2cd8

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);
}
}