@extends('layouts.app')
@section('title',ucfirst($side).' Aging')
@section('page_title',ucfirst($side).' Aging')
@section('content')
<div class="page-head"><div><h1>{{ ucfirst($side) }} Aging</h1><p>Outstanding posted documents grouped by days past due.</p></div></div><div class="card"><div class="table-wrap"><table class="table"><thead><tr><th>{{ ucfirst($side) }}</th><th>Current / 0-30</th><th>31-60</th><th>61-90</th><th>Over 90</th><th>Total</th></tr></thead><tbody>@forelse($groups as $g)<tr><td><a href="{{ route('parties.show',$g->party) }}">{{ $g->party?->legal_name }}</a></td><td>{{ number_format($g->current,2) }}</td><td>{{ number_format($g->{'31_60'},2) }}</td><td>{{ number_format($g->{'61_90'},2) }}</td><td>{{ number_format($g->over_90,2) }}</td><td><strong>{{ number_format($g->total,2) }}</strong></td></tr>@empty<tr><td colspan="6" class="empty">No outstanding balances.</td></tr>@endforelse<tr><th>Total</th><th>{{ number_format($groups->sum('current'),2) }}</th><th>{{ number_format($groups->sum('31_60'),2) }}</th><th>{{ number_format($groups->sum('61_90'),2) }}</th><th>{{ number_format($groups->sum('over_90'),2) }}</th><th>{{ number_format($groups->sum('total'),2) }}</th></tr></tbody></table></div></div>
@endsection
