Salary Sheet

@php $incomeComponents = [ 'Basic Salary' => $payrollData['payslipData']->monthly_basic_salary, 'Allowance' => $payrollData['payslipData']->monthly_fixed_allowance, 'SSF Contribution' => $payrollData['payslipData']->ssf_contribution ]; $totalAnnualIncome = 0; $monthlyTotal = 0; @endphp @foreach($incomeComponents as $name => $amount) @php $annualAmount = $amount * 12; $totalAnnualIncome += $annualAmount; $monthlyTotal += $amount; @endphp @for ($i = 1; $i <= 12; $i++) @endfor @endforeach @if($payrollData['payslipData']->bonus > 0) @for($month = 4; $month <= 12; $month++) @endfor @for($month = 1; $month <= 3; $month++) @endfor @php $totalAnnualIncome += $payrollData['payslipData']->bonus; @endphp @endif @foreach($payrollData['earnings'] as $earning) @php $annualEarning = $earning['amount'] * 12; $totalAnnualIncome += $annualEarning; $monthlyTotal += $earning['amount']; @endphp @for ($i = 1; $i <= 12; $i++) @endfor @endforeach @for ($i = 4; $i <= 12; $i++) @php $currentMonthTotal = $monthlyTotal + (isset($bonus->applicable_month) && $bonus->applicable_month == $i ? $payrollData['payslipData']->bonus : 0); @endphp @endfor @for ($i = 1; $i <= 3; $i++) @php $currentMonthTotal = $monthlyTotal + (isset($bonus->applicable_month) && $bonus->applicable_month == $i ? $payrollData['payslipData']->bonus : 0); @endphp @endfor @for ($i = 1; $i <= 12; $i++) @endfor @php $totalAnnualDeduction = $payrollData['payslipData']->ssf_deduction * 12; $totalMonthlyDeduction = $payrollData['payslipData']->ssf_deduction; @endphp @foreach($payrollData['deductions'] as $deduction) @for ($i = 1; $i <= 12; $i++) @endfor @php $totalAnnualDeduction += $deduction['amount'] * 12; $totalMonthlyDeduction += $deduction['amount']; @endphp @endforeach @for ($i = 1; $i <= 12; $i++) @endfor @for ($i = 4; $i <= 12; $i++) @if($i == $month) @endif @endfor @for ($i = 1; $i <= 3; $i++) @if($i == $month) @endif @endfor @php $annualTotalPayable = $totalAnnualIncome - $totalAnnualDeduction - ($payrollData['payslipData']->tds * 12); @endphp @for ($i = 4; $i <= 12; $i++) @php $monthlyIncome = $monthlyTotal + (isset($bonus->applicable_month) && $bonus->applicable_month == $i ? $payrollData['payslipData']->bonus : 0); $monthlyTDS = ($i == $month) ? $payrollData['payslipData']->tds : 0; $monthlyTotalPayable = $monthlyIncome - $totalMonthlyDeduction - $monthlyTDS; @endphp @endfor @for ($i = 1; $i <= 3; $i++) @php $monthlyIncome = $monthlyTotal + (isset($bonus->applicable_month) && $bonus->applicable_month == $i ? $payrollData['payslipData']->bonus : 0); $monthlyTDS = ($i == $month) ? $payrollData['payslipData']->tds : 0; $monthlyTotalPayable = $monthlyIncome - $totalMonthlyDeduction - $monthlyTDS; @endphp @endfor
Particular Total Shrawan Bhadra Ashoj Kartik Mangsir Poush Magh Falgun Chaitra Baisakh Jestha Asadh
Income
{{ $name }}{{ $currency.' '.$annualAmount }}{{ $currency.' '.$amount }}
Bonus {{ $currency.' '.$payrollData['payslipData']->bonus }}{{ isset($bonus->applicable_month) && $bonus->applicable_month == $month ? $currency.' '.$payrollData['payslipData']->bonus : '' }}{{ isset($bonus->applicable_month) && $bonus->applicable_month == $month ? $currency.' '.$payrollData['payslipData']->bonus : '' }}
{{ $earning['name'] }}{{ $currency.' '.$annualEarning }}{{ $currency.' '.$earning['amount'] }}
Total Income {{ $currency . ' ' . number_format($totalAnnualIncome, 2) }}{{ $currency . ' ' . number_format($currentMonthTotal, 2) }}{{ $currency . ' ' . number_format($currentMonthTotal, 2) }}
Deductions
SSF Contribution {{ $currency.' '.($payrollData['payslipData']->ssf_deduction*12) }}{{ $currency.' '.$payrollData['payslipData']->ssf_deduction }}
{{ $deduction['name'] }} {{ $currency.' '.($deduction['amount']*12) }}{{ $currency.' '.$deduction['amount'] }}
Total Deduction {{ $currency.' '.number_format($totalAnnualDeduction, 2) }}{{ $currency.' '.number_format($totalMonthlyDeduction, 2) }}
TDS Paid {{ $payrollData['payslipData']->tds }}{{ $currency . ' ' . $payrollData['payslipData']->tds }}{{ $currency . ' ' . $payrollData['payslipData']->tds }}
Total Payable{{ $currency . ' ' . number_format($annualTotalPayable, 2) }}{{ $currency . ' ' . number_format($monthlyTotalPayable, 2) }}{{ $currency . ' ' . number_format($monthlyTotalPayable, 2) }}

