				<table  class="table table-striped table-bordered" id="tabloan">
				<thead>
					<tr>
						<th>#</th>
						<th>Date</th>					
						<th style="text-align: right;">Principal</th>							
						<?php /* <th>Interest(%)</th> */ ?>
						<th style="text-align: right;">Interest</th>						
						<th style="text-align: right;">Bank<br>Charges</th>						
						<th style="text-align: right;">Late Fee</th>						
						<th style="text-align: right;">Others</th>						
						<th style="text-align: right;">EMI</th>							
						<th style="text-align: right;">Paid</th>
						<th style="text-align: right;">Balance</th>
						<th>Dig</th>
						<?php /* <td>Rex</td> */ ?>
					</tr>
				</thead>
				<tbody>	
				<?php					
					$totinterestamtx =0;
					$tototheramtx = 0;
					$totemiamtx = 0;
					$totpaidamtx = 0;
					$totbalamtx = 0;
					$btnx=0;
					$paid_amtx = 0;
					$bal_amtx=0;
					$totdelaypaymentx=0;
					$totchqbouncex=0;
					$totpaiddecreaseonloopx = $data['LoanTotalPaidx'];
				?>
						<?php $__currentLoopData = $data['LoanInstallmentRecordsx']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LoanInstallmentRecx): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<?php
						$lins_amtx=$LoanInstallmentRecx->lins_amt;					
						$lins_iamtx=$LoanInstallmentRecx->lins_iamt;						
						$othr_amtx=$LoanInstallmentRecx->penaltysum;
						$delayamtx=$LoanInstallmentRecx->delayamt;
						$chqbouncex=$LoanInstallmentRecx->chequebounce;
						$totamtx = $lins_amtx+$lins_iamtx+$othr_amtx+$delayamtx+$chqbouncex;
						//Sum Total 
						$totinterestamtx = $totinterestamtx +  $lins_iamtx;
						$tototheramtx = $tototheramtx + $othr_amtx;
						$totchqbouncex=$totchqbouncex+$chqbouncex;
						$totemiamtx = $totemiamtx+ ($lins_amtx+$lins_iamtx+$othr_amtx+$delayamtx+$chqbouncex);
						$totdelaypaymentx = $totdelaypaymentx + $delayamtx;
						if($totpaiddecreaseonloopx > $totamtx)
						{
							$paid_amtx=$totamtx;
							$totpaiddecreaseonloopx = $totpaiddecreaseonloopx - $totamtx;
						}
						else
						{
							$paid_amtx = $totpaiddecreaseonloopx;
							$totpaiddecreaseonloopx = 0;
						}
												
						$bal_amtx=$totamtx-$paid_amtx;
						
						$totpaidamtx = $totpaidamtx + $paid_amtx;
						
				//Coding to Calculate days difference between two days start here	
				$currentdtx = strtotime(date("Y-m-d")); //Current day
				$installmentdtx = strtotime($LoanInstallmentRecx->lins_date); //Installment day
				$datediffx = $currentdtx - $installmentdtx;				
				$daysdifferencex =  round($datediffx / (60 * 60 * 24)) ;
				if($daysdifferencex >=0)
				{
					if($bal_amtx > 0)
					{
						$daysdifferencex=$daysdifferencex;
					}
					else
					{
						$daysdifferencex=0;
					}
				}
				else
				{
					$daysdifferencex =0;
				}
				//Coding to Calculate days difference between two days ends here
						?>
						<tr  
						<?php
						if($bal_amtx > 0)
						{
						echo 'style="color:red;"';
						}
						else
						{
						echo 'style="color:green;"';
						}
						?>
						>
							<td><?php echo e($LoanInstallmentRecx->lins_no); ?></td><!-- SL No. -->
							<td><?php echo date("d-m-Y",strtotime($LoanInstallmentRecx->lins_date)); ?></td><!-- Installment dt -->
							<td style="text-align: right;"><?php echo e(round($LoanInstallmentRecx->lins_amt)); ?></td><!-- Principle Amt -->
						<?php /*	<td>{{$LoanInstallmentRecx->lins_iperc}}%</td>   */ ?> <!-- Interest -->
							<td style="text-align: right;"><?php echo e(round($LoanInstallmentRecx->lins_iamt)); ?></td>  <!-- Interest Amt -->
							<td style="text-align: right;"><?php echo e(round($LoanInstallmentRecx->chequebounce)); ?></td>  <!-- Cheque Bounce Amt -->
							<td style="text-align: right;">
