Merge pull request 'ranjith-dev' (#1057) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 20s

Reviewed-on: #1057
This commit was merged in pull request #1057.
This commit is contained in:
2026-09-19 09:42:42 +00:00
2 changed files with 32 additions and 26 deletions

View File

@@ -40,6 +40,7 @@ class Scheduler extends Command
{ {
$this->call('approval:trigger-mails'); $this->call('approval:trigger-mails');
$this->call('approval:laser-stop');
// $this->call('sftp:process-files'); // $this->call('sftp:process-files');
// --- Production Rules --- // --- Production Rules ---

View File

@@ -871,6 +871,7 @@ class PdfController extends Controller
$alreadyReceived = ProcessOrder::where('plant_id', $plantId) $alreadyReceived = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('machine_name', $machineId)
->where('item_id', $itemId) ->where('item_id', $itemId)
->sum('received_quantity'); ->sum('received_quantity');
@@ -938,6 +939,7 @@ class PdfController extends Controller
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId) ->where('line_id', $lineNamePlantId)
->where('coil_number', $coilMain) ->where('coil_number', $coilMain)
->where('machine_name', $machineId)
->first(); ->first();
if (! $existingCoil) { if (! $existingCoil) {
@@ -963,6 +965,7 @@ class PdfController extends Controller
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId) ->where('line_id', $lineNamePlantId)
->where('coil_number', $coilNo) ->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first(); ->first();
if (! $existingCoil) { if (! $existingCoil) {
@@ -1005,20 +1008,20 @@ class PdfController extends Controller
]); ]);
} }
} else { } else {
if ($coilNo > 1) { // if ($coilNo > 1) {
$prevCoilNo = (string) ($coilNo - 1); // $prevCoilNo = (string) ($coilNo - 1);
$existPrevCoil = ProcessOrder::where('plant_id', $plantId) // $existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) // ->where('process_order', $processOrder)
->where('coil_number', $prevCoilNo) // ->where('coil_number', $prevCoilNo)
->first(); // ->first();
if (! $existPrevCoil) { // if (! $existPrevCoil) {
return response()->json([ // return response()->json([
'status_code' => 'ERROR', // '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}' and process order '{$processOrder}'!",
], 404); // ], 404);
} // }
} // }
$existingCoil = ProcessOrder::where('plant_id', $plantId) $existingCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
@@ -1050,6 +1053,7 @@ class PdfController extends Controller
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId) ->where('line_id', $lineNamePlantId)
->where('coil_number', $coilNo) ->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->update([ ->update([
// 'order_quantity' => $orderQty, // 'order_quantity' => $orderQty,
'received_quantity' => $receivedQty, 'received_quantity' => $receivedQty,
@@ -1084,6 +1088,7 @@ class PdfController extends Controller
$existing = ProcessOrder::where('plant_id', $plantId) $existing = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('coil_number', $coilNo) ->where('coil_number', $coilNo)
->where('machine_name', $machineId)
->first(); ->first();
if ($existing) { if ($existing) {
@@ -1094,20 +1099,20 @@ class PdfController extends Controller
], 404); ], 404);
} }
if ($coilNo > 1) { // if ($coilNo > 1) {
$prevCoilNo = (string) ($coilNo - 1); // $prevCoilNo = (string) ($coilNo - 1);
$existPrevCoil = ProcessOrder::where('plant_id', $plantId) // $existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) // ->where('process_order', $processOrder)
->where('coil_number', $prevCoilNo) // ->where('coil_number', $prevCoilNo)
->first(); // ->first();
if (! $existPrevCoil) { // if (! $existPrevCoil) {
return response()->json([ // return response()->json([
'status_code' => 'ERROR', // '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}' and process order '{$processOrder}'!",
], 404); // ], 404);
} // }
} // }
if ($total > $updatedOrderQty) { if ($total > $updatedOrderQty) {
return response()->json([ return response()->json([