@php $worksheetRows = $worksheetRows ?? []; $canAdjustBasicPay = $canAdjustBasicPay ?? false; $period = $accounting_payroll_period; $showActions = collect($worksheetRows)->contains(fn ($row) => ! empty($row['line'])); $colspan = $showActions ? 14 : 13; $money = fn ($value) => number_format((float) $value, 2); $totals = [ 'basic' => 0.0, 'allowances' => 0.0, 'bonus' => 0.0, 'gross' => 0.0, 'nssf' => 0.0, 'shif' => 0.0, 'housing' => 0.0, 'paye' => 0.0, 'other_deductions' => 0.0, 'total_deductions' => 0.0, 'net' => 0.0, ]; foreach ($worksheetRows as $row) { foreach ($totals as $key => $_) { $totals[$key] += (float) ($row[$key] ?? 0); } } $otherTitle = function (array $row): string { $parts = []; if ((float) ($row['staff_loan'] ?? 0) > 0) { $parts[] = 'Staff loan '.number_format((float) $row['staff_loan'], 2); } if ((float) ($row['salary_advance'] ?? 0) > 0) { $parts[] = 'Advance '.number_format((float) $row['salary_advance'], 2); } if ((float) ($row['unpaid_leave'] ?? 0) > 0) { $parts[] = 'Unpaid leave '.number_format((float) $row['unpaid_leave'], 2); } $named = (float) ($row['staff_loan'] ?? 0) + (float) ($row['salary_advance'] ?? 0) + (float) ($row['unpaid_leave'] ?? 0); $remainder = round((float) ($row['other_deductions'] ?? 0) - $named, 2); if ($remainder > 0.004) { $parts[] = 'Other '.number_format($remainder, 2); } return $parts === [] ? 'Non-statutory deductions' : implode(' · ', $parts); }; @endphp @if (in_array($period->normalizedStatus(), ['locked', 'paid'], true))

This register is with treasury for disbursement

After confirmation, payments are processed as bank, cash, or M-Pesa on the treasury payroll payments queue.

@if ($canViewTreasuryPayrollQueue ?? false) Open payroll payments @endif
@endif @if ($canAdjustBasicPay)
Adjust basic pay for this period before generating. Statutory deductions and net pay recalculate from that amount. The salary master is not changed. @if ($period->isGenerated()) After changing basics, click Regenerate so PAYE, NSSF, SHIF, housing levy, and net pick up the new figures. @endif
@elseif ($canGeneratePayroll ?? false)
Generate payroll lines from each employee's active salary assignment using the toolbar above.
@endif @php $wrapForm = $canAdjustBasicPay && $worksheetRows !== []; @endphp @if ($wrapForm)
@csrf @endif
@if ($showActions) @endif @if ($showActions) @endif @forelse ($worksheetRows as $row) @php $line = $row['line'] ?? null; $skip = $row['skip_reason'] ?? null; $channel = $row['payment_method_label'] ?? 'Hold'; @endphp @if ($showActions) @endif @empty @endforelse @if ($worksheetRows !== []) @if ($showActions) @endif @endif
Employee Channel Basic Allow. Bonus Gross NSSF SHIF Housing PAYE Other Ded. NetActions
{{ $row['name'] }} {{ $row['employee_number'] }} @if ($skip) {{ $skip }} @elseif (! empty($row['basic_overridden'])) Period override @endif {{ $channel }} @if ($canAdjustBasicPay && ! $skip && ($row['employee_id'] ?? 0) > 0) @else {{ $money($row['basic'] ?? 0) }} @endif {{ $money($row['allowances'] ?? 0) }} {{ $money($row['bonus'] ?? 0) }} {{ $money($row['gross'] ?? 0) }} {{ $money($row['nssf'] ?? 0) }} {{ $money($row['shif'] ?? 0) }} {{ $money($row['housing'] ?? 0) }} {{ $money($row['paye'] ?? 0) }} {{ $money($row['other_deductions'] ?? 0) }} {{ $money($row['total_deductions'] ?? 0) }} {{ $money($row['net'] ?? 0) }} @if ($line) @include('loan.accounting.books.payroll.partials.payslip-line-actions', [ 'period' => $period, 'line' => $line, 'showBreakdown' => true, 'showPeriodLink' => false, 'showEdit' => false, 'canManualEditLines' => false, ]) @else — @endif
@if ($period->normalizedStatus() === 'draft') No eligible employees yet. Mark staff as Include in HR payroll with a basic salary, then generate. @else No lines in this run. Fix employee salaries and regenerate. @endif
Totals {{ $money($totals['basic']) }} {{ $money($totals['allowances']) }} {{ $money($totals['bonus']) }} {{ $money($totals['gross']) }} {{ $money($totals['nssf']) }} {{ $money($totals['shif']) }} {{ $money($totals['housing']) }} {{ $money($totals['paye']) }} {{ $money($totals['other_deductions']) }} {{ $money($totals['total_deductions']) }} {{ $money($totals['net']) }}
@if ($wrapForm)
@if ($canGeneratePayroll ?? false) @endif @if ($canRegeneratePayroll ?? false) @endif
@endif