SL# Name of Employee Employee Id Designation Joining Date Branch Name Basic Salary Job Duration (Year) Opening Balance Current Period Closing Balance {{-- Under Current Period Recov --}} Generated Refund Adjustment @php // Declare varriable for total calculation $totalObGratuity = 0; $totalCurrentPeriodGenerated = 0; $totalCurrentPeriodRefund = 0; $totalCurrentPeriodAdjust = 0; $totalClosingBalance = 0; @endphp @foreach ($data['users'] as $user) {{ ++$loop->index }} {{ $user->emp_name_english }} {{ $user->emp_id }} {{ $user->designation }} {{ date( 'd-m-Y', strtotime($user->joining_date) ) }} {{ $user->branchName }} {{ number_format($user->basicSalary,2) }} {{ $user->jobDuration }} {{-- under ob --}} @if($user->openningBalanceGratuity) {{ number_format($user->openningBalanceGratuity,2) }} @else - @endif @php $totalObGratuity += $user->openningBalanceGratuity; @endphp {{-- Under Current Period --}} @if($user->generatedGratuity) {{ number_format($user->generatedGratuity,2) }} @else - @endif @if($user->cpwGratuity) {{ number_format($user->cpwGratuity,2) }} @else - @endif @if($user->cpAdjustment) {{ number_format($user->cpAdjustment,2) }} @else - @endif @php $totalCurrentPeriodGenerated += $user->generatedGratuity; $totalCurrentPeriodRefund += $user->cpwGratuity; $totalCurrentPeriodAdjust += $user->cpAdjustment; @endphp {{-- Under Closing Balance --}} @if($user->closingBalance) {{ number_format($user->closingBalance,2) }} @else - @endif @php $totalClosingBalance += $user->closingBalance; @endphp @endforeach Total - - {{-- Under Ob --}} @if($totalObGratuity) {{ number_format($totalObGratuity,2) }} @else - @endif {{-- Under Current Period --}} @if($totalCurrentPeriodGenerated) {{ number_format($totalCurrentPeriodGenerated,2) }} @else - @endif @if($totalCurrentPeriodRefund) {{ number_format($totalCurrentPeriodRefund,2) }} @else - @endif @if($totalCurrentPeriodAdjust) {{ number_format($totalCurrentPeriodAdjust,2) }} @else - @endif {{-- Under closing balance --}} @if($totalClosingBalance) {{ number_format($totalClosingBalance,2) }} @else - @endif