SL# Name of Employee Employee Id Designation Joining Date Branch Name Opening Balance Current Period Deposit Current Period Refund Closing Balance {{-- under ob --}} Pri. Int. Total {{-- under Currnt Period Recov --}} Pri. Int. Total {{-- under Currnt Period refund --}} Pri. Int. Total {{-- under closing balance --}} Pri. Int. Total @php // Declare var for total calculation $totalObSD = 0.00; $totalObSDInt = 0.00; $totalSDTotal = 0.00; $totalCurrentRecovery = 0.00; $totalCurrentRecoveryInt = 0.00; $totalCurrentRecoveryTotal = 0.00; $totalCpRefundOwn = 0.00; $totalCpRefundInt = 0.00; $totalCpRefundTotal = 0.00; $totalCb = 0.00; $totalCbInt = 0.00; $totalCbTotal = 0.00; @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 }} {{-- under ob --}} @if($user->obSd) {{ number_format($user->obSd,2) }} @else - @endif @if($user->obSdInt) {{ number_format($user->obSdInt,2) }} @else - @endif @if($user->obSdTotal) {{ number_format($user->obSdTotal,2) }} @else - @endif @php $totalObSD += $user->obSd; $totalObSDInt += $user->obSdInt; $totalSDTotal += $user->obSdTotal; @endphp {{-- under Currnt Period Recov --}} @if($user->cpRecovery) {{ number_format($user->cpRecovery,2) }} @else - @endif @if($user->cpRecoveryInt) {{ number_format($user->cpRecoveryInt,2) }} @else - @endif @if($user->cpRecoveryTotal) {{ number_format($user->cpRecoveryTotal,2) }} @else - @endif @php $totalCurrentRecovery += $user->cpRecovery; $totalCurrentRecoveryInt += $user->cpRecoveryInt; $totalCurrentRecoveryTotal += $user->cpRecoveryTotal; @endphp {{-- Under Currnt Period Refund --}} @if($user->cpRefundOwn) {{ number_format($user->cpRefundOwn,2) }} @else - @endif @if($user->cpRefundInt) {{ number_format($user->cpRefundInt,2) }} @else - @endif @if($user->cpRefundTotal) {{ number_format($user->cpRefundTotal,2) }} @else - @endif @php $totalCpRefundOwn += $user->cpRefundOwn; $totalCpRefundInt += $user->cpRefundInt; $totalCpRefundTotal += $user->cpRefundTotal; @endphp {{-- Under closing balance --}} @if($user->currentBalance) {{ number_format($user->currentBalance,2) }} @else - @endif @if($user->currentBalanceInt) {{ number_format($user->currentBalanceInt,2) }} @else - @endif @if($user->currentBalanceTotal) {{ number_format($user->currentBalanceTotal,2) }} @else - @endif @php $totalCb += $user->currentBalance; $totalCbInt += $user->currentBalanceInt; $totalCbTotal += $user->currentBalanceTotal; @endphp @endforeach {{-- Total Row --}} Total @if($totalObSD) {{ number_format($totalObSD,2) }} @else - @endif @if($totalObSDInt) {{ number_format($totalObSDInt,2) }} @else - @endif @if($totalSDTotal) {{ number_format($totalSDTotal,2) }} @else - @endif @if($totalCurrentRecovery) {{ number_format($totalCurrentRecovery,2) }} @else - @endif @if($totalCurrentRecoveryInt) {{ number_format($totalCurrentRecoveryInt,2) }} @else - @endif @if($totalCurrentRecoveryTotal) {{ number_format($totalCurrentRecoveryTotal,2) }} @else - @endif @if($totalCpRefundOwn) {{ number_format($totalCpRefundOwn,2) }} @else - @endif @if($totalCpRefundInt) {{ number_format($totalCpRefundInt,2) }} @else - @endif @if($totalCpRefundTotal) {{ number_format($totalCpRefundTotal,2) }} @else - @endif @if($totalCb) {{ number_format($totalCb,2) }} @else - @endif @if($totalCbInt) {{ number_format($totalCbInt,2) }} @else - @endif @if($totalCbTotal) {{ number_format($totalCbTotal,2) }} @else - @endif