diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index c3652878..d7b2875f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4162,7 +4162,7 @@ class PD_Controller extends REST_Controller { //get zip url from s3 if any - $key = $main_applicant_name.'_'.$pdid.'_'.'pd_images.zip'; + $key = 'pd'.$pdid.'/'.$main_applicant_name.'_'.$pdid.'_'.'pd_images.zip'; $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); if($pd_master_details[0]['is_zip_created']) { @@ -5129,7 +5129,7 @@ class PD_Controller extends REST_Controller { //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,''); //echo $total_replaces; diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index 858aac1d..4be58394 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/helpers/neighbourreferencecheckform_helper.php b/api/application/helpers/neighbourreferencecheckform_helper.php index 22b0d0db..1f8fc603 100644 --- a/api/application/helpers/neighbourreferencecheckform_helper.php +++ b/api/application/helpers/neighbourreferencecheckform_helper.php @@ -11,7 +11,7 @@ public static function getNeighbourhoodDetails($company_name,$values,$pdMasterVa $neighbourhood_do_know = null; $neighbourhood_business_running_yr = null; $ownership = null; - + $neighbourhood_name_only = $tag['neighbourhood_name']; if(strtoupper($tag['do_know'])=='YES'){ $neighbourhood_do_know = $tag['neighbourhood_name']." knows about applicants and their business."; @@ -68,7 +68,7 @@ public static function getNeighbourhoodDetails($company_name,$values,$pdMasterVa } //$makeSentense.=(strtoupper($tag['is_applicant_owner']) == 'YES') ? "owner of the business." : ((strtoupper($tag['is_applicant_owner']) == 'NO') ? "not owner of the business." : ""); - return array('neighbourhood_name' => $neighbourhood_name,'neighbourhood_do_know' => $neighbourhood_do_know,'neighbourhood_business_running_yr' => $neighbourhood_business_running_yr,'ownership' => $ownership); + return array('neighbourhood_name_only' => $neighbourhood_name_only,'neighbourhood_name' => $neighbourhood_name,'neighbourhood_do_know' => $neighbourhood_do_know,'neighbourhood_business_running_yr' => $neighbourhood_business_running_yr,'ownership' => $ownership); }, $values); return $values; } diff --git a/api/application/helpers/otherfamilyform_helper.php b/api/application/helpers/otherfamilyform_helper.php index 5f056c02..f95fb4cd 100644 --- a/api/application/helpers/otherfamilyform_helper.php +++ b/api/application/helpers/otherfamilyform_helper.php @@ -25,12 +25,13 @@ public static function getFamilyDetails($values){ $gender = array_search($tag['family_member_relationship'],$male_gender_array); $gender = $gender ? 'He' :'She'; $getFamilyEarning=''; + $year_to_display = $tag['earning_number_of_years_in_employment_or_business'] == 1 ? 'year.' : 'years.'; if($tag['family_member_earning_status']==1){ $getFamilyEarning= 'Earning '; $getFamilyOccupation = $tag['earning_segment']==1 ? $tag['earning_if_others_segment'].' Income of '.$tag['earning_gross_income_per_month'].' per month. ':' Income of '.''.' '.MYUTIL::customIndianNumberFormat($tag['earning_gross_income_per_month']).' per month '; $getFamilyOccupation .= $tag['earning_name_of_the_employer_or_business'] ? ' received from '.$tag['earning_name_of_the_employer_or_business'].'. ' : ''; - $getFamilyOccupation .= $gender.' has been working for '.$tag['earning_number_of_years_in_employment_or_business'].' years.'; + $getFamilyOccupation .= $gender.' has been working for '.$tag['earning_number_of_years_in_employment_or_business'].' '.$year_to_display; // ? .' years earning Rs.'. : $tag['earning_segment_master'].' with '.$tag['earning_name_of_the_employer_or_business'].' since '.$tag['earning_number_of_years_in_employment_or_business'].' years earning Rs.'.$tag['earning_gross_income_per_month'].' per month '; } diff --git a/api/application/views/js/phantomchart.js b/api/application/views/js/phantomchart.js index 59bc9b8d..2f02843b 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 = 99.9;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 = 45.6;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/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 fe849cc9..970c14a2 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -557,24 +557,28 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '
'; echo '

Person(s) Met:

'; - echo '
'; + echo '
'; foreach($person_met_data as $pk => $person) { - - echo '

'.$person['name'].'

'; - echo '

'.substr_replace($person['relations'],'.',strrpos($person['relations'],','),1).'

'; - echo '

'; + $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : ''; + //echo '

'; + echo '

'.$person['name'].' - '.$display_for_person_met.'

'; + //echo '

'.$display_for_person_met.'

'; + if($display_for_person_met != "" || $display_for_person_met != null){ + echo '

'; + } if($person['photo']) { - echo ''; + echo ''; } - echo '          '; + //echo '          '; if($person['id_proof']) { - echo ''; + echo ''; } - echo '

'; + //echo '

'; echo count($person_met_data) != ($pk+1)? '
':''; + //echo '
'; } echo '
'; @@ -692,14 +696,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> -
+ - + if($general_form['general_remark'] != "") { ?> + + '.$general_form['general_remark'].'

'; + } + ?> +
@@ -769,7 +776,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "
"; //######################### CHART ########################### } - $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 Shared >>", "minimum_client_info" => "Client Information Shared >>","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 >>"); + $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 >>"); $general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>"); @@ -789,7 +796,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $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'); - + + if($bsk == 'location_suited_for_busienss') { $answer = $address_type_remarks_caption[ $business_score['answer'] ]; @@ -798,9 +806,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { $answer = $per > 0 ? 'Yes' : 'No'; } + else if($bsk == 'no_of_years_business_run') + { + $answer = isset($business_score['answer']) ? $business_score['answer'].' Yrs' : ''; + } + else if($bsk == 'business_seasonality') + { + $answer = isset($business_score['answer']) ? ((!strcasecmp($business_score['answer'], 'yes')) ? 'Seasonal': 'Not Seasonal') : ''; + } else { - $answer = isset($business_score['answer']) ? $business_score['answer'] : 'WAIT'; + $answer = isset($business_score['answer']) ? $business_score['answer'] : ''; } echo ' '. $business_captions[$bsk] .' '. '
'. ucfirst($answer).' '; @@ -819,9 +835,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $per = $general_score['attributed_score'] > 0 && $general_score['max_score'] > 0 ? ( ($general_score['attributed_score'] / $general_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'); + $answer = ucfirst($general_score['answer']); + + if($gsk == 'value_of_other_assets') + { + //print_r($general_score);die(); + $answer = round((($answer/$loan_form['loan_amount']) * 100),2) .' %'; + + } - - echo ' '. $general_captions[$gsk] .' '. '
'. ucfirst($general_score['answer']).' '; + echo ' '. $general_captions[$gsk] .' '. '
'. $answer.' '; } echo ''; echo ''; @@ -858,6 +881,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $final_remark_data = json_decode($pd_processed_forms[20][0]['processed_json'],true) ; $business_assets_details = json_decode($pd_processed_forms[22][0]['processed_json'],true); + + $address_images = $pd_images[5]; + $pd_location_approach_img_url = ''; + foreach ($address_images as $address_image_key => $address_image_value) { + if($address_image_value['is_show_report'] == 1) + { + $pd_location_approach_img_url = $address_image_value['doc_url']; + break; + } + } + //print_r($address_images);die(); ?>

PD LOCATION

@@ -872,12 +906,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); alt="Satellite Image of location of Where PD was Done" style="width:100%;height:300px;border-color:#0191ed" />


