|
|
@ -2,13 +2,15 @@ |
|
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers; |
|
|
|
namespace App\Http\Controllers; |
|
|
|
|
|
|
|
|
|
|
|
use App\Models\Project; |
|
|
|
|
|
|
|
use App\Models\Activity; |
|
|
|
use App\Models\Activity; |
|
|
|
use App\Models\VersionGantt; |
|
|
|
use App\Models\AssignMaterial; |
|
|
|
use App\Models\Divisi; |
|
|
|
use App\Models\Divisi; |
|
|
|
|
|
|
|
use App\Models\Project; |
|
|
|
use App\Models\ProjectPhase; |
|
|
|
use App\Models\ProjectPhase; |
|
|
|
use App\Models\AssignMaterial; |
|
|
|
|
|
|
|
use App\Models\ReportActivityMaterial; |
|
|
|
use App\Models\ReportActivityMaterial; |
|
|
|
|
|
|
|
use App\Models\User; |
|
|
|
|
|
|
|
use App\Models\UserToVersionGantt; |
|
|
|
|
|
|
|
use App\Models\VersionGantt; |
|
|
|
use Illuminate\Support\Collection; |
|
|
|
use Illuminate\Support\Collection; |
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
|
|
|
|
|
|
|
@ -421,8 +423,8 @@ class DashboardBoDController extends Controller |
|
|
|
$difference = $plannedPercentage - $progressPercentage; |
|
|
|
$difference = $plannedPercentage - $progressPercentage; |
|
|
|
|
|
|
|
|
|
|
|
$dataResponse = array( |
|
|
|
$dataResponse = array( |
|
|
|
'planned' => $plannedPercentage, |
|
|
|
'planned' => $plannedPercentage == false ? 0 : $plannedPercentage, |
|
|
|
'progress' => $progressPercentage, |
|
|
|
'progress' => $progressPercentage == false ? 0 : $progressPercentage, |
|
|
|
'difference' => $difference, |
|
|
|
'difference' => $difference, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -441,5 +443,32 @@ class DashboardBoDController extends Controller |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getDetailExpenditure($year = '%'){ |
|
|
|
|
|
|
|
$year = $this->interpolateYear($year); |
|
|
|
|
|
|
|
$projects = Project::where('mulai_proyek', 'like', $year) |
|
|
|
|
|
|
|
/* ->orWhere('akhir_proyek', 'like', $year) */ |
|
|
|
|
|
|
|
->get(); |
|
|
|
|
|
|
|
foreach($projects as $project){ |
|
|
|
|
|
|
|
$lastGantt = $this->getLatestGantt($project->id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($project->kode_sortname != ""){ |
|
|
|
|
|
|
|
$resp = $this->getInvoiceIntegration($project->kode_sortname); |
|
|
|
|
|
|
|
$project->invoice = [ |
|
|
|
|
|
|
|
'invoiced' => $resp->data->total_invoice_amount ?? 0, |
|
|
|
|
|
|
|
'paid' => $resp->data->total_invoice_paid_amount ?? 0, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$project->pm = User::find($project->pm_id); |
|
|
|
|
|
|
|
/* $project->header = Activity::where('proyek_id', $project->id)->where('version_gantt_id', $lastGantt['last_gantt_id'])->whereNull('parent_id')->first(); */ |
|
|
|
|
|
|
|
$project->scurve = $this->getSCurve($project->id); |
|
|
|
|
|
|
|
$project->manPowers = UserToVersionGantt::where('version_gantt_id', $lastGantt['last_gantt_id'])->count(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return response()->json([ |
|
|
|
|
|
|
|
'data' => $projects, |
|
|
|
|
|
|
|
'total_manpowers' => User::count() |
|
|
|
|
|
|
|
], 200); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|