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

Payroll Management

Manage employee salaries and payments

Create Payroll

Total Payrolls

{{ $payrolls->total() }}

{{ \App\Models\User::role('employee')->count() }} employees

Draft

{{ \App\Models\Payroll::where('status', 'draft')->count() }}

Pending

Processed

{{ \App\Models\Payroll::where('status', 'processed')->count() }}

Ready

Paid

{{ \App\Models\Payroll::where('status', 'paid')->count() }}

Completed
@forelse($payrolls as $payroll) @empty @endforelse
Employee & Period
Salary Details
Payment
Status
Actions
{{ $payroll->employee->name }}
{{ $payroll->employee->employee_id }}
{{ $payroll->pay_period_start->format('M d') }} - {{ $payroll->pay_period_end->format('M d, Y') }}
Basic: {{ number_format($payroll->basic_salary, 2) }} EGP
Allowances: +{{ number_format($payroll->allowances, 2) }}
Deductions: -{{ number_format($payroll->deductions, 2) }}
Net Salary: {{ number_format($payroll->net_salary, 2) }} EGP
@if($payroll->payment_date)
{{ $payroll->payment_date->format('M d, Y') }}
@else
Not scheduled
@endif @if($payroll->processed_at)
Processed: {{ $payroll->processed_at->format('M d, h:i A') }}
@endif
@php $statusColors = [ 'draft' => 'bg-amber-100 text-amber-800', 'processed' => 'bg-blue-100 text-blue-800', 'paid' => 'bg-emerald-100 text-emerald-800' ]; $statusIcons = [ 'draft' => 'fa-clock', 'processed' => 'fa-check-circle', 'paid' => 'fa-money-check-alt' ]; @endphp {{ ucfirst($payroll->status) }}
@if($payroll->status == 'draft')
@csrf
@csrf @method('DELETE')
@endif @if($payroll->status == 'processed')
@csrf
@endif

No Payrolls Found

You haven't created any payrolls yet. Get started by creating payroll records for your employees.

Create Payroll
@if($payrolls->hasPages())
{{ $payrolls->links() }}
@endif
@endsection