diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 5f7897db..41153749 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -325,12 +325,6 @@ class PD_Controller extends REST_Controller { $pd_details = json_decode($this->post('pd_details'),true); - - // $pd_details['fk_lender_id'] = 16; - // $pd_details['fk_product_id'] = 7;` - // $pd_details['fk_customer_segment'] = 5; - // $pd_details['pd_status'] = TRIGGERED; - $pd_addtional_requirements = array(); $docs_to_be_collected = array(); unset($pd_details['createdon']); @@ -386,7 +380,9 @@ class PD_Controller extends REST_Controller { { //get customer segment abbrvations $customer_segment_abbr = $this->PD_Model->selectCustomRecords(array('*'),array('customer_segment_id' => $pd_details['fk_customer_segment'],'isactive' => 1),CUSTOMERSEGMENT); - $customer_segment_abbr = $customer_segment_abbr[0]['customer_segment_abbr']; + //print_r($this->db->last_query());die(); + $customer_segment_abbr = $customer_segment_abbr[0]['abbr']; + //echo $customer_segment_abbr; if( !strcasecmp($customer_segment_abbr,'SAL-CASH') || !strcasecmp($customer_segment_abbr,'SAL-CHQ')) { @@ -411,8 +407,7 @@ class PD_Controller extends REST_Controller { } } - - + // /ie(); /***********************PD ALLOCATION TYPE PROCESS **********/ // $pd_details['pd_status'] = TRIGGERED; @@ -1088,6 +1083,7 @@ public function assignPDTempalate($data) //print_r($data); $customer_segment_abbr = ''; + $res_array = array(); if(!is_array($data)) { $logger = MYLOG::logFunction(null,$data); @@ -1101,12 +1097,13 @@ public function assignPDTempalate($data) $templateid = null; $fields = array('fk_template_id'); $where_condition_array = array(); - + //print_r($res_array[0]['fk_customer_segment']);die(); if(!is_array($data)) { $where_condition_array = array('fk_lender_id'=>$res_array[0]['fk_lender_id'] ,'fk_product_id'=> $res_array[0]['fk_product_id'],'fk_customer_segment'=> $res_array[0]['fk_customer_segment'],'isactive' => 1); - $customer_segment_abbr = $this->PD_Model->selectCustomRecords(array('*'),array('customer_segment_id' => $res_array[0]['fk_customer_segment'], 'isactive' => 1),CUSTOMERSEGMENT); - $customer_segment_abbr = $customer_segment_abbr[0]['name']; + //$customer_segment_abbr = $this->PD_Model->selectCustomRecords(array('*'),array('customer_segment_id' => $res_array[0]['fk_customer_segment'], 'isactive' => 1),CUSTOMERSEGMENT); + //$customer_segment_abbr = $customer_segment_abbr[0]['abbr']; + //print_r($customer_segment_abbr); } else @@ -1134,24 +1131,25 @@ public function assignPDTempalate($data) if( !strcasecmp($customer_segment_abbr,'SAL-CASH') || !strcasecmp($customer_segment_abbr,'SAL-CHQ')) { //SAL - (CASH/CHQ) - $pd_details['fk_pd_template_id'] = 1; + $templateid = 1; } else if( !strcasecmp($customer_segment_abbr,'SE-DI') || !strcasecmp($customer_segment_abbr,'SEP-DI') || !strcasecmp($customer_segment_abbr,'SEP_INDV')) { //* SENP/SEP - (DI) - $pd_details['fk_pd_template_id'] = 2; + $templateid = 2; } else if( !strcasecmp($customer_segment_abbr,'SE-AI') || !strcasecmp($customer_segment_abbr,'SEP-AI') ) { //* SENP/SEP - (DI) - $pd_details['fk_pd_template_id'] = 3; + $templateid = 3; } else if( !strcasecmp($customer_segment_abbr,'SE-RI')) { //* SENP/SEP - (RI) - $pd_details['fk_pd_template_id'] = 4; + $templateid = 4; } } + // echo $templateid;die(); return $templateid; @@ -5766,6 +5764,7 @@ public function getPDFormDetailsJSON_post() public function codeigniterViewTest_post() { + //echo $this->assignPDTempalate(1325);die(); $records = $this->post('records'); $pdid = $records['pd_id']; //$external_path = $this->config->item('external_data_path'); diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index a399bf32..13951ca7 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -948,8 +948,6 @@ class PD_Model extends SPARQ_Model { if(count($pd_master_detials)){ $template_id = $pd_master_detials[0]['fk_pd_template_id']; } - - $this->db->SELECT('TEMPLATEFORMS.form_id,PDFORMS.pd_form_order,PDFORMS.pd_form_level_order,PDFORMS.pd_form_name as form_name'); $this->db->FROM(TEMPLATEFORMS.' as TEMPLATEFORMS'); $this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATEFORMS.form_id = PDFORMS.pd_form_id'); diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 652ccf39..f56017f8 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -636,7 +636,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : ''; $person_met_details = $person['name']; - $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + if( strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV')) + { + $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + } echo '

'.$person_met_details.'

'; //if($display_for_person_met != "" || $display_for_person_met != null){ @@ -1456,12 +1459,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');

