This commit is contained in:
venbatechnologies@gmail.com 2021-03-24 16:56:36 +05:30
commit 71e0f61513
14 changed files with 1083 additions and 35 deletions

View File

@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption','readexceldata');
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption','readexceldata','loanform');
/*
| -------------------------------------------------------------------

View File

@ -99,7 +99,7 @@ defined('SAVEROOMINFO_API') OR define('SAVEROOMINFO_API', 'saveRoomInfo')
defined('SAVESMCCREDITPDIMAGE_API') OR define('SAVESMCCREDITPDIMAGE_API', 'saveSMCCreditPDImage'); // no errors
defined('GETSMCPDIMGSECTIONDATA_API') OR define('GETSMCPDIMGSECTIONDATA_API', 'getSMCPDImgSectionData'); // no errors
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors
defined('CAMUNDA_URL') OR define('CAMUNDA_URL','http://34.121.71.79:8080/engine-rest/');
/*********************AWS resources Constants*************************************************/
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
if(ENVIRONMENT == 'development')

View File

@ -302,6 +302,7 @@ $route['filterSalesPDList']='Sales_PD_Controller/filterSalesPDList';
$route['generateSatelliteImg']='Sales_PD_Controller/generateSatelliteImg';
$route['getSalesPDImgDataCusLink']='Sales_PD_Controller/getSalesPDImgDataCusLink';
$route['sendSalesCusLinkViaSMS']='Sales_PD_Controller/sendSalesCusLinkViaSMS';
$route['camundaTest']='Sales_PD_Controller/camundaTest';
$route['listSMCCreditPD/(:num)']='SMC_Credit_PD_Controller/listSMCCreditPD';

View File

@ -1023,7 +1023,7 @@ class PD_Controller extends REST_Controller {
$pd_details['is_cus_link_disabled'] = 1;
}
if(isset($pd_details['pd_status']) && ($pd_details['pd_status'] == TRIGGERED || $pd_details['pd_status'] == INITIATED))
if(isset($pd_details['pd_status']) && ($pd_details['pd_status'] == TRIGGERED || $pd_details['pd_status'] == INITIATED || $pd_details['pd_status'] == INPROGRESS))
{
/***********************CHOOSE PD TEMPALATE*********************/
@ -6079,6 +6079,8 @@ public function getPDFormDetailsJSON_post()
public function codeigniterViewTest_post()
{
// echo "i am here";
// exit();
// $host = getenv('DB_HOST');
// echo $this->config->item('new_db_variable');
// echo MY_CONSTANT;
@ -6139,7 +6141,8 @@ public function getPDFormDetailsJSON_post()
{
mkdir($this->external_path.'/pd_reports/'.$pdid,0761);
}
// echo "finally";
// exit();
// $this->load->helper('DIFFCHECK');
// $old_version = $this->external_path.'/pd_reports/'.$pdid.'/a.html';
@ -6231,7 +6234,7 @@ public function getPDFormDetailsJSON_post()
$data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid);
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
print_r($data['pd_master_details']);die();
// print_r($data['pd_master_details']);die();
//$data['satellite_path'] = $this->external_path.'/pd_reports/'. $pdid .'/satellite.png';
// $data['pd_master_details'][0]['lender_short_name'] = 'CLIXH';
// $data['pd_master_details'][0]['product_abbr'] = 'HL';
@ -8415,9 +8418,13 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
function getLatestPDReportHTMLFile($pdid,$random_string,$return_type = false)
{
// echo "now i am in child function ";
// exit();
if(($pdid != null || $pdid != "")) //&& (strlen($pdid) == 16) &&(is_string($pdid)))
{
$pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $random_string,'pd_id' => $pdid),PDTRIGGER);
// print_r($pd_data);exit();
if(count($pd_data))
{
@ -8431,6 +8438,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
}
file_put_contents($temp_file_path,$report_data);
$view_name = 'pd_reports/'. $pd_data[0]['pd_id'] .'/temp.html';
// echo $view_name;
// die();
return $this->load->view($view_name,array(),$return_type);
@ -11019,15 +11028,28 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if(!empty($_FILES['video_file']))
{
$folder_to_check = XLPATH.'/pd_reports/'.$records['fk_pd_id'].'/videos';
if(!file_exists($folder_to_check))
{
mkdir($folder_to_check,0777);
}
// die();
// $modified_fname = $records['rand_key'].'~'.str_replace(' ','_',($_FILES['pd_excel_data']['name']));
$modified_fname = str_replace(' ','_',($_FILES['video_file']['name']));
// echo file_exists($folder_to_check);die();
$config = array('upload_path' => $folder_to_check,'overwrite' => TRUE,'allowed_types' => '*','file_name' => $modified_fname);
$this->load->library('upload', $config);
$this->upload->initialize($config);
try {
if($this->upload->do_upload('video_file'))
{
log_message('ERROR','video uplaod done :' . $folder_to_check);
$sourcefile = $folder_to_check.'/'.$modified_fname;
// echo $sourcefile;
$key = 'pd'.$records['fk_pd_id'].'/video/'.$modified_fname;
@ -11043,6 +11065,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
unlink($sourcefile);
}
}
else
{
log_message('ERROR','video uplaod failed :' . $folder_to_check);
}
} catch (Exception $e) {
log_message('ERROR','video uplaod failed exception:' . $folder_to_check.' - '.$e->getMessage());
}
// die();
if($is_bucket_upload_sucess && $id)
@ -11124,14 +11154,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if($user_details['data'][0]['user_role'] == 26)//Credit Manager
{
//get RCM and allocate to RCM
$rcm = $this->SMC_Credit_PD_Model->getSMCFlowUsers($existing_pd_details[0]['fk_city'],27);
$rcm = $this->SMC_Credit_PD_Model->getSMCFlowUsers($existing_pd_details[0]['fk_state'],27);
if(count($rcm))
{
$pd_details['fk_pd_allocated_to'] = $rcm[0]['userid'];
}
else
{
log_message('ERROR',('### Couldnot find RCM users in BOUNCED status - '.$existing_pd_details[0]['fk_city']));
log_message('ERROR',('### Couldnot find RCM users in BOUNCED status - '.$existing_pd_details[0]['fk_state']));
}

View File

@ -1575,7 +1575,7 @@ public function filterSalesPDList_post() {
// print_r($view_data);
// 25 "product_abbr": "NBFC/MFI",
if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){
$html_content = $this->load->view('smc_creditpd_reports/MWISE2',$view_data,true);
$html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true);
}else{
$html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true);
}

