@php $periodLabel = 'FY ' . ($financialYearLabel ?? ''); $grossComponents = $payrollTemplateComponets->filter(function ($component) { return $component->group_type_name == 'Gross' && $component->type == 'earning'; })->values(); $ctcComponents = $payrollTemplateComponets->filter(function ($component) { return $component->group_type_name == 'CTC' && $component->type == 'earning'; })->values(); $otherEarningComponents = $payrollTemplateComponets->filter(function ($component) { return $component->group_type_name == 'Others' && $component->type == 'earning'; })->values(); $reimbursementComponents = collect($reimbursementEligibilities ?? [])->values(); $ctcSectionComponents = $grossComponents->concat($ctcComponents)->values(); $grossMonthlyTotal = round($grossComponents->sum(function ($component) { return (float) ($component->calculate_salary ?? 0); }), 2); $ctcMonthlyTotal = round($ctcComponents->sum(function ($component) { return (float) ($component->calculate_salary ?? 0); }), 2); $otherEarningMonthlyTotal = round($otherEarningComponents->sum(function ($component) { return (float) ($component->calculate_salary ?? 0); }), 2); $ctcSectionMonthlyTotal = round($grossMonthlyTotal + $ctcMonthlyTotal, 2); $reimbursementAnnualTotal = round($reimbursementComponents->sum(function ($component) { return (float) ($component->actual_amount ?? $component->eligible_amount ?? 0); }), 2); $reimbursementMonthlyTotal = round($reimbursementAnnualTotal / 12, 2); $grandMonthlyTotal = round($grossMonthlyTotal + $ctcMonthlyTotal + $otherEarningMonthlyTotal + $reimbursementMonthlyTotal, 2); $grandAnnualTotal = round(($grossMonthlyTotal * 12) + ($ctcMonthlyTotal * 12) + ($otherEarningMonthlyTotal * 12) + $reimbursementAnnualTotal, 2); $formatCurrency = function ($amount, $showDashForZero = false) { $amount = (float) $amount; if ($showDashForZero && abs($amount) < 0.00001) { return '—'; } return number_format($amount, 2, '.', ','); }; @endphp CTC Slip - {{$organization->name}}
{{$organization->name}}
CTC Slip — {{$periodLabel}}
Document Type
CTC Breakup
Employee Name
{{ $employeesinfo->name ?? '-' }}
Employee Code
{{ $employeesinfo->employee_code ?? '-' }}
Period
{{$periodLabel}}
@if($ctcSectionComponents->isNotEmpty()) @foreach($ctcSectionComponents as $index => $component) @php $monthlyAmount = (float) ($component->calculate_salary ?? 0); $annualAmount = $monthlyAmount * 12; @endphp @endforeach @endif @if($reimbursementComponents->isNotEmpty()) @foreach($reimbursementComponents as $index => $component) @php $annualAmount = (float) ($component->actual_amount ?? $component->eligible_amount ?? 0); $monthlyAmount = round($annualAmount / 12, 2); @endphp @endforeach @endif @if($otherEarningComponents->isNotEmpty()) @foreach($otherEarningComponents as $index => $component) @php $monthlyAmount = (float) ($component->calculate_salary ?? 0); $annualAmount = $monthlyAmount * 12; @endphp @endforeach @endif
# Component Per Month (₹) Per Annum (₹)
{{ $index + 1 }} {{ $component->type_name }} {{ $formatCurrency($monthlyAmount, true) }} {{ $formatCurrency($annualAmount, true) }}
CTC {{ $formatCurrency($ctcSectionMonthlyTotal) }} {{ $formatCurrency($ctcSectionMonthlyTotal * 12) }}
{{ $ctcSectionComponents->count() + $index + 1 }} {{ $component->head->display_name ?? $component->head->name ?? '-' }} {{ $formatCurrency($monthlyAmount, true) }} {{ $formatCurrency($annualAmount, true) }}
Other Allowances {{ $formatCurrency($reimbursementMonthlyTotal) }} {{ $formatCurrency($reimbursementAnnualTotal) }}
{{ $ctcSectionComponents->count() + $reimbursementComponents->count() + $index + 1 }} {{ $component->type_name }} {{ $formatCurrency($monthlyAmount, true) }} {{ $formatCurrency($annualAmount, true) }}
Other Benefits {{ $formatCurrency($otherEarningMonthlyTotal) }} {{ $formatCurrency($otherEarningMonthlyTotal * 12) }}
Total {{ $formatCurrency($grandMonthlyTotal) }} {{ $formatCurrency($grandAnnualTotal) }}