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

{{ __('payroll.edit.page_title', ['id' => $payroll->id]) }}

{{ __('payroll.edit.page_title', ['id' => $payroll->id]) }}

@if($payroll->status !== 'pending')
{{ __('payroll.edit.cannot_edit_status', ['status' => $payroll->status]) }}
{{ __('payroll.employee_payrolls_page.back_to_list') }} @else
@csrf @method('PUT')
@error('month')
{{ $message }}
@enderror
@error('year')
{{ $message }}
@enderror
{{ get_currency_code() }}
@error('basic_salary')
{{ $message }}
@enderror
{{ get_currency_code() }}
@error('incentives')
{{ $message }}
@enderror
@php $paidOffExisting = 0; if ($payroll->relationLoaded('payrollSalaryComponents')) { foreach ($payroll->payrollSalaryComponents as $psc) { $meta = $psc->meta ?? null; $isPaidOff = false; if (is_array($meta) && (($meta['type'] ?? '') === 'paid_off_days')) $isPaidOff = true; if (($psc->name ?? '') === 'Paid Off-day Compensation') $isPaidOff = true; if ($isPaidOff) { $paidOffExisting = $psc->value; break; } } } @endphp
{{ get_currency_code() }}
{{ get_currency_code() }}
{{ get_currency_code() }}
@php $selectedInstallments = []; if (!empty($payroll->meta) && is_array($payroll->meta)) { $selectedInstallments = $payroll->meta['installment_ids'] ?? []; } elseif (!empty($payroll->meta) && is_string($payroll->meta)) { $tmp = json_decode($payroll->meta, true) ?: []; $selectedInstallments = $tmp['installment_ids'] ?? []; } @endphp @if(!empty($pendingInstallments) && $pendingInstallments->isNotEmpty()) @foreach($pendingInstallments as $inst)
id, $selectedInstallments) ? 'checked' : '' }}>
@endforeach @else
{{ __('payroll.create.no_pending_installments', [], null) ?: 'لا توجد أقساط معلقة لهذا الشهر.' }}
@endif
{{ get_currency_code() }}
{{ get_currency_code() }}
@error('net_salary')
{{ $message }}
@enderror
{{ __('payroll.create.additional_components') }}
@foreach($payroll->payrollSalaryComponents as $psc)
@endforeach
@error('notes')
{{ $message }}
@enderror
@endif
تفاصيل الإجازات لشهر {{ $payroll->month }}/{{ $payroll->year }}
الأيام المسموح بها شهريًا: {{ $payroll->employee->monthly_leave_days_allowed ?? 0 }} يوم
الأيام المستخدمة (من السجل): {{ $usedLeaveDays ?? 0 }} يوم
الأيام الزائدة: {{ $excessDays ?? 0 }} يوم
{{ __('payroll.labels.daily_rate') }}: {{ number_format($dailyRate ?? 0, 2) }} {{ get_currency_code() }}
خصم الإجازات: - {{ number_format($leaveDeduction ?? 0, 2) }} {{ get_currency_code() }}
معلومات الراتب
@if($payroll->paid_at) @endif
الحالة:{{ $payroll->status == 'paid' ? 'مدفوع' : ($payroll->status == 'pending' ? 'قيد الدفع' : 'ملغى') }}
تاريخ الإنشاء:{{ $payroll->created_at->format('Y-m-d H:i') }}
تاريخ الدفع:{{ $payroll->paid_at->format('Y-m-d H:i') }}
{{ __('payroll.create.overtime_hours', [], null) ?: 'ساعات الأوفر تايم لهذا الشهر' }}: {{ number_format($attendanceOvertimeHours ?? 0, 2) }} {{ __('payroll.labels.hours', [], null) ?: 'س' }}
{{ __('payroll.create.overtime_amount', [], null) ?: 'قيمة الأوفر تايم' }}: {{ number_format($overtimeAmount ?? 0, 2) }} {{ get_currency_code() }}
@push('scripts') @endpush @endsection