<?php 
if($daysdifferencex>0)
{
?>							
	<button class="btn btn-warning btn-xs"  data-toggle="modal"  id="<?php echo e($LoanInstallmentRecx->lins_id); ?>" data-target="#myDelayPayment"><?php echo e(round($LoanInstallmentRecx->delayamt)); ?></button>
<?php
}
else
{
?>
	<?php echo e(round($LoanInstallmentRecx->delayamt)); ?>

<?php
}
?>
[<?php echo $daysdifferencex; ?> Days]
							</td><!-- Delay Payment -->
							<td style="text-align: right;">
							<?php
							if($bal_amtx > 0)
							{
							?>
							<button class="btn btn-danger btn-xs"  data-toggle="modal"  id="<?php echo e($LoanInstallmentRecx->lins_id); ?>" data-target="#myotheramt"><?php echo " " . $LoanInstallmentRecx->penaltysum; ?></button>
							<?php
							}
							else
							{
								echo "" . $LoanInstallmentRecx->penaltysum;
							}							
							?>
							</td>  <!-- Others Amt -->
							<td style="text-align: right;"><?php echo round($totamtx); ?></td><!-- EMI Amt -->
							<td style="text-align: right;">							
							<?php
							if($bal_amtx > 0)
							{
							?>
							<button class="btn btn-primary btn-xs"  data-toggle="modal"  id="<?php echo e($LoanInstallmentRecx->lins_id); ?>" data-target="#mypayment" ><?php echo round($paid_amtx); ?></button>
							<?php
							}
							else
							{
							?>
							<?php echo round($paid_amtx); ?>
							<?php
							}
							?>
							</td><!-- Paid Amt -->
							<td style="text-align: right;"><b><?php echo round($bal_amtx); ?></b></td><!-- Balance Amt -->
							<td><button class="btn btn-info btn-xs"  data-toggle="modal"  id="<?php echo e($LoanInstallmentRecx->lins_id); ?>" data-target="#viewreport" ><span class='fa fa-list'></span></button></td>
							<?php
							/*
							<td><button class="btn btn-info btn-xs"  onclick="loadreport('<?php echo $LoanInstallmentRecx->lins_id; ?>')" ><span class='fa fa-book'></span></button></td>
							*/
							?>
						</tr>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				</tbody>
		<tfoot>
			<th></th>
			<th></th>	
			<th style="text-align: right;"><?php echo e(round($LoanApplicantRec->lacc_loanamt)); ?></th>
			<th style="text-align: right;"><?php echo round($totinterestamtx); ?></th>
			<th style="text-align: right;"><?php echo round($totchqbouncex); ?></th>			
			<th style="text-align: right;"><?php echo round($totdelaypaymentx); ?></th>					
			<th style="text-align: right;"><?php echo round($tototheramtx); ?></th>
			<th style="text-align: right;"><?php echo round($totemiamtx); ?></th>							
			<th style="text-align: right;"><?php echo round($data['LoanTotalPaidx']); ?></th>		
			<th style="text-align: right;"><?php echo round($totemiamtx-($data['LoanTotalPaidx'])); ?></th>
			<th></th>
		</tfoot>
</table>
<?php /* ############################################################################################## */ ?>
<style>
.paymentmodal {
    width: 75%;
    margin: 30px auto;
}
</style>
<script src="assets/js/king-table.js"></script>
<script src="assets/js/popper.min.js"></script>
<div class="loadreport">
<?php
$LoanTotalPaid=0;
foreach($data['LoanApplicantRecords'] as $LoanApplicantRec)
{
	$lacc_id = $LoanApplicantRec->lacc_id;
}
foreach($data['LoanInstallmentRecords'] as $LoanInstallmentRec)
{
	$lins_amt = $LoanInstallmentRec->lins_amt;
	$lins_iamt =$LoanInstallmentRec->lins_iamt;
}

