{{-- hidden month passed to store() --}}
Month: {{ ucfirst($monthname) }}, Year: {{ $year }}
Date Note/Remark
{{-- fixed name (remark) --}}
@foreach ($payroll_heads as $details) @endforeach @php $allTotal = 0; $allTotal_net = 0; @endphp @foreach ($employees as $i => $employee) @php $total_payment = 0; $total_deduction = 0; @endphp {{-- Payment heads --}} @foreach ($payroll_heads as $details) @if ($details['operation_type'] === 'pay') @php $payroll_head_id = $details['id']; $payment = round( (float) GetPayrollData( $payroll_head_id, $employee->salary_type_id, $employee->id, $month, $details['header_type'], ), 2, ); $total_payment += $payment; @endphp @endif @endforeach {{-- Deduction heads --}} @foreach ($payroll_heads as $details) @if ($details['operation_type'] === 'deduction') @php $payroll_head_id = $details['id']; $deduction = round( (float) GetPayrollData( $payroll_head_id, $employee->salary_type_id, $employee->id, $month, $details['header_type'], ), 2, ); $total_deduction += $deduction; @endphp @endif @endforeach @php $total_salary = $total_payment - $total_deduction; $allTotal += $total_salary; $employee_primary = employee_primary($employee->id); $advance = (float) ($employee_primary['advanced'] ?? 0); $adjusted = (float) ($employee_primary['adjusment'] ?? 0); // keeping existing helper key $due = (float) ($employee_primary['advance_due'] ?? 0); $net_salary = $total_salary; // adjustment input will change this on UI $allTotal_net += $net_salary; @endphp @endforeach
Sl Employee Name Gross Salary Pay Total Deduction Deduction Total Net Salary
{{ $details['head_name'] }}
{{ $i + 1 }} {{ $employee->name }} {{ number_format($employee->gross_salary, 2) }} {{ number_format($total_payment, 2) }} {{ number_format($total_deduction, 2) }} {{ number_format($total_salary, 2) }} @if ($advance > 0)
Total Advance: {{ number_format($advance, 2) }}
Total Adjustment: {{ number_format($adjusted, 2) }}
Remain Advanced: {{ number_format($due, 2) }}
View Details @else @endif
@if ($due > 0) @else - @endif {{ number_format($total_salary, 2) }}
Net Total (Payment) {{ number_format($allTotal, 2) }} {{ number_format($allTotal_net, 2) }}