sparqapi/api/application/views/smc_creditpd_reports/MWISE.php
2020-11-24 20:40:27 +05:30

1132 lines
43 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$uparrow = '<span style="color:green;">↑</span>';
$downarrow = '<span style="color:red;">↓</span>';
$dash = '<span style="color:black;"> </span>';
// $product_name = $master[0]['abbr'];
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
//print_r($master[0]['abbr']);die();
?><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<style type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
.page_break { page-break-before: always; }
#page_break { page-break-before: always; }
/*.page { width: 100%; height: 95%; }*/
@page {
margin: 100px 50px;
/*font-family:Helvetica,Arial;*/
font-family:Merriweather;
}
header {
position: fixed;
top: -70px;
left: 0px;
right: 0px;
height: 20px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: right;
/*line-height: 35px;*/
}
footer {
position: fixed;
bottom: 5px;
left: 0px;
right: 0px;
height: 20px;
font-size: 10px;
/** Extra personal styles **/
/*background-color: #03a9f4;
color: white;*/
text-align: left;
/*line-height: 35px;*/
}
/* #########Score Card Table Styles######### */
.scorecard_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: inline;
}
.scorecard_table td, .scorecard_table th {
border: 1px solid #000;
padding: 8px;
page-break-inside: inline;
}
.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: inline; }
.scorecard_table tr:hover {background-color: #ddd;}
.scorecard_table th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: inline;
}
/* #########End of Score Card Table Styles######### */
/* #########Score Card2 Table Styles######### */
.scorecard_table2 {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: 100%;
page-break-inside: avoid;
}
.scorecard_table2 td, .scorecard_table2 th {
border: 1px solid #000;
padding: 8px;
page-break-inside: avoid;
}
.scorecard_table2 tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid; }
.scorecard_table2 tr:hover {background-color: #ddd;}
.scorecard_table2 th {
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Score Card 2 Table Styles######### */
.tdcenteralign{ text-align: center; }
.thlargefont{ font-size: 20px; }
</style>
</head>
<body style="font-family:Merriweather;font-size:12px;margin:15px 30px">
<footer>
<hr>
<img style="width:100px;height:50px;opacity: 0.5;padding-top: 5px;" src='https://pdgenie.com/logo/sineedge_red.png'/> Powered By PD Genie
</footer>
<header>
<div><img style="width:100px;height:50px;opacity: 0.5;" src='https://www.smcfinance.com/images/logo-small.jpg'/></div>
<hr>
</header>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Personal Discussion Sheet - Business Loans </th>
</tr>
<tr>
<td colspan="3"> Application ID</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $pd_master_details[0]['lender_applicant_id'] ? $pd_master_details[0]['lender_applicant_id'] : 'Not Provided'?> </td>
</tr>
<tr>
<td colspan="3"> Name of the Company/Firm</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $applicant_details[0]['company_name']?></td>
</tr>
<?php if(isset($pd_section_data[1]['person_met'])){?>
<tr>
<td colspan="3"> Name of Person Met During Visit</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $pd_section_data[1]['person_met']?> </td>
</tr>
<?php }?>
<!-- <tr>
<td colspan="3"><?php if($master[0]['sales_pd_type'] == 1){echo 'Name of Person Met during visit'; }else{ echo 'Name of the Person Contacted'; } ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $section1['person_met_during_visit']?></td>
</tr> -->
<tr>
<td colspan="3" rowspan="2" ><?php echo 'Business Address'; ?></td>
<td class = "tdcenteralign" colspan="7"><?php echo $pd_master_details[0]['addressline1']?></td>
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo$pd_master_details[0]['city_name']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $pd_master_details[0]['state_name']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($pd_master_details[0]['pincode_others'])){ echo $pd_master_details[0]['pincode_others']; } else { echo $pd_master_details[0]['pincode']; }?></td>
</tr>
<?php
if(isset($pd_section_data[2]))
{
if(isset($pd_section_data[2]['alternative_address']) && $pd_section_data[2]['alternative_address'] != '')
{
echo '<tr> <td colspan="3">Actual PD Address</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['alternative_address'].'</td></tr>';
}
echo '<tr> <td colspan="3">Address Type</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].'</td></tr>';
echo '<tr> <td colspan="3">PD locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_locality']['locality_name'].'</td></tr>';
echo '<tr> <td colspan="3">Location Approach</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_location']['description'].'</td></tr>';
echo '<tr> <td colspan="3">Comment On Locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['comment_locality']['rating'].'</td></tr>';
}
?>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tr>
<th class="thlargefont" colspan="8">Applicant`s Details</th>
</tr>
<tr>
<th colspan="1">Borrower<br> Type</th><th colspan="1">Name</th><th colspan="1">Entity Type</th><th colspan="1">Designation</th><th colspan="1">Relation</th><th colspan="1">Realtion to</th><th colspan="1">Age</th><th colspan="1">No of Year(s)<br> Business runing</th>
</tr>
<?php
foreach ($pd_section_data[1]['borrower_details'] as $key1 => $value1)
{
echo '<tr><td colspan="1" class = "tdcenteralign">'.$value1['borrower_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['borrower_name'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['entity_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['designation'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship_to'].'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['borrower_age']) ? : 'NA').'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['numbers_of_years_business_running']) ? $value1['numbers_of_years_business_running'] : 'NA').'</td></tr>';
}
?>
<tbody>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Fund Requirement</th>
</tr>
<tr>
<td colspan="3" >Loan Amount Applied for (Rs)</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[3]['loan_amount'])?></td>
<td colspan="2">Total Fund Requirement (Rs)</td>
<td class = "tdcenteralign" colspan="2"> <?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['total_fund_requirement'])?></td>
</tr>
<?php if(isset($pd_section_data[3]['remarks_fund_source_balance'])){?>
<tr>
<td colspan="3" >Remarks of funds for balance Amount required</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['remarks_fund_source_balance']?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3" >Is There any Balance Transfer</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['is_transfer']?></td>
</tr>
<?php if(isset($pd_section_data[3]['is_transfer']) && strtolower($pd_section_data[3]['is_transfer']) == 'yes'){?>
<tr>
<td colspan="3" >Balance Transfer Amount</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['balance_transfer_amount'])?></td>
<td colspan="2" >Top up amount</td>
<td class = "tdcenteralign" colspan="2" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['topup_amount'])?></td>
</tr>
<tr>
<td colspan="3" >Lender from where BT done</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['lender']['lender_name']?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3" >Type of Property being Mortaged</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['property_type']?></td>
</tr>
<tr>
<td colspan="3" >Name of The Owner</td>
<td class = "tdcenteralign" colspan="7" ><?php echo $pd_section_data[3]['owner_name']?></td>
</tr>
<tr>
<td colspan="3" >Estimated Market Value as per Customer</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['emv_per_customer'])?></td>
<td colspan="2" >Market Value considered for LTV</td>
<td class = "tdcenteralign" colspan="2" ><?php echo $rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[3]['ltv_market_value_calculation'])?></td>
</tr>
<tr>
<td colspan="3" >Addess of property</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $pd_section_data[3]['address'].', '.$pd_section_data[3]['city']['name'].', '.$pd_section_data[3]['state']['name'].', '.$pd_section_data[3]['pincode']?></td>
<td colspan="2" >Stage of construction</td>
<td class = "tdcenteralign" colspan="2" ><?php echo $pd_section_data[3]['construction_stage']?></td>
</tr>
<tr>
<td colspan="3" >Property usage</td>
<td class = "tdcenteralign" colspan="3" ><?php echo $pd_section_data[3]['property_usage']?></td>
<td colspan="2" >Structure type</td>
<td class = "tdcenteralign" colspan="2" ><?php echo $pd_section_data[3]['structure_type']?></td>
</tr>
</tbody>
</table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="15">Details of Key Stakeholders in the Business</th>
</tr>
<tr>
<th colspan="5">Name</th>
<th colspan="2" >Share Holding</th>
<th colspan="2" >Year(s) in Current Business</th>
<th colspan="2">Total Work Exp(Yrs)</th>
<th colspan="2" >Previous Experience Details</th>
<th colspan="2" >Started Business</th>
</tr>
<?php
if(isset($pd_section_data[5]))
{
foreach ($pd_section_data[5]['key_stakeholders'] as $section5_key => $section5_value)
{
echo '<tr><td class="tdcenteralign" colspan="5">'.$section5_value['stakeholder_name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['share_holding'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['vintage_in_current_biz'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section5_value['started_biz'].'</td>'.
'</tr>';
}
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="15">Other Family Members involved in the business</th>
</tr>
<?php if(isset($pd_section_data[16]['family_details'])) {?>
<tr>
<th colspan="5">Name</th>
<th colspan="3" >Relationship</th>
<th colspan="2" >Relation to Individual Stakeholders</th>
<th colspan="3">Relation to Company / Firm</th>
<th colspan="2" >Started Biz (Yes / No)</th>
<!-- <th colspan="2" >Started Business</th> -->
</tr>
<?php } ?>
<?php
if(isset($pd_section_data[16]['family_details']) && count($pd_section_data[16]['family_details']))
{
foreach ($pd_section_data[16]['family_details'] as $sectio16_key => $section16_value)
{
echo '<tr><td class="tdcenteralign" colspan="5">'.$section16_value['member_name'] .'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['relationship']['name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section16_value['stakeholder_relation'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['company_relation']['name'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section16_value['started_biz'].'</td>'.
'</tr>';
}
}
if(isset($pd_section_data[16]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="5">Remarks</th><td class="tdcenteralign" colspan="10">'.$pd_section_data[16]['common_remarks'] .'</td>';
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Brief of the Business / Service</th>
</tr>
<tr>
<th colspan="3">Product/Service Name</th>
<th colspan="2">Contribution Business Product</th>
<th colspan="5">remarks</th>
</tr>
<?php
// print_r($pd_section_data[6]);
if(isset($pd_section_data[6]))
{
foreach ($pd_section_data[6]['key_products_contribution'] as $section6_key => $section6_value)
{
// print_r($section6_value);
echo '<tr><td class="tdcenteralign" colspan="3">'.$section6_value['product_name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section6_value['contribution_business_product'].'%</td>'.
'<td class="tdcenteralign" colspan="5">'.$section6_value['remarks'].'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
// '<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section5_value['started_biz'].'</td>'.
}
// if(isset($pd_section_data[6]['business_process']))
// {
// echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="8">'.$pd_section_data[6]['business_process'] .'</td>';
// }
if(isset($pd_section_data[6]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="7">'.$pd_section_data[6]['common_remarks'] .'</td>';
}
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<?php
echo '<tr><th>Business Brief</th></tr><tr><td class="tdcenteralign">'.$pd_section_data[6]['business_process'] .'</td></tr>';?>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="12">Employee Strength</th>
</tr>
<tr>
<td colspan="4" >No of Employees as per person met</td>
<td colspan="4" >No fo Employees Sighted during the Visit</td>
<td colspan="4" >Approx Salary Paid per month (Rs)</td>
</tr>
<tr>
<td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['permanant_employees_person_met'];?></td>
<td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['permanant_employees_cm'];?></td><td colspan="2" >Permanent >></td>
<td colspan="2" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[7]['permanant_employees_salary']);?></td>
</tr>
<tr>
<td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['temporary_employees_person_met'];?></td>
<td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $pd_section_data[7]['temporary_employees_cm'];?></td><td colspan="2" >Temporary >></td>
<td colspan="2" ><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[7]['temporary_employees_salary']);?></td>
</tr>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="8">General Business Information</th>
</tr>
<tr>
<td colspan="4" >Business Entity Type</td>
<td colspan="4" ><?php echo $pd_section_data[4]['business_entity_type'] ?></td>
</tr>
<tr>
<td colspan="4" >Business Activity</td>
<td colspan="4" ><?php echo $pd_section_data[4]['select_business_activity_type'] ?></td>
</tr>
<tr>
<td colspan="4" >Area of Sale</td>
<td colspan="4" ><?php echo $pd_section_data[4]['area_of_sale'] ?></td>
</tr>
</tbody></table>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="16">Seasonality of the Business</th>
</tr>
<tr>
<td colspan="4" >Business Seasonal (Yes / No)</td>
<td colspan="4" ><?php echo $pd_section_data[4]['seasonality'] ?></td>
<td colspan="4" >If Seasonal Please mention the Lean Months</td>
<?php $low_month = '';if(isset($pd_section_data[4]['low_sale_month']) && is_array($pd_section_data[4]['low_sale_month']) && count($pd_section_data[4]['low_sale_month'])){foreach($pd_section_data[4]['low_sale_month'] as $low){ $low_month .= $low.' ,';}}
if($low_month != ''){$low_month = substr_replace($low_month, '', -1);}else{$low_month = '-';}
?>
<td colspan="4" ><?php echo $low_month ?></td>
</tr>
<?php if(isset($pd_section_data[4]['low_sale_month_reason'])){?>
<tr>
<td colspan="4" >Reason</td>
<td colspan="12" ><?php echo $pd_section_data[4]['low_sale_month_reason'] ?></td>
</tr>
<?php }?>
</tbody></table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Business Assets</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[8]['display_data']) && is_array($pd_section_data[8]['display_data']) && count($pd_section_data[8]['display_data'])){?>
<thead>
<?php echo $pd_section_data[8]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[8]['display_data']['first_row']?>
<?php echo $pd_section_data[8]['display_data']['second_row']?>
<?php echo $pd_section_data[8]['display_data']['third_row']?>
<?php echo $pd_section_data[8]['display_data']['fourth_row']?>
<?php echo $pd_section_data[8]['display_data']['five_row']?>
<?php echo $pd_section_data[8]['display_data']['siz_row']?>
<?php echo $pd_section_data[8]['display_data']['seven_row']?>
</tbody>
<?php }else
{
echo '<tr> <td class = "tdcenteralign">There is no Business asset</td> </tr>';
}
?>
</table>
<?php if(isset($pd_section_data[8]['common_remarks']))
{
echo '<br><br><table class="scorecard_table"><tr> <td class = "tdcenteralign" colspan="1">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr></table>';
}?>
<!-- <div id="page_break"></div> -->
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="10" >Financial Information</th>
</tr>
<tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted </td>
<td class = "tdcenteralign" colspan="4" ><?php echo $applicant_details[0]['company_name']?></td>
</tr>
</tbody></table>
<table class="scorecard_table"><tbody>
<tr>
<th colspan="7">Particulars of Financials as per books of Accounts</th>
<?php
// $sales_pd_created_date = date('Y-m-d',strtotime($master[0]['createdon']));
// $last_four_finyrs = MYUTIL::getFinYears($sales_pd_created_date,1);
// $ordered_finyrs_data = MYUTIL::reOrderFinYrsData($section5,$last_four_finyrs);
//print_r($section5);die();
// $totol = 0;
$pd_section_data[10]['financial_info'] = array_reverse($pd_section_data[10]['financial_info']);
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
// if(is_numeric($fy_key))
// {
// $totol++;
echo '<th colspan="1" >FY - '.($fy_value['fy']).'</th>';
// }
}
?>
</tr>
<tr>
<td colspan="7">Sales / Revenue (Rs) </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($fy_value['sales_revenue'])).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit / (Net Loss) (Rs) </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($fy_value['net_profit']).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >Net Profit or (Net Loss) to Sales % </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
// echo '<td colspan="1" class="tdcenteralign">'.round((($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ),2).'%</td>';
echo '<td colspan="1" class="tdcenteralign">'.($fy_value['net_profit_sales_percent']).'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Sales over PY </td>
<?php
// $pre_year_sales = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
// echo '<td colspan="1" class="tdcenteralign">'.($fy_value['sales_py']).'</td>';
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// //echo $pre_year_sales;
// $sales_over_py = round( ((($fy_value['sales_revenue'] - $pre_year_sales) / $pre_year_sales ) * 100),2);
$sales_over_py = $fy_value['sales_py'];
echo '<td colspan="1"class="tdcenteralign" >'. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).'' . abs($sales_over_py). ' %</td>';
}
// $pre_year_sales = $fy_value['sales_revenue'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit over PY </td>
<?php
$pre_year_net_profit = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// $net_profit_over_py = round( ((($fy_value['net_profit'] - $pre_year_net_profit) / $pre_year_net_profit ) * 100),2);
$net_profit_over_py = $fy_value['netprofit_py'];
echo '<td colspan="1" class="tdcenteralign">'. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($net_profit_over_py). '% </td>';
}
// $pre_year_net_profit = $fy_value['net_profit'];
}
}
?>
</tr>
<tr>
<td colspan="7" >% <?php echo '( '.$uparrow.'/'.$downarrow.' )'?> in Net Profit % over PY </td>
<?php
$pre_year_net_pro_loss_per = 0;
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
else
{
// $year_net_pro_loss_per_over_py = round( ((( (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ) - $pre_year_net_pro_loss_per) / $pre_year_net_pro_loss_per ) * 100),2);
$year_net_pro_loss_per_over_py = $fy_value['netprofit_py_percent'];
echo '<td colspan="1" class="tdcenteralign">'. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($year_net_pro_loss_per_over_py). '% </td>';
// // echo '<td colspan="1" >'. (($year_net_pro_loss_per_over_py > 0 )? '<span style="color:green;">↑</span>' : '<span style="color:red;">↓</span>').' ( ' . $year_net_pro_loss_per_over_py. ' )</td>'; //(($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 )
}
// $pre_year_net_pro_loss_per = (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 );
}
}
?>
</tr>
<tr>
<td colspan="7">Debtor days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.number_format($fy_value['debtor_days_cet'],2,'.','') .'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7">Debtor days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.number_format($fy_value['creditor_days_cet'],2,'.','') .'</td>';
}
}
?>
</tr>
<tr>
<td colspan="7">Inventory days </td>
<?php
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
if(is_numeric($fy_key))
{
echo '<td colspan="1" class="tdcenteralign">'.number_format($fy_value['inventory_days_cet'],2,'.','') .'</td>';
}
}
?>
</tr>
</tbody></table>
<br>
<table class="scorecard_table">
<tr><th>Particulars of Financials for Latest Year as per person met during PD visit</th></tr>
</table>
<table class="scorecard_table">
<tbody>
<?php echo '<tr> <td>Sales / Revenue (Rs) </td><td class="tdcenteralign">'.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[10]['sales_amount']) .'</td> </tr>'?>
<?php echo '<tr> <td>Net Profit or (Net Loss) to Sales % </td><td class="tdcenteralign">'. $pd_section_data[10]['net_profit_to_sales_percent'] .'</td> </tr>'?>
<?php echo '<tr> <td>Net Profit / (Net Loss) (Rs) </td><td class="tdcenteralign">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[10]['net_profit_rs']) .'</td> </tr>'?>
</tbody>
</table><br>
<table class="scorecard_table">
<tr><th>Working Capital Cycle (As per Person Met during PD)</th></tr>
</table>
<table class="scorecard_table">
<tbody>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Debtor Days</td> <td colspan="2" class="tdcenteralign"</td>'.$pd_section_data[10]['debtor_days_cm'].'<td colspan="2" class="tdcenteralign">Creditor Days</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['creditor_days_cm'].'</td> <td colspan="2" class="tdcenteralign">Stock Days</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['inventory_days_cm'].'</td> </tr>'?>
<?php echo '<tr> <td colspan="4" class="tdcenteralign">Does the business have any working capital facility from any lender other than Moneywise? (Yes / No)</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['is_any_other_working_captial_facility'].'</td> <td colspan="4" class="tdcenteralign">If Yes, then details of the same to be captured</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['facility_details_specify'].'<br>('.(isset($pd_section_data[10]['facility_details_other']) ? $pd_section_data[10]['facility_details_other'] : $pd_section_data[10]['facility_details_other_lender']).')'.'</td> </tr>'?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Remarks on Financials >></td> <td colspan="10" class="tdcenteralign">'.$pd_section_data[10]['common_remarks'].'</td> </tr>'?>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Supplier Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[11]['supplier_details']) && is_array($pd_section_data[11]['supplier_details']) && count($pd_section_data[11]['supplier_details'])) { ?>
<thead>
<?php echo $pd_section_data[11]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[11]['display_data']['first_row']?>
<?php echo $pd_section_data[11]['display_data']['second_row']?>
<?php echo $pd_section_data[11]['display_data']['third_row']?>
<?php echo $pd_section_data[11]['display_data']['fourth_row']?>
<?php echo $pd_section_data[11]['display_data']['five_row']?>
<?php echo $pd_section_data[11]['display_data']['siz_row']?>
<?php echo $pd_section_data[11]['display_data']['seven_row']?>
</tbody>
<?php }
else if(isset($pd_section_data[11]['supplier_not_available_reason'])){
echo '<tr><td class="tdcenteralign">Supplier Information Not available. Reason - '.$pd_section_data[11]['supplier_not_available_reason'] .'</td></tr>';}
if(isset($pd_section_data[11]['common_remarks'])){
echo '<tr><td class="tdcenteralign">Remarks - '.$pd_section_data[11]['common_remarks'] .'</td></tr>';}
?>
</table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Client Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[12]['client_details']) && is_array($pd_section_data[12]['client_details']) && count($pd_section_data[12]['client_details'])) { ?>
<thead>
<?php echo $pd_section_data[12]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[12]['display_data']['first_row']?>
<?php echo $pd_section_data[12]['display_data']['second_row']?>
<?php echo $pd_section_data[12]['display_data']['third_row']?>
<?php echo $pd_section_data[12]['display_data']['fourth_row']?>
<?php echo $pd_section_data[12]['display_data']['five_row']?>
<?php echo $pd_section_data[12]['display_data']['siz_row']?>
<?php echo $pd_section_data[12]['display_data']['seven_row']?>
</tbody>
<?php }
else if(isset($pd_section_data[12]['client_not_available_reason'])){
echo '<tr><td class="tdcenteralign">Client Information Not available. Reason - '.$pd_section_data[12]['client_not_available_reason'] .'</td></tr>';}
if(isset($pd_section_data[12]['common_remarks'])){
echo '<tr><td class="tdcenteralign">Remarks - '.$pd_section_data[12]['common_remarks'] .'</td></tr>';}
?>
</table><br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Details of Stock Sighted during the PD visit</th>
</tr>
<?php if(isset($pd_section_data[13]['stock_details']) && is_array($pd_section_data[13]['stock_details']) && count($pd_section_data[13]['stock_details']) ){?>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="1">Type of Stock (RM / FG)</th>
<th colspan="3">Stock Item</th>
<th colspan="2">Approx Stock Value (Rs)</th>
<th colspan="1">Approx Stock Quantity</th>
</tr>
<?php
foreach ($pd_section_data[13]['stock_details'] as $section13_key => $section13_value)
{
echo '<tr><td class="tdcenteralign" colspan="1">'.($section13_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section13_value['stock_type'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['estimated_stock_value']) ? $section13_value['estimated_stock_value'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section13_value['estimated_quantity']) ? $section13_value['estimated_quantity'].' '.$section13_value['estimated_uom'] : 'NA').'</td>'.'</tr>';
}
if(isset($pd_section_data[13]['estimated_uom']))
{
echo '<tr><td class="tdcenteralign" colspan="4">Does stock sighted justify the business operations ? (Yes / No)</td>';
echo '<td class="tdcenteralign" colspan="4">'.( ucfirst($pd_section_data[13]['estimated_uom']) ) .'</td></tr>';
}
}
else if(isset($pd_section_data[13]['stock_not_available_reason']))
{
echo '<tr><td class="tdcenteralign" colspan="8">Stock Information Not available. Reason - '.$pd_section_data[13]['stock_not_available_reason'] .'</td></tr>';
}
if(isset($pd_section_data[13]['common_remarks'])){
echo '<tr><td class="tdcenteralign" colspan="8">Remarks - '.$pd_section_data[13]['common_remarks'] .'</td></tr>';}
?>
</tbody></table>
<br>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Future Plans & Business Environment</th>
</tr>
<tr><td colspan="4">USP of the business (How applicants business is different from others in the business)</td><td colspan="4"><?php echo $pd_section_data[14]['usp_of_business'];?></td></tr>
<tr><td colspan="4">Future plan for business expansion</td><td colspan="4"><?php echo $pd_section_data[14]['future_business_expansion'];?></td></tr>
<tr><td colspan="4">Key competitors in the business</td><td colspan="4"><?php echo $pd_section_data[14]['key_competitors'];?></td></tr>
<tr><td colspan="4">Succession Plan for business</td><td colspan="4"><?php echo $pd_section_data[14]['sucession_plan'];?></td></tr>
<tr><td colspan="4">Brief of other group concerns/
Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[14]['other_group_business_applicants'];?></td></tr>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Business Banking & Personal Banking</th>
</tr>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="2">Account Holder's Name</th>
<th colspan="3">Bank Name</th>
<th colspan="1">Account Type</th>
<th colspan="1">OD / CC Limit</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
<?php
if(isset($pd_section_data[9]))
{
foreach ($pd_section_data[9]['banking_details'] as $section9_key => $section9_value)
{
// $vintage = $section9_value['vintage_year'].'Yr(s)';
// $vintage .= (isset($section9_value['vintage_month']) && $section9_value['vintage_month'] != 0 ? (' & '.$section9_value['vintage_month'].'Mt(s)') : '');
echo '<tr><td class="tdcenteralign" colspan="1">'.($section9_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section9_value['applicant_name'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.(isset($section9_value['bank_name']) ? $section9_value['bank_name'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['account_type']) ? $section9_value['account_type'] : 'NA').'</td>'.
// '<td class="tdcenteralign" colspan="1">'.(isset($section14_value['estimated_quantity']) ? $section14_value['estimated_quantity'].' '.$section14_value['estimated_uom'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['cc_limit']) ? $section9_value['cc_limit'] : '-').'</td>'.'</tr>';
}
// if(isset($pd_section_data[13]['estimated_uom']))
// {
// echo '<tr><td class="tdcenteralign" colspan="4">Does stock sighted justify the business operations ? (Yes / No)</td>';
// echo '<td class="tdcenteralign" colspan="4">'.( ucfirst($pd_section_data[13]['estimated_uom']) ) .'</td></tr>';
// }
}
?>
</tbody></table>
<br>
<!-- <table class="scorecard_table">
<tr><th class="thlargefont" colspan="<?php echo (count($pd_section_data[15]['existing_loan_details']) + 1 )?>">Existing Loan Obligations</th></tr>
</table>
<br>
<table class="scorecard_table">
<thead>
<?php echo $pd_section_data[15]['display_data']['header_row']?>
</thead>
<tbody>
<?php echo $pd_section_data[15]['display_data']['first_row']?>
<?php echo $pd_section_data[15]['display_data']['second_row']?>
<?php echo $pd_section_data[15]['display_data']['third_row']?>
<?php echo $pd_section_data[15]['display_data']['fourth_row']?>
<?php echo $pd_section_data[15]['display_data']['five_row']?>
<?php echo $pd_section_data[15]['display_data']['install_fre_row']?>
<?php echo $pd_section_data[15]['display_data']['siz_row']?>
<?php echo $pd_section_data[15]['display_data']['seven_row']?>
<?php echo $pd_section_data[15]['display_data']['eight_row']?>
</tbody>
</table> -->
<table class="scorecard_table">
<tr>
<th>Existing Loan Obligations</th>
</tr>
</table>
<br>
<table class="scorecard_table">
<thead>
<tr>
<th colspan="">Sr. No.</th>
<th colspan="">Loan<br>Type</th>
<th colspan="">Loan Amount </th>
<th colspan="">Availed From </th>
<th colspan="">Borrower`s Name </th>
<th colspan="">Instalment Amount (Rs) </th>
<th colspan="">Instalment Frequency (Rs) </th>
<th colspan="">Original Tenure (Mnts) </th>
<th colspan="">Elapsed Tenure (Mnts) </th>
<th colspan="">Balance Tenure (Mnts)</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
</thead>
<tbody>
<?php
foreach ($pd_section_data[15]['existing_loan_details'] as $key15 => $value15)
{
echo '<tr><td class="tdcenteralign">'. ($key15 + 1) .'</td><td>'. $value15['loan_type'] .'</td><td>'.$rupee_symbol.MYUTIL::customIndianNumberFormat($value15['loan_amount']).'</td><td>'.$value15['lender_name'].'</td><td>'.$value15['loan_taken_by'].'</td><td class="tdcenteralign">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($value15['instalment_amount']).'</td><td class="tdcenteralign">'.$value15['instalment_frequency'].'</td><td class="tdcenteralign">'.$value15['original_tenure_months'].'</td><td class="tdcenteralign">'.$value15['current_tenure_months'].'</td><td class="tdcenteralign">'.$value15['elapsed_tenure_months'].'</td></tr>';
}
?>
</tbody>
</table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Neighbour Details</th></tr>
</table>
<table class="scorecard_table">
<!-- <thead>
<?php echo $pd_section_data[12]['display_data']['header_row']?>
</thead> -->
<tbody>
<?php echo $pd_section_data[17]['display_data']['first_row']?>
<?php echo $pd_section_data[17]['display_data']['second_row']?>
<?php echo $pd_section_data[17]['display_data']['third_row']?>
<?php echo $pd_section_data[17]['display_data']['fourth_row']?>
<?php echo $pd_section_data[17]['display_data']['five_row']?>
<!-- <?php echo $pd_section_data[17]['display_data']['siz_row']?>
<?php echo $pd_section_data[17]['display_data']['seven_row']?> -->
</tbody>
</table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="2">Credit Manager Specific Queries</th>
</tr>
<tr>
<th colspan="1">Question</th>
<th colspan="1">Answer</th>
</tr>
<?php
if(isset($pd_section_data[18]))
{
foreach ($pd_section_data[18]['cm_queries'] as $section18_key => $section18_value)
{
echo '<tr><td class="tdcenteralign" colspan="1">'.$section18_value['question'] .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section18_value['answer'].'</td>'.'</tr>';
}
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Final Remarks of PD officer</th>
</tr>
<?php
$customer_behaviour = array('1' => 'Others','2' => 'Rude','3' => 'Polite');
$over_all = array('2' => 'Positive','3' => 'Negative');
?>
<tr><td colspan="4">Customer Behaviour
[Polite / Rude / Others (Please specify)]</td><td colspan="4"><?php echo isset($pd_section_data[19]['customer_behaviour_other']) ? $pd_section_data[19]['customer_behaviour_other'] : $customer_behaviour [ $pd_section_data[19]['customer_behaviour'] ];?></td></tr>
<tr><td colspan="4">Suitability of Business Location
[Well Suited / Fairly Suited / Not Suited]</td><td colspan="4"><?php echo $pd_section_data[19]['business_location_suited'];?></td></tr>
<tr><td colspan="4">PD Officer's overall assessment
(Positive / Negative)</td><td colspan="4"><?php echo $over_all [ $pd_section_data[19]['pd_officer_recommendation'] ];?></td></tr>
<?php
$reason = '';
foreach($pd_section_data[19]['pd_officer_recommendation_remarks'] as $key => $val)
{ $reason .= ($key + 1).' '.$val['reason'].'<br>'; }
?>
<tr><td colspan="4">PD Officer's key points considered while arriving at the
aforementioned status</td><td colspan="4"><?php echo $reason;?></td></tr>
</tbody></table>
<div id="page_break"></div>
<br><table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Satellite Image of PD Location</th></tr></table><br>
<p><b>GPS Coordinates of location where PD Visit was done : <?php echo $pd_master_details[0]['start_location'] ? $pd_master_details[0]['start_location'] : '-'; ?></b></p>
<?php if($pd_master_details[0]['start_location']) { ?>
<img style="border:3px solid #0191ed;" src = "<?php echo 'data:image/gif;base64,'.$satellite[0]['img']; ?>" alt = "PD Visted Location Satellite Image " height="300px" width="630px">
<?php
}else{ echo '<p>Due to location access not provided by loan applicant Geo coordinates on photographs and Satellite image of PD location is not shown</p>';}
?>
<?php
$iter = 0;
$photo_names = array('person_met' => 'Selfie with person met','person_met_id_proof' => 'Person met ID Proof','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','supplier_image' => 'Supplier Bills','client_image' => 'Client Bills','machinary_image' => 'Machinary Image');
// if($master[0]['sales_pd_type'] == 2){ $photo_names['selfie_with_person_met'] = 'Selfie of the person contacted';}
// echo count($smc_images);die();
//print_r(array_keys($section9));die();
$tot_rows = ceil(count($smc_images) / 3);
if(count($smc_images))
{
echo '<div id="page_break"></div>';
echo '<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Photograph`s</th></tr></table><br><table ><tbody>';
$add_factor = 0;
for($row = 0;$row < $tot_rows; $row++)
{
echo '<tr>';
$from = $row == 0 ? $row : ($row+$add_factor);
$to = ($from + 2);
$add_factor = $add_factor + 2;
for($i = $from ; $i <= $to; $i++)
{
if(isset($smc_images[$i]))
{
echo '<td style="text-align:center;border:1px solid;"> <img src="'.$smc_images[$i]['img'].'" height = "200" width="200" alt="'.$smc_images[$i]['img_name'].'"/><br>'.$photo_names [ $smc_images[$i]['img_name'] ].'</td>';
}
//unset($p_key);
}
echo '</tr>';
}
echo '</tbody></table>';
}?>
<br><br>
<table class="scorecard_table">
<tbody>
<tr>
<td colspan="3" >Name of PD Offier </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby']?></td>
</tr>
<tr>
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby_designation']?></td>
</tr>
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['pd_visit_date']?></td>
</tr>
</tbody>
</table>
</body>
</html>