@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Payroll Period Settings')) @section('content') @php $periodMode = old('period_mode', $settings['period_mode']); $salaryBasis = old('salary_basis', $settings['salary_basis']); $blockIncomplete = (bool) old('block_incomplete_calendar', $settings['block_incomplete_calendar']); $exampleMonthNum = (int) date('n'); $exampleYearNum = (int) date('Y'); $modeLabels = [ 'calendar_month' => __('Calendar month'), 'month_cutoff' => __('Month cutoff'), 'cross_month' => __('Cross-month cycle'), ]; $salaryLabels = [ 'full_month' => __('Full monthly gross'), 'period_prorata' => __('Pro-rated gross'), ]; $monthShortNames = array_map( fn ($m) => \Carbon\Carbon::create(null, $m, 1)->format('M'), range(1, 12) ); @endphp

{{ __('Payroll Period Settings') }}

{{ __('Control attendance windows, absent rules, and salary basis when generating payroll.') }}

@if(session('message'))
{{ session('message') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
{{ $modeLabels[$periodMode] ?? $periodMode }}
{{ __('Period mode') }}
{{ $salaryLabels[$salaryBasis] ?? $salaryBasis }}
{{ __('Salary basis') }}
{{ $blockIncomplete ? __('Blocked') : __('Allowed') }}
{{ __('Mid-month generation') }}
{{ __('Configuration') }}
@csrf
{{ __('Attendance period') }}
{{ __('Calendar month') }}

{{ __('1st through last day of the labeled month.') }}

{{ __('Month cutoff') }}

{{ __('Day 1 through a fixed cutoff day each month.') }}

{{ __('Cross-month') }}

{{ __('Spans previous month start day to current month end day.') }}

{{ __('Attendance covers the full calendar month. If you generate payroll before month end, working days after today without attendance are counted as absent.') }}
{{ __('Block incomplete current month') }}

{{ __('Prevent generating payroll for the current calendar month before it ends. When off, you can generate mid-month and remaining working days without attendance count as absent.') }}

{{ __('Salary calculation') }}
{{ __('Full month keeps gross fixed and adjusts absent/unpaid deductions. Pro-rated scales gross when the attendance period is shorter than a full month.') }}
{{ __('Live preview') }}
{{ $exampleLabel }}
{{ __('For payroll labeled :month, the attendance period will be:', ['month' => $exampleMonthName]) }}
{{ __('Cancel') }}
@endsection @section('script') @endsection