//######AllInstRecords starts here ***************				
$totinterestamt =0;
$tototheramt = 0;
$totemiamt = 0;
$totpaidamt = 0;
$totbalamt = 0;
$btn=0;
$paid_amt = 0;
$bal_amt=0;
$totdelaypayment=0;
$chqbounce=0;
$totchqbounce=0;
$totinsamt=0;
$totalloanamnt = $LoanApplicantRec->lacc_loanamt;
$totpaiddecreaseonloop = $data['LoanTotalPaid'];
$paidamtbal = $data['LoanTotalPaid'];
$nopending = 0;
foreach($data['AllInstRecordsPrev'] as $LoanInstallmentRecPrev)
{
	$lins_amt=$LoanInstallmentRecPrev->lins_amt;						
	$lins_iamt=$LoanInstallmentRecPrev->lins_iamt;						
	$othr_amt=$LoanInstallmentRecPrev->penaltysum;
	$delayamt=$LoanInstallmentRecPrev->delayamt;
	$chqbounce=$LoanInstallmentRecPrev->chequebounce;
	$totamt = $lins_amt+$lins_iamt+$othr_amt+$delayamt+$chqbounce;
	//Sum Total
	$totinsamt = $totinsamt + $lins_amt;
	$totinterestamt = $totinterestamt +  $lins_iamt;
	$totemiamt = $totemiamt+ ($lins_amt+$lins_iamt+$othr_amt+$delayamt);
	$totdelaypayment = $totdelaypayment + $delayamt;
	$totchqbounce= $totchqbounce + $chqbounce;
	$tototheramt = $tototheramt + $othr_amt;
	if($totpaiddecreaseonloop > $totamt)
	{
		$paid_amt=$totamt;
		$totpaiddecreaseonloop = $totpaiddecreaseonloop - $totamt;
	}
	else
	{
		$paid_amt = $totpaiddecreaseonloop;
		$totpaiddecreaseonloop = 0;
	}												
	$bal_amt=$totamt-$paid_amt;						
	$totpaidamt = $totpaidamt + $paid_amt;
	if(round($bal_amt) > 0)
	{
		$nopending = $nopending + 1;
	}
}
if($data['CurrentPayableAmt'] > 0 )
{
	$nopending = $nopending + 1;
}
//###-Other charges starts here
if($paidamtbal > $tototheramt)
{
	$paidamtbal = $paidamtbal - $tototheramt;
	$tototheramt = 0;
}
else
{
	$tototheramt = $tototheramt - $paidamtbal;
	$paidamtbal =0;
}
//###-Other charges ends here
//###-Penalty charges starts here
if($paidamtbal > $totdelaypayment)
{
	$paidamtbal = $paidamtbal - $totdelaypayment;
	$totdelaypayment =0;
}
else
{
	$totdelaypayment = $totdelaypayment - $paidamtbal;
	$paidamtbal =0;
}
//###-Penalty charges ends here
//###-Cheque Bounce charges starts here
if($paidamtbal > $totchqbounce)
{
	$paidamtbal = $paidamtbal - $totchqbounce;
	$totchqbounce = 0;
}
else
{
	$totchqbounce = $totchqbounce - $paidamtbal;
	$paidamtbal =0;
}
//###-Cheque Bounce charges ends here
//##Interest Amount starts here
if($paidamtbal > $totinterestamt)
{
	$paidamtbal = $paidamtbal - $totinterestamt;
	$totinterestamt = 0;
}
else
{
	$totinterestamt = $totinterestamt - $paidamtbal;
	$paidamtbal =0;
}
//##Interest amount ends here
//##Principal Amount starts here
if($paidamtbal > $totinsamt)
{
	$totinsamt = 0;
	$paidamtbal = $paidamtbal - $totinsamt;
}
else
{
	$totinsamt = $totinsamt - $paidamtbal;
	$paidamtbal =0;
}
//##Principal Amount ends here
//######AllInstRecords ends here ***************

?>
<!-- MAIN CONTENT WRAPPER -->
<div class="content">	
	<div class="main-content">
		<!-- DATA EXPORT -->
<div id="divprint">		
		<div class="widget widget-table">

<div class="widget-header">
	<h3><i class="fa fa-table"></i>Ledger</h3>
	<div class='btn-toolbar pull-right'>
		<div class='btn-group'>
			<button type='button' class='btn btn-primary' id="idreload" onclick="refreshpage('LoanSingleCustomerReport?&lacc_id=<?php echo $lacc_id; ?>')" ><i class="fa fa-refresh" aria-hidden="true"></i></button>
		</div>
	</div>
