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

Reviewed-on: #1054
This commit was merged in pull request #1054.
This commit is contained in:
2026-09-18 12:03:25 +00:00

View File

@@ -535,7 +535,7 @@ class PdfController extends Controller
$processOrder = $request->header('process-order');
$machineName = $request->header('machine-name');
// $machineName = $request->header('machine-name');
if (! $plantCode) {
return response()->json([
@@ -548,12 +548,6 @@ class PdfController extends Controller
'status_description' => 'Process Order cannot be empty!',
], 404);
}
elseif (! $machineName) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Machine Name cannot be empty!',
], 404);
}
$plant = Plant::where('code', $plantCode)->first();
$plantId = $plant->id;
@@ -574,26 +568,14 @@ class PdfController extends Controller
], 404);
}
$proOrdAgPlan = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->first();
if (! $proOrdAgPlan) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Process order not found for this plant!',
], 404);
}
$proOrdAgPlant = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('machine_name', $machineName)
->first();
if (! $proOrdAgPlant) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Process order not found for this plant and machine name!',
'status_description' => 'Process order not found for this plant!',
], 404);
}
@@ -602,20 +584,17 @@ class PdfController extends Controller
$processOrderRecords = ProcessOrder::with('item')
->where('plant_id', $plant->id)
->where('process_order', $processOrder)
->where('machine_name', $machineName)
->get();
$lastRecord = ProcessOrder::with('item')
->where('plant_id', $plant->id)
->where('process_order', $processOrder)
->where('machine_name', $machineName)
->orderBy('id', 'desc')
->first();
$lastRecord1 = ProcessOrder::with('item')
->where('plant_id', $plant->id)
->where('process_order', $processOrder)
->where('machine_name', $machineName)
->where('rework_status', 0)
->orderBy('id', 'desc')
->first();
@@ -627,7 +606,7 @@ class PdfController extends Controller
if ($totalReceivedQty == $proOrdAgPlant->order_quantity) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Process order '{$processOrder}' for plant '{$plantCode}' and machine name '{$machineName}' has already reached its order quantity.",
'status_description' => "Process order '{$processOrder}' for plant '{$plantCode}' has already reached its order quantity.",
], 404);
}