@php $pct = fn ($r) => $r->sales > 0 ? number_format($r->commission / $r->sales * 100, 1).'%' : '–'; @endphp @include('admin.commission._tabs')
@foreach ([['Sales', inr($totals->sales)], ['Commission', inr($totals->commission)], ['GST on commission', inr($totals->gst)], ['Effective rate', $pct($totals)]] as [$label, $value])
{{ $label }}
{{ $value }}
@endforeach
@foreach ([['By month', $byMonth, 'month'], ['By category', $byCategory, 'label'], ['By seller', $bySeller, 'seller']] as [$title, $rows, $key])
{{ $title }}
@forelse ($rows as $row) @empty @endforelse
{{ ['month' => 'Month', 'label' => 'Category', 'seller' => 'Seller'][$key] }}ItemsSalesCommissionRate
{{ $key === 'month' ? \Illuminate\Support\Carbon::createFromFormat('!Y-m', $row->month)->format('M Y') : $row->{$key} }} {{ $row->items }} {{ inr($row->sales) }} {{ inr($row->commission) }} {{ $pct($row) }}
No delivered items in this period.
@endforeach