@extends('adminlte::page') @section('title','Loan Report') @section('plugins.Datatables', true) @section('content_header')

Loan Report

Export CSV
@stop @section('content')
Reset
Loan Report
@foreach($loans as $loan) @php $paid = App\Models\Collection::where( 'loan_id', $loan->id )->sum( 'principal_amount' ); $remaining = $loan->total_payable - $paid; @endphp @endforeach
# Account Start Date Customer Loan Amount Interest % Total Payable Remaining Amount Status
{{ $loop->iteration }} {{ $loan->account->account_no }} {{ date('d-m-Y',strtotime($loan->loan_start_date)) }} {{ $loan->account->customer_name }} ₹ {{ number_format($loan->loan_amount,2) }} {{ $loan->interest_rate }} % ₹ {{ number_format($loan->total_payable,2) }} ₹ {{ number_format($remaining,2) }} @if($loan->status == 'Active') Active @else Closed @endif
Grand Total ₹ {{ number_format($totalLoanAmount,2) }} ₹ {{ number_format($totalInterestAmount,2) }} ₹ {{ number_format($totalPayableAmount,2) }} ₹ {{ number_format($totalRemainingAmount,2) }}
@stop @section('js') @stop