@extends('layouts/microfin_layout') @section('title', '| One Time Loan Transaction') @section('content') @php use carbon\Carbon; use App\Traits\GetSoftwareDate; use \App\Http\Controllers\microfin\savings\MfnSavingsDepositTypeController as createForm; $pageNo = isset($_GET['page']) ? (int) $_GET['page']: 1; $branchSelected = isset($_GET['filBranch']) ? $_GET['filBranch'] : null; $samitySelected = isset($_GET['filSamity']) ? $_GET['filSamity'] : null; $memberCodeSelected = isset($_GET['filMemberCode']) ? $_GET['filMemberCode'] : null; $loanProductSelected = isset($_GET['filLoanProduct']) ? $_GET['filLoanProduct'] : null; $dateFromSelected = isset($_GET['filDateFrom']) ? $_GET['filDateFrom'] : null; $dateToSelected = isset($_GET['filDateTo']) ? $_GET['filDateTo'] : null; $balanceZeroSelected = isset($_GET['zeroBalance']) ? $_GET['zeroBalance'] : null; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $moneyRecNoSelected = isset($_GET['filMoneyRecNo']) ? $_GET['filMoneyRecNo'] : null; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @endphp
@if(in_array($userRoleId, Config('services.branch_level_user_roles'))) Add Transaction @endif

ONE TIME LOAN TRANSACTION LIST

{!! Form::open(array('url' => 'viewMfnOneTimeLoanTransaction', 'role' => 'form', 'class'=>'form-horizontal form-groups', 'id' => 'filterFormId', 'method'=>'get')) !!}
@if(!in_array($userRoleId, Config('services.branch_level_user_roles')))
{!! Form::label('', 'Branch:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('filBranch', [''=>'--All--']+$branchList, $branchSelected ,['id'=>'filBranch','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
@endif
{!! Form::label('', 'Samity:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('filSamity', [''=>'--All--']+$samityList, $samitySelected ,['id'=>'filSamity','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
{!! Form::label('', 'Member/Loan Code:', ['class' => 'control-label pull-left']) !!}
{!! Form::text('filMemberCode', $memberCodeSelected ,['id'=>'filMemberCode','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
{{-- --------//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--------- --}} @if($moneyRecNoType != null)
{!! Form::label('', 'Money Receipt No:', ['class' => 'control-label pull-left']) !!}
{!! Form::text('filMoneyRecNo', $moneyRecNoSelected,['id'=>'filMoneyRecNo','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
@endif {{-- --------//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--------- --}}
{!! Form::label('', 'Loan Product:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('filLoanProduct', [''=>'--All--']+$loanProductList, $loanProductSelected ,['id'=>'filLoanProduct','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
{!! Form::label('', 'Date From:', ['class' => 'control-label pull-left']) !!}
{!! Form::text('filDateFrom', $dateFromSelected,['id'=>'filDateFrom','class'=>'form-control input-sm', 'autocomplete'=>'off','style'=>'cursor:pointer']) !!}
{!! Form::label('', 'Date To:', ['class' => 'control-label pull-left']) !!}
{!! Form::text('filDateTo', $dateToSelected,['id'=>'filDateTo','class'=>'form-control input-sm', 'autocomplete'=>'off','style'=>'cursor:pointer', 'required']) !!}
{!! Form::label('', 'Balance 0:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('zeroBalance', [1=>'Yes', 0=>'No'], $balanceZeroSelected,['id'=>'zeroBalance','class'=>'form-control input-sm', 'autocomplete'=>'off','style'=>'cursor:pointer', 'required']) !!}
{!! Form::label('', '', ['class' => 'control-label col-md-12']) !!}
{!! Form::submit('Search', ['id' => 'searchButton', 'class' => 'btn btn-primary btn-xs']); !!}
{!! Form::close() !!} {{-- --------//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--------- --}} @if($moneyRecNoType != null) @endif {{-- ------------////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////----- --}} @php // dd($transactions); $sl = 0; @endphp @foreach($transactions as $key => $transaction) @php // $paidPricipalAmount = DB::table('mfn_loan_collection')->where('softDel', 0)->where('loanIdFk',$transaction->loanIdFk)->where('collectionDate','<=',$transaction->collectionDate)->sum('principalAmount'); // $outstandingAmount = $transaction->loanAmount - $paidPricipalAmount; // $rebateAmount = $loanRebates->where('loanIdFk',$transaction->loanIdFk)->where('date',$transaction->collectionDate)->sum('amount'); // if ($rebateAmount>0) { // $outstandingAmount = $outstandingAmount - $rebateAmount; // } // // CHECK IF THERE IS ANY OTHER TRANSACTION ON THE SAME DATE OR AFTERWARDS. IF IT HAS, THIS TRANSACTION CANN'T BE EDITED OR DELETED. // if($transaction->isLoanCompleted == 0){ // if(!$transaction->transactionAfterwards){ // if($dateToSelected != null){ // $transactionDaysDiff = Carbon::parse($transaction->collectionDate)->diffInDays(Carbon::parse($dateToSelected))+1; // }else{ // $transactionDaysDiff = Carbon::parse($transaction->collectionDate)->diffInDays(Carbon::parse($softwareDate))+1; // } // $interestOutstanding = round($outstandingAmount*$transactionDaysDiff*0.000657); // $outstandingAmount += $interestOutstanding; // } // }else{ // $outstandingAmount = 0; // } if($balanceZeroSelected == 0 && (int)$outstandingAmount == 0) { continue; }else{ $sl++; } @endphp {{-- --}} {{-- ------------------/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////------------- --}} @if($moneyRecNoType != null) @endif {{-- ---------------------///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////---------- --}} @endforeach
SL# Member Name Member Code Loan Code Date Transaction AmountMoney Receipt NoMode Of
Payment
Entry By Status Action
P I P+I Paid Outstanding
{{($pageNo-1)*100+($key+1)}}{{$sl}} {{$transaction->memberName}} {{$transaction->memberCode}} {{$transaction->loanCode}} {{date('d-m-Y',strtotime($transaction->collectionDate))}} {{number_format($transaction->principalAmount,2)}} {{number_format($transaction->interestAmount,2)}} {{number_format($transaction->amount,2)}} {{number_format($transaction->paidAmount,2)}} {{number_format($transaction->outstandingAmount,2)}}{{$transaction->moneyReceiptNo}}{{$transaction->moneyReceiptAutoSerialNo ?? null}}{{$transaction->paymentType}} {{$transaction->entryBy}} @if ($transaction->isAuthorized==1) @else @endif {{-- --------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////----------------- --}} @if($isMoneyReceiptPrintAllow == 1) @endif {{-- -------------------////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////------------ --}} @if($transaction->canDeleteOrEdit) @endif
{{-- @if (!$_GET['filDateFrom'] && $_GET['filDateFrom'] == '')
{{ $transactions->appends(request()->input())->links() }}
@endif --}}
{{-- View Modal --}} {{-- End View Modal --}} {{-- Edit Modal --}} {{-- End Edit Modal --}} {{-- Delete Modal --}} {{-- End Delete Modal --}} @endsection