@extends('layouts.dashboard') @section('title', 'Payroll Details') @section('content')

Payroll Details

View payroll information for {{ $payroll->employee->name }}

Back to Payrolls @if($payroll->status == 'draft') Edit @endif @if(auth()->user()->can('admin'))
@if($payroll->status == 'draft')
@csrf
@endif @if($payroll->status == 'processed')
@csrf
@endif @if($payroll->status == 'draft')
@csrf @method('DELETE')
@endif
@endif
@php $statusColors = [ 'draft' => 'bg-yellow-50 border-yellow-200 text-yellow-800', 'processed' => 'bg-blue-50 border-blue-200 text-blue-800', 'paid' => 'bg-green-50 border-green-200 text-green-800' ]; $statusIcons = [ 'draft' => 'clock', 'processed' => 'check-circle', 'paid' => 'money-check-alt' ]; @endphp

Payroll Status: {{ ucfirst($payroll->status) }}

@if($payroll->status == 'draft') This payroll is in draft status and can be edited or processed. @elseif($payroll->status == 'processed') This payroll has been processed and is ready for payment. @else This payroll has been paid on {{ $payroll->payment_date->format('F d, Y') }}. @endif

{{ strtoupper($payroll->status) }}

Employee Information

Full Name

{{ $payroll->employee->name }}

Employee ID

{{ $payroll->employee->employee_id ?? 'N/A' }}

Department

{{ $payroll->employee->department->name ?? 'N/A' }}

Email

{{ $payroll->employee->email }}

Phone

{{ $payroll->employee->phone ?? 'N/A' }}

Employment Date

{{ $payroll->employee->hire_date ? $payroll->employee->hire_date->format('M d, Y') : 'N/A' }}

Pay Period & Payment Details

Pay Period

{{ $payroll->pay_period_start->format('M d, Y') }} {{ $payroll->pay_period_end->format('M d, Y') }}

{{ $payroll->pay_period_start->diffInDays($payroll->pay_period_end) + 1 }} days

Payment Date

@if($payroll->payment_date) {{ $payroll->payment_date->format('F d, Y') }} @else Not scheduled @endif

Created At

{{ $payroll->created_at->format('M d, Y h:i A') }}

Last Updated

{{ $payroll->updated_at->format('M d, Y h:i A') }}
@if($payroll->processed_at)

Processed At

{{ $payroll->processed_at->format('M d, Y h:i A') }}
@endif
@if($payroll->notes)

Notes

{{ $payroll->notes }}

@endif

Salary Summary EGP

Earnings

Basic Salary {{ number_format($payroll->basic_salary, 2) }}
@if($payroll->allowances > 0)
Allowances + {{ number_format($payroll->allowances, 2) }}
@endif @if($payroll->overtime > 0)
Overtime + {{ number_format($payroll->overtime, 2) }}
@endif @if($payroll->bonus > 0)
Bonus + {{ number_format($payroll->bonus, 2) }}
@endif
@if($payroll->deductions > 0)

Deductions

Total Deductions - {{ number_format($payroll->deductions, 2) }}
@endif
Total Earnings {{ number_format($payroll->basic_salary + $payroll->allowances + $payroll->overtime + $payroll->bonus, 2) }}
Before deductions EGP

Net Salary

{{ number_format($payroll->net_salary, 2) }} EGP

Amount to be paid to employee

Salary Breakdown

Basic Salary {{ number_format(($payroll->basic_salary / $payroll->net_salary) * 100, 1) }}%
@php $additionalEarnings = $payroll->allowances + $payroll->overtime + $payroll->bonus; $additionalPercentage = $additionalEarnings > 0 ? ($additionalEarnings / $payroll->net_salary) * 100 : 0; @endphp @if($additionalEarnings > 0)
Additional Earnings {{ number_format($additionalPercentage, 1) }}%
@endif @if($payroll->deductions > 0)
Deductions {{ number_format(($payroll->deductions / $payroll->net_salary) * 100, 1) }}%
@endif

Monthly Comparison

@if($payroll->net_salary > 5000) Above average @elseif($payroll->net_salary < 5000) Below average @else Average @endif

Quick Actions

All Payrolls
@if($payroll->status == 'draft')
Edit Payroll
@endif
@endsection