Loan Over Due Issue Resloved

This commit is contained in:
velz2020 2017-11-29 10:33:20 +05:30
parent 3461c7f75b
commit be31b7c493

View File

@ -4,9 +4,11 @@
<?php
// print_r($loanrecords);
date_default_timezone_set("Asia/Kolkata");
$dateflag=0;
$statusflag =0;
$overdueflag = 0;
$source = array('company'=>'Company');
$historytableflag = 0;
if(!empty($childdata) )
@ -20,17 +22,43 @@
foreach($loanrecords as $r)
{
//print_r($r);
if(!empty($r->Loan_Issued_Date))
{
$dateflag=1;
$statusflag=1;
}
if(!empty($r->Due_Start_Date) && !empty($r->No_of_Dues))
{
// echo date('Y-m-d h:m:s');
// echo $r->Due_Start_Date;
$noofdus = $r->No_of_Dues;
$time=strtotime($r->Due_Start_Date);
$month=date("m",$time);
$finalmonth = $month+($noofdus-1);
//echo $finalmonth;
$curmonth = date('m');
//echo $curmonth;
if($curmonth > $finalmonth)
{
// echo 'overdue';
//echo ($curmonth - $finalmonth);
$overdueflag = 1;
}
}
}
}
}
if(!empty($loanemployees))
{
foreach($loanemployees as $l)
@ -182,6 +210,7 @@
$totalloangiven = 0;
$totalrecovered = 0;
$totalbalance = 0;
//$overdue = 0;
$base=base_url();
if(!empty($loanrecords))
{
@ -201,8 +230,30 @@
<td style="text-align:right;"><?php if(!empty($rec->Loan_Issued_Date)){echo $rec->Loan_Issued_Date;}else{echo "-";}?></td>
<?php }?>
<td style="text-align:right;"><?php if(!empty($rec->Paid_Amount)){$totalrecovered+=$rec->Paid_Amount ;echo $rec->Paid_Amount;}else{echo "0.00";} ?></td>
<?php if($statusflag == 1) {?>
<td style="text-align:center;" ><?php $final = ''; if($rec->is_Active == 1){$final = "<font color='blue'>Pending</font>"; }else{$final = "<font color='green'>Completed</font>";} if($rec->Remaining_Due < 0 and $rec->is_Active == 1){$final.=",<font color='red'>Over Due</font>";} echo $final;?></td>
<?php if($statusflag == 1) {
// if(!empty($rec->Due_Start_Date) && !empty($rec->No_of_Dues))
// {
// // echo $rec->Due_Start_Date;
// $noofdus = $rec->No_of_Dues;
// $time=strtotime($rec->Due_Start_Date);
// $month=date("m",$time);
// $finalmonth = $month+$noofdus;
// // echo $finalmonth;
// $curmonth = date('m');
// if($curmonth > $finalmonth)
// {
// //echo 'overdue';
// //echo ($curmonth > $finalmonth);
// $overdueflag = 1;
// }
// }
?>
<td style="text-align:center;" ><?php $final = ''; if($rec->is_Active == 1){$final = "<font color='blue'>Pending</font>"; }else{$final = "<font color='green'>Completed</font>";} if($overdueflag == 1 and $rec->is_Active == 1){$final.=",<font color='red'>Over Due</font>";} echo $final;?></td>
<?php }?>
<td style="text-align:right;"><?php if(!empty(($rec->Loan_Amount) and ($rec->Paid_Amount))){ $totalbalance+= ($rec->Loan_Amount - $rec->Paid_Amount);echo number_format(($rec->Loan_Amount - $rec->Paid_Amount),2,'.','');}else {echo "0.00";}?></td>
</tr>