</div>

			<div class="widget-content">
				<?php
				/*
				<center><h3><img src="img/navachethana-logo.png" >Navachethana Finance Company (R)</h3><br>
				<p>"Beauty Plaza" Building, Ground Floor, Balmatta Road, mangalore-575001<br>
				<b>Phone : 0824 - 4255640 Mobile No. 7760833500</b>
				</p></center>
				<hr> 
				*/
				?>
				<table  class="table table-striped table-bordered" border="1">
					<?php  $i=1;?>
					<?php $__currentLoopData = $data['LoanApplicantRecords']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LoanApplicantRec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
					<?php
					//print_r($LoanApplicantRec);
					?>
					<?php $lacc_id = $LoanApplicantRec->lacc_id; ?>
					<input type="hidden" name="lacc_id" id="lacc_id" value="<?php echo e($LoanApplicantRec->lacc_id); ?>">
					<input type="hidden" name="lacc_no" id="lacc_no" value="<?php echo e($LoanApplicantRec->lacc_no); ?>">
						<tr>
							<th style="width: 15%">Loan Account No.</th><td style="width: 35%"><b><?php echo $loanacc = $LoanApplicantRec->lacc_no; ?></b></td>	
							<th style="width: 20%">Loan Account Date</th><td style="width: 30%"><b><?php echo  date("d-m-Y",strtotime($LoanApplicantRec->lacc_opendt)); ?></b></td>								
						</tr>			
						<tr>
							<th>Customer Name</th><td><b><?php echo e($LoanApplicantRec->lacc_custname); ?></b></td>	
							<th>EMI Start Date</th>
							<td><b><?php 
//echo  date("d-m-Y",strtotime($LoanApplicantRec->lacc_opendt));
echo $effectiveDate = date('d-M-Y', strtotime("+1 month", strtotime($LoanApplicantRec->lacc_opendt)));
					?></b></td>						
						</tr>
						<tr style="width: 15%">
							<th rowspan="3">Customer Address</th><td rowspan="3"><b><?php 
							$addr=unserialize($LoanApplicantRec->lacc_resaddr); 
							//print_r($addr);
							echo $addr[0]."<br>";
							echo $addr[1]."<br>";
							echo $addr[2]."<br>";
							echo $addr[3];
							if($addr[4] != "")
							{
							echo "," . $addr[4];
							}
							?></b></td>	
							<th>EMI Close Date</th><td><b> <?php 
//echo  date("d-m-Y",strtotime($LoanApplicantRec->lacc_opendt));
echo $effectiveDate = date('d-M-Y', strtotime("+$LoanApplicantRec->lacc_tenor months", strtotime($LoanApplicantRec->lacc_opendt)));
					?></b></td>
						</tr>
						
						<tr>
							<th>Interest rate.</th><td><b><?php echo $loanacc = $LoanApplicantRec->lacc_intrate; ?>%</b></td>
						</tr>
						
						<tr>
							<th>Loan Tenure.</th><td><b><?php echo e($LoanApplicantRec->lacc_tenor); ?> months</b></td>
						</tr>
						
						<tr>
							<th>Mobile No.</th><td><b><?php echo $addr[5]; ?></b></td>
							<th>Monthly EMI.</th><td><b><?php echo round($lins_amt + $lins_iamt); ?></b></td>
						</tr>
						<tr>
							<th>Tel.</th><td><b><?php echo $addr[6]; ?></b></td>
							<th>Outstanding Principal.</th><td><b><?php 
							echo round(($LoanApplicantRec->lacc_loanamt) - ($data['LoanTotalPaid'] - ($data['LoanTotalInterest']+$data['LoanAllCharges']) ));
							?></b></td>
						</tr>
						<tr>
							<th>Branch</th><td><b><?php echo e($LoanApplicantRec->br_name); ?></b></td>	
							<th>No. of EMI Arrears</th><td><b><?php echo $nopending; ?></b></td>
						</tr>
						
						<tr>
							<th>Loan Amount</th><td><b><?php echo e(round($LoanApplicantRec->lacc_loanamt)); ?></b></td>	
							<th>Arrear EMI</th><td><b><?php echo round($data['ArrearEMI']); ?></b></td>
						</tr>
						<tr>
							<th rowspan="3">Loan Paid details</th><td rowspan="3"><?php echo e($LoanApplicantRec->lacc_remarks); ?></td>	
							<th>Bank charges</th><td><b><?php echo round($data['ArrearBank']); ?></b></td>
						</tr>
						
						<tr>
							<th>Arrear Penalty.</th><td><b><?php echo round($data['ArrearPenalty']); ?></b></td>
						</tr>
						 
						<tr>
							<th>Legal/Other charges</th><td><b><?php echo round($data['ArrearLegalOther']); ?></b></td>
						</tr>
					
						<tr>
							<th>Chit Reference No.</th><td><b><?php echo e($LoanApplicantRec->lacc_chitrefno); ?></b></td>	
							<th>Total Arrear's.</th><td><b><?php echo round($data['ArrearEMI'] + $data['ArrearBank'] + $data['ArrearPenalty'] + $data['ArrearLegalOther']); ?></b></td>
						</tr>
						
						<tr>
							<th>Branch name.</th><td><b><?php echo e($LoanApplicantRec->chitbr); ?></b></td>	
							<th>Current installment</th><td><b><?php echo round($data['ArrearCurrInst']);
							?></b></td>
						</tr>
						
						<tr>
							<th>Paid up amount.</th>
							<td><b><?php
										if($LoanApplicantRec->lacc_paidupamt != "")
										{
										echo "". round($LoanApplicantRec->lacc_paidupamt);
										}
								?></b>
							</td>	
							<th>Total Amt pending</th>
							<td><b><?php echo round($data['ArrearEMI'] + $data['ArrearBank'] + $data['ArrearPenalty'] + $data['ArrearLegalOther'] + $data['ArrearCurrInst']); ?></b></td>
						</tr>
					<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				</table>
			</div>
		</div>
		<!-- END DATA EXPORT -->
		 <?php 
		 //echo print_r($data['LoanInstallmentRecords']); 
		 ?>

		<!-- DATA EXPORT -->
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> Loan Installment detail</h3>
			</div>
			<div class="widget-content">
