@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Salary Structure Rules')) @section('content') @php $scopedRulesOn = (int) get_setting('salary_structure_scoped_rules') === 1; $rules = old('rules', $row->rules ?? []); if (! is_array($rules) || count($rules) === 0) { $rules = [\App\Services\SalaryStructureService::normalizeRule([ 'id' => 'new_1', 'label' => '', 'type' => \App\Services\SalaryStructureService::TYPE_PERCENT_OF_BASIC, 'apply_at' => \App\Services\SalaryStructureService::APPLY_SETUP, 'percent' => 0, 'target' => 'house_rent', 'enabled' => true, 'sort' => 10, 'scope_mode' => 'all', 'scope_ids' => [], ])]; } $targetLabels = [ 'basic_salary' => __('Basic Salary'), 'house_rent' => __('House Rent'), 'medical' => __('Medical'), 'food' => __('Food / Lunch'), 'conveyance' => __('Conveyance / Travel'), 'utility' => __('Utility / Mobile'), 'Others' => __('Others'), 'provident_fund' => __('Provident Fund'), ]; @endphp
{{ __('Company-wide allowance formulas. Enter basic on salary setup; rules fill components. Lunch and bill overrides apply at payroll.') }}
@if($scopedRulesOn){{ __('Scoped rules enabled. Each rule can target all staff, selected branches, departments, or employees. When several rules match the same slot, priority is: employee → department → branch → all.') }} {{ __('Change in Website Settings') }}
@else{{ __('All rules currently apply to every employee. Enable') }} {{ __('Salary Structure Scoped Rules') }} {{ __('in Website Settings to limit lunch and other allowances by branch, department, or employee.') }}
@endif