@extends('layouts.app') @section('title','Payroll Configuration') @section('page-title','Payroll') @push('styles') @endpush @section('content') {{-- Tab navigation --}}
{{-- ═══════════════════════════════════════════════════════ TAB 1: COUNTRY CONFIGURATIONS ═══════════════════════════════════════════════════════ --}}
{{-- Existing Configurations --}}
@forelse($configurations as $cfg)
{{ $cfg->name }} @if($cfg->is_active) Active @endif
{{ $cfg->country_name }} · {{ $cfg->currency_code }}
@if(!$cfg->is_active)
@csrf
@endif @if(!$cfg->is_active)
@csrf @method('DELETE')
@endif
Tax Method
{{ $cfg->tax_method_label }}
Employee Pension
{{ $cfg->employee_pension_rate }}% of {{ $cfg->pension_base }}
@if($cfg->secondary_currency_code)
Exchange Rate
1 {{ $cfg->currency_code }} = {{ $cfg->exchange_rate }} {{ $cfg->secondary_currency_code }}
@endif
{{-- Tax Brackets --}} @if($cfg->tax_method === 'progressive')
Tax Brackets ({{ $cfg->taxBrackets->count() }})
@foreach($cfg->taxBrackets as $bracket)
{{ number_format($bracket->min_income) }} – {{ $bracket->max_income ? number_format($bracket->max_income) : '∞' }} {{ $bracket->rate }}%
@csrf @method('DELETE')
@endforeach @if($cfg->taxBrackets->isEmpty())
No brackets yet. Add at least one.
@endif
@endif
@empty
No payroll configurations yet. Add one for your country below.
@endforelse
{{-- Add New Configuration --}}
Add Country Configuration
@csrf
{{-- ═══════════════════════════════════════════════════════ TAB 2: SALARY COMPONENTS ═══════════════════════════════════════════════════════ --}}
{{-- Components Table --}}
Salary Components
@forelse($components as $comp) @empty @endforelse
Component Code Type Taxable Mandatory Calc. Default Value Status Actions
{{ $comp->name }}
@if($comp->description)
{{ $comp->description }}
@endif
{{ $comp->code }} {{ ucfirst($comp->type) }} @if($comp->is_taxable) @else @endif @if($comp->is_mandatory) @else @endif {{ ucfirst($comp->calculation_type) }} {{ $comp->calculation_type === 'percentage' ? $comp->default_value.'%' : number_format($comp->default_value,2) }} {{ $comp->is_active ? 'Active' : 'Inactive' }}
@csrf @method('DELETE')
No salary components defined yet.
{{-- Add Component --}}
Add Salary Component
@csrf
{{-- ═══════════════════════════════════════════════════ MODALS ═══════════════════════════════════════════════════ --}} {{-- Edit Configuration Modal --}} {{-- Add Tax Bracket Modal --}} {{-- Edit Component Modal --}} @endsection @push('scripts') @endpush