PD REPORTS FEEDBACKS WITH CLIX BL CHANGES

This commit is contained in:
Velz2020 2019-07-04 16:08:34 +05:30
parent a651b272c6
commit 48aa1a1f67
4 changed files with 145 additions and 67 deletions

View File

@ -99,7 +99,7 @@ defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMA
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','lender');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_dev');
defined('LOGTOBOT') OR define('LOGTOBOT',0);
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0');
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg');
}
else if(ENVIRONMENT == 'testing')
{
@ -108,7 +108,7 @@ else if(ENVIRONMENT == 'testing')
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','len');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test');
defined('LOGTOBOT') OR define('LOGTOBOT',0);
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0');
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg');
}
else if(ENVIRONMENT == 'prod')
{
@ -117,7 +117,7 @@ else if(ENVIRONMENT == 'prod')
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','lender');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test');
defined('LOGTOBOT') OR define('LOGTOBOT',0);
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0');
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg');
}
/*********************END of AWS resources Constants*************************************************/

View File

@ -2339,6 +2339,9 @@ class PD_Controller extends REST_Controller {
case 22:
$processed_json = GETPROCESSEDJSON::convertBusinessAssetsForm($records,$formid);
break;
case 23:
$processed_json = $records;
break;
//default:
//echo "Something Wrong! Form ID did not match, Contact System Administrator";
@ -5031,7 +5034,7 @@ class PD_Controller extends REST_Controller {
$records = $this->post('records');
$pdid = $records['pd_id'];
ini_set('max_execution_time', 300);
//PDALERTS::pdnotification($pdid);die();
$is_regenerate = 0;
if(isset($records['regenerate']))
@ -5040,7 +5043,6 @@ class PD_Controller extends REST_Controller {
}
//print_r($records);
$data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid);
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
//print_r($data['applicants_details']);die();
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
@ -5102,17 +5104,17 @@ class PD_Controller extends REST_Controller {
$data['pd_images'][$i] = $this->PD_Model->getSignedPDDocsURL($pdid,$i);
// $this->getPDImages_post($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC');
// $this->getPDImages_post``($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC');
// print_r($this->db->last_query());
}
// print_r($data['pd_processed_forms']);
//print_r($data['pd_processed_forms']);die();
//print_r($data['pd_images']);die(); //print_r(json_decode($data['pd_processed_forms'][14][0]['processed_json'],true));
//die();
//echo "*******************************************";
$t = $this->load->view('report_templates/JSONTOREPORT',$data,true);
//$t = $this->load->view('temp_html.html',null,true);
//echo $t;die();
echo $t;die();
$total_replaces = substr_count($t,'<span class="tooltip">');
//echo $total_replaces;
@ -6320,22 +6322,22 @@ class PD_Controller extends REST_Controller {
$address_form = (json_decode($form_data[5][0]['processed_json'],true));
//print_r($address_form);die();
if($address_form['is_pd_done_on_initiated_address'] == 1)
if(isset($address_form['is_pd_done_on_initiated_address']) && $address_form['is_pd_done_on_initiated_address'] != 1)
{
// 4 - QNO(1.2) - Comment on locality
$score_questions['general']['comment_locality'] = $address_form['addresses'][0]['comment_locality_master'];
// 5 - QNO(1.3) - pd location approach
$score_questions['general']['pd_location_approach'] = $address_form['addresses'][0]['pd_location_master'];
$score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master'];
// 5 - QNO(1.3) - pd location approach
$score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master'];
}
else //get it from alternative address
{
// 4 - QNO(1.2) - Comment on locality
$score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master'];
// 5 - QNO(1.3) - pd location approach
$score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master'];
$score_questions['general']['comment_locality'] = $address_form['addresses'][0]['comment_locality_master'];
// 5 - QNO(1.3) - pd location approach
$score_questions['general']['pd_location_approach'] = $address_form['addresses'][0]['pd_location_master'];
}
@ -6817,6 +6819,7 @@ class PD_Controller extends REST_Controller {
public function pdFormsCompletenessCheck_post()
{
$pdid = $this->post('pd_id');
$client = $this->post('client') ? $this->post('client') : 'WEB';
$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");
@ -6912,7 +6915,14 @@ class PD_Controller extends REST_Controller {
array_push($selected_type_of_activity,$value['type_of_activity_id']);
}
// 13 - QNO(2.4) - all business certificate
if($business_form['employees_temporary'] == "" || $business_form['employees_permanent'] == "" || $business_form['employees_appx_salary'] == "")
{
$incomplete_details[] = 'Business Section - Company Employees Details Not Filled';
}
if( $client != 'WEB')// if API came from web then ignore this check
{
$certificate_count = 0;
$name_board_image_count = 0;
if(count($pd_images[13]))
@ -6962,8 +6972,8 @@ class PD_Controller extends REST_Controller {
//If Business Type of activity is manufacturing or whole sale trading then check these two certifications,
if(in_array('2',$selected_type_of_activity) || in_array('4',$selected_type_of_activity))
//If Business Type of activity is manufacturing then check these two certifications,
if(in_array('2',$selected_type_of_activity))// || in_array('4',$selected_type_of_activity))
{
if(isset($business_form['factory_cert']))
{
@ -6974,8 +6984,8 @@ class PD_Controller extends REST_Controller {
} //else { $certificate_count++; }
}
//If Business Type of activity is manufacturing then check
if(in_array('2',$selected_type_of_activity))
//If Business Type of activity is manufacturing,wholesale,retail then check
if(in_array('2',$selected_type_of_activity) || in_array('4',$selected_type_of_activity) || in_array('3',$selected_type_of_activity))
{
if(isset($business_form['export_import_cert']))
{
@ -7002,42 +7012,52 @@ class PD_Controller extends REST_Controller {
if($certificate_count){ $incomplete_details[] = 'Business Section - Images for Document Sighted Not Sufficient'; }
}
#####End of Business Form Questions########
########## Finance Form Questions################
$finance_form = isset($form_data[14][0]['processed_json'])?(json_decode($form_data[14][0]['processed_json'],true)):array();
$finance_form_photo_count = isset($pd_images[14]) ? count($pd_images[14]) : 0;
//print_r($finance_form);die();
//print_r($pd_images[14]);die();
if(!strcasecmp($finance_form['is_financial_statements'],'yes') && !($finance_form_photo_count) )
if( $client != 'WEB')// if API came from web then ignore this check
{
$incomplete_details[] = 'Financial Section - Financial Images Not captured';
$finance_form = isset($form_data[14][0]['processed_json'])?(json_decode($form_data[14][0]['processed_json'],true)):array();
$finance_form_photo_count = isset($pd_images[14]) ? count($pd_images[14]) : 0;
//print_r($finance_form);die();
//print_r($pd_images[14]);die();
if(!strcasecmp($finance_form['is_financial_statements'],'yes') && !($finance_form_photo_count) )
{
$incomplete_details[] = 'Financial Section - Financial Images Not captured';
}
}
#####End of Finance Form Questions########
#####Business Assets Form Questions########
$business_assest_form = (json_decode($form_data[22][0]['processed_json'],true));
$businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0;
//print_r($business_assest_form);die();
if(array_key_exists('business_assets_details',$business_assest_form))
if( $client != 'WEB')// if API came from web then ignore this check
{
foreach($business_assest_form['business_assets_details'] as $value)
$business_assest_form = (json_decode($form_data[22][0]['processed_json'],true));
$businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0;
//print_r($business_assest_form);die();
if(array_key_exists('business_assets_details',$business_assest_form))
{
if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 4 && !($businees_assest_images_count))
{
$incomplete_details[] = 'Business Assets Section - Machinery Image';
}
foreach($business_assest_form['business_assets_details'] as $value)
{
if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 4 && !($businees_assest_images_count))
{
$incomplete_details[] = 'Business Assets Section - Machinery Image';
}
}
}
}
#####End of Business Assets Form Questions########
if($client != 'WEB')
{
#####supplier Form Questions########
$supplier_form = isset($form_data[1][0]['processed_json'])?(json_decode($form_data[1][0]['processed_json'],true)):array();
@ -7080,11 +7100,11 @@ class PD_Controller extends REST_Controller {
}
if($cureent_supplier_images_count < 2){ $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient';}
if($cureent_supplier_images_count < 2){ $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient.';}
}
else
{
$incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient';
$incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found';
}
}
else
@ -7130,7 +7150,7 @@ class PD_Controller extends REST_Controller {
}
else
{
$incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient';
$incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found';
}
}
else
@ -7193,7 +7213,7 @@ class PD_Controller extends REST_Controller {
}
else
{
$incomplete_details[] = 'Client Section - '.$client_name .'- Image Not Sufficient';
$incomplete_details[] = 'Client Section - '.$client_name .'- Images Not Found';
}
}
@ -7235,7 +7255,7 @@ class PD_Controller extends REST_Controller {
}
else
{
$incomplete_details[] = 'Client Section - '.$client_name .'- Image Not Sufficient';
$incomplete_details[] = 'Client Section - '.$client_name .'- Images Not Found';
}
}
else
@ -7275,7 +7295,7 @@ class PD_Controller extends REST_Controller {
}
else
{
$incomplete_details[] ='Client Section - ' .$client_name .'- Image Not Sufficient';
$incomplete_details[] ='Client Section - ' .$client_name .'- Images Not Found';
}
}
@ -7357,12 +7377,13 @@ class PD_Controller extends REST_Controller {
if( $total_stock_observed != 0 && !(count($pd_images[11])))//&& !count($pd_images[11][0])) )
{
$incomplete_details[] = 'Stock Section - Images not sufficient';
$incomplete_details[] = 'Stock Section - Images not sufficient. Available Images - '.(count($pd_images[11]) ? count($pd_images[11]) : 0);
}
//}
}
}
}
$data['dataStatus'] = true;

Binary file not shown.

View File

@ -100,7 +100,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
/* #########End of Mini Score Card Div Styles######### */
#rcorners_green {
background: #ff9900;
background: #33cc33;
padding: 3px;
width: 75px;
height: 5px;
@ -121,7 +121,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
#rcorners_amber{
background: #33cc33;
background: #ff9900;
padding: 3px;
width: 75px;
height: 5px;
@ -797,9 +797,16 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$answer = null;
$per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0;
$class = ( $per >= 80 ? 'rcorners_green' : $per >= 70 && $per < 80 ? 'rcorners_light_green' : $per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red');
$class = ( $per >= 80 ? 'rcorners_green' : ($per >= 70 && $per < 80 ? 'rcorners_light_green' : ($per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red')));
// if($bsk == 'business_seasonality')
// {
// echo "BUSINESS";
// echo $per;
// echo $class;
// echo $per >= 80 ? 'rcorners_green' : 'SOME';
// die();
// }
if($bsk == 'location_suited_for_busienss')
{
$answer = $address_type_remarks_caption[ $business_score['answer'] ];
@ -980,8 +987,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
else{
echo '<li><span class="tooltip">No business activity was seen during the PD visit.<span class="tooltiptext">Business Assest Form - Busienss activity seen during PD visit </span></span></li>';
}
if(isset($business_assets_details['business_assets_form_remark']) && $business_assets_details['business_assets_form_remark'] != ""){
echo '<li><span class="tooltip">'.$business_assets_details['business_assets_form_remark'] .'<span class="tooltiptext">Business Assest Form - Busienss Assest Form Remarks </span></span></li>';}
if(isset($business_assets_details['business_pd_visited_remark']) && $business_assets_details['business_pd_visited_remark'] != ""){
echo '<li><span class="tooltip">'.$business_assets_details['business_pd_visited_remark'] .'<span class="tooltiptext">Business Assest Form - Busienss Assest Form Remarks </span></span></li>';}
echo "</ul>";
if($address_form['address_form_remark'])
@ -1004,10 +1011,16 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']);
echo '<span contenteditable="true">During the PD visit,</span> '.$main_applicant_name.',<span contenteditable="true"> provided the following information about loan applied for:</span>';
$is_current_product_bl = $pd_master_details[0]['product_abbr'] == "BL" ? true: false;
$loan_table_dispaly_rows = array();
$loan_table_dispaly_rows[] = array('particulars' => 'Total Loan Amount applied for','details' => "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".$loan_amount.' ('.MYUTIL::numtowords($loan_form['loan_amount']).')');
if($is_current_product_bl)
{
$to_dispaly = !strcasecmp($loan_form['is_there_total_fund'], 'yes disclose') ? ('Disclosed '."<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['fund_amt']).' ('.MYUTIL::numtowords($loan_form['fund_amt']).')'):'Not Disclosed';
$loan_table_dispaly_rows[] = array('particulars' => 'Total Fund Requirement','details' => $to_dispaly);
}
$loan_table_dispaly_rows[] = array('particulars' => 'Loan Tenure expected','details' => $loan_form['loan_tenure'].' Months');
$end_use = '';
@ -1033,21 +1046,26 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
else{
$loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>"<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' );
$source_of_own_contribution = null;
foreach($loan_form['source_of_own_contribution_master'] as $own_source)
{
if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; }
}
$source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution));
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution);
if(!$is_current_product_bl)
{
$loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>"<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' );
$source_of_own_contribution = null;
foreach($loan_form['source_of_own_contribution_master'] as $own_source)
{
if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; }
}
$source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution));
$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' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')' );
if(!$is_current_product_bl)
{
$loan_table_dispaly_rows[] = array('particulars' => 'Type of Property Being Mortgaged','details' => $loan_form['property_type_master']);
$owners_list = null;foreach($loan_form['owners_list_master'] as $owner){ $owners_list.=$owner.' and '; }
@ -1057,7 +1075,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']);
$loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')');
}
//print_r($loan_table_dispaly_rows);
?>
<br><br>
@ -1279,7 +1297,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class="customtd"><?php echo $partRow['no_years_business'] ?></td>
<td class="customtd"><?php echo $partRow['total_experience']?></td>
<td class="customtd"><?php echo $partRow['previous_experience']?></td>
<td class="customtd"><?php echo $partRow['started_business']?></td>
<td class="customtd"><?php echo ucfirst($partRow['started_business'])?></td>
</tr>
<?php } ?>
</tbody>
@ -1312,7 +1330,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class="customtd"><?php echo $familyRow['individual_relation'] ?></td>
<td class="customtd"><?php echo $familyRow['relation_to'] ?></td>
<td class="customtd"><?php echo $familyRow['relation_to_company'] ?></td>
<td class="customtd"><?php echo $familyRow['started_business']?></td>
<td class="customtd"><?php echo ucfirst($familyRow['started_business'])?></td>
</tr>
<?php } ?>
<?php } ?>
@ -1909,7 +1927,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table>
<?php }
}
else{ echo "<p>Financials statements not providing by Loan Applicants to PD officer. </p>";}
else{ echo "<p>Financials statements not provided by Loan Applicants to PD officer. </p>";}
?>
@ -2763,8 +2781,47 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} //end of stock details available in current index
?>
<!-- #################end stock section #################-->
<!-- #################Start of Future Plan and Business Environment #################-->
<?php
if(isset($pd_processed_forms[23][$business_count]))
{
$future_plan_business_environment = json_decode($pd_processed_forms[23][$business_count]['processed_json'],true);?>
<h3 contenteditable="true">Future Plan and Business Environment</h3>
<table class="scorecard_table">
<thead>
<tr> <th>Details</th> <th>Particulars</th> </tr>
</thead>
<tbody>
<?php
echo '<tr><td>USP of the business (How applicants business is different from others in the business)</td><td>'.$future_plan_business_environment['usp_of_the_business'].'</td></tr>';
echo '<tr><td>Future plan for business expansion</td><td>'.$future_plan_business_environment['future_plans_for_business_expansion'].'</td></tr>';
echo '<tr><td>Impact of GST on business</td><td>'.$future_plan_business_environment['impact_of_gst_on_the_business'].'</td></tr>';
echo '<tr><td>Key competitors in the business</td><td>'.$future_plan_business_environment['key_competitors'].'</td></tr>';
echo '<tr><td>Succession Plan for business</td><td>'.$future_plan_business_environment['succession_plan'].'</td></tr>';
echo '<tr><td>Brief of other group concerns/ Business run by the applicant</td><td>'.$future_plan_business_environment['brief_of_other_group_concerns_or_businesses_run_by_the_applicants'].'</td></tr>';
?>
</tbody>
</table>
<?php
if($future_plan_business_environment['remarks'] != "")
{
echo '<br>';
echo '<p>'. $future_plan_business_environment['remarks'] .'</p>';
}
}
?>
<!-- #################End of Future Plan and Business Environment #################-->
<!-- #################Start of AI #################-->
<?php
//echo "AI*******************##############@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";