@if(($x=$o->invoices() ->active() ->orderBy('due_at') ->with(['items.taxes','payments','account']) ->get() ->filter(function($item) use ($pid) { return $item->due > 0 || $item->payments->search(function($item) use ($pid) { return $item->id == $pid; }) !== FALSE; }))->count()) @foreach ($x as $io) @endforeach
ID Date Issue Date Due Total Due Apply
{{ $io->sid }} {{ $io->created_at->format('Y-m-d') }} {{ $io->due_at->format('Y-m-d') }} {{ number_format($io->total,2) }} {{ number_format($io->due,2) }}
@else

No invoices due.

@endif