@php $grandTotalPO = $grandTotalModal = 0; @endphp
@foreach ($model->plans as $plan)
@php
$user = $plan->users->first();
$investment = $user->pivot->investment ?? 0;
$remark = $user->pivot->remark;
// Add to total
if ($plan->payment_type == App\Models\Plan::PAYMENT_TYPE_CREDIT){
$grandTotalPO += $investment;
} else {
$grandTotalModal += $investment;
}
@endphp
{{ $plan->name }}
@if (empty($investment) && !empty($remark))
@else
RM {{ number_format($investment / 100, 2) }}
@endif
@endforeach
Jumlah Keseluruhan Modal
RM {{ number_format($grandTotalModal / 100, 2) }}
Jumlah Keseluruhan PO
RM {{ number_format($grandTotalPO / 100, 2) }}