@php use App\Support\EmployeePaymentChannel; use App\Support\Validation\KenyanFieldRules; $employee = $employee ?? null; $paymentChannelLabels = $paymentChannelLabels ?? EmployeePaymentChannel::labels(); $allowanceComponents = $allowanceComponents ?? collect(); $deductionComponents = $deductionComponents ?? collect(); $selectedAllowanceIds = $selectedAllowanceIds ?? []; $selectedDeductionIds = $selectedDeductionIds ?? []; $payComponentPreviewAmounts = $payComponentPreviewAmounts ?? []; $payComponentsConfigured = $payComponentsConfigured ?? false; $includeInPayroll = (bool) old('include_in_payroll', $includeInPayroll ?? $employee?->include_in_payroll ?? false); $selectedChannel = old('payment_channel', $employee?->payment_channel); $defaultRecipientName = trim(trim((string) old('first_name', $employee?->first_name ?? '')).' '.trim((string) old('last_name', $employee?->last_name ?? ''))); $bankHolder = old('bank_account_holder', $employee?->bank_account_holder ?: $defaultRecipientName); $mpesaName = old('mpesa_registered_name', $employee?->mpesa_registered_name ?: $defaultRecipientName); $showChannelDetails = filled($selectedChannel); $payrollBasicSalary = old('basic_salary', $payrollBasicSalary ?? $employee?->currentSalaryAssignment?->basic_salary); @endphp

Payroll

Active staff marked here are included when a payroll period is opened. Amounts for additions and deductions come from payroll settings.

@if ($payComponentsConfigured) @include('loan.accounting.books.payroll.partials.pay-component-checklist', [ 'prefix' => 'allowance', 'components' => $allowanceComponents, 'selectedIds' => $selectedAllowanceIds, 'basicSalary' => (float) ($payrollBasicSalary ?: 0), 'readOnlyAmounts' => true, 'previewAmounts' => $payComponentPreviewAmounts, 'defaultExpanded' => true, ]) @include('loan.accounting.books.payroll.partials.pay-component-checklist', [ 'prefix' => 'deduction', 'components' => $deductionComponents, 'selectedIds' => $selectedDeductionIds, 'basicSalary' => (float) ($payrollBasicSalary ?: 0), 'readOnlyAmounts' => true, 'previewAmounts' => $payComponentPreviewAmounts, 'defaultExpanded' => true, ]) @else

Payroll additions and deductions are not configured yet. Add them under Accounting → Payroll settings.

@endif
! $showChannelDetails])>
$selectedChannel !== EmployeePaymentChannel::BANK])>
$selectedChannel !== EmployeePaymentChannel::MPESA])>
@php $mpesaPhoneAttrs = 'data-loan-field-kind="phone_ke" '.KenyanFieldRules::htmlAttributeStringForKind(KenyanFieldRules::KIND_PHONE_KE); @endphp
$selectedChannel !== EmployeePaymentChannel::CASH])> Cash payments are recorded manually in the payroll payment register. No account details are required.