@extends('layouts/microfin_layout') @section('title', '| Auto Savings Interest Calculation') @section('content')
| SL# | Member Code | Member Name | F/S Name | Savings Code | @if ($route == 'viewAutoInterestSavingsDetails') Monthly Balance @elseif ($route == 'viewAutoInterestSavingsInterest') Monthly Interest @endif | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ date('Y-m', strtotime($value)) }} | @endforeach||||||||||||||||
| {{ $sl++ }} | {{ $member->code }} | {{ $member->name }} | {{ $member->spouseFatherSonName }} | {{ $savingsProduct->shortName }} | @foreach ($closingBalance->where('memberId', $member->id) as $key => $value) {{-- balance info loop --}} @php // apply withdraw condition if ($value['withdraw'] == 0) { $monthsInterest = $value['monthsInterest']; $averageBalance = $value['averageBalance']; } else { $monthsInterest = 0; $averageBalance = 0; } @endphp {{-- savings average balance view --}} @if ($route == 'viewAutoInterestSavingsDetails') @if ($value['withdraw'] == 0){{ number_format($averageBalance, 2) }} Interest: {{ number_format($monthsInterest, 2) }} | @else- Due to Savings Withdraw | @endif {{-- savings interest view --}} @elseif($route == 'viewAutoInterestSavingsInterest') @if ($value['withdraw'] == 0){{ number_format($monthsInterest, 2) }} | @else- Due to Savings Withdraw | @endif @endif @php // members total interest $sumMemberInterest += $monthsInterest; @endphp @endforeach {{-- balance info loop close --}}||||||||
| Total | @foreach ($monthsArr as $key => $month) {{-- months loop --}} @php $sumMonthlyBalance = 0; $sumMonthlyInterest = 0; @endphp @foreach ($closingBalance->where('month', $month) as $key => $value) {{-- balance info loop --}} @php // apply withdraw condition if ($value['withdraw'] == 0) { $averageBalance = $value['averageBalance']; $monthsInterest = $value['monthsInterest']; } else { $averageBalance = 0; $monthsInterest = 0; } // total Monthly balance and interest $sumMonthlyBalance += $averageBalance; $sumMonthlyInterest += $monthsInterest; @endphp @endforeach {{-- balance info loop close --}} {{-- checking route --}} @if ($route == 'viewAutoInterestSavingsDetails'){{ number_format($sumMonthlyBalance, 2) }} | @elseif ($route == 'viewAutoInterestSavingsInterest'){{ number_format($sumMonthlyInterest, 2) }} | @endif @endforeach {{-- months loop close --}} {{-- samity total interest --}}||||||||||||||