@extends('../layout/' . $layout) @section('subhead') Dashboard - PO Bintang Asia @endsection @section('subcontent')
Kewajiban Jatuh Tempo
Rp. -
@php $total = 0 @endphp @php $cartItems = collect(session('cart'))->groupBy(function ($item) { return ($item['id_program'] ?? '') . '||' . $item['kd_brg']; }); @endphp @if (session('cart'))
@foreach ($cartItems as $key => $items) @php $first = $items->first(); $programId = $first['id_program'] ?? ''; $isProgram = $programId !== ''; $mainItems = $items->where('isBonus', '!=', 'Y'); $totalMainQty = $mainItems->sum('satuan_qty'); $totalMainPrice = $mainItems->sum('total_price'); $bonusItems = $items->where('isBonus', 'Y'); $totalBonusQty = $bonusItems->sum('satuan_qty'); $totalBonusPrice = $bonusItems->sum('total_price'); @endphp {{-- Main Row --}}
{{ $first['name'] }}
| {{ $totalMainQty }} ({{ $first['satuan'] }})
@if ($first['isBonus'] == 'Y')
 ( Bonus )
@endif @if (empty($first['id_program'])) @else @endif
Rp. {{ number_format($totalMainPrice, 0, ',', '.') }}
@php $total += $totalMainPrice @endphp
@if ($bonusItems->count() > 0) @php $firstBonus = $bonusItems->first(); @endphp
{{ $firstBonus['name'] }} - {{ $totalBonusQty }} ({{ $firstBonus['satuan'] }}) (Bonus)
@php $total += $totalBonusPrice @endphp @endif @endforeach
@endif
Metode Pembayaran
Subtotal
Rp. {{ number_format($total, 0, ',', '.') }}
Total
Rp. {{ number_format($total, 0, ',', '.') }}
Kewajiban Jatuh Tempo
Rp. -
No. Tiket
-
No. PO
-
Tanggal
{{ date('Y-m-d') }}
Customer
{{ Auth::user()->nama }}
@if (session('jns_product') != '') @endif
@include('pages.dashboard.js') @include('pages.dashboard.modal-add') @endsection