@extends('layouts/microfin_layout') @section('title', '| Auto Process') @section('content')
| Member Information | Loan Information | Saving Information | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SL# | Member ID | Member Name | Father/Spouse Name | Is Present? | Loan ID | Installment Amount | Due | Advance | Full | Partial | Zero | Amount | Savings ID | Auto Pro. Amount | Full | Partial | Zero | Amount | |||||||||||||||||
| {!! Form::checkbox('isPresentAll', '0', true,['class'=>'isPresentAll']) !!} | {!! Form::checkbox('loanFullAll', '0', true,['class'=>'loanFullAll']) !!} | {!! Form::checkbox('loanPartialAll', '0', false,['class'=>'loanPartialAll']) !!} | {!! Form::checkbox('loanZeroAll', '0', false,['class'=>'loanZeroAll']) !!} | {!! Form::checkbox('savingsFullAll', '0', true,['class'=>'savingsFullAll']) !!} | {!! Form::checkbox('savingsPartialAll', '0', false,['class'=>'savingsPartialAll']) !!} | {!! Form::checkbox('savingsZeroAll', '0', false,['class'=>'savingsZeroAll']) !!} | |||||||||||||||||||||||||||||
| {{$key+1}} | {{$member->code}} | {{$member->name}} | {{$member->spouseFatherSonName}} | {!! Form::hidden('presentMemberId[]',$member->id) !!} {!! Form::hidden('isPresentText[]',1,['class'=>'isPresentText']) !!} {!! Form::checkbox('isPresent[]', 1, true,['class'=>'isPresent']) !!} | @endif @if(count($loanAccounts)>0) @php $dueAmount = $dbSchedules->where('loanIdFk',$loanAccounts[0]->id)->where('scheduleDate','<',$softwareDate)->sum('installmentAmount') - $dbLoanCollections->where('loanIdFk',$loanAccounts[0]->id)->where('collectionDate','<',$softwareDate)->sum('amount'); $advanceAmount = $dueAmount<0 ? -$dueAmount : 0; $dueAmount = $dueAmount<0 ? 0 : $dueAmount; $outstandingAmount = $loanAccounts[0]->totalRepayAmount - $dbLoanCollections->where('loanIdFk',$loanAccounts[0]->id)->sum('amount'); $installmentAmount = ($loanAccounts[0]->installmentAmount > $outstandingAmount) ? $outstandingAmount : $loanAccounts[0]->installmentAmount; // adjusting previously paid advance with due if( $advanceAmount > $dueAmount ) $dueAmount = 0; else { $dueAmount = $dueAmount - $advanceAmount; $advanceAmount = 0; } // adjusting previously paid advance with future advance $maxAllowedAdvanceAmount = (float) $dbSchedules->where('scheduleDate','>',$softwareDate)->sortBy('scheduleDate')->take(1)->sum('installmentAmount'); if( $advanceAmount > $maxAllowedAdvanceAmount ) $maxAllowedAdvanceAmount = 0; else $maxAllowedAdvanceAmount = $maxAllowedAdvanceAmount - $advanceAmount; $maxInstallmentAmount = $dueAmount + $maxAllowedAdvanceAmount; $installmentAmount = min( $installmentAmount, $maxInstallmentAmount ); @endphp{{$loanAccounts[0]->loanCode}} | {{number_format($loanAccounts[0]->installmentAmount,2)}} | {{number_format($dueAmount,2)}} | {{number_format($advanceAmount,2)}} | {!! Form::checkbox('loanFull', '0', true,['class'=>'loanFull', 'data-member'=> "$member->id"]) !!} | {!! Form::checkbox('loanPartial', '0', false,['class'=>'loanPartial' , 'data-member'=> "$member->id"]) !!} | {!! Form::checkbox('loanZero', '0', false,['class'=>'loanZero' , 'data-member'=> "$member->id"]) !!} | {!! Form::hidden('loanMemberId[]', $member->id) !!} {!! Form::hidden('loanAccId[]', $loanAccounts[0]->id) !!} {!! Form::hidden('loanFullAmount', $installmentAmount,['class'=>'loanFullAmount']) !!} {!! Form::text('loanAmount[]', $installmentAmount,['class'=>"loanAmount loan_$member->id",'readonly', 'data-member'=> "$member->id"]) !!} | @else@endif @if (isset($savingsAccounts[0])) @php $savingsZeroId = 'savingsZero' . $savingsAccounts[0]->id . 'id'; @endphp | {{$savingsAccounts[0]->savingsCode}} | {{$savingsAccounts[0]->autoProcessAmount}} | {{--{!! Form::checkbox('savingsFull', '0', true,['class'=>'savingsFull']) !!} | --}} {{--{!! Form::checkbox('savingsPartial', '0', false,['class'=>'savingsPartial']) !!} | --}} {{--{!! Form::checkbox('savingsZero', '0', false,['class'=>'savingsZero']) !!} | --}}{!! Form::hidden('savingsMemberId[]', $member->id) !!} {!! Form::hidden('savingsAccId[]', $savingsAccounts[0]->id) !!} {!! Form::hidden('savingsFullAmount', $savingsAccounts[0]->autoProcessAmount,['class'=>'savingsFullAmount']) !!} {!! Form::text('savingsAmount[]', $savingsAccounts[0]->autoProcessAmount,['class'=>"savingsAmount sav_$member->id",'readonly', 'data-member'=> "$member->id"]) !!} | @else@endif | |||||||||||||||
| {{$loanAccounts[$i]->loanCode}} | {{number_format($loanAccounts[$i]->installmentAmount,2)}} | {{number_format($dueAmount,2)}} | {{number_format($advanceAmount,2)}} | {!! Form::checkbox('loanFull', '0', true,['class'=>'loanFull', 'data-member'=> "$member->id"]) !!} | {!! Form::checkbox('loanPartial', '0', false,['class'=>'loanPartial', 'data-member'=> "$member->id"]) !!} | {!! Form::checkbox('loanZero', '0', false,['class'=>'loanZero', 'data-member'=> "$member->id"]) !!} | {!! Form::hidden('loanMemberId[]', $member->id) !!} {!! Form::hidden('loanAccId[]', $loanAccounts[$i]->id) !!} {!! Form::hidden('loanFullAmount', $installmentAmount,['class'=>'loanFullAmount']) !!} {!! Form::text('loanAmount[]', $installmentAmount,['class'=>"loanAmount loan_$member->id",'readonly', 'data-member'=> "$member->id"]) !!} | @else@endif {{-- end loan accounts --}} {{-- savings accounts --}} @if(isset($savingsAccounts[$i])) @php $savingsZeroId = 'savingsZero' . $savingsAccounts[$i]->id . 'id'; @endphp | {{$savingsAccounts[$i]->savingsCode}} | {{$savingsAccounts[$i]->autoProcessAmount}} | {{--{!! Form::checkbox('savingsFull', '0', true,['class'=>'savingsFull']) !!} | --}} {{--{!! Form::checkbox('savingsPartial', '0', false,['class'=>'savingsPartial']) !!} | --}} {{--{!! Form::checkbox('savingsZero', '0', false,['class'=>'savingsZero']) !!} | --}}{!! Form::hidden('savingsMemberId[]', $member->id) !!} {!! Form::hidden('savingsAccId[]', $savingsAccounts[$i]->id) !!} {!! Form::hidden('savingsFullAmount', $savingsAccounts[$i]->autoProcessAmount,['class'=>'savingsFullAmount']) !!} {!! Form::text('savingsAmount[]', $savingsAccounts[$i]->autoProcessAmount,['class'=>"savingsAmount sav_$member->id",'readonly', 'data-member'=> "$member->id"]) !!} | @else@endif {{-- end savings accounts --}} | ||||||||||||||||||||
| Total | {!! Form::hidden('loanTotalAmount',0,['id'=>'loanTotalAmount']) !!} | {!! Form::hidden('savingsTotalAmount',0,['id'=>'savingsTotalAmount']) !!} | |||||||||||||||||||||||||||||||||