@section('title', get_setting('site_name') . ' | ' . __('Approval Hierarchy')) @push('css') @endpush

{{ __('Hierarchy Setup') }}

{{ __('Define who approves each request type, in which order.') }}

{{ __('Mode') }} {{ $scopeLabel }} {{ __('Change scope in Workflow Settings. Empty Department/Branch on a rule = Global fallback.') }}
{{ __('Features') }}
{{ __('Request Type') }}

{{ __('Which module uses this chain (Leave, PF Loan, Separation…).') }}

{{ __('Level + Stage label') }}

{{ __('Level 1 acts first. Label is the name shown on the timeline (e.g. Line manager).') }}

{{ __('Approver type') }}

{{ __('Fixed user = named person. Direct supervisor = requester’s boss. Department head = auto from same dept.') }}

{{ __('Example') }}: {{ __('Leave · Finance · L1 Direct supervisor · L2 Fixed user (HR). Finance staff leave goes to their supervisor, then HR.') }} {{ __('Full guide') }} →
{{ $editingId ? __('Update Hierarchy Rule') : __('Add Hierarchy Rule') }}
@if($editingId) {{ __('Editing') }} @endif
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif @error('requestType')
{{ $message }}
@enderror @error('label')
{{ $message }}
@enderror @error('approverId')
{{ $message }}
@enderror
{{ __('Pick the application this approval chain belongs to.') }}
@if($usesDepartment)
{{ __('Leave Global to use as company-wide fallback for this request type.') }}
@endif @if($usesBranch)
{{ __('Optional. Narrow the rule to one branch/warehouse.') }}
@endif
{{ __('Name shown on the approval timeline.') }}
{{ __('1 = first') }}
@if($approverKind === 'fixed_user') {{ __('Same named officer always handles this stage.') }} @elseif($approverKind === 'direct_supervisor') {{ __('Resolved from the employee’s supervisor at request time.') }} @else {{ __('Resolved from designation / seniority in the same department.') }} @endif
@if($approverKind === 'fixed_user')
@endif
@if($editingId) @endif
{{ __('Configured Rules') }}
@if($usesDepartment)
@endif @if($usesBranch)
@endif
@if($usesDepartment)@endif @if($usesBranch)@endif @forelse($rules as $rule) @if($usesDepartment) @endif @if($usesBranch) @endif @empty @endforelse
{{ __('Level') }} {{ __('Stage') }}{{ __('Department') }}{{ __('Branch') }}{{ __('Approver') }} {{ __('Status') }} {{ __('Action') }}
{{ $rule->level ?? $rule->label }} {{ $rule->stage_name ?: $rule->label }} @if($rule->department) {{ $rule->department->name }} @else {{ __('Global') }} @endif @if($rule->warehouse) {{ $rule->warehouse->name }} @else {{ __('Any') }} @endif @if(($rule->approver_kind ?? 'fixed_user') === 'direct_supervisor') {{ __('Direct supervisor') }} @elseif(($rule->approver_kind ?? 'fixed_user') === 'department_head') {{ __('Department head') }} @else {{ optional($rule->approver)->name ?? '—' }} @if(optional($rule->approver)->id) ({{ $rule->approver->id }}) @endif @endif @if((int) $rule->is_active === 1) {{ __('Active') }} @else {{ __('Inactive') }} @endif
{{ __('No hierarchy rules yet') }}

{{ __('Add Level 1 for a request type on the left. Example: Leave → Line manager → Fixed user.') }}

{{ __('Read the guide') }}
@section('script') @endsection