<table  class="table table-striped table-bordered" id="tabloan">
	<thead>
		<tr>
			<th>Inst No.</th>
			<th>Receipt<br>No.</th>					
			<th>Month</th>							
			<th>Date of<br>Repayment</th>
			<th>Principal</th>							
			<th>Interest</th>					
			<th>Bank<br>charges</th>						
			<th>Late<br>fee</th>								
			<th>Case/Other<br>charges</th>		
			<th>Mode of<br> Payment</th>
			<th>Cheque No. & <br> Bank</th>
		</tr>
	</thead>
	<tbody>	
	<?php
	$i=1;
	$linsamt= 0;
	$intamt = 0;
	$instno = 0;
	$principleamt = 0;	
	$Interestamt = 0;	
	$chqbounce = 0;
	$penaltyamt = 0;	
	$othercharges = 0;
	$totalinstallmentamount = 0;
	$paidamt=0;
	$paidamtbal=0;
	//
	$principleamt1 = 0;	
	$Interestamt1 = 0;	
	$chqbounce1 = 0;
	$penaltyamt1 = 0;	
	$othercharges1 = 0;
	?>
		<?php $__currentLoopData = $data['LoanPaymentRecords']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LoanPaymentRec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
		<?php
		$paidamt = $LoanPaymentRec->ltr_amt;
		$paidamtbal = $paidamtbal + $paidamt;
		$principleamt = $principleamt + $LoanPaymentRec->principleamt;	
		$Interestamt = $Interestamt  + $LoanPaymentRec->Interestamt;	
		$chqbounce = $chqbounce + $LoanPaymentRec->chqbounce;
		$penaltyamt = $penaltyamt + $LoanPaymentRec->penaltyamt;	
		$othercharges = $othercharges + $LoanPaymentRec->othercharges;
		//###-Other charges starts here
		if($paidamtbal > $othercharges)
		{
			$paidamtbal = $paidamtbal - $othercharges;
			if($othercharges <0)
			{
				$othercharges1 = $othercharges;
				$othercharges=0;
			}
			else
			{
				$othercharges1 = $othercharges;
				$othercharges=0;
			}
		}
		else
		{
			$othercharges = $othercharges-$paidamtbal;
			$othercharges1 = $paidamtbal;
			$paidamtbal =0;
		}
		//###-Other charges ends here
		//###-Penalty charges starts here
		if($paidamtbal > $penaltyamt)
		{
			$penaltyamt1 = $penaltyamt;
			$paidamtbal = $paidamtbal - $penaltyamt;
			$penaltyamt=0;
		}
		else
		{
			$penaltyamt = $penaltyamt-$paidamtbal;
			$penaltyamt1 = $paidamtbal;
			$paidamtbal =0;
		}
		//###-Penalty charges ends here
		//###-Cheque Bounce charges starts here
		if($paidamtbal > $chqbounce)
		{
			$chqbounce1 = $chqbounce;
			$paidamtbal = $paidamtbal - $chqbounce;
			$chqbounce=0;
		}
		else
		{
			$chqbounce = $chqbounce-$paidamtbal;
			$chqbounce1 = $paidamtbal;
			$paidamtbal =0;
		}
		//###-Cheque Bounce charges ends here
		//##Interest Amount starts here
		if($paidamtbal > $Interestamt)
		{
			$Interestamt1 = $Interestamt;
			$paidamtbal = $paidamtbal - $Interestamt;
			$Interestamt=0;
		}
		else
		{
			$Interestamt = $Interestamt-$paidamtbal;
			$Interestamt1 = $paidamtbal;
			$paidamtbal =0;
		}
		//##Interest amount ends here
		//##Principal Amount starts here
		if($paidamtbal > $principleamt)
		{
			$principleamt1 = $principleamt;
			$paidamtbal = $paidamtbal - $principleamt;
			$principleamt=0;
		}
		else
		{
			$principleamt = $principleamt-$paidamtbal;
			$principleamt1 = $paidamtbal;
			$paidamtbal =0;
		}
		//##Principal Amount ends here
		?>
		<tr>
			<td><?php echo $LoanPaymentRec->lins_no; ?></td>
			<td><?php echo $LoanPaymentRec->ltr_billno; ?></td>
			<td><?php echo date("M",strtotime($LoanPaymentRec->ltr_transdt)); ?></td>
			<td><?php echo date("d-m-Y",strtotime($LoanPaymentRec->ltr_transdt)); ?></td>
			<td style="text-align: right;"><?php echo e(round($principleamt1)); ?></td>
			<td style="text-align: right;"><?php echo e(round($Interestamt1)); ?></td>
			<td style="text-align: right;"><?php echo e(round($chqbounce1)); ?></td>
			<td style="text-align: right;"><?php echo e(round($penaltyamt1)); ?></td>
			<td style="text-align: right;"><?php echo e(round($othercharges1)); ?></td>
			<td><?php echo $LoanPaymentRec->ltr_paymenttype; ?></td>
			<td><?php echo $LoanPaymentRec->ltr_chqno . " " . $LoanPaymentRec->ltr_bank; ?></td>
		</tr>
		<?php
		$linsamt = $linsamt + $LoanInstallmentRec->lins_amt;
		$intamt  = $intamt + $LoanInstallmentRec->lins_iamt;
		$totalinstallmentamount = $totalinstallmentamount + $paidamt;
		?>
		<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
	</tbody>
	<tfoot>
		<tr>		
			<th colspan="11" >Total Amount : <?php echo round($totalinstallmentamount); ?></th>
		</tr>
	</tfoot>
