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

{{ __('deductions.page_title') }}

{{ __('deductions.cards.total_deductions') }}

{{ $totalDeductions ?? 0 }}

{{ __('deductions.cards.total_amount') }}

{{ number_format($totalAmount ?? 0, 2) }} {{ get_currency_code() }}

{{ __('deductions.cards.monthly') }}

{{ $monthlyDeductions ?? 0 }}

{{ __('deductions.cards.annual') }}

{{ $annualDeductions ?? 0 }}

{{ __('deductions.page_title') }}

@can('create deduction') {{ __('deductions.buttons.create') }} @endcan
@forelse($deductions as $deduction) @empty @endforelse
{{ __('deductions.table.id') }} {{ __('deductions.table.employee_name') }} {{ __('deductions.table.type') }} {{ __('deductions.table.amount') }} {{ __('deductions.table.description') }} {{ __('deductions.table.deduction_date') }} {{ __('deductions.table.frequency') }} {{ __('deductions.table.status') }} {{ __('deductions.table.actions') }}
{{ $deduction->id }} {{ $deduction->employee->name ?? 'غير محدد' }} {{ __('deductions.type_labels.' . $deduction->type) }} {{ number_format($deduction->amount ?? 0, 2) }} {{ get_currency_code() }} {{ $deduction->description ?? '-' }} {{ $deduction->deduction_date?->format('Y-m-d') ?? __('deductions.not_specified') }} @php $freq = $deduction->frequency ?? ($deduction->is_monthly ? 'monthly' : 'once'); @endphp @if($freq === 'monthly') {{ __('deductions.frequency.monthly') }} @elseif(in_array($freq, ['yearly','annual'])) {{ __('deductions.frequency.yearly') }} @else {{ __('deductions.frequency.once') }} @endif @if($deduction->status == 'applied') {{ __('deductions.status.applied') }} @elseif($deduction->status == 'pending') {{ __('deductions.status.pending') }} @elseif($deduction->status == 'cancelled') {{ __('deductions.status.cancelled') }} @else {{ __('deductions.status.unknown') ?? 'غير معروف' }} @endif @if(auth()->user()->hasPermission('edit_deductions') || auth()->user()->hasRole(['admin', 'super-admin'])) @endif @if(auth()->user()->hasPermission('delete_deductions') || auth()->user()->hasRole(['admin', 'super-admin']))
@csrf @method('DELETE')
@endif
{{ __('deductions.table.no_records') }}
@if(isset($deductions) && $deductions->hasPages())
{{ $deductions->links() }}
@endif
@endsection