@extends('layouts.app', ['path' => 'payroll.sheets']) @section('title', 'Payroll Sheet Details - HRMS') @section('content')
@include('partials.new_alerts')
Total Payroll
{{amount_format_number($monthSum['payroll'])}}
Deductions
{{amount_format_number($monthSum['deductions'])}}
Net Pay
{{amount_format_number($monthSum['net'])}}
Allowances
{{amount_format_number($monthSum['allowances'])}}
Payroll Sheet Details For {{ $month }}

Employee payroll breakdown and calculations

Created on {{ $created_at }}

@can('payroll_sheet.export_data') @endcan @can('payroll_sheet.download_payslips') Download Payslips @endcan
{{-- General Information --}} {{-- Ends --}} {{-- Earnings --}} @if (!empty($data[0]['pay_item_calculations'])) @foreach ($data[0]['pay_item_calculations'] as $pay_item) @if($pay_item['pay_item_id'] == null) @continue @endif @if($pay_item['pay_item_id'] != null &&$pay_item['type'] == "earning") @endif @endforeach @endif {{-- Ends --}} {{-- Deductions --}} @if (!empty($data[0]['pay_item_calculations'])) @foreach ($data[0]['pay_item_calculations'] as $pay_item) @if($pay_item['pay_item_id'] == null) @continue @endif @if($pay_item['pay_item_id'] != null && $pay_item['type'] == "deduction") @endif @endforeach @endif @foreach ($data as $item) @php $total_allowance = 0; $total_bonus = 0; $total_advance = 0; $total_loan_installment = 0; $total_arrears_earning = 0; $total_arrears_deduction = 0; $total_arrears = 0; if (!empty($item['pay_item_calculations'])) { foreach ($item['pay_item_calculations'] as $pi) { $amt = isset($pi['calculated_amount']) ? (float) $pi['calculated_amount'] : 0; $item_type = strtolower($pi['item_type'] ?? ''); $type = strtolower($pi['type'] ?? ''); if ($item_type === 'advance') { $total_advance += $amt; } elseif ($item_type === 'bonus') { $total_bonus += $amt; } elseif ($item_type === 'allowance') { $total_allowance += $amt; } elseif ($item_type === 'loan_installment') { $total_loan_installment += $amt; } elseif ($item_type === 'arrears' && $type === 'earning') { $total_arrears += $amt; } } } @endphp {{-- General Information --}} {{-- Ends --}} {{-- Earnings --}} @if (!empty($item['pay_item_calculations'])) @foreach ($item['pay_item_calculations'] as $pay_item) @if($pay_item['pay_item_id'] == null) @continue @endif @if($pay_item['pay_item_id'] != null && $pay_item['type'] == "earning") @endif @endforeach @endif {{-- Ends --}} {{-- Deductions --}} @if (!empty($item['pay_item_calculations'])) @foreach ($item['pay_item_calculations'] as $pay_item) @if($pay_item['pay_item_id'] == null) @continue @endif @if($pay_item['pay_item_id'] != null && $pay_item['type'] == "deduction") @endif @endforeach @endif {{-- Ends --}} @endforeach
Employee ID Employee Name Department Designation Worked Days Gross Salary Payable Salary Taxable SalaryAllowances Bonuses Arrears{{ $pay_item['name'] }}Total EarningsTax Amount Advances Loans{{ $pay_item['name'] }}Total Deductions Net Salary Status Action

{{ $item['employee_id_code'] }}

{{ $item['employee_name'] }} {{ $item['department'] }} {{ $item['designation'] }} {{ $item['pay_days'] }} {{ amount_format_number($item['final_payslip_data']['payroll_summary']['gross_pay'] ?? 0) }} {{ amount_format_number($item['final_payslip_data']['payroll_summary']['payable_amount'] ?? 0) }} {{ amount_format_number($item['final_payslip_data']['payroll_summary']['taxable_salary'] ?? 0) }} {{ amount_format_number($total_allowance) }} {{ amount_format_number($total_bonus) }} {{ amount_format_number($total_arrears) }} {{ amount_format_number($pay_item['calculated_amount'] ?? 0) }} {{ amount_format_number((float)($item['final_payslip_data']['payroll_summary']['total_earnings'] ?? 0) ) }} {{ amount_format_number($item['final_payslip_data']['payroll_summary']['tax_amount'] ?? 0) }} {{ amount_format_number($total_advance) }} {{ amount_format_number($total_loan_installment) }} {{ amount_format_number($pay_item['calculated_amount'] ?? 0) }} {{ amount_format_number( (float)($item['final_payslip_data']['payroll_summary']['total_deductions'] ?? 0) + (float)($item['final_payslip_data']['payroll_summary']['tax_amount'] ?? 0) ) }} {{ amount_format_number($item['final_payslip_data']['payroll_summary']['net_pay'] ?? 0) }} @if ($item['status'] == 'processed') Processed @elseif($item['status'] == 'failed') Failed @else pending @endif @can('payroll_sheet.download_single_payslip')
@endcan
@endsection @push('scripts') @endpush