@extends('layouts.app') @section('title', 'Payroll Reports') @section('breadcrumbs') @endsection @section('content')

Payroll Reports

{{-- Tabs --}}
{{-- Monthly Summary --}}

Monthly Payroll Summary

@forelse($monthlyData ?? [] as $batch) @empty @endforelse @if(!empty($monthlyData) && count($monthlyData) > 0) @endif
Month Employees Earnings (OMR) Deductions (OMR) Net (OMR) Status
{{ \Carbon\Carbon::createFromDate($batch->year, $batch->month, 1)->format('F Y') }} {{ $batch->employee_count }} {{ number_format($batch->total_earnings, 3) }} {{ number_format($batch->total_deductions, 3) }} {{ number_format($batch->total_net, 3) }} {{ ucfirst($batch->status) }}
No payroll data available.
Total {{ number_format(collect($monthlyData)->sum('total_earnings'), 3) }} {{ number_format(collect($monthlyData)->sum('total_deductions'), 3) }} {{ number_format(collect($monthlyData)->sum('total_net'), 3) }}
{{-- Department Cost --}}

Department-wise Cost (Latest Finalized)

@forelse($departmentData ?? [] as $dept) @empty @endforelse
Department Employees Total Cost (OMR) Avg Salary (OMR) % of Total
{{ $dept['name'] }} {{ $dept['count'] }} {{ number_format($dept['total'], 3) }} {{ number_format($dept['average'], 3) }}
{{ number_format($dept['percentage'], 1) }}%
No data available. Finalize a payroll batch first.
{{-- Components Breakdown --}}

Component Breakdown (Latest Finalized)

@forelse($componentData ?? [] as $comp) @empty @endforelse
Component Type Total Amount (OMR) % of Payroll
{{ $comp['name'] }} {{ ucfirst($comp['type']) }} {{ number_format($comp['total'], 3) }} {{ number_format($comp['percentage'], 1) }}%
No data available.
{{-- Year-to-Date --}}

Year-to-Date Summary ({{ date('Y') }})

@if(!empty($ytdData))
{{ number_format($ytdData['total_earnings'], 3) }}
Total Earnings (OMR)
{{ number_format($ytdData['total_deductions'], 3) }}
Total Deductions (OMR)
{{ number_format($ytdData['total_net'], 3) }}
Total Net Paid (OMR)

Based on {{ $ytdData['batches_count'] }} finalized payroll batch(es) in {{ date('Y') }}.

@else

No finalized payroll batches for {{ date('Y') }} yet.

@endif
@endsection