</table>
			</div>
		</div>
		
		<?php /* Cancelled Receipt transaction */ ?>
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> Cheque Return / Cancelled Receipt Transactions </h3>
			</div>
			<div class="widget-content">

				<table  class="table table-striped table-bordered" >
					<thead>
						<tr>
							<th>Inst No.</th>
							<th>Cheque No. & Bank</th>
							<th>Receipt No.</th>								
							<th>Payment Date</th>				
							<th>Cheque Amount</th>	
							<th>Cheque return Date</th>				
							<th>Bank charges</th>
						</tr>
					</thead>
					<tbody>	
					<?php
					$totcancellationcharge = 0;
					?>
						<?php $__currentLoopData = $data['LoanChqBounceRecords']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LoanChqBounceRecords): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<tr>
							<td><?php echo $LoanChqBounceRecords->lins_no; ?></td>
							<td><?php echo $LoanChqBounceRecords->ltr_chqno; ?> <?php echo $LoanChqBounceRecords->ltr_bank; ?></td>
							<td><?php echo $LoanChqBounceRecords->ltr_billno; ?></td>
							<td><?php echo date("d-m-Y",strtotime($LoanChqBounceRecords->ltr_transdt)); ?></td>
							<td style="text-align: right;"><?php echo $LoanChqBounceRecords->chequeamt; ?></td>
							<td><?php echo $LoanChqBounceRecords->cancellationdate; ?></td>
							<td style="text-align: right;"><?php echo $LoanChqBounceRecords->cancellationcharge; ?></td>
						</tr>
						<?php
						$totcancellationcharge = $totcancellationcharge + $LoanChqBounceRecords->cancellationcharge;
						?>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
					</tbody>
	<tfoot>
		<tr>		
			<th colspan="7">Total Amount : <?php echo round($totcancellationcharge); ?></th>
		</tr>
	</tfoot>
				</table>
			</div>
		</div>
		
		<?php /* Balance Amount */ ?>
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> Balance amount Details </h3>
			</div>
			<div class="widget-content">
				<table  class="table table-striped table-bordered" >
					<thead>
						<tr>
							<th>Inst No.</th>
							<th>Amount</th>					
							<th>Paid Date</th>					
							<th>Status</th>		
						</tr>
					</thead>
					<tbody>
					<?php
					/*
						@foreach($data['LoanRpt'] as $LoanInstallmentRec)
						<tr>
							<td><?php echo $i; $i=$i+1; ?></td>
							<td><?php echo $LoanInstallmentRec->ltr_billno; ?></td>
							<td><?php echo date("M",strtotime($LoanInstallmentRec->ltr_transdt)); ?></td>
							<td><?php echo date("d-m-Y",strtotime($LoanInstallmentRec->lins_date)); ?></td>
							<td><?php echo $LoanInstallmentRec->lins_amt; ?></td>
							<td><?php echo $LoanInstallmentRec->lins_iamt; ?></td>
							<td><?php echo $LoanInstallmentRec->bankcharges; ?></td>
							<td><?php echo $LoanInstallmentRec->latefee; ?></td>
							<td><?php echo $LoanInstallmentRec->caseotherchrge; ?></td>
							<td><?php echo $LoanInstallmentRec->ltr_paymenttype; ?></td>
							<td><?php echo $LoanInstallmentRec->ltr_chqno; ?></td>
						</tr>
						@endforeach
					*/
					?>	
					</tbody>
				</table>
			</div>
		</div>
		
						<?php /* Balance Amount */ ?>
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> Delay Payment Details </h3>
			</div>
			<div class="widget-content">
				<table  class="table table-striped table-bordered" >
					<thead>
						<tr>
							<th>Inst No.</th>
							<th>Reason</th>			
							<th>Expense Date</th>
							<th>Expense Amount</th>					
							<th>Note</th>		
						</tr>
					</thead>
					<tbody>
					<?php
					$totLoanExpenseRec = 0;
					?>
						<?php $__currentLoopData = $data['LoanExpenseRecords']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LoanExpenseRec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<tr>
							<td><?php echo $LoanExpenseRec->lins_no; ?></td>
							<td><?php echo $LoanExpenseRec->ltr_transtype; ?></td>
							<td><?php echo date("d-m-Y",strtotime($LoanExpenseRec->expensedate)); ?></td>
							<td style="text-align: right;"><?php echo round($LoanExpenseRec->expenseamt); ?></td>
							<td><?php echo $LoanExpenseRec->ltr_note ; ?></td>
						</tr>
						<?php
						$totLoanExpenseRec = $totLoanExpenseRec + $LoanExpenseRec->expenseamt;
						?>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
					<tfoot>
						<tr>		
							<th colspan="3" style="text-align: right;">Total Amount</th>
							<th style="text-align: right;"><?php echo round($totLoanExpenseRec); ?></th>
							<th ></th>
						</tr>
					</tfoot>
					</tbody>
				</table>
			</div>
		</div>
		
		<?php /* Balance Amount */ ?>
		<div class="widget widget-table">
			<div class="widget-header">
				<h3><i class="fa fa-table"></i> Security Entry </h3>
			</div>
			<div class="widget-content">
				<table  class="table table-striped table-bordered" >
					<thead>
						<tr>
							<td><?php echo e($LoanApplicantRec->lacc_securityentry); ?></td>		
						</tr>
					</thead>
				</table>
			</div>
		</div>

</div>
<div class="widget widget-table">
	<div class="widget-content">
		<table  class="table table-striped table-bordered" >
			<thead>
				<tr>
					<td>
					<center><button class="form-control" style="width: 250px;"  onclick="printDiv(<?php echo $LoanApplicantRec->lacc_id; ?>)">Print</button></center>
					</td>		
				</tr>
			</thead>
		</table>
	</div>
</div>
<script>
function printDiv(lacc_id) 
{
	url = "/LoanSingleCustomerPrint?lacc_id=" + lacc_id + "&reporttype=print"
	var win = window.open(url, '_blank');
	win.focus();
}
</script>