@extends('layouts.app') @section('title', 'Payroll — ' . \Carbon\Carbon::createFromDate($batch->year, $batch->month, 1)->format('F Y') . ' (Finalized)') @section('breadcrumbs') @endsection @section('content')
{{-- Header --}}

{{ \Carbon\Carbon::createFromDate($batch->year, $batch->month, 1)->format('F Y') }} Payroll

Finalized by {{ $batch->finalizer->name ?? 'System' }} on {{ $batch->finalized_at?->format('d M Y H:i') }}
Export Excel @if(!$batch->wps_generated) Generate WPS @else WPS Generated @endif
{{-- Summary Cards --}}
{{ number_format($batch->total_earnings, 3) }}
Total Earnings (OMR)
{{ number_format($batch->total_deductions, 3) }}
Total Deductions (OMR)
{{ number_format($batch->total_net, 3) }}
Net Payable (OMR)
{{ $batch->employee_count }}
Employees
{{-- Items Table --}}

Payroll Details

@foreach($items as $item) @endforeach
Employee Department Gross (OMR) Deductions (OMR) Net (OMR) Payslip
{{ $item->employee->full_name ?? '' }}
{{ $item->employee->employee_code ?? '' }}
{{ $item->employee->department->name ?? '—' }} {{ number_format($item->gross_salary, 3) }} {{ number_format($item->total_deductions, 3) }} {{ number_format($item->net_salary, 3) }} @if($item->payslip_path) PDF @else @endif @if($item->is_overridden) Overridden @endif

Earnings

@foreach($item->earnings ?? [] as $code => $amount)
{{ $code }}{{ number_format($amount, 3) }}
@endforeach

Deductions

@foreach($item->deductions ?? [] as $code => $amount) @if($amount > 0)
{{ $code }}{{ number_format($amount, 3) }}
@endif @endforeach
@if($item->override_notes)
Override: {{ $item->override_notes }}
@endif
@endsection