@extends('layouts.backend') @section('content')

{{ __('Employee Salary Assignments') }}

@if(auth()->user()?->hasAnyPermission(['salary_template.assign', 'employee_salary.assign', 'payroll.manage-salary-templates'])) {{ __('Assign Employee Salary') }} @endif {{ __('Templates') }}
@include('partials.flash')
@forelse($assignments as $assignment) @php $allowances = (float) $assignment->house_rent + (float) $assignment->medical_allowance + (float) $assignment->conveyance_allowance + (float) $assignment->other_allowance; $today = now()->toDateString(); $status = $assignment->effective_from > $today ? 'Future' : (($assignment->effective_to && $assignment->effective_to < $today) ? 'Expired' : 'Active'); $statusClass = $status === 'Active' ? 'bg-success' : ($status === 'Future' ? 'bg-info' : 'bg-secondary'); @endphp @empty @endforelse
{{ __('Employee') }} {{ __('Grade') }} {{ __('Structure') }} {{ __('Frequency') }} {{ __('Basic') }} {{ __('Allowances') }} {{ __('Gross') }} {{ __('Effective') }} {{ __('Status') }} {{ __('Actions') }}
{{ trim($assignment->first_name.' '.$assignment->last_name) }} ({{ $assignment->employee_code }}) {{ $assignment->grade_name ? $assignment->grade_name.' ('.$assignment->grade_code.')' : '-' }} {{ $assignment->template_name }} ({{ $assignment->template_code }}) {{ __(ucfirst($assignment->pay_frequency ?: 'template')) }} {{ number_format((float) $assignment->basic_salary, 2) }} {{ number_format($allowances, 2) }} {{ number_format((float) $assignment->gross_salary, 2) }} {{ $assignment->effective_from }} - {{ $assignment->effective_to ?: __('Current') }} {{ __($status) }}
{{ __('No employee salary assignments found.') }}
{{ $assignments->links('pagination::bootstrap-5') }}
@endsection