View File

@ -9,6 +9,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . '/libraries/REST_Controller.php';
include_once APPPATH.'/vendor/autoload.php';
class Sales_PD_Controller extends REST_Controller {
@ -22,6 +23,7 @@ class Sales_PD_Controller extends REST_Controller {
$this->load->library('AWS_S3');
$this->load->library('pdfgenerator');
$this->load->helper('satellite_image');
$this->load->helper('camunda');
$this->load->library('phpmailer_library');
@ -549,6 +551,9 @@ class Sales_PD_Controller extends REST_Controller {
$records['sales_pd_sno'] = $salepd_serial_no;
// print_r($records);die();
$id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA);
//start camunda process
CAMUNDA::startSalesPDInstance($id);
}
else
{
@ -659,6 +664,8 @@ class Sales_PD_Controller extends REST_Controller {
//echo 'final';die();
$id = $this->Sales_PD_Model->updateRecords($records,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id']));
CAMUNDA::completeSalesPDTask($id);
$this->prepareSalesPDReport($records['sales_pd_id'],false);
sleep(10);
log_message('ERROR','####SALESPD AFTER 10 PREPARED REPORT'.$records['sales_pd_id']);
@ -1191,6 +1198,15 @@ public function filterSalesPDList_post() {
}
}
public function camundaTest_post()
{
// echo 'hi';
CAMUNDA::completeSalesPDTask(1);
//CAMUNDA::startSalesPDInstance(1);
}
}

View File

@ -0,0 +1,154 @@
<?php
class CAMUNDA
{
//include_once APPPATH.'/vendor/autoload.php';
//create a new instance
public static function startNewInstance($process_def_id,$data = array())
{
$url = CAMUNDA_URL.'process-definition/'.$process_def_id.'/start';
$client = new \GuzzleHttp\Client();
try {
$response = $client->post( $url, [
'headers' => ['Content-Type' => 'application/json']
//'body' => json_encode($data)
]);
if($response && $response->getStatusCode() == 200)
{
return (json_decode(($response->getBody()->getContents())));
// echo $response->getBody()->getContents()->id;
// echo $response->getBody()->getContents()['id'];
// die();
}
else
{
return null;
}
} catch (Exception $e) {
//return null;
echo $e->getMessage();
}
}
// complete an activity in an instance or instance
public static function completeInstance($instanceID,$data = array())
{
$url = CAMUNDA_URL.'task/'.$instanceID.'/complete';
$client = new \GuzzleHttp\Client();
$response = $client->post( $url, [
'headers' => ['Content-Type' => 'application/json']
//'body' => json_encode($data)
]);
if($response && $response->getStatusCode() == 200)
{
return json_encode($response->getBody()->getContents());
}
else
{
return null;
}
}
public static function getListOfInstanceByProcessDefinitionKey($processDefinitionKey,$data = array())
{
$url = CAMUNDA_URL . 'task?processDefinitionKey='.$processDefinitionKey;
// echo $url;//die();
$client = new \GuzzleHttp\Client();
$response = $client->request('GET',$url);
// $client = new \GuzzleHttp\Client();
// $res = $client->get( $url, [
// 'headers' => ['Content-Type' => 'application/json'],
// 'body' => json_encode($data)
// ]);
if($response && $response->getStatusCode() == 200)
{
return json_decode($response->getBody()->getContents());
}
else
{
return null;
}
// print_r();
// print_r($response->getStatusCode());
}
public static function startSalesPDInstance($sales_pd_id)
{
$CI =& get_instance();
if($sales_pd_id)
{
$newProcessInstanceID = SELF::startNewInstance('sales_pd_demo:1:38949d25-8c83-11eb-a4f2-42010a800002');
if($newProcessInstanceID && property_exists($newProcessInstanceID, 'id'))
{
$updated = $CI->Sales_PD_Model->updateRecords(array('t_process_instance_id' => $newProcessInstanceID->id),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
log_message('ERROR','####Camunda start new instance success - ', $sales_pd_id);
}
else
{
log_message('ERROR','####Camunda start new instance failed - ', $sales_pd_id);
}
}
}
public static function completeSalesPDTask($sales_pd_id)//completeSalesPDTask ot instance
{
$CI =& get_instance();
if($sales_pd_id)
{
$fields=array('t_process_instance_id');
$sales_pd_data = $CI->Sales_PD_Model->selectCustomRecords($fields,array('sales_pd_id' => $sales_pd_id),SALES_PD_DATA);
if($sales_pd_data && count($sales_pd_data))
{
//get list of task
$task_id = null;
$list_of_task = SELF::getListOfInstanceByProcessDefinitionKey('sales_pd_demo');
if($list_of_task && count($list_of_task))
{
foreach ($list_of_task as $task_key => $task)
{
if($sales_pd_data[0]['t_process_instance_id'] == $task->processInstanceId)
{
$task_id = $task->id;
break;
}
}
}
else
{
log_message('ERROR','####Couldn`t identify Camunda instance - ', $sales_pd_id);
}
if($task_id)
{
SELF::completeInstance($task_id);
}
else
{
log_message('ERROR','####Couldn`t identify task id - ', $sales_pd_id);
}
}
else
{
log_message('ERROR','#### could not get sales pd data - ', $sales_pd_id);
}
}
}
}
?>

View File

@ -0,0 +1,84 @@
<?php
class Loanform
{
public static function getanchordetails($loan_form){
$anchor_details_display = array();
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
$facility_amt = MYUTIL::customIndianNumberFormat($loan_form['facility_amount']);
$monthly_business_anchor_amt = MYUTIL::customIndianNumberFormat($loan_form['monthly_business_anchor']);
$average_invoicevalue_amt = MYUTIL::customIndianNumberFormat($loan_form['average_invoicevalue']);
$stock_related_amt = MYUTIL::customIndianNumberFormat($loan_form['stock_related_anchor']);
// $facility_amt = $loan_form['facility_amount'];
// $monthly_business_anchor_amt = $loan_form['monthly_business_anchor'];
// $average_invoicevalue_amt = $loan_form['average_invoicevalue'];
// $stock_related_amt = $loan_form['stock_related_anchor'];
$payment_mechanism_arr = array('bill_wise' => 'Bill Wise','open_account' => 'Open Account');
$sales_low_months=SELF::getMonths($loan_form['sales_low_months']);
// if($loan_form['vintage_anchor_year'] > 1 ){ $yr = $loan_form['vintage_anchor_year']."Yrs";}
// else if($loan_form['vintage_anchor_year'] == 1 ){ $yr = $loan_form['vintage_anchor_year']."Yr"; }
// else{ $yr = ''; }
// if($loan_form['vintage_anchor_month'] > 1 ){ $mnt = $loan_form['vintage_anchor_month']."Months";}
// else if($loan_form['vintage_anchor_month'] == 1 ){ $mnt = $loan_form['vintage_anchor_month']."Month"; }
// else{ $mnt = ''; }
// if($mnt != '' && $yr != '' ){ $yrandmnt = $yr.' and '.$mnt; }
// else if($mnt == '' && $yr != ''){ $yrandmnt = $yr; }
// else if($mnt != '' && $yr == ''){ $yrandmnt = $mnt; }
// else{ $yrandmnt = '-';}
$anchor_details_display[] = array('particulars' => "Facility Amount Applied For (".$rupee_symbol.")",'details' => $rupee_symbol." ".$facility_amt.' ('.MYUTIL::numtowords($loan_form['facility_amount']).')');
$anchor_details_display[] = array('particulars' => "Name of Anchor",'details' => $loan_form['anchor_name']);
$anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year",'details' => $loan_form['vintage_anchor_year']);
$anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Month",'details' => $loan_form['vintage_anchor_month']);
// $anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year and Month",'details' => $yrandmnt );
$anchor_details_display[] = array('particulars' => "Monthly business (sale/purchase) with the Anchor (".$rupee_symbol.")",'details' => $rupee_symbol." ".$monthly_business_anchor_amt.' ('.MYUTIL::numtowords($loan_form['monthly_business_anchor']).')');
$anchor_details_display[] = array('particulars' => "Business concentration with Anchor",'details' => $loan_form['business_concentration'].' %');
$anchor_details_display[] = array('particulars' => "Credit period with the Anchor (Days)",'details' => $loan_form['credit_period_days']);
$anchor_details_display[] = array('particulars' => "Payment Mechanism",
'details' => $payment_mechanism_arr[$loan_form['payment_mechanism']]);
$anchor_details_display[] = array('particulars' => "Average Invoice Value (".$rupee_symbol.")",'details' => $rupee_symbol." ".$average_invoicevalue_amt.' ('.MYUTIL::numtowords($loan_form['average_invoicevalue']).')');
$anchor_details_display[] = array('particulars' => "Are there peak seasons for the business with Anchor",'details' => ucfirst($loan_form['peakseasons_anchor']));
if($loan_form['peakseasons_anchor']=='yes')
{
$anchor_details_display[] = array('particulars' => "Months in which sales/service is low?",'details' => $sales_low_months );
$anchor_details_display[] = array('particulars' => "Comments",'details' => $loan_form['peak_season_comment'] );
}
$anchor_details_display[] = array('particulars' => "Are there debit/credit notes being issued to/by Anchor",'details' => ucfirst($loan_form['anchor_notes']));
if($loan_form['anchor_notes']=='yes'){
$anchor_details_display[] = array('particulars' => "Reason for such debit/credit notes",'details' => ucfirst($loan_form['debitcredit_notes']) );
}
$anchor_details_display[] = array('particulars' => "Value of stock related to Anchor (".$rupee_symbol.")",'details' => $rupee_symbol." ".$stock_related_amt.' ('.MYUTIL::numtowords($loan_form['stock_related_anchor']).')');
$anchor_details_display[] = array('particulars' => "Observations on Sample Invoices",'details' => $loan_form['sample_invoices'] );
return $anchor_details_display;
// print_r($anchor_details_display);
}
public static function getMonths($details) {
foreach($details as $key=>$value){
$getRow=$getRow;
$getRow .= ($key==0) ? "":($key==count($details)-1 ? ' and ' : ",");
switch($value) {
case 1:$getRow .='January';break;
case 2:$getRow .='February';break;
case 3:$getRow .='March';break;
case 4:$getRow .='April';break;
case 5:$getRow .='May';break;
case 6:$getRow .='June';break;
case 7:$getRow .='July';break;
case 8:$getRow .='August';break;
case 9:$getRow .='September';break;
case 10:$getRow .='October';break;
case 11:$getRow .='November';break;
case 12:$getRow .='December';break;
}
}
return $getRow;
}
}
?>

View File

@ -26,11 +26,12 @@ class Dash_Board_Model extends SPARQ_Model {
public function getDetailsOfPDType($fdate,$tdate,$cityarr,$lenderarr)
{
$smc_lender_id = (ENVIRONMENT == 'production' ? 7 : 35)
if(($lenderarr != "" || $lenderarr != null)&& ($cityarr != "" || $cityarr != null) && ($fdate && $tdate != '')){
$sql_query = "SELECT if(fk_pd_type = 1,'FULL',if(fk_pd_type = 2,'SMART',if(fk_pd_type = 3,'TELE','NULL'))) as PDTYPE,pd_status,count(*) as count FROM t_pd_triggered where MONTH(createdon) = MONTH(CURDATE()) group by fk_pd_type,pd_status;";
$sql_query = "SELECT if(fk_pd_type = 1,'FULL',if(fk_pd_type = 2,'SMART',if(fk_pd_type = 3,'TELE','NULL'))) as PDTYPE,pd_status,count(*) as count FROM t_pd_triggered where MONTH(createdon) = MONTH(CURDATE()) AND fk_lender_id != $smc_lender_id group by fk_pd_type,pd_status;";
}
else{
$sql_query = "SELECT if(fk_pd_type = 1,'FULL',if(fk_pd_type = 2,'SMART',if(fk_pd_type = 3,'TELE','NULL'))) as PDTYPE,pd_status,count(*) as count FROM t_pd_triggered where ";
$sql_query = "SELECT if(fk_pd_type = 1,'FULL',if(fk_pd_type = 2,'SMART',if(fk_pd_type = 3,'TELE','NULL'))) as PDTYPE,pd_status,count(*) as count FROM t_pd_triggered where fk_lender_id != $smc_lender_id AND";
if($lenderarr != "")
{

View File

@ -278,6 +278,10 @@ class PD_Model extends SPARQ_Model {
{
$this->db->WHERE_IN('PDTRIGGER.fk_lender_id',$pd_lender);
}
else
{
$this->db->WHERE('PDTRIGGER.fk_lender_id != ',(ENVIRONMENT == 'production' ? 7 : 35));
}
if($pd_applicant_lender_ref != "" || $pd_applicant_lender_ref != null )
{

View File

@ -1308,11 +1308,10 @@ if ( isset($pdf) ) {
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution );
}
}
if($pd_master_details[0]['lender_short_name'] != 'UDAAN' || $pd_master_details[0]['lender_short_name'] != 'CFPL')
{
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL')){
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}
if(!$is_current_product_bl && !$is_current_product_laep)
{
@ -1371,6 +1370,23 @@ if ( isset($pdf) ) {
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
<br><p contenteditable="true"><b>Anchor Details Section:</b></p>
<table class="scorecard_table_resonal_assest">
<tr> <th style="text-align:center;">S.No</th> <th> Particulars</th> <th> Particular Details</th> </tr>
<tbody>
<?php
foreach($anchor_details_display as $row_key => $row)
{
echo '<tr> <td style="text-align:center;width:25px;">'.($row_key + 1)."</td> <td>".$row['particulars']."</td> <td>".$row['details'] ."</td> </tr>";
}
?>
</tbody>
</table>
<?php } ?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -2217,6 +2233,18 @@ if($total_no_of_business > 0) {
case 7:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit'];
break;
case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name'];
break;
case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount'];
break;
case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type'];
break;
case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor'];
break;
case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date'];
break;
case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi'];
break;
}
}
}
@ -2225,8 +2253,14 @@ if($total_no_of_business > 0) {
$bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null;
//print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']);
array_push($businessFinancialResult,$bindBusinessFinancial);
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null );
}
array_push($businessFinancialResult,$bindBusinessFinancial);
?>
@ -2294,19 +2328,19 @@ if($total_no_of_business > 0) {
</table>
<?php
echo '<br><p>' . $comments_on_financials . '</p>';
}
}
else { if($pd_master_details[0]['fk_pd_type'] == 1) { echo "<p>Financial statements not provided by ".$loan_word." Applicants to PD officer. </p>";} }
// if($pd_master_details[0]['lender_short_name'] != 'CFPL' ) {}
?>
<!-- customer finance statements-->
<p><?php echo $iterateFinance['financial_customer']; ?></p>
<?php
if($iterateFinance['is_customer_statement'])
{
if(count($iterateFinance['customer_statements'])>0){
@ -2463,7 +2497,27 @@ if($total_no_of_business > 0) {
echo '<br>Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY'];
}
?>
<p><strong>Working Capital Cycle:</strong></p>
<!--################ Buisness Financial Information - Title Changes for CFPL lender ###################-->
<?php
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$business_fin_sub_title1 = 'Total Banking Cycle';
$business_fin_sub_title2 = 'Total Banking Facilities';
}else{ $business_fin_sub_title1 = 'Working Capital Cycle';
$business_fin_sub_title2 = 'Working Capital Facilities';
}
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Details</th> </tr> </thead>
<tbody>
<?php foreach($iterateFinance['cfpl_lender_details'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td class="customtd">'.$facility['name'].'</td> <td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
<?php } ?>
<p><strong><?php echo $business_fin_sub_title1.' :'; ?></strong></p>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Days</th> </tr> </thead>
<tbody>
@ -2475,18 +2529,18 @@ if($total_no_of_business > 0) {
<?php if($iterateFinance['is_working_capital_facility'] != "" ){ ?>
<p><strong>Working Capital Facilities:</strong></p>
<p><strong><?php echo $business_fin_sub_title2.' :'; ?></strong></p>
<?php if(strcasecmp($iterateFinance['is_working_capital_facility'],'no')){?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Facility Type</th> <th>Facility Details</th> </tr> </thead>
<tbody>
<?php foreach($iterateFinance['working_capital_facilites'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td class="customtd">'.$facility['name'].'</td> <td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
<?php }else{echo "<p>The Loan Applicants have not availed any Working Capital Facilities from any financial institution.<p>";}
<?php }else{echo "<p>The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.<p>";}
}
?>

View File

@ -1306,7 +1306,7 @@ if ( isset($pdf) ) {
}
}
if($pd_master_details[0]['lender_short_name'] != 'UDAAN' || $pd_master_details[0]['lender_short_name'] != 'CFPL')
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL'))
{
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
}
@ -1368,6 +1368,23 @@ if ( isset($pdf) ) {
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
<br><p contenteditable="true"><b>Anchor Details Section:</b></p>
<table class="scorecard_table_resonal_assest">
<tr> <th style="text-align:center;">S.No</th> <th> Particulars</th> <th> Particular Details</th> </tr>
<tbody>
<?php
foreach($anchor_details_display as $row_key => $row)
{
echo '<tr> <td style="text-align:center;width:25px;">'.($row_key + 1)."</td> <td>".$row['particulars']."</td> <td>".$row['details'] ."</td> </tr>";
}
?>
</tbody>
</table>
<?php } ?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -2214,6 +2231,18 @@ if($total_no_of_business > 0) {
case 7:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit'];
break;
case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name'];
break;
case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount'];
break;
case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type'];
break;
case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor'];
break;
case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date'];
break;
case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi'];
break;
}
}
}
@ -2222,7 +2251,13 @@ if($total_no_of_business > 0) {
$bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null;
//print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']);
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null );
}
array_push($businessFinancialResult,$bindBusinessFinancial);
?>
@ -2460,7 +2495,27 @@ if($total_no_of_business > 0) {
echo '<br>Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY'];
}
?>
<p><strong>Working Capital Cycle:</strong></p>
<!--################ Buisness Financial Information - Title Changes for CFPL lender ###################-->
<?php
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$business_fin_sub_title1 = 'Total Banking Cycle';
$business_fin_sub_title2 = 'Total Banking Facilities';
}else{ $business_fin_sub_title1 = 'Working Capital Cycle';
$business_fin_sub_title2 = 'Working Capital Facilities';
}
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Details</th> </tr> </thead>
<tbody>
<?php foreach($iterateFinance['cfpl_lender_details'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td class="customtd">'.$facility['name'].'</td> <td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
<?php } ?>
<p><strong><?php echo $business_fin_sub_title1.' :'; ?></strong></p>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Days</th> </tr> </thead>
<tbody>
@ -2472,7 +2527,7 @@ if($total_no_of_business > 0) {
<?php if($iterateFinance['is_working_capital_facility'] != "" ){ ?>
<p><strong>Working Capital Facilities:</strong></p>
<p><strong><?php echo $business_fin_sub_title2.' :'; ?></strong></p>
<?php if(strcasecmp($iterateFinance['is_working_capital_facility'],'no')){?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Facility Type</th> <th>Facility Details</th> </tr> </thead>
@ -2483,7 +2538,7 @@ if($total_no_of_business > 0) {
}?>
</tbody>
</table>
<?php }else{echo "<p>The Loan Applicants have not availed any Working Capital Facilities from any financial institution.<p>";}
<?php }else{echo "<p>The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.<p>";}
}
?>

View File

@ -1312,8 +1312,8 @@ if ( isset($pdf) ) {
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution );
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
if(!($pd_master_details[0]['lender_short_name'] == 'UDAAN' || $pd_master_details[0]['lender_short_name'] == 'CFPL')){
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );}
if(!$is_current_product_bl && !$is_current_product_laep)
{
@ -1372,6 +1372,23 @@ if ( isset($pdf) ) {
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
<br><p contenteditable="true"><b>Anchor Details Section:</b></p>
<table class="scorecard_table_resonal_assest">
<tr> <th style="text-align:center;">S.No</th> <th> Particulars</th> <th> Particular Details</th> </tr>
<tbody>
<?php
foreach($anchor_details_display as $row_key => $row)
{
echo '<tr> <td style="text-align:center;width:25px;">'.($row_key + 1)."</td> <td>".$row['particulars']."</td> <td>".$row['details'] ."</td> </tr>";
}
?>
</tbody>
</table>
<?php } ?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -2219,6 +2236,18 @@ if($total_no_of_business > 0) {
case 7:
$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit'];
break;
case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name'];
break;
case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount'];
break;
case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type'];
break;
case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor'];
break;
case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date'];
break;
case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi'];
break;
}
}
}
@ -2227,7 +2256,13 @@ if($total_no_of_business > 0) {
$bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null;
//print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']);
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null );
$bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null );
}
array_push($businessFinancialResult,$bindBusinessFinancial);
?>
@ -2462,7 +2497,27 @@ if($total_no_of_business > 0) {
echo '<br>Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY'];
}
?>
<p><strong>Working Capital Cycle:</strong></p>
<!--################ Buisness Financial Information - Title Changes for CFPL lender ###################-->
<?php
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$business_fin_sub_title1 = 'Total Banking Cycle';
$business_fin_sub_title2 = 'Total Banking Facilities';
}else{ $business_fin_sub_title1 = 'Working Capital Cycle';
$business_fin_sub_title2 = 'Working Capital Facilities';
}
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Details</th> </tr> </thead>
<tbody>
<?php foreach($iterateFinance['cfpl_lender_details'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td class="customtd">'.$facility['name'].'</td> <td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
<?php } ?>
<p><strong><?php echo $business_fin_sub_title1.' :'; ?></strong></p>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Particulars</th> <th>Days</th> </tr> </thead>
<tbody>
@ -2474,7 +2529,7 @@ if($total_no_of_business > 0) {
<?php if($iterateFinance['is_working_capital_facility'] != "" ){ ?>
<p><strong>Working Capital Facilities:</strong></p>
<p><strong><?php echo $business_fin_sub_title2.' :'; ?></strong></p>
<?php if(strcasecmp($iterateFinance['is_working_capital_facility'],'no')){?>
<table class="scorecard_table">
<thead> <tr> <th>S.No</th> <th>Facility Type</th> <th>Facility Details</th> </tr> </thead>
@ -2485,7 +2540,7 @@ if($total_no_of_business > 0) {
}?>
</tbody>
</table>
<?php }else{echo "<p>The Loan Applicants have not availed any Working Capital Facilities from any financial institution.<p>";}
<?php }else{echo "<p>The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.<p>";}
}
?>

View File

@ -0,0 +1,594 @@
<?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######### */
/* ######### Mini Score Card Table Styles######### */
.mini_scorecard_table {
width: 100%;
page-break-inside: avoid;
}
.mini_scorecard_table td, .mini_scorecard_table th {
page-break-inside: avoid;
}
.mini_scorecard_table th {
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
background-color: #0191ed;
color: white;page-break-inside: avoid;
}
/* #########End of Mini Score Card Table Styles######### */
/* #########End of Mini Score Card Div Styles######### */
#rcorners_green {
background: #33cc33;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_red {
background: red;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_light_green {
background: #99ff66;
padding: 3px;
width: 75px;
height: 5px;
}
#rcorners_amber{
background: #ff9900;
padding: 3px;
width: 75px;
height: 5px;
}
/* #########End of Mini Score Card DIv 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 - <?php echo $pd_master_details[0]['product_abbr']?> </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 isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
</tr>
<?php if(isset($pd_section_data[1]['person_met']) && $pd_section_data[1]['person_met'] != ''){?>
<tr>
<td colspan="3"> Name of Person Met During Visit and Contact Number</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 'Address visited for PD'; ?></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>';
}
$ownership_type = '';
if( isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'owned')
{
$ownership_type = '( Owned )';
}
else if(isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'rented')
{
$ownership_type = ' ( Rented ) - Rent paid '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[8]['business_monthly_rented_amt']);
}
echo '<tr> <td colspan="3">Address Type / Ownership</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].$ownership_type.'</td></tr>';
if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes')
{
echo '<tr> <td colspan="3">Period for which business has been <br>in operation from this address </td> <td class = "tdcenteralign" colspan="7">'.($pd_section_data[8]['business_years'].' Year(s)'.(isset($pd_section_data[8]['business_months']) && $pd_section_data[8]['business_months'] != '' ? ' & ' . $pd_section_data[8]['business_months'] .' Month(s)': '')).'</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>';
echo '<tr> <td colspan="3">Estimated Area of Business Premise </td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['business_estimated_area'].' '.$pd_section_data[2]['uom'].'</td></tr>';
}
?>
</tbody>
</table>
<!-- <div id="page_break"></div> -->
<br><br>
<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="270px" width="630px">
<?php
}else{ echo '<p>Location access Not Available</p>';}
?>
<div id="page_break"> </div>
<br>
<table class="scorecard_table">
<tr>
<th class="thlargefont" colspan="4">General Section</th>
</tr>
<?php if(isset($pd_section_data['21']) && count($pd_section_data['21']) && ($pd_section_data['21']['name'] != '') && ($pd_section_data['21']['loan_amount'] != '' )){?>
<tr>
<th colspan="1">Name</th><th colspan="1">Loan Amount</th><th colspan="1">Product</th><th colspan="1">Location</th>
</tr>
<?php
echo '<tr><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['name'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['loan_amount'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['product'].'</td><td colspan="1" class = "tdcenteralign">'.$pd_section_data['21']['location'].'</td></tr>';
}
else {
echo '<tr> <td colspan="4" class="tdcenteralign"> General Section Not Available</td> </tr>';
}
?>
<tbody>
</tbody>
</table>
<br><br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Profile</th></tr>
<?php if(isset($pd_section_data['22']) && count($pd_section_data['22']) && ($pd_section_data['22']['history_vintage'] != '') && ($pd_section_data['22']['primary_partners'] != '' )){
echo '</table><br><p><b>History &  Vintage and  Lineage </b></p>
<p align="justify">'.$pd_section_data['22']['history_vintage'].'</p>
<br><p class="parasubtitle"><b>Primary shareholding , promoters  and major   equity  partners</b></p>
<p align="justify">'.$pd_section_data['22']['capital_details'].'</p>
<br><p class="parasubtitle"><b>The  capital  structure and details of  the  various  investments vehicles</b></p>
<p align="justify">'.$pd_section_data['22']['history_vintage'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Profile Not Available</td> </tr></tbody></table>';
}
?>
<br><br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Size and Geographical Reach</th></tr>
<?php if(isset($pd_section_data['23']) && count($pd_section_data['23']) && ($pd_section_data['23']['aum_book'] != '') && ($pd_section_data['23']['geographical_details'] != '' )){
echo '</table><br><p><b>AUM  (  off book  &  on book  ) &e. Trend of Disbursement in last 2 quarters</b></p>
<p align="justify">'.$pd_section_data['23']['aum_book'].'</p>
<br><p><b>States  and geographical  regions & Branches  &  geographical  customer base</b></p>
<p align="justify">'.$pd_section_data['23']['geographical_details'].'</p>
<br><p><b>Branches /employees / structure</b></p>
<p align="justify">'.$pd_section_data['23']['branches_employees'].'</p>
<br><p><b>Portfolio concentration and Cuts to be discussed</b></p>
<p align="justify">'.$pd_section_data['23']['portfolio_concentration'].'</p>
<br><p><b>Who are the competitors to the business</b></p>
<p align="justify">'.$pd_section_data['23']['business_competitors'].'</p>
<br><p><b>Estimated Market Size of the Business& Market share</b></p>
<p align="justify">'.$pd_section_data['23']['estimated_market'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Size and Geographical Reach Not Available</td> </tr></tbody></table>';
}
?>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Product  &  Processes</th></tr>
<?php if(isset($pd_section_data['24']) && count($pd_section_data['24']) && ($pd_section_data['24']['products'] != '') && ($pd_section_data['24']['policies'] != '' )){
echo '</table><br><p><b>Products</b></p>
<p align="justify">'.$pd_section_data['24']['products'].'</p>
<br><p><b>Policies</b></p>
<p align="justify">'.$pd_section_data['24']['policies'].'</p>
<br><p><b>Credit  appraisal mechanism</b></p>
<p align="justify">'.$pd_section_data['24']['credit_appraisal'].'</p>
<br><p><b>Technology and  usage  for    acquisition and  credit</b></p>
<p align="justify">'.$pd_section_data['24']['technology_credit'].'</p>
<br><p><b>Collection policy and   mechanism -Collection efficiency trends in last 12 months (CC/CD, TC/CD,TC/TD) any deviation to be discussed in detail</b></p>
<p align="justify">'.$pd_section_data['24']['collection_policy'].'</p>
<br><p><b>Provisioning policy</b></p>
<p align="justify">'.$pd_section_data['24']['provisioning_policy'].'</p>
<br><p><b>Restructuring policy</b></p>
<p align="justify">'.$pd_section_data['24']['restructuring_policy'].'</p>
<br><p><b>Covid  impact and policy</b></p>
<p align="justify">'.$pd_section_data['24']['covid_policy'].'</p>';
}else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Product  &  Processes Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Portfolio Health</th></tr>
<?php if(isset($pd_section_data['25']) && count($pd_section_data['25']) && ($pd_section_data['25']['par_book'] != '') && ($pd_section_data['25']['provisioning_resolution'] != '' )){
echo '</table><br><p><b>Par  own book /Par off  book -d</b></p>
<p align="justify">'.$pd_section_data['25']['par_book'].'</p>
<p><b>NPAs/Provisioning & resolution strategy</b></p>
<p align="justify">'.$pd_section_data['25']['provisioning_resolution'].'</p>
<p><b>Strategy to manage flow as well as  post moratorium stress</b></p>
<p align="justify">'.$pd_section_data['25']['post_morotorium'].'</p>
<p><b>Strategy  for non-paying customers</b></p>
<p align="justify">'.$pd_section_data['25'][' non-paying_customers'].'</p>
<p><b>PAR (Productwise)/Net NPAs/Write offs Movement of Bucket ,PAR 90+</b></p>
<p align="justify">'.$pd_section_data['25']['par'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Portfolio Health Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Total Overall Debt/Equity Profile</th></tr>
<?php if(isset($pd_section_data['26']) && count($pd_section_data['26'])&& ($pd_section_data['26']['dept_structures'] != '') && ($pd_section_data['26']['future_plan'] != '' )){
echo '</table><br><p><b>Types of debt structures and  major debt providers</b></p>
<p align="justify">'.$pd_section_data['26']['dept_structures'].'</p>
<p><b>Future plan for additional funding</b></p>
<p align="justify">'.$pd_section_data['26']['future_plan'].'</p>
<p><b>Funding received during covid times including liquidity  support  from  DFIs & Banks</b></p>
<p align="justify">'.$pd_section_data['26']['dfi_banks'].'</p>
<p><b>Fresh sanctions lined up in the  present month and coming quarters</b></p>
<p align="justify">'.$pd_section_data['26']['fresh_sanctions'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Total Overall Debt/Equity Profile Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="6">Financial  analysis</th>
</tr>
<?php if(isset($pd_section_data['27']) && count($pd_section_data['27'])&& ($pd_section_data['27']['car_type'] != '') && ($pd_section_data['27']['leverage'] != '' )){?>
<tr>
<th colspan="1">CAR (Tier-1)/CAR (Tier-1 + Tier-2)</th>
<th colspan="1">Leverage (D/E) (excluding Managed)</th>
<th colspan="1">ALM</th>
<th colspan="1">Opex</th>
<th colspan="1">NIM (%) - as per Audited B/S</th>
<th colspan="1">Opex (% of Avg. Book)</th>
</tr>
<?php
echo '<tr><td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['car_type'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['leverage'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['alm'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['nim'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex_average'].'</td></tr>';?>
<tr>
<th colspan="1">Opex (% of NII)</th>
<th colspan="1">Return on Assets</th>
<th colspan="1">Return on Equity</th>
<th colspan="1">IRR (Derived)</th>
<th colspan="1">Avg. Borrowing Cost (Derived)</th>
<th colspan="1">Spread (Derived)</th>
</tr>
<?php
echo '<tr>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['opex_nii'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['return_asset'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['return_equity'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['irr'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['avg_borrowing'].'</td>
<td colspan="1" class = "tdcenteralign">'.$pd_section_data['27']['spread'].'</td></tr>';
}
else {
echo '<tr> <td colspan="6" class="tdcenteralign"> Financial  analysis Not Available</td> </tr>';
}
?>
</tbody>
</table>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Overall Plan of Action</th></tr>
<?php if(isset($pd_section_data['28']) && count($pd_section_data['28'])&& ($pd_section_data['28']['future_plan'] != '')){
echo '</table><br><p><b>Future plan on  expansion  geographies wise , products and regions . Equity  and debt structuring as well as  dilution in future. Target book for the present quarter and  YOY   projections</b></p>
<p align="justify">'.$pd_section_data['28']['future_plan'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Overall Plan of Action Not Available</td> </tr></tbody></table>';
}
?>
<br>
<div id="page_break"> </div>
<table class="scorecard_table"><tr><th class="thlargefont" colspan="10">Validation Points vide Systems and Books at HQ & Branches</th></tr>
<?php if(isset($pd_section_data['29']) && count($pd_section_data['29']) && ($pd_section_data['29']['stock_validated'] != '') && ($pd_section_data['29']['collateral_coverage'] != '' )){
echo '</table><br><p><b>Stock to be validated from system</b></p>
<p align="justify">'.$pd_section_data['29']['stock_validated'].'</p>
<p><b>Collateral coverage for existing borrowing ( System Mapping to be checked)</b></p>
<p align="justify">'.$pd_section_data['29']['collateral_coverage'].'</p>
<p><b>Collection efficiency and system flagging to be counterchecked and same with PAR cuts</b></p>
<p align="justify">'.$pd_section_data['29']['collection_efficiency'].'</p>
<p><b>Sample check of loan dox, application form along with PAN for Active loan accounts</b></p>
<p align="justify">'.$pd_section_data['29']['loan_dox'].'</p>
<p><b>Disbursement no to be checked from system</b></p>
<p align="justify">'.$pd_section_data['29']['disbursement'].'</p>
<p><b>Top 20 exposure to be checked with data submitted</b></p>
<p align="justify">'.$pd_section_data['29']['top20_exposure'].'</p>
<p><b>Sample Sanction letters to validate collateral cover stipulated for existing Borrowing</b></p>
<p align="justify">'.$pd_section_data['29']['sanction_letters'].'</p>
<p><b>Provisioning /Write-off/NPA flagging to be counter checked</b></p>
<p align="justify">'.$pd_section_data['29']['provisioning'].'</p>
<p><b>Restructuring of Loans in system on sample basis</b></p>
<p align="justify">'.$pd_section_data['29']['restructuring_loan'].'</p>
<p><b>EMI cycle date in system</b></p>
<p align="justify">'.$pd_section_data['29']['emi_date'].'</p>
<p><b>Cash and Bank ledger to be checked</b></p>
<p align="justify">'.$pd_section_data['29']['cash_checked'].'</p>
<p><b>Free FD details to be taken and validated from Accounting system</b></p>
<p align="justify">'.$pd_section_data['29']['fd_details'].'</p>
<p><b>Application/Systems used for Boarding /Loan management</b></p>
<p align="justify">'.$pd_section_data['29']['loan_management'].'</p>';
}
else {
echo '<tbody><tr> <td colspan="10" class="tdcenteralign">Validation Points vide Systems and Books at HQ & Branches Not Available</td> </tr></tbody></table>';
}
?>
</tbody>
</table>
<div id="page_break"> </div>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Final Remarks of PD officer</th>
</tr>
<?php
if(isset($pd_section_data['19']) && count($pd_section_data['19'])&& ($pd_section_data[19]['pd_officer_recommendation'] != '') && ($pd_section_data[19]['customer_behaviour'] != '' )){
$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">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>
<?php if(isset($pd_section_data[19]['final_form_remarks']) && !empty($pd_section_data[19]['final_form_remarks'])){
echo '<tr><td colspan="4">Remarks</td><td colspan="4">'.$pd_section_data[19]['final_form_remarks'] .'</td></tr>';
} } else{
echo '<tr> <td class="tdcenteralign" colspan="8">Final Remarks of PD officer Not Available</td> </tr>';
}?>
</tbody></table>
<?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 Credit Manager </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>