diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index 39bcf4a3..d9c2b1d8 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -660,7 +660,8 @@ class PD_Controller extends REST_Controller {
$ch = curl_init();
$timeout = 5;
- $url = 'https://ssa.sineedge.com/officertracking/'.$randomString;
+ $url = 'https://ssa.sineedge.com/officertracking/#/officertracking/'.$randomString;
+
//echo "$url";
curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
@@ -2362,7 +2363,7 @@ class PD_Controller extends REST_Controller {
break;
case 4:
$processed_json = GETPROCESSEDJSON::convertOtherAssetForm($records,$formid);
- $processed_json = $records;
+ //$processed_json = $records;
break;
case 5:
$processed_json = GETPROCESSEDJSON::convertAddressForm($records,$formid);
@@ -3377,6 +3378,7 @@ class PD_Controller extends REST_Controller {
$temp_netprofit = 0;
$temp_grossprofit = 0;
$temp_netmargin = 0;
+ //print_r($sales_by_item_monthwise);
foreach($sales_by_item_monthwise as $monthwise_key => $sales_by_item_month)
{
$month_total = 0;
@@ -3393,15 +3395,23 @@ class PD_Controller extends REST_Controller {
}
$month_total = $month_total + $temp;
}
- $sales_monthwise[] = array('total' => $month_total,'no_of_months' => $i);
+ $sales_monthwise[] = array('total' => $month_total,'no_of_months' => $i,'sales_type' => $sales_by_item_month['sales_type']);
}
foreach($sales_monthwise as $sale)
{
+ //print_r($sale);
$annual_multuplier = 12 / $sale['no_of_months'];
- $total_sales_monthwise = $total_sales_monthwise + ($sale['total'] * $annual_multuplier);
+ if($sale['sales_type'] == 1)
+ {
+ $total_sales_monthwise = $total_sales_monthwise + ($sale['total'] * $annual_multuplier);
+ }
+ else if($sale['sales_type'] == 2)
+ {
+ $total_sales_monthwise = $total_sales_monthwise + $sale['total'];
+ }
}
//calculation part
@@ -4339,6 +4349,8 @@ class PD_Controller extends REST_Controller {
public function codeigniterViewTest_post()
{
+ // echo MYUTIL::customIndianNumberFormat(4589621);
+ // die();
$records = $this->post('records');
$pdid = $records['pd_id'];
$is_regenerate = 0;
@@ -4357,27 +4369,27 @@ class PD_Controller extends REST_Controller {
//echo $score_for_chart;
//GET phantom script from DB
- //$phantom_script = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => 'phantomjs_local'),SCRIPTS);
+ $phantom_script = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => 'phantomjs_local'),SCRIPTS);
- //$exact_script = $phantom_script[0]['script_content'];
- //print_r($exact_script);
- //$exact_script = str_replace('{{place_score_here}}',$score_for_chart,$exact_script);
+ $exact_script = $phantom_script[0]['script_content'];
+ print_r($exact_script);
+ $exact_script = str_replace('{{place_score_here}}',$score_for_chart,$exact_script);
//print_r($exact_script);die();
//GENERATE CHART PART
- // file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX);
+ file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX);
- // $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js';
- // exec($str,$ou);
- // exec('phantom.exit();');
+ $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js';
+ exec($str,$ou);
+ exec('phantom.exit();');
// //print_r($ou);
- // $chart_img_path = APPPATH.'/views/report_templates/chart.png';
- // $type = pathinfo($chart_img_path, PATHINFO_EXTENSION);
- // $chart_img_content = file_get_contents($chart_img_path);
- // $base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content);
- // $data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url;
+ $chart_img_path = APPPATH.'/views/report_templates/chart.png';
+ $type = pathinfo($chart_img_path, PATHINFO_EXTENSION);
+ $chart_img_content = file_get_contents($chart_img_path);
+ $base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content);
+ $data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url;
// echo $data['base64_pdscore_chart_url'];
//die();
//GENERATE CHART PART
@@ -4391,8 +4403,10 @@ class PD_Controller extends REST_Controller {
$data['pd_processed_forms'][$i] = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON,array(),'','company_id','ASC');
}
+ //print_r(json_decode($data['pd_processed_forms'][20][0]['processed_json'],true));
+ //die();
$t = $this->load->view('report_templates/JSONTOREPORT',$data,true);
-
+ //echo $t; die();
//PDF Gen using DOM PDF
$pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
//End of PDF Gen using DOM PDF
@@ -4492,10 +4506,6 @@ class PD_Controller extends REST_Controller {
//echo $str;
if(!strcmp($str,'AI')) { $ai_flag = 1; }
//echo $ai_flag;
- //USING TEMPLATE ID , GET ASSESSED INCOME ASSIGNED OR NOT
- $fields = array('*');
- $where_condition_array = array('isactive' => 1,'form_id'=> 16,'fk_template_id' =>$pd_master_details[0]['fk_pd_template_id'] );
- $rec = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATEFORMS);
$company_list = array();
$fields = array('json');
@@ -4519,13 +4529,12 @@ class PD_Controller extends REST_Controller {
$form_array = array();
if($ai_flag == 0) // DI case
{
- // echo "DI";
+
$form_array = array(
array('form_id' => 13,'form_name' => 'About Business'),
array('form_id' => 22,'form_name' => 'Business Assets'),
array('form_id' => 21,'form_name' => 'Business Banking'),
array('form_id' => 14,'form_name' => 'Financial Information'),
- //array('form_id' => 16,'form_name' => 'Assessed Income'),
array('form_id' => 1,'form_name' => 'Supplier Details'),
array('form_id' => 2,'form_name' => 'Client Details'),
array('form_id' => 11,'form_name' => 'Stock Details'),
@@ -4534,7 +4543,7 @@ class PD_Controller extends REST_Controller {
}
else // AI Case
{
- // echo "AI";
+
$form_array = array(
array('form_id' => 13,'form_name' => 'About Business'),
array('form_id' => 22,'form_name' => 'Business Assets'),
@@ -4546,6 +4555,9 @@ class PD_Controller extends REST_Controller {
array('form_id' => 11,'form_name' => 'Stock Details'),
);
+
+
+
}
foreach($company_list as $list_key => $company)
{
@@ -4556,6 +4568,10 @@ class PD_Controller extends REST_Controller {
$client_form_status = 0;
foreach($form_array as $form)
{
+
+ $template_forms_count = 0;
+ if($form['form_id'] != 16)
+ {
$this->db->SELECT('count(*) as count');
$this->db->FROM(PDFORMDETAILSJSON.' as PDFORMDETAILSJSON');
$this->db->WHERE('PDFORMDETAILSJSON.fk_pd_id',$pd_id);
@@ -4563,6 +4579,14 @@ class PD_Controller extends REST_Controller {
$this->db->WHERE('PDFORMDETAILSJSON.company_id',$company['company_order_id']);
$this->db->WHERE('PDFORMDETAILSJSON.isactive',1);
$template_forms_count = $this->db->GET()->result_array();
+ }
+ else
+ {
+
+ $fields = array('count(*) as count');
+ $where_condition_array = array('fk_pd_id'=>$pd_id,'company_id' => $company['company_order_id'],'is_completed' => 1);
+ $template_forms_count = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDASSESSEDINCOMEESTIMATIONOFGROSSPROFITTYPE);
+ }
// print_r($this->db->last_query());
// print_r($template_forms_count);echo $form['form_id'];
if($template_forms_count[0]['count'] != 0) {
@@ -4777,11 +4801,16 @@ class PD_Controller extends REST_Controller {
public function getPDOfficerCurrentLocation_post()
{
- $pdid = $this->post('pd_id');
- //
- //PDALERTS::pdnotification($pdid);
+ $enc_string = $this->post('pd_id');
- $result_data = $this->db->SELECT('*')->FROM(PDOFFICERCURRENTLOCATION)->WHERE('fk_pd_id',$pdid)->ORDER_BY(PDOFFICERCURRENTLOCATIONID,'DESC')->LIMIT(1)->GET()->result_array();
+ $pdid = $this->db->SELECT('pd_id')->FROM(PDTRIGGER)->WHERE('random_string',$enc_string)->ORDER_BY(PDTRIGGERID,'DESC')->LIMIT(1)->GET()->result_array();
+ //print_r($this->db->last_query());
+ //print_r($pdid);
+
+ $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid[0]['pd_id']);
+ $offcier_name = $pd_master_details[0]['pd_allocated_to'];
+ $result_data['officer_details']['officer_name'] = $offcier_name;
+ $result_data['location'] = $this->db->SELECT('*')->FROM(PDOFFICERCURRENTLOCATION)->WHERE('fk_pd_id',$pdid[0]['pd_id'])->ORDER_BY(PDOFFICERCURRENTLOCATIONID,'DESC')->LIMIT(1)->GET()->result_array();
if(count($result_data))
{
@@ -5398,6 +5427,9 @@ class PD_Controller extends REST_Controller {
$form_data = $this->PD_Model->getScorablePDFormDetailsJSON($pdid);
//print_r($form_data);
+ //Get Latest Loan Amount form loan form.
+ $loan_amt_from_loam_form = json_decode($form_data[10][0]['processed_json'],true);
+ $loan_amt_from_loam_form = $loan_amt_from_loam_form['loan_amount'];
//seperate PD Scorable quesitons from JSON
$score_questions = $this->seperateScoreQuestions($form_data,$pd_master_details[0]['is_otp_done']);
@@ -5426,14 +5458,14 @@ class PD_Controller extends REST_Controller {
switch($combination)
{
case 111111:
- PDSCORE::calculatePDScore111($score_questions,$pd_master_details,$personal_asset_grid);
+ PDSCORE::calculatePDScore111($score_questions,$loan_amt_from_loam_form,$personal_asset_grid);
break;
default:
switch($pd_master_details[0]['fk_customer_segment'])
{
case 5:
- $score_questions = PDSCORE::genericDI($score_questions,$pd_master_details,$personal_asset_grid);
+ $score_questions = PDSCORE::genericDI($score_questions,$loan_amt_from_loam_form,$personal_asset_grid);
break;
}
}
@@ -5471,8 +5503,14 @@ class PD_Controller extends REST_Controller {
$score_questions['general']['person_met_is_applicant'] = 'yes';
}
}
+ //print_r($qualification_temp_array);
+ $qualification_temp_array = array_map(function($item){
+ return $item != "" || $item != null ? $item : 6;
+ },$qualification_temp_array);
+ //print_r($qualification_temp_array);
$min = count($qualification_temp_array) ? min($qualification_temp_array) : 6;
- //print_r($qualification_temp_array);die();
+
+ //die();
// 2 - QNO(1.8) - Qualification
@@ -5594,7 +5632,9 @@ class PD_Controller extends REST_Controller {
$supplier_count = count($manufacturing_details['main_raw_materials']) ? ++$supplier_count: $supplier_count;
+
}
+ //echo 'IN manu-'.$supplier_count;
}
if(array_key_exists('trade_details',$supplier_form))
@@ -5602,11 +5642,13 @@ class PD_Controller extends REST_Controller {
foreach($supplier_form['trade_details'] as $trade_details)
{
- $supplier_count = count($supplier_form['trade_details']) ? ++$supplier_count: $supplier_count;
+ $supplier_count = count($trade_details['trading_products']) ? ++$supplier_count: $supplier_count;
}
+ //echo 'IN trade-'.$supplier_count;
}
+ //echo $supplier_count;
// 16 - QNO(2.7) - atleast one supplier
$score_questions['business']['minimum_supplier_info'] = $supplier_count ? 'Provided':'Not Provided';
}
@@ -5614,6 +5656,8 @@ class PD_Controller extends REST_Controller {
{
$score_questions['business']['minimum_supplier_info'] = 'Not Applicable';
}
+
+ //echo $score_questions['business']['minimum_supplier_info'];die();
#####End of supplier Form Questions########
@@ -5639,7 +5683,7 @@ class PD_Controller extends REST_Controller {
foreach($client_form['trade_details'] as $trade_details)
{
- $client_count = count($client_form['trade_details']) ? ++$client_count: $client_count;
+ $client_count = count($trade_details['trading_products']) ? ++$client_count: $client_count;
}
}
@@ -5649,7 +5693,7 @@ class PD_Controller extends REST_Controller {
foreach($client_form['service_provider_details'] as $service_provider_details)
{
- $client_count = count($client_form['service_provider_details']) ? ++$client_count: $client_count;
+ $client_count = count($service_provider_details['service_products']) ? ++$client_count: $client_count;
}
}
@@ -5766,7 +5810,7 @@ class PD_Controller extends REST_Controller {
//pd_expense_id, fk_pd_id, expense_item_id, expense_value, fk_frequency_id, annual_expenses_value, isactive, fk_createdby, createdon, company_id, comments
$annual_emp_salary = ($records['employees_appx_salary'] * 12);
- echo $annual_emp_salary;
+ //echo $annual_emp_salary;
$temp_array = array( 'fk_pd_id' => $records['pdid'],'expense_item_id' => 3,'expense_value' => $records['employees_appx_salary'],'fk_frequency_id' => 7, 'annual_expenses_value' => $annual_emp_salary,'fk_createdby' => $records['fk_createdby'],'company_id' => $records['company_id'],'comments' => 'Derived from Business Form');
diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf
index c86992c4..d569bb40 100644
Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ
diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php
index 20720120..5e351148 100644
--- a/api/application/helpers/assetsform_helper.php
+++ b/api/application/helpers/assetsform_helper.php
@@ -7,32 +7,32 @@ public static function getOthersAssetsDetails($values){
$mergeResult=array();
foreach($values as $fetchVal){
$storeValue=array();
- $storeValue['assets_mode'] = $fetchVal['assets_mode'];
- $storeValue['name_of_the_owner'] = $fetchVal['name_of_the_owner']['id']==0 ? $fetchVal['other_owner'] : $fetchVal['name_of_the_owner']['name'];
+ $storeValue['assets_mode'] = $fetchVal['assets_mode_master'];
+ $storeValue['name_of_the_owner'] = $fetchVal['name_of_the_owner'][0]['id']==0 ? $fetchVal['other_owner'] : $fetchVal['name_of_the_owner'][0]['name'];
// this is for investments type
if($fetchVal['assets_mode']==7){
- $storeValue['approximate_market_value'] = 'Rs.'.$fetchVal['approximate_market_value'];
- switch($fetchVal['details'][0]['investments_type']) {
+ $storeValue['approximate_market_value'] = 'Rs.'.$fetchVal['details'][0]['amount_of_invest'];
+ switch($fetchVal['details'][0]['investments_type_master']) {
case 1:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['other_investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['other_investments_type'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
case 2:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
case 3:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
case 4:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
case 5:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
case 6:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
break;
default:
- $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type'].' with '.$fetchVal['details'][0]['bank_name'];
+ $storeValue['about_assets'] = ' Invested in '.$fetchVal['details'][0]['investments_type_master'].' with '.$fetchVal['details'][0]['in_which_organisation'];
}
@@ -70,14 +70,14 @@ public static function getOthersAssetsDetails($values){
}
// this is machinaries
else if($fetchVal['assets_mode']==4){
- $storeValue['approximate_market_value'] = '';
+ $storeValue['approximate_market_value'] = 'Rs.'.$fetchVal['approximate_market_value'];
$storeValue['about_assets'] = $fetchVal['details'][0]['equipment_manufacturing_description'];
}
// this is for vehicle
else if($fetchVal['assets_mode']==3){
- $storeValue['approximate_market_value'] = '';
+ $storeValue['approximate_market_value'] = 'Rs.'.$fetchVal['approximate_market_value'];
$storeValue['about_assets'] = $fetchVal['details'][0]['manufacturer_model_vehicle'].' purchased in '. $fetchVal['purchase_year'];
@@ -114,7 +114,7 @@ public static function getBusinessAssetsDetails($values){
$storeValue['business_approximate_market_value'] = '';
break;
case 'OWNED':
- $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner']['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner']['name'];
+ $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description'].' purchased in '.$fetchVal['business_purchase_year'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value'];
break;
diff --git a/api/application/helpers/businessform_helper.php b/api/application/helpers/businessform_helper.php
index 27c76d4c..8e395150 100644
--- a/api/application/helpers/businessform_helper.php
+++ b/api/application/helpers/businessform_helper.php
@@ -17,7 +17,7 @@ public static function getPartnerDetails($values){
'share_holding' => $tag['shareholding'].'%',
'no_years_business' => $con_business_run,
'total_experience' => $tag['total_business_experiance'],
- 'previous_experience' => array_key_exists('total_business_previous_experience',$tag) ? $tag['total_business_previous_experience'] : '',
+ 'previous_experience' => array_key_exists('total_business_previous_experience',$tag) ? $tag['total_business_previous_experience'] : 'NIL',
);
}, $values);
diff --git a/api/application/helpers/getprocessedjson_helper.php b/api/application/helpers/getprocessedjson_helper.php
index 05ff131e..d29ae92d 100644
--- a/api/application/helpers/getprocessedjson_helper.php
+++ b/api/application/helpers/getprocessedjson_helper.php
@@ -623,9 +623,11 @@ class GETPROCESSEDJSON
{
$CI->db->SELECT( $master_tables_field_names['PDAPPLICANTSDETAILS'] );
$CI->db->FROM(PDAPPLICANTSDETAILS);
- $CI->db->WHERE('isactive',1);
+ //$CI->db->WHERE('isactive',1);
$CI->db->WHERE( $master_tables_pkid['PDAPPLICANTSDETAILS'] ,$family_details['selected_person']);
$owner= $CI->db->GET()->result_array();
+ // print_r($CI->db->last_query());
+ // print_r($owner);
if(count($owner))
{
$selected_person_master = $owner[0][$master_tables_field_names['PDAPPLICANTSDETAILS']];
@@ -744,7 +746,7 @@ class GETPROCESSEDJSON
}
}
- return $raw_json;
+ return ($raw_json);
}
/*****************########## END OTHER FAMILY DETAILS FORM ##########**************/
@@ -1601,7 +1603,7 @@ class GETPROCESSEDJSON
$master_tables_field_names = $CI->config->item('master_tables_field_names');
$master_tables_pkid = $CI->config->item('master_tables_pkid');
- //print_r($raw_json);
+ //print_r($raw_json);die();
// GET KEYS FROM MASTER TABLE FOR SUPPLIER FORM
$fields = array('question', 'key', 'ismaster', 'master_name');
@@ -1619,7 +1621,8 @@ class GETPROCESSEDJSON
$CI->db->WHERE('isactive',1);
$CI->db->WHERE( $master_tables_pkid['ASSETTYPE'] ,$assets_detail['assets_mode']);
$assest_mode_name= $CI->db->GET()->result_array();
- //print_r($CI->db->last_query());
+ // print_r($assest_mode_name);
+ // print_r($CI->db->last_query());die();
if(count($assest_mode_name))
{
$raw_json['assets_details'][$assets_detail_key]['assets_mode_master'] = $assest_mode_name[0][$master_tables_field_names['ASSETTYPE']];
diff --git a/api/application/helpers/myutil_helper.php b/api/application/helpers/myutil_helper.php
index 9bbdfe01..2fe8c73c 100644
--- a/api/application/helpers/myutil_helper.php
+++ b/api/application/helpers/myutil_helper.php
@@ -15,17 +15,17 @@ class MYUTIL
$digits_1 = strlen($no);
$i = 0;
$str = array();
- $words = array('0' => '', '1' => 'one', '2' => 'two',
- '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six',
- '7' => 'seven', '8' => 'eight', '9' => 'nine',
- '10' => 'ten', '11' => 'eleven', '12' => 'twelve',
- '13' => 'thirteen', '14' => 'fourteen',
- '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
- '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',
- '30' => 'thirty', '40' => 'forty', '50' => 'fifty',
- '60' => 'sixty', '70' => 'seventy',
- '80' => 'eighty', '90' => 'ninety');
- $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
+ $words = array('0' => '', '1' => 'One', '2' => 'Two',
+ '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
+ '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
+ '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
+ '13' => 'Thirteen', '14' => 'Fourteen',
+ '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
+ '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
+ '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
+ '60' => 'Sixty', '70' => 'Seventy',
+ '80' => 'Eighty', '90' => 'Ninety');
+ $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
@@ -81,8 +81,13 @@ class MYUTIL
$getSentense = $value['company_name'];
$getSentense .=' is a ';
$getSentense .=$value['business_entity_type']==1 ? $value['business_entity_type_other'] : $value['business_entity_type_master'];
- $getSentense .=' ,formed on ';
- $getSentense .=$value['business_date_object'] ? date("d-m-Y", strtotime($value['business_date_object'])) : '';
+ $getSentense .=' formed on ';
+
+ $year_and_month = $value['business_years'] . ' Years';
+ $year_and_month .= isset($value['business_month']) ? $value['business_month'] . ' months ago': ' ago';
+ $getSentense .=$value['business_date_object'] ? date("d-m-Y", strtotime($value['business_date_object'])) : $year_and_month;
+
+
$getSentense .='.';
return $getSentense;
//return $value['company_name'].' is a '.$value['business_entity_type']==1 ? $value['business_entity_type_other'] : $value['business_entity_type_master'] .' formed on '.date("d-m-Y", strtotime($value['business_date_object']));
@@ -109,6 +114,13 @@ class MYUTIL
}
}
+ }
+
+ public static function customIndianNumberFormat($value)
+ {
+ $indian_num_format = numfmt_create( 'en_IN', NumberFormatter::CURRENCY );
+ //echo numfmt_format_currency($indian_num_format,$value, "INR");
+ return numfmt_format_currency($indian_num_format,$value, "INR");
}
}
diff --git a/api/application/helpers/pdscore_helper.php b/api/application/helpers/pdscore_helper.php
index 557094be..a1e4ffe5 100644
--- a/api/application/helpers/pdscore_helper.php
+++ b/api/application/helpers/pdscore_helper.php
@@ -8,7 +8,7 @@ class PDSCORE
}
- public static function genericDI($score_questions,$pd_master_details,$personal_asset_grid)
+ public static function genericDI($score_questions,$loan_amt_from_loam_form,$personal_asset_grid)
{
//print_r($score_questions);echo "###################";
@@ -107,7 +107,7 @@ class PDSCORE
$neibourhood_check_as_per_pd_officer_max_score = ($l1_general/100) * ($neibourhood_check_as_per_pd_officer_L2/100) * max($neibourhood_check_as_per_pd_officer);
- $score_questions['general']['neibourhood_check_as_per_pd_officer'] = array('l1_weightage' => $l1_general,'l2_weightage' => $neibourhood_check_as_per_pd_officer_L2,'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['neibourhood_check_as_per_pd_officer'],'attributed_score' => $neibourhood_check_as_per_pd_officer_actual_score, 'max_score' => $neibourhood_check_as_per_pd_officer_max_score,'score_band'=>$neibourhood_check_as_per_pd_officer[$score_questions['general']['neibourhood_check_as_per_pd_officer'] != "" || $score_questions['general']['neibourhood_check_as_per_pd_officer'] != null ?$score_questions['general']['neibourhood_check_as_per_pd_officer']: "Negative" ],'max_score_band' => max($neibourhood_check_as_per_pd_officer));
+ $score_questions['general']['neibourhood_check_as_per_pd_officer'] = array('l1_weightage' => $l1_general,'l2_weightage' => $neibourhood_check_as_per_pd_officer_L2,'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['neibourhood_check_as_per_pd_officer'],'attributed_score' => round($neibourhood_check_as_per_pd_officer_actual_score,2), 'max_score' => round($neibourhood_check_as_per_pd_officer_max_score,2),'score_band'=>$neibourhood_check_as_per_pd_officer[$score_questions['general']['neibourhood_check_as_per_pd_officer'] != "" || $score_questions['general']['neibourhood_check_as_per_pd_officer'] != null ?$score_questions['general']['neibourhood_check_as_per_pd_officer']: "Negative" ],'max_score_band' => max($neibourhood_check_as_per_pd_officer));
}
@@ -126,7 +126,7 @@ class PDSCORE
$person_met_is_applicant_max_score = ($l1_general/100) * ($person_met_is_applicant_L2/100) * max($person_met_is_applicant);
- $score_questions['general']['person_met_is_applicant'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($person_met_is_applicant_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['person_met_is_applicant'],'attributed_score' => $person_met_is_applicant_actual_score, 'max_score' => $person_met_is_applicant_max_score,'score_band'=>($person_met_is_applicant[$score_questions['general']['person_met_is_applicant']]),'max_score_band' => max($person_met_is_applicant));
+ $score_questions['general']['person_met_is_applicant'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($person_met_is_applicant_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['person_met_is_applicant'],'attributed_score' => round($person_met_is_applicant_actual_score,2), 'max_score' => round($person_met_is_applicant_max_score,2),'score_band'=>($person_met_is_applicant[$score_questions['general']['person_met_is_applicant']]),'max_score_band' => max($person_met_is_applicant));
//######1.2 pd_location_approach
@@ -136,7 +136,7 @@ class PDSCORE
$pd_location_approach_max_score = ($l1_general/100) * ($pd_location_approach_L2/100) * max($pd_location_approach);
- $score_questions['general']['pd_location_approach'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($pd_location_approach_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['pd_location_approach'],'attributed_score' => $pd_location_approach_actual_score, 'max_score' => $pd_location_approach_max_score,'score_band'=>$pd_location_approach[$score_questions['general']['pd_location_approach']],'max_score_band' => max($pd_location_approach));
+ $score_questions['general']['pd_location_approach'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($pd_location_approach_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['pd_location_approach'],'attributed_score' => round($pd_location_approach_actual_score,2), 'max_score' => round($pd_location_approach_max_score,2),'score_band'=>$pd_location_approach[$score_questions['general']['pd_location_approach']],'max_score_band' => max($pd_location_approach));
//######1.3 comment_locality
@@ -146,7 +146,7 @@ class PDSCORE
$comment_locality_max_score = ($l1_general/100) * ($comment_locality_L2/100) * max($comment_locality);
- $score_questions['general']['comment_locality'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($comment_locality_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['comment_locality'],'attributed_score' => $comment_locality_actual_score, 'max_score' => $comment_locality_max_score,'score_band'=>$comment_locality[$score_questions['general']['comment_locality']],'max_score_band' => max($comment_locality));
+ $score_questions['general']['comment_locality'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($comment_locality_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['comment_locality'],'attributed_score' => round($comment_locality_actual_score,2), 'max_score' => round($comment_locality_max_score,2),'score_band'=>$comment_locality[$score_questions['general']['comment_locality']],'max_score_band' => max($comment_locality));
//######1.4 customer_behaviour
@@ -156,7 +156,7 @@ class PDSCORE
$customer_behaviour_max_score = ($l1_general/100) * ($customer_behaviour_L2/100) * max($customer_behaviour);
- $score_questions['general']['customer_behaviour'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($customer_behaviour_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['customer_behaviour'],'attributed_score' => $customer_behaviour_actual_score, 'max_score' => $customer_behaviour_max_score,'score_band'=>$customer_behaviour[$score_questions['general']['customer_behaviour']],'max_score_band' => max($customer_behaviour));
+ $score_questions['general']['customer_behaviour'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($customer_behaviour_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['customer_behaviour'],'attributed_score' => round($customer_behaviour_actual_score,2), 'max_score' => round($customer_behaviour_max_score,2),'score_band'=>$customer_behaviour[$score_questions['general']['customer_behaviour']],'max_score_band' => max($customer_behaviour));
//######1.6 was_the_company_name_board_sighted
@@ -166,7 +166,7 @@ class PDSCORE
$was_the_company_name_board_sighted_max_score = ($l1_general/100) * ($was_the_company_name_board_sighted_L2/100) * max($was_the_company_name_board_sighted);
- $score_questions['general']['was_the_company_name_board_sighted'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($was_the_company_name_board_sighted_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['was_the_company_name_board_sighted'],'attributed_score' => $was_the_company_name_board_sighted_actual_score, 'max_score' => $was_the_company_name_board_sighted_max_score,'score_band'=>$was_the_company_name_board_sighted[$score_questions['general']['was_the_company_name_board_sighted']],'max_score_band' => max($was_the_company_name_board_sighted));
+ $score_questions['general']['was_the_company_name_board_sighted'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($was_the_company_name_board_sighted_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['was_the_company_name_board_sighted'],'attributed_score' => round($was_the_company_name_board_sighted_actual_score,2), 'max_score' => round($was_the_company_name_board_sighted_max_score,2),'score_band'=>$was_the_company_name_board_sighted[$score_questions['general']['was_the_company_name_board_sighted']],'max_score_band' => max($was_the_company_name_board_sighted));
//######1.7 otp_done
@@ -176,7 +176,7 @@ class PDSCORE
$otp_done_max_score = ($l1_general/100) * ($otp_done_L2/100) * max($otp_done);
- $score_questions['general']['otp_done'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($otp_done_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['otp_done'],'attributed_score' => $otp_done_actual_score, 'max_score' => $otp_done_max_score,'score_band'=>$otp_done[$score_questions['general']['otp_done']],'max_score_band' => max($otp_done));
+ $score_questions['general']['otp_done'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($otp_done_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['otp_done'],'attributed_score' => round($otp_done_actual_score,2), 'max_score' => round($otp_done_max_score,2),'score_band'=>$otp_done[$score_questions['general']['otp_done']],'max_score_band' => max($otp_done));
//######1.8 qualification
@@ -187,7 +187,7 @@ class PDSCORE
$qualification_max_score = ($l1_general/100) * ($qualification_L2/100) * max($qualification['id_score']);
$keys = array_keys($qualification['name_score']);
- $score_questions['general']['qualification'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($qualification_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $keys[($score_questions['general']['qualification']-1)],'attributed_score' => $qualification_actual_score, 'max_score' => $qualification_max_score,'score_band'=>$qualification['id_score'][$score_questions['general']['qualification']],'max_score_band' => max($qualification['id_score']));
+ $score_questions['general']['qualification'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($qualification_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $keys[($score_questions['general']['qualification']-1)],'attributed_score' => round($qualification_actual_score,2), 'max_score' => round($qualification_max_score,2),'score_band'=>$qualification['id_score'][$score_questions['general']['qualification']],'max_score_band' => max($qualification['id_score']));
//######1.9 value of assets as a % of Loan Amount
//print_r($personal_asset_grid);
@@ -199,8 +199,8 @@ class PDSCORE
$actual_value_of_assets = $score_questions['general']['value_of_other_assets'];
$asset_calculation_details['actual_value_of_assets'] = round($actual_value_of_assets,2);
//echo 'actual_value_of_assets -'.$actual_value_of_assets;die();
-
- $loan_amount = $pd_master_details[0]['loan_amount'];
+ //print_r($loan_amt_from_loam_form);
+ $loan_amount = $loan_amt_from_loam_form;
$asset_calculation_details['loan_amount'] = $loan_amount;
//echo 'loan_amount - '.$loan_amount;
@@ -240,7 +240,7 @@ class PDSCORE
$asset_calculation_details['score'] = $final_asset_score;
// echo "final_asset_score--".$final_asset_score;
// die();
- $score_questions['general']['value_of_other_assets'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($value_of_other_assets_L2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['value_of_other_assets'],'attributed_score' => $final_asset_attributed_score, 'max_score' => (($l1_general/100 ) * ($value_of_other_assets_L2/100) * 10),'score_band'=> $final_asset_score,'max_score_band' => 10);
+ $score_questions['general']['value_of_other_assets'] = array('l1_weightage' => $l1_general,'l2_weightage' => round($value_of_other_assets_L2,2),'distributed_weightage' => $general_distribute_level_weightage,'answer' => $score_questions['general']['value_of_other_assets'],'attributed_score' => round($final_asset_attributed_score,2), 'max_score' => round((($l1_general/100 ) * ($value_of_other_assets_L2/100) * 10),2),'score_band'=> $final_asset_score,'max_score_band' => 10);
/*-----------END OF GENERAL SECTION -----------*/
@@ -305,11 +305,11 @@ class PDSCORE
//######2.9 stock of raw material
$stock_raw_material_enough_L2 = $business_distribute_level_weightage ? ($stock_raw_material_enough_L2 + ($stock_raw_material_enough_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $stock_raw_material_enough_L2 ;
- $stock_raw_material_enough_actual_score = ($l1_business/100) * ($stock_raw_material_enough_L2/100) * $stock_answer_scores [ $score_questions['business']['stock_raw_material_enough'] ];
+ $stock_raw_material_enough_actual_score = ($l1_business/100) * ($stock_raw_material_enough_L2/100) * $stock_answer_scores [ strtolower($score_questions['business']['stock_raw_material_enough']) ];
- $stock_raw_material_enough_max_score = strcasecmp($score_questions['business']['stock_raw_material_enough'],'Not Applicable')? ($l1_business/100) * ($stock_raw_material_enough_L2/100) * max($stock_answer_scores) : 0;
+ $stock_raw_material_enough_max_score = ($l1_business/100) * ($stock_raw_material_enough_L2/100) * max($stock_answer_scores);
- $score_questions['business']['stock_raw_material_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_raw_material_enough_L2,2),'answer' => $score_questions['business']['stock_raw_material_enough'],'attributed_score' => round($stock_raw_material_enough_actual_score,2), 'max_score' => round($stock_raw_material_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ $score_questions['business']['stock_raw_material_enough'] ],'max_score_band' =>max($stock_answer_scores) );
+ $score_questions['business']['stock_raw_material_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_raw_material_enough_L2,2),'answer' => $score_questions['business']['stock_raw_material_enough'],'attributed_score' => round($stock_raw_material_enough_actual_score,2), 'max_score' => round($stock_raw_material_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ strtolower($score_questions['business']['stock_raw_material_enough']) ],'max_score_band' =>max($stock_answer_scores) );
//######2.10 stock_finished_goods_enough
$stock_finished_goods_enough_L2 = $business_distribute_level_weightage ? ($stock_finished_goods_enough_L2 + ($stock_finished_goods_enough_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $stock_finished_goods_enough_L2 ;
@@ -318,7 +318,9 @@ class PDSCORE
$stock_finished_goods_enough_max_score = strcasecmp($score_questions['business']['stock_finished_goods_enough'],'Not Applicable') ? ($l1_business/100) * ($stock_finished_goods_enough_L2/100) * max($stock_answer_scores) : 0;
- $score_questions['business']['stock_finished_goods_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_finished_goods_enough_L2,2),'answer' => $score_questions['business']['stock_finished_goods_enough'],'attributed_score' => round($stock_finished_goods_enough_actual_score,2), 'max_score' => round($stock_finished_goods_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ $score_questions['business']['stock_finished_goods_enough'] != "" || $score_questions['business']['stock_finished_goods_enough'] != null ? $score_questions['business']['stock_finished_goods_enough'] : "no" ],'max_score_band' => max($stock_answer_scores));
+
+ $temp_stock_finished_goods_enough = strtolower($score_questions['business']['stock_finished_goods_enough']);
+ $score_questions['business']['stock_finished_goods_enough'] = array('l1_weightage' => $l1_business,'l2_weightage' => round($stock_finished_goods_enough_L2,2),'answer' => $score_questions['business']['stock_finished_goods_enough'],'attributed_score' => round($stock_finished_goods_enough_actual_score,2), 'max_score' => round($stock_finished_goods_enough_max_score,2),'distributed_weightage' => $business_distribute_level_weightage,'score_band' => $stock_answer_scores [ $temp_stock_finished_goods_enough != "" || $temp_stock_finished_goods_enough != null ? $temp_stock_finished_goods_enough : "no" ],'max_score_band' => max($stock_answer_scores));
diff --git a/api/application/libraries/Pdfgenerator.php b/api/application/libraries/Pdfgenerator.php
index f5b5473f..e187227d 100644
--- a/api/application/libraries/Pdfgenerator.php
+++ b/api/application/libraries/Pdfgenerator.php
@@ -30,7 +30,7 @@ class Pdfgenerator
$canvas = $dompdf->get_canvas();
//$font = Font_Metrics::get_font("helvetica", "bold");
$font = null;
- $canvas->page_text(515,750, "Page {PAGE_NUM} of {PAGE_COUNT}", $font,8, array(0,0,0));
+ $canvas->page_text(515,760, "Page {PAGE_NUM} of {PAGE_COUNT}", $font,8, array(0,0,0));
if ($stream) {
$dompdf->stream($filename.".pdf", array("Attachment" => 0));
diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php
index c1dbfbc7..9ffed26e 100644
--- a/api/application/models/PD_Model.php
+++ b/api/application/models/PD_Model.php
@@ -685,7 +685,7 @@ class PD_Model extends SPARQ_Model {
*/
public function getPDMasterDetails($pdid)
{
- $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done');
+ $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url');
$this->db->FROM(PDTRIGGER.' as PDTRIGGER');
$this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT');
$this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT');
@@ -1378,7 +1378,7 @@ class PD_Model extends SPARQ_Model {
public function getScorablePDFormDetailsJSON($pdid)
{
- $array = array(1,2,4,5,11,13,18,19,20,21,22);
+ $array = array(1,2,4,5,11,13,18,19,20,21,22,10);
$return_data = array();
foreach($array as $key => $value)
{
diff --git a/api/application/views/js/phantomchart.js b/api/application/views/js/phantomchart.js
index f6e17d38..8bb28df3 100644
--- a/api/application/views/js/phantomchart.js
+++ b/api/application/views/js/phantomchart.js
@@ -1 +1 @@
-var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 72.11;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
\ No newline at end of file
+var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 55;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
\ No newline at end of file
diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php
index 08004380..e6280a36 100644
--- a/api/application/views/report_templates/JSONTOREPORT.php
+++ b/api/application/views/report_templates/JSONTOREPORT.php
@@ -13,7 +13,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
@page {
margin: 100px 50px;
font-family:Helvetica,Arial;
- }
+ }
header {
position: fixed;
top: -70px;
@@ -32,7 +32,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
bottom: 5px;
left: 0px;
right: 0px;
- height: 30px;
+ height: 20px;
font-size: 10px;
/** Extra personal styles **/
@@ -63,25 +63,26 @@ defined('BASEPATH') OR exit('No direct script access allowed');
tfoot{
color:#e00201;
}
+
/* #########Score Card Table Styles######### */
- #scorecard_table {
+ .scorecard_table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
-#scorecard_table td, #scorecard_table th {
+.scorecard_table td, .scorecard_table th {
border: 1px solid #ddd;
padding: 8px;
}
-#scorecard_table tr:nth-child(even){background-color: #f2f2f2;}
+.scorecard_table tr:nth-child(even){background-color: #f2f2f2;}
-#scorecard_table tr:hover {background-color: #ddd;}
+.scorecard_table tr:hover {background-color: #ddd;}
-#scorecard_table th {
+.scorecard_table th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
@@ -91,6 +92,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
.customth { width: 10%; }
/* #########Score Card Table Styles######### */
+
@@ -116,7 +118,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
";
- setlocale(LC_MONETARY, 'en_IN');
+
echo "
| As Per PD Initiation | Rs " . number_format($pd_master_details[0]['loan_amount'],2,'.',','). ". | ||||
| As Per Loan Applicants during PD | Rs " . number_format($loan_form['loan_amount'],2,'.',','). ". | ||||
| As Per PD Initiation | ₹" . MYUTIL::customIndianNumberFormat($pd_master_details[0]['loan_amount']). " (". MYUTIL::numtowords($pd_master_details[0]['loan_amount']) .") | |||
| As Per Loan Applicants during PD | ₹" . MYUTIL::customIndianNumberFormat($loan_form['loan_amount']). " (". MYUTIL::numtowords($loan_form['loan_amount']) .") |
| Asset Value Calculaitons | |
|---|---|
| Actual Value Of Assets(a) | ". number_format($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets'],2,'.',',')." |
| Loan Amount(b) | ". number_format($pd_score['score_summary']['asset_calculation_details']['loan_amount'],2,'.',',')." |
| Avg Expected Value Of Assets(c) | ". round($pd_score['score_summary']['asset_calculation_details']['avg_expected_value_of_assets'],2)."% |
| Expected Value Of Assets(d = c*b) | ". number_format($pd_score['score_summary']['asset_calculation_details']['expected_value_of_assets'],2,'.',',')." |
| Actual Value Of Assets Percentage(e = (a/b) * 100) | ". round($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets_percentage'],2)."% |
| Variance(f = ((e-c)/c) * 100) | ". round($pd_score['score_summary']['asset_calculation_details']['variance'],2)." |
| Score As per Grid | ". round($pd_score['score_summary']['asset_calculation_details']['score'],2)." |
| Final Remarks Questions L1(". $pd_score['final_remarks']['pd_officer_recommandations']['l1_weightage']."%) | L2 | Answer | Score | Attributed Score | Max Score |
|---|---|---|---|---|---|
| '.$question.' | '.$final_remark['l2_weightage'].'% | '.$final_remark['answer'].' | '.$final_remark['score_band'].' | '.$final_remark['attributed_score'].' '.$span.' | '.$final_remark['max_score'].' '.$max_span.' |
| Final Remarks Section Sum of Attributed Score | Sum of Max Score | ".number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')." | ".number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')." | |||
| Business Questions L1(". $pd_score['business']['no_of_years_business_run']['l1_weightage']."%) | L2 | Answer | Score | Attributed Score | Max Score |
|---|---|---|---|---|---|
| '.$question.' | '.$business['l2_weightage'].'% | '.$business['answer'].' | '.$business['score_band'].' | '.$business['attributed_score'].' '.$span.' | '.$business['max_score'].' '.$max_span.' |
| Certificates | '.round($business['l2_weightage'],2).'% | '.'Refer Cert Table'.' | '.$business['score_band'].' | '.$business['attributed_score'].' | '.$business['max_score'].' |
| Business Section Sum of Attributed Score | Sum of Max Score | ".number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')." | ".number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')." | |||
| Business Certificates | Answer | Score | Attributed Score | Max Score | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| '.$question.' | '.$cerificate['answer'].' | '.$cerificate['score_band'].' | '.round($cerificate['attributed_score'],3).' '.$span.' | '.round($cerificate['max_score'],3).' '.$max_span.' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".$individual['applicant_title_name_master'].$applicant_name." | ";
foreach($general_form['company_with_relationships'] as $company_with_relationship)
@@ -378,8 +271,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if($individual['pd_co_applicant_id'] == $persons_with_relationship['pd_co_applicant_id'] && $persons_with_relationship['relationship'] != null)
{
echo " "; - $RSNA = isset($persons_with_relationship['relation_to_master']) ? $persons_with_relationship['relation_to_master'] : "RRRR"; - print_r($persons_with_relationship['relationship_master'] .' Of '. $RSNA); + $RSNA = isset($persons_with_relationship['relation_to_master']) ? $persons_with_relationship['relation_to_master'] : " Could Not Find"; + isset($persons_with_relationship['relationship_master']) ? print_r($persons_with_relationship['relationship_master'] .' Of '. $RSNA) : ""; //print_r($persons_with_relationship); } } @@ -398,11 +291,1525 @@ defined('BASEPATH') OR exit('No direct script access allowed'); + + + Location Details : + + $address)
+ {
+
+
+ $address_key == 0? $paragraph_starting_text = "The applicants were met at their ": $paragraph_starting_text = "The applicants were also met at their ";
+
+ $address_type = $address['address_type_others'] != "" ? $address['address_type_others'] : $address['address_type_master'];
+
+ $locality_type = $address['locality_others'] != "" ? $address['locality_others'] : $address['locality_master'];
+
+
+ echo $paragraph_starting_text.$address_type." at ".$address['address'].". The PD location is situated in an area that can be classified as ".$locality_type.", and the approach was ".$address['pd_location_master'].". The locality was ".$address['comment_locality_master'].". PD Officer's Note (About Location Details) : + + + + + + ++ Loan Details : + A loan for Rs ".MYUTIL::customIndianNumberFormat($loan_form['loan_amount'])." (".MYUTIL::numtowords($loan_form['loan_amount']).") has been applied by the applicant for ".$loan_form['end_use_master'][0]."."; + if($loan_form['is_transfer'] == 'yes') + { + echo "There is a balance transfer of Rs. ".MYUTIL::customIndianNumberFormat($loan_form['balance_transfer_amount'])." (".MYUTIL::numtowords($loan_form['balance_transfer_amount']).")from ".$loan_form['lender_master'].",and the balance top up of Rs.".$loan_form['topup_amount']." is to be used for ".$loan_form['end_use_topup_master'].". The applicants are comfortable to pay an EMI of Rs.".MYUTIL::customIndianNumberFormat($loan_form['emi_level'])." per month."; + } + else + { + $own_contribution_string = ""; + if(count($loan_form['source_of_own_contribution_master'])) + { + $own_contribution_string = implode(" , ",$loan_form['source_of_own_contribution_master']); + } + // echo $own_contribution_string; + // echo "#################".strripos($own_contribution_string,','); + if($loan_form['other_source'] != "") + { + $own_contribution_string = substr_replace($own_contribution_string,"and",strripos($own_contribution_string,','),1); + } + echo "The amount of Rs.".MYUTIL::customIndianNumberFormat($loan_form['own_contribution'])." as own contribution from ".$own_contribution_string.". The applicants are comfortable to pay an EMI of Rs.".MYUTIL::customIndianNumberFormat($loan_form['emi_level'])." per month."; + } + + + //print_r($loan_form['owners_list_master']); + $owners_list = ""; + if(count($loan_form['owners_list_master'])) + { + foreach($loan_form['owners_list_master'] as $owner) + { + $owners_list .= $owner." , "; + } + $owners_list = substr($owners_list,0,(strlen($owners_list)-2)); + } + + //echo "#################".strripos($owners_list,','); + $owners_list = count($loan_form['owners_list_master']) > 1 ? substr_replace($owners_list," and ",strripos($owners_list,','),1) : $owners_list ; + echo "The property being mortgaged is a ".$loan_form['property_type_master']." owned by ".$owners_list.", and is ".$loan_form['construction_status_master']." with an estimated market value of Rs ".number_format($loan_form['emv_per_customer'])."(".MYUTIL::numtowords($loan_form['emv_per_customer']).")"; + + if($loan_form['loandetails_remarks'] != "" || $loan_form['loandetails_remarks'] != null) + { + ?> ++ PD Officer's Note (About Loan Details) : + + + + + + $bRow) { + $businessRow = json_decode($bRow['processed_json'],true); + $companyList = MYUTIL::findCompanyName($all_company_details,$businessRow['company_id'],2); + //$companyList .=' The director details are as under :'; + $bindEachResult["company_name"]=$companyList; + // this is for partner details + if(array_key_exists('partners',$businessRow)){ + $bindEachResult["partner"]=Businessform::getPartnerDetails($businessRow['partners']); + } + else { + $getPartner=array(); + $bindEachResult["partner"]=$getPartner; + } + // this is for person with relationship + if(array_key_exists('persons_with_relationships',$businessRow)){ + $bindEachResult["family_members_involved"]=Businessform::getFamilyMemberDetails($businessRow['persons_with_relationships']); + } + else { + $getFamilyMembers=array(); + $bindEachResult["family_members_involved"]=$getFamilyMembers; + } + // this is for manufacturing activities + + if(array_key_exists('manufacturing_activity_details',$businessRow)){ + $bindEachResult['manufacturing'] = Businessform::getActivityDetails($businessRow['manufacturing_activity_details'],1); + } + else{ + $getManufacturingRow=array(); + $bindEachResult['manufacturing']=$getManufacturingRow; + } + // this is for retail activites + if(array_key_exists('retail_trading_activity_details',$businessRow)){ + $bindEachResult['retail'] = Businessform::getActivityDetails($businessRow['retail_trading_activity_details'],2); + } + else{ + $getRetailRow=array(); + $bindEachResult['retail']=$getRetailRow; + } + // this is for whole sale activites + if(array_key_exists('wholesale_trading_activity_details',$businessRow)){ + $bindEachResult['wholesale'] = Businessform::getActivityDetails($businessRow['wholesale_trading_activity_details'],3); + } + else{ + $getWholesaleRow=array(); + $bindEachResult['wholesale']=$getWholesaleRow; + } + + // this is for service provider + if(array_key_exists('service_provider_activity_details',$businessRow)){ + $bindEachResult['serviceprovider']=Businessform::getActivityDetails($businessRow['service_provider_activity_details'],4); + } + else{ + $getServiceproviderRow=array(); + $bindEachResult['serviceprovider']=$getServiceproviderRow; + } + // this is for other activity details + if(array_key_exists('others_activity_details',$businessRow)){ + $bindEachResult['otheractivity']=Businessform::getActivityDetails($businessRow['others_activity_details'],5); + } + else{ + $getOtheractivityRow=array(); + $bindEachResult['otheractivity']=$getOtheractivityRow; + } + // this if for get business peak period + if(strtoupper($businessRow['seasonality'])=='YES' && array_key_exists('peak_period_of_business',$businessRow)){ + $bindEachResult['business_peak_details']=Businessform::getBusinessPeakDetails($businessRow['peak_period_of_business']); + } + else{ + $bindEachResult['business_peak_details']='The Business has no major changes in sales across season.'; + } + // this is for no of employess details + $bindEachResult['company_empployees']='As per person met there are '.$businessRow['employees_permanent'].' permanent and '.$businessRow['employees_temporary'].' temporary employees with company.'; + $bindEachResult['officer_visit_company_empployees']='The PD Officer could notice approximately '.$businessRow['officer_total'] .' employees during the visit.'; + //this is documents visited + $getDocuments=array(); + if(array_key_exists('shop_eat_act_cert',$businessRow) && strtoupper($businessRow['shop_eat_act_cert'])=='YES'){ + array_push($getDocuments,'Shop/Est act Certificate.'); + } + if(array_key_exists('gst_Regn_cert',$businessRow) && strtoupper($businessRow['gst_Regn_cert'])=='YES'){ + array_push($getDocuments,'GST Registration.'); + } + if(array_key_exists('pf_regn',$businessRow) && strtoupper($businessRow['pf_regn'])=='YES'){ + array_push($getDocuments,'PF Registration.'); + } + if(array_key_exists('esic_regn',$businessRow) && strtoupper($businessRow['esic_regn'])=='YES'){ + array_push($getDocuments,'ESIC Registration.'); + } + if(array_key_exists('export_import_cert',$businessRow) && strtoupper($businessRow['export_import_cert'])=='YES'){ + array_push($getDocuments,'Export/Import Certificate.'); + } + if(array_key_exists('factory_cert',$businessRow) && strtoupper($businessRow['factory_cert'])=='YES'){ + array_push($getDocuments,'Factory Certificate.'); + } + if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){ + foreach($businessRow['documents'] as $docValue){ + array_push($getDocuments,$docValue['document'].'.'); + } + } + $bindEachResult['visit_documents']=$getDocuments; + array_push($businessResult,$bindEachResult); + } + ?> +Business Details+ $fetchRow){ + ?> +About Company : The director details are as under :
+
+ Besides the above, the below family members are also involved in the business : +
+
+ The Manufacturing details are as under : +
+
+ The Retail Trading details are as under : +
+
+ The Service Provider details are as under : +
+
+ The Wholesale Trading details are as under : +
+
+ Other activity details are as under : +
+
+
+
+
+
+
+
+
+
+
+ The below documents were sighted during the visit : +
Financial Information+ 0){ ?> + + + 0){ ?> +
Financial information is not available. + + + + + + + $cRow) { + $clientRow = json_decode($cRow['processed_json'],true); + + $bindEachResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1); + $getmanufacturing = array(); + $getTrading=array(); + $getService=array(); + $getTotalPaymentsPercentonCredit=array(); + if(array_key_exists('manufacturing_details',$clientRow)){ + foreach($clientRow['manufacturing_details'] as $manuRow){ + if(isset($manuRow['main_raw_materials'])){ + $getmanufacturing = array_map(function($tag) { + return array( + 'product' => $tag['manufacturing_product_name'], + 'client_name' => $tag['manufacturing_client_name'], + 'person_title_name' => array_key_exists('person_title_name_master',$tag) ? $tag['person_title_name_master'] : '', + 'person_designation' => ($tag['person_designation']==1) ? $tag['other_person_designation'] : ($tag['person_designation']>1 ? $tag['person_designation_master']: ''), + 'contact_person_name' => $tag['manufacturing_contact_person_name'], + 'contact_person_mobile_number' => $tag['manufacturing_contact_person_mobile_number'], + 'payment_type_master' => array_key_exists('manufacturing_payment_type_master',$tag) ? $tag['manufacturing_payment_type_master'] : '', + + ); + }, $manuRow['main_raw_materials']); + array_push($getTotalPaymentsPercentonCredit,$manuRow['main_raw_materials_total_payments_percent_on_credit']); + + } + } + } + // this is for trading + if(array_key_exists('trade_details',$clientRow)){ + foreach($clientRow['trade_details'] as $tradeRow){ + + if(isset($tradeRow['trading_products'])){ + + $getTrading = array_map(function($tag) { + return array( + 'product' => $tag['trade_product_name'], + 'client_name' => $tag['trade_client_name'], + 'person_title_name' => array_key_exists('person_title_name_master',$tag) ? $tag['person_title_name_master'] : '', + 'person_designation' => ($tag['person_designation']==1) ? $tag['other_person_designation'] : ($tag['person_designation']>1 ? $tag['person_designation_master']: ''), + 'contact_person_name' => $tag['trade_product_contact_person_name'], + 'contact_person_mobile_number' => $tag['trade_product_contact_person_mobile_number'], + 'payment_type_master' => array_key_exists('trade_product_payment_type_master',$tag) ? $tag['trade_product_payment_type_master'] :'', + + ); + }, $tradeRow['trading_products']); + array_push($getTotalPaymentsPercentonCredit,$tradeRow['trading_products_total_payments_percent_on_credit']); + + } + } + } + + //this is for service + if(array_key_exists('service_provider_details',$clientRow)){ + foreach($clientRow['service_provider_details'] as $serviceRow){ + + if(isset($serviceRow['service_products'])){ + + $getService = array_map(function($tag) { + return array( + 'product' => $tag['service_provider_product_name'], + 'client_name' => $tag['service_provider_client_name'], + 'person_title_name' => array_key_exists('person_title_name_master',$tag) ? $tag['person_title_name_master'] : '', + 'person_designation' => ($tag['person_designation']==1) ? $tag['other_person_designation'] : ($tag['person_designation']>1 ? $tag['person_designation_master']: ''), + 'contact_person_name' => $tag['service_provider_product_contact_person_name'], + 'contact_person_mobile_number' => $tag['service_provider_product_contact_person_mobile_number'], + 'payment_type_master' => array_key_exists('service_provider_product_payment_type_master',$tag) ? $tag['service_provider_product_payment_type_master'] :'', + + ); + }, $serviceRow['service_products']); + array_push($getTotalPaymentsPercentonCredit,$serviceRow['service_products_total_payments_percent_on_credit']); + + } + } + } + $bindEachResult["details"]=array_merge($getmanufacturing,$getTrading,$getService); + $bindEachResult['total_payments_percent_on_credit'] = $getTotalPaymentsPercentonCredit; + array_push($clientResult,$bindEachResult); + + } + + ?> +Client Details+ +
Supplier Details+ +
Stock Details+ + + + + 0) { ?> +The Manufacturing stock details are as under : +
The Retail trading stock details are as under : +
The Wholesale trading stock details are as under : +
Asset Details+ 0){ ?> + + +
Business asset is not available. + + + + + + + $oaRow) { + $otherAssetRow = json_decode($oaRow['processed_json'],true); + if(count($otherAssetRow['assets_details'])>0){ + $otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details']); + + //print_r($otherAssetResult);die(); + } + } + ?> +Personal Assets+ 0){ ?> +
Personal asset is not available. + + + + + $iRow) { + $otherIcomeRow = json_decode($iRow['processed_json'],true); + if(strtoupper($otherIcomeRow['other_income'])=='YES' && count($otherIcomeRow['income_details'])>0){ + $otherIncomeResult=OTHERINCOMEFORM::getIncomeDetails($otherIcomeRow['income_details']); + } + } + ?> +Other Income Details+ 0){ ?> +The below mentioned other source of income were shared : +
Other source of income is not available. + + + + + + $ibRow) { + $individualBankRow = json_decode($ibRow['processed_json'],true); + if(count($individualBankRow['banking_details'])>0){ + $getIndividualEachValues=BANKINGFORM::getIndividualBankingDetails($individualBankRow['banking_details']); + $bankingResult = array_merge($bankingResult,$getIndividualEachValues); + + } + } + // business banking + foreach($pd_processed_forms[21] as $rowKey=> $bbRow) { + $businessBankRow = json_decode($bbRow['processed_json'],true); + if(count($businessBankRow['banking_details'])>0){ + $getEachValues=BANKINGFORM::getBusinessBankingDetails($businessBankRow['banking_details']); + $bankingResult = array_merge($bankingResult,$getEachValues); + + } + } + ?> +Banking Details+ 0){ ?> +Below bank account details were shared : +
Bank account details is not available. + + + + + $elRow) { + $otherLoanRow = json_decode($elRow['processed_json'],true); + if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){ + $existLoanResult=FINANCIALFORM::getOtherLoanDetails($otherLoanRow['loan_details']); + } + } + ?> + 0){ ?> +Other Financial Information+ +The below current loan obligations were shared : +
Other Family Details+ 0){ ?> + $fmValue) { ?> ++
Family of +
Other Family Members is not available. + + + + + + + $nrcRow) { + $neighbourRefRow = json_decode($nrcRow['processed_json'],true); + if(count($neighbourRefRow['neighbourhood_list'])>0){ + $existNeighRefCheck=NEIGHBOURREFERENCECHECKFORM::getNeighbourhoodDetails($neighbourRefRow['neighbourhood_list'],$pd_master_details[0]); + } + // if(&& count($neighbourRefRow['referencecheck_list'])>0){ + // $existNeighRefCheck=NEIGHBOURREFERENCECHECKFORM::getReferenceDetails($neighbourRefRow['referencecheck_list'],$pd_master_details[0]); + // } + } + ?> +Neighbourhood / Reference Check+ 0){ ?> +
Neighbourhood / Reference Check is not available. + + + + + +Final Remarks Section+ "https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/slightly-smiling-face.png",'name_to_display' => 'Polite','selected'=>0); + $Rude = array('url' => "https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/pouting-face.png",'name_to_display' => 'Rude','selected'=>0); + $Others = array('url' => "https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/confused-face.png",'name_to_display' => 'Other Negative','selected'=>0); + //$Polite = ' kjdhflksd dkldnldgdf'; + $behavoiur = trim($final_remark_data['final_custormer_remark_type_master']); + $behavoiur = $$behavoiur; + $behavoiur['selected'] = 1; + //print_r($behavoiur); + //print_r($Rude); + $pd_officers_recommendation_data = array(); + switch($final_remark_data['pd_officers_recommendation']) + { + case 1: //others + + $pd_officers_recommendation_data['comments'] = array($final_remark_data['others_pd_officers_recommendation']); + break; + + case 4: //refer to credit + + if(count($final_remark_data['recommendation_refer_to_credit'])) + { + foreach($final_remark_data['recommendation_refer_to_credit'] as $comment){ + $pd_officers_recommendation_data['comments'][] = $comment['reason_for_refer_to_credit']; + } + } + break; + + case 3: //refer to credit + + if(count($final_remark_data['recommendation_negative'])) + { + foreach($final_remark_data['recommendation_negative'] as $comment){ + $pd_officers_recommendation_data['comments'][] = $comment['reason_for_negative']; + } + } + break; + + case 2: //refer to credit + + if(count($final_remark_data['recommendation_positive'])) + { + foreach($final_remark_data['recommendation_positive'] as $comment){ + $pd_officers_recommendation_data['comments'][] = $comment['reason_for_positive']; + } + } + break; + } + + //print_r($pd_officers_recommendation_data); + + + $fairly_suited = array('url' => 'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/thumbs-up.png','name_to_display','name_to_display'=>'Fairly Suited'); + $well_suited = array('url' => 'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/ok-hand.png','name_to_display'=>'Well Suited'); + $not_suited = array('url' => 'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/cross-mark.png','name_to_display'=>'Not Suited'); + $location = $final_remark_data['is_service_provided']; + $location = $$location; + + + //recommendation + $_4 = array('url'=>'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/backhand-index-pointing-right.png','name_to_display'=>'Refer to credit'); + $_1 = array('url'=>'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/o-button-blood-type.png','name_to_display'=>'Others'); + $_2 = array('url'=>'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/heavy-plus-sign.png','name_to_display'=>'Positive'); + $_3 = array('url'=>'https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/heavy-minus-sign.png','name_to_display'=>'Negative'); + + $recommendation = '_'.$final_remark_data['pd_officers_recommendation']; + $recommendation = $$recommendation; + //print_r($recommendation); + + ?> +
Details Score Card Section+ + '; + echo " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General Questions L1(". $pd_score['general']['otp_done']['l1_weightage']."%) | L2 | Answer | Score | Attributed Score | Max Score | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| '.$question.' | '.$general['l2_weightage'] .'% | '.$general['answer']. + ' | '.$general['score_band'].' | '.$general['attributed_score'].' '.$span.' | '.$general['max_score'].' '.$max_span.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| General Section Sum of Attributed Score | Sum of Max Score | ".number_format($pd_score['score_summary']['general']['actual_score'],2,'.',',')." | ".number_format($pd_score['score_summary']['general']['max_score'],2,'.',',')." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Asset Value Calculaitons | |
|---|---|
| Actual Value Of Assets(a) | ". number_format($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets'],2,'.',',')." |
| Loan Amount(b) | ". number_format($pd_score['score_summary']['asset_calculation_details']['loan_amount'],2,'.',',')." |
| Avg Expected Value Of Assets(c) | ". round($pd_score['score_summary']['asset_calculation_details']['avg_expected_value_of_assets'],2)."% |
| Expected Value Of Assets(d = c*b) | ". number_format($pd_score['score_summary']['asset_calculation_details']['expected_value_of_assets'],2,'.',',')." |
| Actual Value Of Assets Percentage(e = (a/b) * 100) | ". round($pd_score['score_summary']['asset_calculation_details']['actual_value_of_assets_percentage'],2)."% |
| Variance(f = ((e-c)/c) * 100) | ". round($pd_score['score_summary']['asset_calculation_details']['variance'],2)." |
| Score As per Grid | ". round($pd_score['score_summary']['asset_calculation_details']['score'],2)." |
| Final Remarks Questions L1(". $pd_score['final_remarks']['pd_officer_recommandations']['l1_weightage']."%) | L2 | Answer | Score | Attributed Score | Max Score |
|---|---|---|---|---|---|
| '.$question.' | '.$final_remark['l2_weightage'].'% | '.$final_remark['answer'].' | '.$final_remark['score_band'].' | '.$final_remark['attributed_score'].' '.$span.' | '.$final_remark['max_score'].' '.$max_span.' |
| Final Remarks Section Sum of Attributed Score | Sum of Max Score | ".number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',')." | ".number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',')." | |||
| Business Questions L1(". $pd_score['business']['no_of_years_business_run']['l1_weightage']."%) | L2 | Answer | Score | Attributed Score | Max Score |
|---|---|---|---|---|---|
| '.$question.' | '.$business['l2_weightage'].'% | '.$business['answer'].' | '.$business['score_band'].' | '.$business['attributed_score'].' '.$span.' | '.$business['max_score'].' '.$max_span.' |
| Certificates | '.round($business['l2_weightage'],2).'% | '.'Refer Cert Table'.' | '.$business['score_band'].' | '.$business['attributed_score'].' | '.$business['max_score'].' |
| Business Section Sum of Attributed Score | Sum of Max Score | ".number_format($pd_score['score_summary']['business']['actual_score'],2,'.',',')." | ".number_format($pd_score['score_summary']['business']['max_score'],2,'.',',')." | |||
| Business Certificates | Answer | Score | Attributed Score | Max Score |
|---|---|---|---|---|
| '.$question.' | '.$cerificate['answer'].' | '.$cerificate['score_band'].' | '.round($cerificate['attributed_score'],3).' '.$span.' | '.round($cerificate['max_score'],3).' '.$max_span.' |