{{-- .auto-deduct-select, not .select2, so only this page's init claims them. --}}
{{-- One table: each manager's deductions together, a subtotal row after each
manager, and the grand total at the foot. --}}
| # |
Manager ID |
Manager |
Deducted At |
Bill Type |
Bill |
Balance Before |
Deducted Amount |
Balance After |
@php $sl = 0; @endphp
@forelse ($groups as $group)
@php $reseller = $group->first()->reseller; @endphp
@foreach ($group as $row)
| {{ ++$sl }} |
{{ optional($reseller)->id }} |
{{ optional($reseller)->name ?? '—' }} |
{{ $row->deducted_at->format('d M Y h:i A') }} |
{{ $row->bill_type }} |
@if ($row->bill_id)
#{{ $row->bill_id }}{{ $row->bill_label ? ' — ' . $row->bill_label : '' }}
@else
Deleted bill
@endif
|
{{ $row->balance_before !== null ? number_format($row->balance_before, 2) : '—' }} |
{{ number_format($row->amount, 2) }} |
{{ $row->balance_after !== null ? number_format($row->balance_after, 2) : '—' }}
|
@endforeach
|
{{ optional($reseller)->name ?? '—' }} Total
({{ $group->count() }} {{ $group->count() > 1 ? 'entries' : 'entry' }})
|
{{ number_format($group->sum('amount'), 2) }} |
|
@empty
| No auto deduction in this period. |
@endforelse
@if ($groups->count())
| Grand Total |
{{ number_format($grandTotal, 2) }} |
|
@endif