Additional Information

{{----}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @php--}} {{-- $totalRetirementContribution = $payrollData['payslipData']->ssf_contribution * 12;--}} {{-- foreach($payrollData['earnings'] as $earning) {--}} {{-- $totalRetirementContribution += $earning['amount'] * 12;--}} {{-- }--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @foreach($payrollData['earnings'] as $earning)--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @php--}} {{-- $annualEarning = $earning['amount'] * 12;--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- @endforeach--}} {{-- @foreach ($otherComponents as $component)--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @endforeach--}} {{-- @php--}} {{-- $totalDeductions = $totalRetirementContribution;--}} {{-- foreach ($otherComponents as $component) {--}} {{-- $totalDeductions += $component->annual_component_value;--}} {{-- }--}} {{-- $taxableIncome = $totalAnnualIncome - $totalDeductions;--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{--
ParticularAmountAmount
Total Income{{ $currency . ' ' . number_format($totalAnnualIncome, 2) }}
lessTotal Retirement Contribution Allowed{{ $currency . ' ' . number_format($totalRetirementContribution, 2) }}
SSF Contribution Salary{{ $currency . ' ' . number_format($payrollData['payslipData']->ssf_contribution * 12, 2) }}
{{ $earning['name'] }}{{ $currency . ' ' . number_format($annualEarning, 2) }}
{{ $component->name }}--}} {{-- --}} {{--
Taxable Income{{ $currency . ' ' . number_format($taxableIncome, 2) }}
--}} {{--@php--}} {{-- $maritalStatus = $payrollData['payslipData']->marital_status;--}} {{-- $remainingIncome = $taxableIncome;--}} {{-- $totalTax = 0;--}} {{-- $isFirstBracket = true;--}} {{--@endphp--}} {{--@if (isset($taxData[$maritalStatus]))--}} {{--

Tax Calculation on Taxable Income ({{ ucfirst($maritalStatus) }})

--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @foreach($taxData[$maritalStatus] as $bracket)--}} {{-- @php--}} {{-- $from = $bracket->annual_salary_from;--}} {{-- $to = $bracket->annual_salary_to >= 1.0E+20 ? null : $bracket->annual_salary_to;--}} {{-- $percent = $bracket->tds_in_percent;--}} {{-- $bracketIncome = min(max($remainingIncome, 0), $to ? $to - $from : $remainingIncome);--}} {{-- $taxAmount = $bracketIncome * ($percent / 100);--}} {{-- if ($isFirstBracket && $payrollData['payslipData']->ssf_contribution > 0) {--}} {{-- $taxAmount = 0;--}} {{-- }--}} {{-- $totalTax += $taxAmount;--}} {{-- $remainingIncome -= $bracketIncome;--}} {{-- $isFirstBracket = false;--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @endforeach--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{--
FromToIncomePercentTax Amount
{{ $currency . ' ' . number_format($from, 2) }}{{ $to ? $currency . ' ' . number_format($to, 2) : '' }}{{ $currency . ' ' . number_format($bracketIncome, 2) }}{{ number_format($percent, 2) }}%{{ $currency . ' ' . number_format($taxAmount, 2) }}
Total{{ $currency . ' ' . number_format($taxableIncome, 2) }}{{ $currency . ' ' . number_format($totalTax, 2) }}
--}} {{--@else--}} {{--

No tax data available for the current marital status ({{ $maritalStatus }}).

--}} {{--@endif--}} @php $totalRetirementContribution = $payrollData['payslipData']->ssf_contribution * 12; foreach($payrollData['earnings'] as $earning) { $totalRetirementContribution += $earning['amount'] * 12; } @endphp @foreach($payrollData['earnings'] as $earning) @php $annualEarning = $earning['amount'] * 12; @endphp @endforeach @foreach ($otherComponents as $component) @endforeach @php $totalDeductions = $totalRetirementContribution; foreach ($otherComponents as $component) { $totalDeductions += $component->annual_component_value; } $taxableIncome = $totalAnnualIncome - $totalDeductions; @endphp
Particular Amount Amount
Total Income {{ $currency . ' ' . number_format($totalAnnualIncome, 2) }}
less Total Retirement Contribution Allowed {{ $currency . ' ' . number_format($totalRetirementContribution, 2) }}
SSF Contribution Salary {{ $currency . ' ' . number_format($payrollData['payslipData']->ssf_contribution * 12, 2) }}
{{ $earning['name'] }} {{ $currency . ' ' . number_format($annualEarning, 2) }}
{{ $component->name }}
Taxable Income {{ $currency . ' ' . number_format($taxableIncome, 2) }}
@if (isset($taxData[$payrollData['payslipData']->marital_status]))

Tax Calculation on Taxable Income ({{ ucfirst($payrollData['payslipData']->marital_status) }})

@php $remainingIncome = $taxableIncome; $totalTax = 0; $isFirstBracket = true; @endphp @foreach($taxData[$payrollData['payslipData']->marital_status] as $bracket) @php $from = $bracket->annual_salary_from; $to = $bracket->annual_salary_to >= 1.0E+20 ? null : $bracket->annual_salary_to; $percent = $bracket->tds_in_percent; $bracketIncome = min(max($remainingIncome, 0), $to ? $to - $from : $remainingIncome); $taxAmount = $bracketIncome * ($percent / 100); if ($isFirstBracket && $payrollData['payslipData']->ssf_contribution > 0) { $taxAmount = 0; } $totalTax += $taxAmount; $remainingIncome -= $bracketIncome; $isFirstBracket = false; @endphp @endforeach
From To Income Percent Tax Amount
{{ $currency . ' ' . number_format($from, 2) }} {{ $to ? $currency . ' ' . number_format($to, 2) : '' }} {{ $currency . ' ' . number_format($bracketIncome, 2) }} {{ number_format($percent, 2) }}% {{ $currency . ' ' . number_format($taxAmount, 2) }}
Total {{ $currency . ' ' . number_format($taxableIncome, 2) }} {{ $currency . ' ' . number_format($totalTax, 2) }}
@else

No tax data available for the current marital status ({{ $payrollData['payslipData']->marital_status }}).

@endif
less: Tax Deduction
Medical Claim
Female Discount
Other Discount
Total Payable TDS
Total Paid TDS
Total Due TDS {{ $totalTax - $payrollData['payslipData']->tds - 750 - 0 - 0 }}