BUSINESS INFORMATION:

$fetchRow){ ?>

-
Company / Firm Name :
-
Business Entity Type :
+

+


Date of Incorporation :
@@ -3853,18 +3863,33 @@ defined('BASEPATH') OR exit('No direct script access allowed'); foreach($pd_processed_forms[8] as $rowKey=> $elRow) { $otherLoanRow = json_decode($elRow['processed_json'],true); $existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks']; + $is_all_loan_details_availble = 'yes'; + $out_standing_loan_info = array(); + if(array_key_exists('loan_info_available',$otherLoanRow)) + { + $is_all_loan_details_availble = $otherLoanRow['loan_info_available']; + + } + $total_no_of_data = 0; - if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){ + if(strtoupper($otherLoanRow['existing_loan'])=='YES' && (!strcasecmp($is_all_loan_details_availble,'yes') && count($otherLoanRow['loan_details'])>0)){ $is_existing_loans_available = 1; $total_no_of_data = count($otherLoanRow['loan_details']); $existLoanResult=FINANCIALFORM::getOtherLoanDetails($otherLoanRow['loan_details']); } + else if(!strcasecmp($is_all_loan_details_availble,'no')) + { + $out_standing_loan_info['tot_running_loans'] = $otherLoanRow['tot_running_loans']; + $out_standing_loan_info['tot_emi_paid'] = $otherLoanRow['tot_emi_paid']; + $out_standing_loan_info['tot_outstanding_loans'] = $otherLoanRow['tot_outstanding_loans']; + } + } ?>

Existing loan obligation

- @@ -3899,6 +3924,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Loan applicant(s) have '.$out_standing_loan_info['tot_running_loans'].' existing loan(s) with '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_outstanding_loans']).' outstanding amount'; + echo $out_standing_loan_info['tot_emi_paid'] != '' || $out_standing_loan_info['tot_emi_paid'] != 0 ?' and '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_emi_paid']).' has been paid.' : '.'; + echo '

'; + } else {?>

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

diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index 98c40a9c..b0e9d211 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -652,7 +652,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : ''; $person_met_details = $person['name']; - $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + if( strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV')) + { + $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + } echo '

'.$person_met_details.'

'; //if($display_for_person_met != "" || $display_for_person_met != null){ @@ -1497,13 +1500,19 @@ if($total_no_of_business > 0) { ?>

BUSINESS INFORMATION:

$fetchRow){ ?>

-
Company / Firm Name :
-
Business Entity Type :
+

+


Date of Incorporation :
diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php index 6fd8caa9..8ce2bffd 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php @@ -652,7 +652,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : ''; $person_met_details = $person['name']; - $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + if( strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV')) + { + $person_met_details .= ($display_for_person_met != "" ? ' - ' . $display_for_person_met :''); + } echo '

'.$person_met_details.'

'; //if($display_for_person_met != "" || $display_for_person_met != null){ @@ -1495,12 +1498,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');

BUSINESS INFORMATION:

$fetchRow){ ?>

-
Company / Firm Name :
-
Business Entity Type :
+

+


Date of Incorporation :