@foreach ($sales as $clientSales) @php $grandTotal = 0; $paidTotal = 0; $clientName = ''; $rowspan = $clientSales->count(); @endphp @foreach ($clientSales as $sale) @php $grandTotal += $sale->GrandTotal; $paidTotal += $sale->paid_amount; $clientName = $sale->client->name; @endphp @if ($loop->first) @endif @endforeach @php $due = $grandTotal - $paidTotal; @endphp @endforeach
REKAPAN HUTANG
OUTLET BELI TGL PEMBELIAN Bulan Jatuh tempo KETERANGAN PAYMENT PEMBELIAN Sum of TOTAL BELI Sum of TOTAL BELI + PPN KETERANGAN Total jatuh tempo
{{ $sale->client->name }} 1 JATUH TEMPO {{ number_format($sale->details->sum('total'), 2) }} {{ number_format($sale->GrandTotal, 2) }}
Cicil {{ number_format($paidTotal, 2) }}
{{ $clientName }} {{ number_format($due, 2) }}