@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Approval Hierarchy Settings')) @section('content')

{{ __('Approval Hierarchy & Workflow') }}

{{ __('Choose how approval chains are maintained — global, department-wise, branch-wise, or both — then define levels on Hierarchy Setup.') }}

@if(session('message'))
{{ session('message') }}
@endif @if($errors->any())
@endif
@csrf
{{ __('Approval required per module') }}

{{ __('Checked = go through Approval Center. Unchecked = auto-approve on submit (e.g. Visit/Movement with no approval).') }}

@foreach($moduleGroups as $groupLabel => $types)
{{ __($groupLabel) }}
@foreach($types as $fqcn => $label) @php $checked = old('module_required') !== null ? in_array($fqcn, (array) old('module_required'), true) : ($moduleStatuses[$fqcn] ?? true); @endphp
@endforeach
@endforeach
@if(!empty($hierarchyEnabled))
{{ __('Hierarchy scope') }}
{{ __('Example: Leave for Finance can go to Finance Manager; Program dept can use a different chain.') }}
{{ __('Fallback when no matching chain') }}
{{ __('Workflow policies') }}
{{ __('How matching works') }}
  1. {{ __('Employee department / branch is taken from their staff profile at request time.') }}
  2. {{ __('Department + Branch mode tries exact match first, then department-only, then global.') }}
  3. {{ __('Global rules (no department / branch) remain available as a company-wide fallback when configured.') }}
  4. {{ __('The full chain is frozen on the request when it is created.') }}
@endif
@endsection