Added ok_quantity and not_ok_quantity parameter (with functionality) in process order get response json
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CharacteristicValue;
|
||||
use App\Models\GrMaster;
|
||||
use App\Models\Item;
|
||||
use App\Models\Line;
|
||||
@@ -607,14 +608,20 @@ class PdfController extends Controller
|
||||
// ], 404);
|
||||
// }
|
||||
|
||||
$okQty = CharacteristicValue::where('plant_id', $plant->id)->where('process_order', $processOrder)->where('status', 'Ok')->get()->count();
|
||||
|
||||
$notOkQty = CharacteristicValue::where('plant_id', $plant->id)->where('process_order', $processOrder)->where('status', 'NotOk')->get()->count();
|
||||
|
||||
return response()->json([
|
||||
'item_code' => $item?->code ?? '',
|
||||
'description' => $item?->description ?? '',
|
||||
// 'coil_number' => $proOrdAgPlant->coil_number ?? "",
|
||||
// 'order_quantity' => (string)$proOrdAgPlant->order_quantity ?? "",
|
||||
'coil_number' => $lastRecord->coil_number ?? '',
|
||||
'order_quantity' => (string) $lastRecord->order_quantity ?? '',
|
||||
'received_quantity' => (string) $totalReceivedQty ?? '',
|
||||
'coil_number' => (string) $lastRecord->coil_number ?? '0',
|
||||
'order_quantity' => (string) $lastRecord->order_quantity ?? '0.000',
|
||||
'ok_quantity' => (string) $okQty ?? '0',
|
||||
'not_ok_quantity' => (string) $notOkQty ?? '0',
|
||||
'received_quantity' => (string) (($totalReceivedQty == 0) ? '0.000' : $totalReceivedQty) ?? '0.000',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -867,15 +874,13 @@ class PdfController extends Controller
|
||||
], 404);
|
||||
}
|
||||
|
||||
if($rework != 'Yes' && $rework != 'No'){
|
||||
if ($rework != 'Yes' && $rework != 'No') {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Rework value should be either 'Yes' or 'No'!",
|
||||
], 404);
|
||||
}
|
||||
else if ($rework == 'No')
|
||||
{
|
||||
if($scrapQty != 0){
|
||||
} elseif ($rework == 'No') {
|
||||
if ($scrapQty != 0) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Scrap Quanity value should be '0'!",
|
||||
@@ -883,10 +888,8 @@ class PdfController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ($rework == 'Yes')
|
||||
{
|
||||
try {
|
||||
if ($rework == 'Yes') {
|
||||
$updated = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('line_id', $lineNamePlantId)
|
||||
@@ -894,12 +897,12 @@ class PdfController extends Controller
|
||||
->update([
|
||||
// 'order_quantity' => $orderQty,
|
||||
'received_quantity' => $receivedQty,
|
||||
'scrap_quantity' => $scrapQty,
|
||||
'scrap_quantity' => $scrapQty,
|
||||
// 'sfg_number' => $sfgNo,
|
||||
// 'machine_name' => $machineId,
|
||||
'rework_status' => 1,
|
||||
'updated_by' => $createdBy,
|
||||
'updated_at' => now(),
|
||||
'rework_status' => 1,
|
||||
'updated_by' => $createdBy,
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
if ($updated == 0) {
|
||||
@@ -907,17 +910,13 @@ class PdfController extends Controller
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => 'No matching record found for rework coil number!',
|
||||
], 404);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return response()->json([
|
||||
'status_code' => 'SUCCESS',
|
||||
'status_description' => 'Record Updated Successfully (Rework)',
|
||||
]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$existing = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('coil_number', $coilNo)
|
||||
@@ -960,7 +959,8 @@ class PdfController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function storeLaserPdf(Request $request){
|
||||
public function storeLaserPdf(Request $request)
|
||||
{
|
||||
|
||||
$expectedUser = env('API_AUTH_USER');
|
||||
$expectedPw = env('API_AUTH_PW');
|
||||
@@ -976,7 +976,7 @@ class PdfController extends Controller
|
||||
|
||||
$workflowId = $request->header('work_flow_id');
|
||||
|
||||
if (!$workflowId) {
|
||||
if (! $workflowId) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "work_flow_id can't be empty!",
|
||||
@@ -999,9 +999,9 @@ class PdfController extends Controller
|
||||
// 'local'
|
||||
// );
|
||||
|
||||
$filename = $workflowId . '.pdf';
|
||||
$filename = $workflowId.'.pdf';
|
||||
|
||||
$filePath = 'uploads/LaserDocs/' . $filename;
|
||||
$filePath = 'uploads/LaserDocs/'.$filename;
|
||||
|
||||
if (Storage::disk('local')->exists($filePath)) {
|
||||
Storage::disk('local')->delete($filePath);
|
||||
|
||||
Reference in New Issue
Block a user