@extends('layout.app') @section('content')
{{-- .auto-deduct-select, not .select2, so only this page's init claims them. --}}
Reset
{{-- One table: each manager's deductions together, a subtotal row after each manager, and the grand total at the foot. --}}
@php $sl = 0; @endphp @forelse ($groups as $group) @php $reseller = $group->first()->reseller; @endphp @foreach ($group as $row) @endforeach @empty @endforelse @if ($groups->count()) @endif
# Manager ID Manager Deducted At Bill Type Bill Balance Before Deducted Amount Balance After
{{ ++$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) : '—' }}
{{ optional($reseller)->name ?? '—' }} Total ({{ $group->count() }} {{ $group->count() > 1 ? 'entries' : 'entry' }}) {{ number_format($group->sum('amount'), 2) }}
No auto deduction in this period.
Grand Total {{ number_format($grandTotal, 2) }}
@endsection @section('ajax') @endsection @include('partials.finance-sticky-table')