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

Employees & HR

Payroll management

Attendance, leave, overtime, salary structures, loans, approval locks, WPS batches and accounting in one auditable flow.

Runs under review

{{ $stats['draft'] }}

Approved awaiting payment

{{ $stats['approved'] }}

Latest approved net

AED {{ number_format((float)$stats['last_net'],2) }}

Active loan balance

AED {{ number_format((float)$stats['active_loans'],2) }}

@if(auth()->check() && auth()->user()->hasPermission('payroll.process'))

Start payroll run

Missing salary structures block calculation. Bank, attendance, corrections and pending leave appear as validation warnings.

@csrf
@endif

Payroll runs

@forelse($runs as $run)@empty@endforelse
RunPeriodScopeGrossDeductionsNetWarningsStatus
{{ $run->run_number }}{{ $run->created_at->format('d M Y H:i') }}{{ $run->period->period_name }}{{ $run->period->period_start->format('d M') }}–{{ $run->period->period_end->format('d M Y') }}{{ $run->branch?->name ?? 'All branches' }}{{ $run->group?->name ?? 'All payroll groups' }}AED {{ number_format((float)$run->gross_total,2) }}AED {{ number_format((float)$run->deduction_total,2) }}AED {{ number_format((float)$run->net_total,2) }}{{ count($run->validation_warnings ?? []) }}{{ str_replace('_',' ',$run->status) }}
No payroll runsCalculate the first period once salaries and attendance are ready.
{{ $runs->links() }}
@if(auth()->check() && auth()->user()->hasPermission('payroll.salary.view'))

Salary readiness

Salary values remain hidden from users without salary permission.

{{ $employees->count() }} active employees
@foreach($employees as $employee)
{{ $employee->full_name }}

{{ $employee->employee_code }} · {{ $employee->designation }}

@if($employee->currentSalary)

AED {{ number_format((float)$employee->currentSalary->basic_salary,2) }}

Basic · effective {{ $employee->currentSalary->effective_from->format('d M Y') }}

@elseSalary missing@endif
Salary & bank details@if(auth()->check() && auth()->user()->hasPermission('payroll.process'))@endif
@if(auth()->check() && auth()->user()->hasPermission('payroll.process'))
@csrf
@endif
@endforeach
@endif @if($loans->isNotEmpty())

Loans and salary advances

@foreach($loans as $loan)@endforeach
LoanEmployeeAmountInstallmentRemainingStatusAction
{{ $loan->loan_number }}{{ ucfirst(str_replace('_',' ',$loan->type)) }}{{ $loan->employee->full_name }}AED {{ number_format((float)$loan->amount,2) }}AED {{ number_format((float)$loan->installment_amount,2) }}AED {{ number_format((float)$loan->remaining_amount,2) }}{{ ucfirst($loan->status) }}@if($loan->status==='requested') @if(auth()->check() && auth()->user()->hasPermission('payroll.approve'))
@csrf
@endif @elsePayroll deduction active@endif
@endif
@endsection