SL# Loan Payment Date @if($data['employeeColShow']) Name of Employee Employee ID @endif Branch Name Loan Information Opening Balance Current Preiod Recovery Closing Balance No. Of Installment Installment Amount Installment Start Loan Amount Principle Interest Total @if(count($data['result'])>0) @php $index = 1; $installmentAmountGrandTotal = 0.00; $loanAmountGrandTotal = 0.00; $obGrandTotal = 0.00; $cpRecoveryPriGrandTotal = 0.00; $cpRecoveryIntGrandTotal = 0.00; $cpRecoverySubTotalGrandTotal = 0.00; $closingBalanceGrandTotal = 0.00; @endphp @foreach($data['result'] as $row) @php // Skipping if( $row['opening_balance'] <= 0.00 && $row['recoveryPrinciple'] <= 0.00 && $row['recoveryInterest'] <= 0.00 && $row['closing_balance'] <= 0.00 ){ continue; } // Calculation $cpRecoverySubTotalGrandTotal += ($row['recoveryPrinciple'] + $row['recoveryInterest']); $installmentAmountGrandTotal += $row['loan_installment_amount']; $loanAmountGrandTotal += $row['loan_amount']; $obGrandTotal += $row['opening_balance']; $cpRecoveryPriGrandTotal += $row['recoveryPrinciple']; $cpRecoveryIntGrandTotal += $row['recoveryInterest']; $closingBalanceGrandTotal += $row['closing_balance']; @endphp {{ $index++ }} {{ $row['loan_payment_date'] }} @if($data['employeeColShow']) {{ $row['employee'] }} {{ $row['employee_id'] }} @endif {{ $row['branch_name'] }} {{ $row['loan_no_of_installment'] }} {{ $row['loan_installment_amount'] }} {{ $row['loan_installment_start_date'] }} {{ number_format($row['loan_amount'],2) }} {{ number_format($row['opening_balance'],2) }} {{ number_format($row['recoveryPrinciple'],2) }} {{ number_format($row['recoveryInterest'],2) }} {{ number_format( ($row['recoveryPrinciple'] + $row['recoveryInterest']), 2) }} {{ number_format($row['closing_balance'],2) }} @endforeach Total: {{ number_format($installmentAmountGrandTotal,2) }} {{ number_format($loanAmountGrandTotal,2) }} {{ number_format($obGrandTotal,2) }} {{ number_format($cpRecoveryPriGrandTotal,2) }} {{ number_format($cpRecoveryIntGrandTotal,2) }} {{ number_format($cpRecoverySubTotalGrandTotal,2) }} {{ number_format($closingBalanceGrandTotal,2) }} @else No data available @endif