@php use App\Modules\Sellers\Services\CommissionService as Cs; $stateTone = ['running' => 'success', 'scheduled' => 'info', 'ended' => 'secondary', 'off' => 'secondary']; $stateLabel = ['running' => 'Running', 'scheduled' => 'Starts later', 'ended' => 'Ended', 'off' => 'Off']; $r = $editing; @endphp @include('admin.commission._tabs')
{{-- Default --}}
@csrf @method('PUT')
Marketplace default {{ Cs::describe($default) }}
{{-- Rules --}}
Category and seller rules · the most specific running rule wins @if (request('seller'))Show all@endif
@forelse ($rules as $rule) @php $state = $rule->state(); @endphp in_array($state, ['ended', 'off'])])> @empty @endforelse
Applies toCommissionWhen
{{ app(Cs::class)->label($rule) }}
@if ($rule->note)
{{ $rule->note }}
@endif
{{ Cs::describe(app(Cs::class)->asArray($rule)) }} {{ $stateLabel[$state] }} @if ($rule->starts_on || $rule->ends_on)
{{ $rule->starts_on?->format('d M Y') ?? 'Now' }} – {{ $rule->ends_on?->format('d M Y') ?? 'no end' }}
@endif
@csrf @method('DELETE')
No rules yet. Everyone pays the default. Add a rule for a category (e.g. a lower rate on groceries) or for one seller.
{{-- Add / edit rule --}}
@csrf @if ($r) @method('PUT') @endif
{{ $r ? 'Edit rule' : 'Add a rule' }}
is_active ?? true))>
{{-- Calculator --}}
Check a sale
@if ($calc)
  • Sale{{ inr($calc['amount']) }}
  • Commission ({{ Cs::pct($calc['rate']) }} rate)− {{ inr($calc['commission']) }}
  • GST on commission− {{ inr($calc['commission_tax']) }}
  • Seller gets (before TCS/TDS){{ inr($calc['net']) }}

{{ $calc['commission_basis'] }}

@endif
{{-- History --}}
Recent changes
    @forelse ($history as $h)
  • {{ ['commission.default_changed' => 'Default changed', 'commission.rule_added' => 'Rule added', 'commission.rule_changed' => 'Rule changed', 'commission.rule_removed' => 'Rule removed'][$h->action] ?? $h->action }}
    @if ($text = $h->new_values['rule'] ?? $h->old_values['rule'] ?? null)
    {{ $text }}
    @endif
    {{ $h->created_at->format('d M Y, h:i A') }}{{ $h->user ? ' · '.$h->user->name : '' }}
  • @empty
  • No changes yet.
  • @endforelse