@extends('backend.layouts.app') @section('title', $title) @push('styles') @endpush @section('content')
{{ $title }}
{{ __('Control cash-in and cash-out commission by operation, amount range, or currency. Assign rules from the agent review modal.') }}
{{ __('Agents') }}
{{ __('Commission Rules') }}
{{ __('Rules are checked by specificity first, then priority.') }}
{{ trans_choice(':count rule|:count rules', $rules->total(), ['count' => $rules->total()]) }}
@forelse($rules as $rule) @empty @endforelse
{{ __('Rule') }} {{ __('Scope') }} {{ __('Range') }} {{ __('Commission') }} {{ __('Use') }} {{ __('Action') }}
{{ $rule->name }}
{{ __('Priority') }} {{ $rule->priority }}
{{ $operationTypes[$rule->operation_type] ?? title($rule->operation_type) }}
{{ $rule->currency?->code ?? __('Any currency') }}
{{ number_format((float) $rule->min_amount, (int) setting('site_decimal', 2)) }}
{{ $rule->max_amount ? number_format((float) $rule->max_amount, (int) setting('site_decimal', 2)) : __('No max') }}
@if($rule->calculation_type === \App\Enums\AgentCommissionRuleType::PERCENTAGE)
{{ number_format((float) $rule->percentage_rate, 2) }}%
@else
{{ number_format((float) $rule->fixed_amount, (int) setting('site_decimal', 2)) }}
@endif
{{ $rule->calculation_type->label() }}
{{ $rule->status ? __('Active') : __('Inactive') }}
{{ $rule->applies_globally ? __('Global fallback') : __('Assignment only') }}
{{ trans_choice(':count assigned agent|:count assigned agents', $rule->assignments_count, ['count' => $rule->assignments_count]) }}
{{ $rules->links() }}
@foreach($rules as $rule) @endforeach @endsection