@extends('admin.admin_dashboard') @section('admin')
@php $tot = ['current'=>0,'b1'=>0,'b2'=>0,'b3'=>0,'b4'=>0,'total'=>0]; @endphp @foreach($rows as $i => $r) @foreach(['current','b1','b2','b3','b4','total'] as $k) @php $tot[$k] += $r->$k; @endphp @endforeach @endforeach
# Vendor Ref Due Date Current 1–30 31–60 61–90 >90 Total
{{ $i+1 }} {{ $r->vendor }} {{ $r->reference }} {{ $r->due_date }} {{ number_format($r->current,2) }} {{ number_format($r->b1,2) }} {{ number_format($r->b2,2) }} {{ number_format($r->b3,2) }} {{ number_format($r->b4,2) }} {{ number_format($r->total,2) }}
Grand Total {{ number_format($tot['current'],2) }} {{ number_format($tot['b1'],2) }} {{ number_format($tot['b2'],2) }} {{ number_format($tot['b3'],2) }} {{ number_format($tot['b4'],2) }} {{ number_format($tot['total'],2) }}
@endsection