@php // --- DATA PREPARATION (UNCHANGED) --- $earnings = [ 'Salary' => $wdTotalAmount + $otTotalAmount, 'Uniform Allowance' => $misc->uniform_allowance ?? 0, '5 days Incentives' => $misc->incentive_pay ?? 0, 'Holiday' => 0.0, 'Nightshift Differential' => $misc->night_differential_pay ?? 0, 'Allowance' => $totalPositiveAdjustment, ]; $total_salary = array_sum($earnings); $deductions_list = [ 'SSS' => $misc->sss_contribution ?? 0, 'PhilHealth' => $misc->philhealth_contribution ?? 0, 'HDMF' => $misc->pag_ibig_contribution ?? 0, 'SSS Loan' => 0.0, 'HDMF Loan' => 0.0, 'Loss & Damages' => 0.0, 'Cash Advance' => 0.0, 'Payroll Adjust' => abs($totalNegativeAdjustment), 'License' => 0.0, 'Cashbond' => 0.0, 'Tailoring' => 0.0, 'Others' => 0.0, ]; foreach ($loans as $loan) { if (str_contains(strtoupper($loan->type), 'SSS')) { $deductions_list['SSS Loan'] += $loan->deduction_rate; } elseif (str_contains(strtoupper($loan->type), 'HDMF') || str_contains(strtoupper($loan->type), 'PAG-IBIG')) { $deductions_list['HDMF Loan'] += $loan->deduction_rate; } elseif (str_contains(strtoupper($loan->type), 'CASH ADVANCE')) { $deductions_list['Cash Advance'] += $loan->deduction_rate; } else { $deductions_list['Others'] += $loan->deduction_rate; } } foreach ($deductions as $deduction) { if (str_contains(strtoupper($deduction->name), 'CASH BOND')) { $deductions_list['Cashbond'] += $deduction->deduction_rate; } elseif (str_contains(strtoupper($deduction->name), 'LICENSE')) { $deductions_list['License'] += $deduction->deduction_rate; } } $total_deductions = array_sum($deductions_list); @endphp
@foreach ($earnings as $label => $amount) @endforeach @foreach ($deductions_list as $label => $amount) @endforeach

Dragon Knights

SECURITY SERVICES CORPORATION

Ground Floor AMWSLAI Building, Mayor PN Roa Street, Patag, Cagayan de Oro City

Tel No. (088) 557-7351 / Cel No. 0917009341 / email ad: [email protected]

Name: {{ $personnel->last_name . ', ' . $personnel->first_name }} Period: {{ strtoupper(\Carbon\Carbon::parse($payment_period->start_date)->format('F d')) }}-{{ \Carbon\Carbon::parse($payment_period->end_date)->format('d, Y') }}
PAY SLIP
{{ $label }} {{ number_format($amount, 2) }}
Total Salary {{ number_format($total_salary, 2) }}
Deductions:
{{ $label }} {{ number_format($amount, 2) }}
Total Deductions {{ number_format($total_deductions, 2) }}
NET PAY {{ number_format($payment->total, 2) }}
Received the above amount.
By: