Browse Source

Merge pull request 'staging' (#279) from staging into master

Reviewed-on: ordo/adw-backend#279
pull/1/head
farhantock 11 months ago
parent
commit
3ce78b2df8
  1. 6
      app/Helpers/MasterFunctionsHelper.php
  2. 6
      app/Http/Controllers/ActivityController.php

6
app/Helpers/MasterFunctionsHelper.php

@ -1702,6 +1702,9 @@ class MasterFunctionsHelper
// if($keyPlanM->duration == 0){ // if($keyPlanM->duration == 0){
// $duration = 2; // $duration = 2;
// Tanggal awal // Tanggal awal
if (count($keyPlanM) == 0) {
continue;
}
$startDate = new DateTime($keyPlanM->planned_start); $startDate = new DateTime($keyPlanM->planned_start);
// Tanggal akhir // Tanggal akhir
$endDate = new DateTime($keyPlanM->planned_end); $endDate = new DateTime($keyPlanM->planned_end);
@ -1733,6 +1736,9 @@ class MasterFunctionsHelper
// hitung progress actual // hitung progress actual
// if (count($dataActualM) > 0 && count($dataActualM[0]) > 0) { // if (count($dataActualM) > 0 && count($dataActualM[0]) > 0) {
foreach ($dataActualM as $keyActualM) { foreach ($dataActualM as $keyActualM) {
if (count($keyPlanM) == 0) {
continue;
}
# hitung untuk persentase progress actual # hitung untuk persentase progress actual
// $progressActualWeek = ((((($keyActualM->qty_actual / $keyActualM->sum_qty_actual) * 100) / $keyActualM->qty_plan)*100)*$keyActualM->bobot_planning)/100; // $progressActualWeek = ((((($keyActualM->qty_actual / $keyActualM->sum_qty_actual) * 100) / $keyActualM->qty_plan)*100)*$keyActualM->bobot_planning)/100;
// jika total report > dari planning // jika total report > dari planning

6
app/Http/Controllers/ActivityController.php

@ -697,7 +697,7 @@ class ActivityController extends Controller
'm_version_gantt.name_version', 'm_version_gantt.name_version',
DB::raw('user_names.user_name as user_name'), DB::raw('user_names.user_name as user_name'),
DB::raw('SUM(report_activity_material.qty) as qty'), DB::raw('SUM(report_activity_material.qty) as qty'),
'assign_material_to_activity.qty_planning', DB::raw('SUM(assign_material_to_activity.qty_planning) as qty_planning'),
'assign_material_to_activity.id as join_third_id' 'assign_material_to_activity.id as join_third_id'
) )
->join('m_version_gantt', 'm_version_gantt.id', '=', 'selfTable.version_gantt_id') ->join('m_version_gantt', 'm_version_gantt.id', '=', 'selfTable.version_gantt_id')
@ -710,11 +710,9 @@ class ActivityController extends Controller
GROUP BY activity_id) as user_names'), function ($join) { GROUP BY activity_id) as user_names'), function ($join) {
$join->on('user_names.activity_id', '=', 'selfTable.id'); $join->on('user_names.activity_id', '=', 'selfTable.id');
}) })
->where('report_activity_material.assign_material_id', '=', DB::raw('assign_material_to_activity.id'))
->groupBy('selfTable.id') ->groupBy('selfTable.id')
->groupBy('selfTable.name')
->groupBy('selfTable.persentase_progress')
->groupBy('m_version_gantt.name_version') ->groupBy('m_version_gantt.name_version')
->groupBy('assign_material_to_activity.qty_planning')
->groupBy('assign_material_to_activity.id') ->groupBy('assign_material_to_activity.id')
->groupBy('user_names.user_name') ->groupBy('user_names.user_name')
->get(); ->get();

Loading…
Cancel
Save