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

Generate Payroll

Run a new payroll cycle for a period

@include('partials.flashes')
@csrf

Select Employees

@foreach ($all as $s) @endforeach

{{ $selectedIds->count() }} of {{ $all->count() }} selected · Basic salary total —

@if ($preview && count($computations) > 0)
@php $previewPaye = collect($computations)->sum(fn ($c) => $c['paye']); $previewNet = collect($computations)->sum(fn ($c) => $c['netPay']); @endphp
Employees {{ count($computations) }}
Total Gross {{ number_format($totalGross, 2) }}
Total PAYE {{ number_format($previewPaye, 2) }}
Total Net {{ number_format($previewNet, 2) }}
@foreach ($computations as $comp) @endforeach
Employee Basic Gross NSSF SHIF Housing Levy Taxable PAYE Total Deductions Net Pay Details
{{ $comp['staff']->full_name }} {{ $comp['staff']->staff_no }} {{ number_format($comp['basicSalary'], 2) }} {{ number_format($comp['grossPay'], 2) }} {{ number_format($comp['nssfEmployee'], 2) }} {{ number_format($comp['shif'], 2) }} {{ number_format($comp['housingLevy'], 2) }} {{ number_format($comp['taxablePay'], 2) }} {{ number_format($comp['paye'], 2) }} {{ number_format($comp['totalDeductions'], 2) }} {{ number_format($comp['netPay'], 2) }}
@elseif ($preview)
Select at least one employee to preview the computation.
@endif
@endsection