- + +

Location Summary

0){ ?>
-

Type of Business Activity : Manufacturing

+
@@ -1308,7 +1347,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>
-

Type of Business Activity : Retail Trading

+
@@ -1359,7 +1398,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>
-

Type of Business Activity : Service Provider

+
@@ -1411,7 +1450,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>
-

Type of Business Activity : Wholesale Trading

+
@@ -1469,7 +1508,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>
-

Other activity details are as under :

+
@@ -1495,7 +1534,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); As per person`s met,applicant using Mobile Wallets/UPI for business transactions.

'; + echo '

As per person`s met, applicant using Mobile Wallets/UPI for business transactions.

'; }//else //{ // echo '

As per person`s met,applicant using Mobile Wallets/UPI for business transactions.

' @@ -1911,7 +1950,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); }?>
- The Loan Applicants have not availed any Working Capital Facilities from any financial institution

";} ?> + The Loan Applicants have not availed any Working Capital Facilities from any financial institution.

";} ?> -

As per loan applicant he does not have any existing loan obligations

+

As per loan applicant he does not have any existing loan obligations.

'.$existing_loan_form_common_remarks.'

';} @@ -3293,7 +3332,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $nfValue) { - echo '
Neighbour '.(++$nkey); + echo $nfValue['neighbourhood_name_only']; ?>