@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)