@extends('layouts/microfin_layout') @section('title', '| Savings Status') @section('content')

SAVINGS STATUS

Member Name: {{$member->name}} Member Code: {{$member->code}} Saving Code: {{$saving->savingsCode}} Date: {{$dateFrom}} to {{$dateTo}}
@php $openingBalance = $openingPrincipal + $openingInterest - $openingWithdraw; @endphp @foreach ($dates as $key => $date) @php $depositAmount = $deposits->where('depositDate',$date)->sum('amount'); $interestAmount = $interests->where('depositDate',$date)->sum('amount'); // $interestAmount = $interests->where('date',$date)->sum('interestAmount'); $withdrawAmount = $withdraws->where('withdrawDate',$date)->sum('amount'); $totalDeposits = $deposits->where('depositDate','<=',$date)->sum('amount'); $totalInterestAmount = $interests->where('depositDate','<=',$date)->sum('amount'); // $totalInterestAmount = $interests->where('date','<=',$date)->sum('interestAmount'); $totalWithdrawAmount = $withdraws->where('withdrawDate','<=',$date)->sum('amount'); $balance = $openingBalance + $totalDeposits + $totalInterestAmount - $totalWithdrawAmount; @endphp @endforeach @php // $totalBalance = $deposits->sum('amount') + $interests->sum('interestAmount') - $withdraws->sum('amount'); $totalBalance = $deposits->sum('amount') + $interests->sum('amount') - $withdraws->sum('amount'); @endphp {{-- --}}
SL# Date Deposit Interest Refund Balance
Opening Balance {{number_format($openingPrincipal,2)}} {{number_format($openingInterest,2)}} {{number_format($openingWithdraw,2)}} {{number_format($openingBalance,2)}}
{{$key+1}} {{date('d-m-Y',strtotime($date))}} {{number_format($depositAmount,2)}} {{number_format($interestAmount,2)}} {{number_format($withdrawAmount,2)}} {{number_format($balance,2)}}
Total {{number_format($deposits->sum('amount') + $openingPrincipal,2)}}{{number_format($interests->sum('interestAmount') + $openingInterest,2)}}{{number_format($interests->sum('amount') + $openingInterest,2)}} {{number_format($withdraws->sum('amount') + $openingWithdraw,2)}} {{number_format($totalBalance + $openingBalance,2)}}
@endsection