Compare commits
4 Commits
2a2bf8db4c
...
2e0ccd7c34
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e0ccd7c34 | |||
|
|
da178087ea | ||
|
|
3dd5b30070 | ||
|
|
6cb67362d5 |
@@ -832,8 +832,8 @@ class RequestCharacteristicResource extends Resource
|
|||||||
$prefix = "WF-{$year}{$month}{$date}-";
|
$prefix = "WF-{$year}{$month}{$date}-";
|
||||||
|
|
||||||
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
||||||
|
// ->where('plant_id', $plantId)
|
||||||
// ->where('machine_id', $MachineId)
|
// ->where('machine_id', $MachineId)
|
||||||
->where('work_flow_id', 'like', "{$prefix}%")
|
|
||||||
->orderByDesc('work_flow_id')
|
->orderByDesc('work_flow_id')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
|||||||
@@ -58,14 +58,15 @@ class CharacteristicApprovalController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// foreach ($levels as $lvl => $column) {
|
foreach ($levels as $lvl => $column)
|
||||||
// if ($record->$column == 'Hold') {
|
{
|
||||||
|
if ($record->$column == 'Hold') {
|
||||||
|
|
||||||
// if ($lvl == $level) {
|
if ($lvl == $level) {
|
||||||
// return view('approval.already-processed', [
|
return view('approval.already-processed', [
|
||||||
// 'status' => 'On Hold',
|
'status' => 'On Hold',
|
||||||
// ]);
|
]);
|
||||||
// }
|
}
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// return view('approval.already-processed', [
|
// return view('approval.already-processed', [
|
||||||
@@ -73,8 +74,8 @@ class CharacteristicApprovalController extends Controller
|
|||||||
// 'message' => 'On Hold',
|
// 'message' => 'On Hold',
|
||||||
// ]);
|
// ]);
|
||||||
// }
|
// }
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
$allowedMailStatusByLevel = [
|
$allowedMailStatusByLevel = [
|
||||||
1 => 'Sent',
|
1 => 'Sent',
|
||||||
@@ -355,8 +356,6 @@ class CharacteristicApprovalController extends Controller
|
|||||||
], 403);
|
], 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$workflowRecords = RequestCharacteristic::where('plant_id', $record->plant_id)
|
$workflowRecords = RequestCharacteristic::where('plant_id', $record->plant_id)
|
||||||
->where('machine_id', $record->machine_id)
|
->where('machine_id', $record->machine_id)
|
||||||
->where('aufnr', $record->aufnr)
|
->where('aufnr', $record->aufnr)
|
||||||
@@ -369,6 +368,10 @@ class CharacteristicApprovalController extends Controller
|
|||||||
$approvedAtColumn => Carbon::now(),
|
$approvedAtColumn => Carbon::now(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (in_array($status, ['Approved', 'Rejected'])) {
|
||||||
|
$updateData['trigger_at'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($pendingRecords as $rec) {
|
foreach ($pendingRecords as $rec) {
|
||||||
$rec->update($updateData);
|
$rec->update($updateData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2841,7 +2841,7 @@ class CharacteristicsController extends Controller
|
|||||||
$app2 = $pendingExists->approver_status2 ?? null;
|
$app2 = $pendingExists->approver_status2 ?? null;
|
||||||
$app3 = $pendingExists->approver_status3 ?? null;
|
$app3 = $pendingExists->approver_status3 ?? null;
|
||||||
|
|
||||||
if ($app1 != 'Rejected' && $app2 != 'Rejected' && $app3 != 'Rejected' && $app1 != 'Approved' && $app2 != 'Approved' && $app3 != 'Approved') {
|
if ($app1 != 'Approved' && $app2 != 'Approved' && $app3 != 'Approved' && $app1 != 'Rejected' && $app2 != 'Rejected' && $app3 != 'Rejected') {
|
||||||
$pendingCharacteristics[] = strtoupper($charNameUpp);
|
$pendingCharacteristics[] = strtoupper($charNameUpp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2887,7 +2887,6 @@ class CharacteristicsController extends Controller
|
|||||||
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
||||||
// ->where('plant_id', $plantId)
|
// ->where('plant_id', $plantId)
|
||||||
// ->where('machine_id', $MachineId)
|
// ->where('machine_id', $MachineId)
|
||||||
->where('work_flow_id', 'like', "{$prefix}%")
|
|
||||||
->orderByDesc('work_flow_id')
|
->orderByDesc('work_flow_id')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
@@ -2999,10 +2998,11 @@ class CharacteristicsController extends Controller
|
|||||||
$app2 = $pendingExists->approver_status2 ?? null;
|
$app2 = $pendingExists->approver_status2 ?? null;
|
||||||
$app3 = $pendingExists->approver_status3 ?? null;
|
$app3 = $pendingExists->approver_status3 ?? null;
|
||||||
|
|
||||||
if ($app1 != 'Approved' && $app2 != 'Approved' && $app3 != 'Approved') {// $app1 != 'Rejected' && $app2 != 'Rejected' && $app3 != 'Rejected' &&
|
if ($app1 != 'Approved' && $app2 != 'Approved' && $app3 != 'Approved' && $app1 != 'Rejected' && $app2 != 'Rejected' && $app3 != 'Rejected') {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status_code' => 'ERROR',
|
'status_code' => 'ERROR',
|
||||||
'status_description' => "Quality Approval is already pending for the Job Number : '{$jobNo}'",
|
'status_description' => "Quality Approval is already pending for the Job Number : '{$jobNo}'",
|
||||||
|
// 'status_error' => $pendingExists,
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3014,7 +3014,6 @@ class CharacteristicsController extends Controller
|
|||||||
$prefix = "WF-{$year}{$month}{$date}-";
|
$prefix = "WF-{$year}{$month}{$date}-";
|
||||||
|
|
||||||
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
$lastWorkflow = RequestCharacteristic::where('work_flow_id', 'like', "{$prefix}%")
|
||||||
->where('work_flow_id', 'like', "{$prefix}%")
|
|
||||||
->orderByDesc('work_flow_id')
|
->orderByDesc('work_flow_id')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
@@ -3583,15 +3582,9 @@ class CharacteristicsController extends Controller
|
|||||||
'requested_characteristics' => $response,
|
'requested_characteristics' => $response,
|
||||||
], 200);
|
], 200);
|
||||||
} else {
|
} else {
|
||||||
$filePath = '';
|
$extension = ($requestType == 'Characteristic') ? 'pdf' : 'png';
|
||||||
$filename = '';
|
$filePath = "uploads/LaserDocs/{$workFlowId}.{$extension}";
|
||||||
if ($requestType == 'Characteristic') {
|
$filename = "{$workFlowId}.{$extension}";
|
||||||
$filePath = "uploads/LaserDocs/{$workFlowId}.pdf";
|
|
||||||
$filename = "{$workFlowId}.pdf";
|
|
||||||
} else {
|
|
||||||
$filePath = "uploads/LaserDocs/{$workFlowId}.png";
|
|
||||||
$filename = "{$workFlowId}.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
$workFlowIdExist = RequestCharacteristic::where('work_flow_id', $workFlowId)->first();
|
$workFlowIdExist = RequestCharacteristic::where('work_flow_id', $workFlowId)->first();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user