diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 1ef659d6..811a5230 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5589,7 +5589,7 @@ public function getPDFormDetailsJSON_post() // print_r($data['assessed_income_details']); // echo "**************************"; //$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] ); - if($data['pd_master_details'][0]['is_score_card_enabled'] != 0) + if($data['pd_master_details'][0]['is_score_card_enabled'] = 0) { $data['pd_score'] = $this->calculateScore($pdid); $score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],1) : 0; diff --git a/api/application/helpers/businessform_helper.php b/api/application/helpers/businessform_helper.php index 14301785..f56b6580 100644 --- a/api/application/helpers/businessform_helper.php +++ b/api/application/helpers/businessform_helper.php @@ -6,12 +6,18 @@ class Businessform public static function getPartnerDetails($values){ $getPartner=array(); foreach($values as $parRow){ - $getPartner = array_map(function($tag) { - $con_business_run = $tag['current_business_experiance_year'] >0 ? $tag['current_business_experiance_year'] :""; - $con_business_run .= ($tag['current_business_experiance_year'] == 1) ? " Year" : (($tag['current_business_experiance_year'] > 1) ? " Years" : ""); - $con_business_run.=' '; - $con_business_run .=$tag['current_business_experiance_month'] >0 ? 'and ' . $tag['current_business_experiance_month'] : ""; - $con_business_run .=($tag['current_business_experiance_month'] == 1) ? " Month" : (($tag['current_business_experiance_month'] > 1) ? " Months" : ""); + $getPartner = array_map(function($tag) { + $con_business_run = ''; + if($tag['current_business_experiance_year'] != '' && $tag['current_business_experiance_month'] != '') + { + $con_business_run = $tag['current_business_experiance_year'].' Year(s) and ' . $tag['current_business_experiance_month'].' Month(s)'; + } + else + { + $con_business_run = ($tag['current_business_experiance_year'] != '' ? $tag['current_business_experiance_year'] .' Year(s)' : ($tag['current_business_experiance_month'] != '' ? $tag['current_business_experiance_month'].' Month(s)':'')); + } + + return array( 'name' => array_key_exists('partner_other_name',$tag) ? $tag['partner_other_name'] : $tag['partner_name_master'], 'share_holding' => $tag['shareholding'].'%', diff --git a/api/application/helpers/myutil_helper.php b/api/application/helpers/myutil_helper.php index 8a71b716..b23a5303 100644 --- a/api/application/helpers/myutil_helper.php +++ b/api/application/helpers/myutil_helper.php @@ -113,8 +113,8 @@ class MYUTIL $data['partners_title_name'] = "Trustee Details"; break; } - $data['year_and_month']= $value['business_years'] . ' Years'; - $data['year_and_month'] .= isset($value['business_month']) && $value['business_month'] != "" ? ' and '.$value['business_month'] . ' Months': ''; + $data['year_and_month']= $value['business_years'] . ' Year(s)'; + $data['year_and_month'] .= isset($value['business_month']) && $value['business_month'] != "" ? ' and '.$value['business_month'] . ' Month(s)': ''; $data['formed_on'] = $value['business_date_object'] ? date("d-m-Y", strtotime($value['business_date_object'])) : null; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index ef86e448..5bf3cd4b 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -836,13 +836,13 @@ class PD_Model extends SPARQ_Model { if($result_array[0]['lender_applicant_id'] == "" || $result_array[0]['lender_applicant_id'] == null){ $mandatory_fields[] = 'lender_applicant_id'; } - if($result_array[0]['fk_product_id'] == "" || $result_array[0]['fk_product_id'] == null){ $mandatory_fields[] = 'fk_product_id'; } + if($result_array[0]['fk_product_id'] == "" || $result_array[0]['fk_product_id'] == null || $result_array[0]['fk_product_id'] == 0){ $mandatory_fields[] = 'fk_product_id'; } - //if($result_array[0]['fk_subproduct_id'] == "" || $result_array[0]['fk_subproduct_id'] == null){ $mandatory_fields[] = 'fk_subproduct_id'; } + if($result_array[0]['fk_subproduct_id'] == "" || $result_array[0]['fk_subproduct_id'] == null || $result_array[0]['fk_subproduct_id'] == 0){ $mandatory_fields[] = 'fk_subproduct_id'; } - if($result_array[0]['fk_pd_type'] == "" || $result_array[0]['fk_pd_type'] == null){ $mandatory_fields[] = 'fk_pd_type'; } + if($result_array[0]['fk_pd_type'] == "" || $result_array[0]['fk_pd_type'] == null || $result_array[0]['fk_pd_type'] == 0){ $mandatory_fields[] = 'fk_pd_type'; } - if($result_array[0]['fk_customer_segment'] == "" || $result_array[0]['fk_customer_segment'] == null){ $mandatory_fields[] = 'fk_customer_segment'; } + if($result_array[0]['fk_customer_segment'] == "" || $result_array[0]['fk_customer_segment'] == null || result_array[0]['fk_customer_segment'] == 0){ $mandatory_fields[] = 'fk_customer_segment'; } if($result_array[0]['loan_amount'] == "" || $result_array[0]['loan_amount'] == null){ $mandatory_fields[] = 'loan_amount'; } @@ -858,34 +858,27 @@ class PD_Model extends SPARQ_Model { if($result_array[0]['pincode'] == "" || $result_array[0]['pincode'] == null){ $mandatory_fields[] = 'pincode'; } if($result_array[0]['lender_short_name'] != 'IMGC') { - if($result_array[0]['pd_contact_person'] == "" || $result_array[0]['pd_contact_person'] == null){ $mandatory_fields[] = 'pd_contact_person'; } + + } + if($result_array[0]['pd_contact_person'] == "" || $result_array[0]['pd_contact_person'] == null){ + + if($result_array[0]['lender_credit_person'] == "" || $result_array[0]['lender_credit_person'] == null) + { + $mandatory_fields[] = 'pd_contact_person'; + } + + } - if($result_array[0]['pd_contact_landline'] == "" || $result_array[0]['pd_contact_landline'] == null) + if($result_array[0]['pd_contact_landline'] == "" || $result_array[0]['pd_contact_landline'] == null) { if($result_array[0]['pd_contact_mobileno'] == "" || $result_array[0]['pd_contact_mobileno'] == null) { - $mandatory_fields[] = 'pd_contact_landline'; + $mandatory_fields[] = 'pd_contact_mobileno'; } } - } - else - { - // if($result_array[0]['lender_sales_person'] == "" || $result_array[0]['lender_sales_person'] == null) - // { - // $mandatory_fields[] = 'lender_sales_person'; - // } - - if($result_array[0]['lender_credit_person'] == "" || $result_array[0]['lender_credit_person'] == null) - { - $mandatory_fields[] = 'lender_credit_person'; - } - if($result_array[0]['imgc_fin_institute'] == "" || $result_array[0]['imgc_fin_institute'] == null) - { - $mandatory_fields[] = 'imgc_fin_institute'; - } - } + if($result_array[0]['fk_address_id'] == "" || $result_array[0]['fk_address_id'] == null) { diff --git a/api/application/views/js/phantomchart.js b/api/application/views/js/phantomchart.js index e859424b..55c35454 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 = 74.2;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/ssa_external_data/testing/pd_reports/1244/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 = 43.2;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/ssa_external_data/production/pd_reports/1/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 1f0bae33..bc74c173 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -638,7 +638,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $individual) { @@ -1426,7 +1426,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Name Share Holding No.of Years in Current Business - Total Work Experience + Total Work Experience(Yrs) Previous Experience Started Business