@extends('layouts.app') @section('title', 'Payroll - {{ $employee->first_name }} {{ $employee->last_name }} - Blackberry Farm') @section('content')
← Back to Employee ⏰ Timesheet ✏️ Edit Employee 👥 All Employees
${{ number_format($monthlyStats['total_pay'], 2) }}
{{ $currentMonth->format('F Y') }} Earnings
{{ number_format($monthlyStats['total_hours'], 1) }}h
Total Hours This Month
{{ number_format($monthlyStats['overtime_hours'], 1) }}h
Overtime Hours
{{ $monthlyStats['days_worked'] }}
Days Worked

💼 Pay Information

Pay Type
{{ ucwords(str_replace('_', ' ', $employee->pay_type)) }}
Base Rate
${{ number_format($employee->pay_type === 'salary' ? $employee->annual_salary : $employee->hourly_rate, 2) }} {{ $employee->pay_type === 'salary' ? '/year' : '/hour' }}
@if($employee->overtime_rate)
Overtime Rate
${{ number_format($employee->overtime_rate, 2) }}/hour
@endif
Pay Frequency
{{ ucwords(str_replace('_', ' ', $employee->pay_frequency)) }}

📊 Payroll Analytics

💰 Monthly Pay Breakdown

📈 Pay History (6 Months)

📅 Year-to-Date Summary

${{ number_format($ytdStats['total_pay'], 2) }}
Total Earnings YTD
{{ number_format($ytdStats['total_hours'], 1) }}
Total Hours YTD
${{ number_format($ytdStats['total_hours'] > 0 ? $ytdStats['total_pay'] / $ytdStats['total_hours'] : 0, 2) }}
Avg Hourly Rate
{{ $ytdStats['months_worked'] }}
Months Worked

📋 Pay Period History

@if($payPeriods->count() > 0)
@foreach($payPeriods as $period) @endforeach
Pay Period Days Worked Total Hours Gross Pay Avg Daily Hours
{{ $period['period'] }}
{{ $period['start_date']->format('M j') }} - {{ $period['end_date']->format('M j, Y') }}
{{ $period['days_worked'] }}
{{ number_format($period['total_hours'], 1) }}h
${{ number_format($period['total_pay'], 2) }}
{{ $period['days_worked'] > 0 ? number_format($period['total_hours'] / $period['days_worked'], 1) : '0.0' }}h
@else

No Pay History Available

No timesheet entries found for this employee yet.

Start Time Tracking
@endif
@if($monthlyTimesheets->count() > 0)

📅 {{ $currentMonth->format('F Y') }} Timesheet Details

@foreach($monthlyTimesheets as $timesheet) @endforeach
Date Clock In Clock Out Regular Hours Overtime Total Pay
{{ $timesheet->date->format('M j, Y') }}
{{ $timesheet->date->format('l') }}
{{ $timesheet->clock_in ? $timesheet->clock_in->format('g:i A') : '-' }}
{{ $timesheet->clock_out ? $timesheet->clock_out->format('g:i A') : 'Still working' }}
{{ number_format($timesheet->regular_hours ?? 0, 1) }}h
@if(($timesheet->overtime_hours ?? 0) > 0)
{{ number_format($timesheet->overtime_hours, 1) }}h
@else
-
@endif
${{ number_format($timesheet->total_pay ?? 0, 2) }}
@endif @endsection @push('scripts') @endpush