@php $totalLoanAmount = 0; $totalPaidPrincipal = 0; $totalPaidInterest = 0; $totalOutstanding = 0; $pfloans = $data['pfloan']['curBalance']; $opPfloans = $data['pfloan']['opBalance']; $countPfRows = count($pfloans) + count($opPfloans); @endphp {{-- pf loans view --}} @if (count($pfloans) > 0) @foreach ($pfloans as $key => $loan) {{-- @php $totalLoanAmount += $loan['principal']; $totalPaidPrincipal += $loan['collectedPrincipal']; $totalPaidInterest += $loan['collectedInterest']; $totalOutstanding += $loan['outstanding']; @endphp @endforeach @endif @if (count($opPfloans) > 0) @foreach ($opPfloans as $key => $loan) @php $totalLoanAmount += $loan['opPrincipal']; $totalPaidPrincipal += $loan['opCollectedPrincipal']; $totalPaidInterest += $loan['opCollectedInterest']; $totalOutstanding += $loan['opOutstanding']; @endphp @endforeach @endif {{-- pf loans view end --}} {{-- motorcyle loan view --}} @php $motorCycleLoans = $data['motorcyleloan']['curBalance']; $opMotorCycleloans = $data['motorcyleloan']['opBalance']; $countMotorCycleRows = count($motorCycleLoans) + count($opMotorCycleloans); @endphp @if (count($motorCycleLoans) > 0) @foreach ($motorCycleLoans as $key => $loan) {{-- @php $totalLoanAmount += $loan['principal']; $totalPaidPrincipal += $loan['collectedPrincipal']; $totalPaidInterest += $loan['collectedInterest']; $totalOutstanding += $loan['outstanding']; @endphp @endforeach @endif @if (count($opMotorCycleloans) > 0) @foreach ($opMotorCycleloans as $key => $loan) @php $totalLoanAmount += $loan['opPrincipal']; $totalPaidPrincipal += $loan['opCollectedPrincipal']; $totalPaidInterest += $loan['opCollectedInterest']; $totalOutstanding += $loan['opOutstanding']; @endphp @endforeach @endif {{-- motor cycle loan view end --}} {{-- bicyle loan view --}} @php $biCycleLoans = $data['bicyleloan']['curBalance']; $opBiCycleloans = $data['bicyleloan']['opBalance']; $countBiCycleRows = count($biCycleLoans) + count($opBiCycleloans); @endphp @if (count($biCycleLoans) > 0) @foreach ($biCycleLoans as $key => $loan) {{-- @php $totalLoanAmount += $loan['principal']; $totalPaidPrincipal += $loan['collectedPrincipal']; $totalPaidInterest += $loan['collectedInterest']; $totalOutstanding += $loan['outstanding']; @endphp @endforeach @endif @if (count($opBiCycleloans) > 0) @foreach ($opBiCycleloans as $key => $loan) @php $totalLoanAmount += $loan['opPrincipal']; $totalPaidPrincipal += $loan['opCollectedPrincipal']; $totalPaidInterest += $loan['opCollectedInterest']; $totalOutstanding += $loan['opOutstanding']; @endphp @endforeach @endif {{-- bi cycle loan view end --}} {{-- advance salary loan view --}} @php $totalLoanAmount += $data['advancedloan']['loanAmount']; $totalPaidPrincipal += $data['advancedloan']['collectionAmount']; $totalOutstanding += $data['advancedloan']['outstanding']; @endphp @if ($data['advancedloan']['loanType'] == 'obasloan') @elseif ($data['advancedloan']['loanType'] == 'asloan') @endif {{-- advance salary loan view end --}} @php if ($totalOutstanding == 0) { $totalLoanAmount = 0; $totalPaidPrincipal = 0; $totalPaidInterest = 0; } @endphp
Loan Name Loan Amount Paid Amount Outstanding Action
Principle Interest Total
--}} Provident Fund Loan {{ number_format($loan['principal']) }} {{ number_format($loan['collectedPrincipal']) }} {{ number_format($loan['collectedInterest']) }} {{ number_format($loan['collectedPrincipal'] + $loan['collectedInterest']) }} {{ number_format($loan['outstanding']) }}
0) style="display: none;" @else style="padding-left: 20px;" rowspan="{{ $countPfRows }}" @endif> Provident Fund Loan {{ number_format($loan['opPrincipal']) }} {{ number_format($loan['opCollectedPrincipal']) }} {{ number_format($loan['opCollectedInterest']) }} {{ number_format($loan['opCollectedPrincipal'] + $loan['opCollectedInterest']) }} {{ number_format($loan['opOutstanding']) }}
--}} Motor Cycle Loan {{ number_format($loan['principal']) }} {{ number_format($loan['collectedPrincipal']) }} {{ number_format($loan['collectedInterest']) }} {{ number_format($loan['collectedPrincipal'] + $loan['collectedInterest']) }} {{ number_format($loan['outstanding']) }}
0) style="display: none;" @else style="padding-left: 20px;" rowspan="{{ $countMotorCycleRows }}" @endif> Motor Cycle Loan {{ number_format($loan['opPrincipal']) }} {{ number_format($loan['opCollectedPrincipal']) }} {{ number_format($loan['opCollectedInterest']) }} {{ number_format($loan['opCollectedPrincipal'] + $loan['opCollectedInterest']) }} {{ number_format($loan['opOutstanding']) }}
--}} Motor Cycle Loan {{ number_format($loan['principal']) }} {{ number_format($loan['collectedPrincipal']) }} {{ number_format($loan['collectedInterest']) }} {{ number_format($loan['collectedPrincipal'] + $loan['collectedInterest']) }} {{ number_format($loan['outstanding']) }}
0) style="display: none;" @else style="padding-left: 20px;" rowspan="{{ $countBiCycleRows }}" @endif> Bi-cycle Loan {{ number_format($loan['opPrincipal']) }} {{ number_format($loan['opCollectedPrincipal']) }} {{ number_format($loan['opCollectedInterest']) }} {{ number_format($loan['opCollectedPrincipal'] + $loan['opCollectedInterest']) }} {{ number_format($loan['opOutstanding']) }}
Advanced Salary {{ number_format($data['advancedloan']['loanAmount']) }} {{ number_format($data['advancedloan']['collectionAmount']) }} - {{ number_format($data['advancedloan']['collectionAmount']) }} {{ number_format($data['advancedloan']['outstanding']) }}
Total {{ number_format($totalLoanAmount) }} {{ number_format($totalPaidPrincipal) }} {{ number_format($totalPaidInterest) }} {{ number_format($totalPaidPrincipal + $totalPaidInterest) }} {{ number_format($totalOutstanding) }}