TEMPLATE ASSIGN ISSUE CLIX AND SEP IND CHANGE

This commit is contained in:
Velz2020 2019-09-27 17:33:39 +05:30
parent 0e7a570ba2
commit c1f46eea5a
5 changed files with 78 additions and 30 deletions

View File

@ -325,12 +325,6 @@ class PD_Controller extends REST_Controller {
$pd_details = json_decode($this->post('pd_details'),true); $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(); $pd_addtional_requirements = array();
$docs_to_be_collected = array(); $docs_to_be_collected = array();
unset($pd_details['createdon']); unset($pd_details['createdon']);
@ -386,7 +380,9 @@ class PD_Controller extends REST_Controller {
{ {
//get customer segment abbrvations //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 = $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')) 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 ALLOCATION TYPE PROCESS **********/
// $pd_details['pd_status'] = TRIGGERED; // $pd_details['pd_status'] = TRIGGERED;
@ -1088,6 +1083,7 @@ public function assignPDTempalate($data)
//print_r($data); //print_r($data);
$customer_segment_abbr = ''; $customer_segment_abbr = '';
$res_array = array();
if(!is_array($data)) if(!is_array($data))
{ {
$logger = MYLOG::logFunction(null,$data); $logger = MYLOG::logFunction(null,$data);
@ -1101,12 +1097,13 @@ public function assignPDTempalate($data)
$templateid = null; $templateid = null;
$fields = array('fk_template_id'); $fields = array('fk_template_id');
$where_condition_array = array(); $where_condition_array = array();
//print_r($res_array[0]['fk_customer_segment']);die();
if(!is_array($data)) 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); $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 = $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 = $customer_segment_abbr[0]['abbr'];
//print_r($customer_segment_abbr);
} }
else else
@ -1134,24 +1131,25 @@ public function assignPDTempalate($data)
if( !strcasecmp($customer_segment_abbr,'SAL-CASH') || !strcasecmp($customer_segment_abbr,'SAL-CHQ')) if( !strcasecmp($customer_segment_abbr,'SAL-CASH') || !strcasecmp($customer_segment_abbr,'SAL-CHQ'))
{ {
//SAL - (CASH/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')) else if( !strcasecmp($customer_segment_abbr,'SE-DI') || !strcasecmp($customer_segment_abbr,'SEP-DI') || !strcasecmp($customer_segment_abbr,'SEP_INDV'))
{ {
//* SENP/SEP - (DI) //* 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') ) else if( !strcasecmp($customer_segment_abbr,'SE-AI') || !strcasecmp($customer_segment_abbr,'SEP-AI') )
{ {
//* SENP/SEP - (DI) //* SENP/SEP - (DI)
$pd_details['fk_pd_template_id'] = 3; $templateid = 3;
} }
else if( !strcasecmp($customer_segment_abbr,'SE-RI')) else if( !strcasecmp($customer_segment_abbr,'SE-RI'))
{ {
//* SENP/SEP - (RI) //* SENP/SEP - (RI)
$pd_details['fk_pd_template_id'] = 4; $templateid = 4;
} }
} }
// echo $templateid;die();
return $templateid; return $templateid;
@ -5766,6 +5764,7 @@ public function getPDFormDetailsJSON_post()
public function codeigniterViewTest_post() public function codeigniterViewTest_post()
{ {
//echo $this->assignPDTempalate(1325);die();
$records = $this->post('records'); $records = $this->post('records');
$pdid = $records['pd_id']; $pdid = $records['pd_id'];
//$external_path = $this->config->item('external_data_path'); //$external_path = $this->config->item('external_data_path');

View File

@ -948,8 +948,6 @@ class PD_Model extends SPARQ_Model {
if(count($pd_master_detials)){ if(count($pd_master_detials)){
$template_id = $pd_master_detials[0]['fk_pd_template_id']; $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->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->FROM(TEMPLATEFORMS.' as TEMPLATEFORMS');
$this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATEFORMS.form_id = PDFORMS.pd_form_id'); $this->db->JOIN(PDFORMS.' as PDFORMS','TEMPLATEFORMS.form_id = PDFORMS.pd_form_id');

View File

@ -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) : ''; $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : '';
$person_met_details = $person['name']; $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 '<p>'.$person_met_details.'</p>'; echo '<p>'.$person_met_details.'</p>';
//if($display_for_person_met != "" || $display_for_person_met != null){ //if($display_for_person_met != "" || $display_for_person_met != null){
@ -1456,12 +1459,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<h3 contenteditable="true">BUSINESS INFORMATION:</h3> <h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php <?php
//print_r($businessResult); //print_r($businessResult);
$company_firm_name_heading = 'Company / Firm Name : ';
$business_entity_type_heading = 'Business Entity Type :';
if( !strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$company_firm_name_heading = 'Nature of Services : ';
$business_entity_type_heading = 'Entity Type :';
}
foreach($businessResult as $bKey=>$fetchRow){ foreach($businessResult as $bKey=>$fetchRow){
?> ?>
<p> <p>
<br><strong>Company / Firm Name : </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br> <br><strong><?php echo $company_firm_name_heading ?> </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br>
<br><strong>Business Entity Type : </strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br> <br><strong><?php echo $business_entity_type_heading ?></strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br>
<?php if($fetchRow['company_details']['formed_on']){ ?> <?php if($fetchRow['company_details']['formed_on']){ ?>
<br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br> <br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br>
<?php } ?> <?php } ?>
@ -3853,18 +3863,33 @@ defined('BASEPATH') OR exit('No direct script access allowed');
foreach($pd_processed_forms[8] as $rowKey=> $elRow) { foreach($pd_processed_forms[8] as $rowKey=> $elRow) {
$otherLoanRow = json_decode($elRow['processed_json'],true); $otherLoanRow = json_decode($elRow['processed_json'],true);
$existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks']; $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; $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; $is_existing_loans_available = 1;
$total_no_of_data = count($otherLoanRow['loan_details']); $total_no_of_data = count($otherLoanRow['loan_details']);
$existLoanResult=FINANCIALFORM::getOtherLoanDetails($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'];
}
} }
?> ?>
<br> <br>
<h3 contenteditable="true">Existing loan obligation</h3> <h3 contenteditable="true">Existing loan obligation</h3>
<?php if($is_existing_loans_available != null){ <?php if($is_existing_loans_available != null && (!strcasecmp($is_all_loan_details_availble,'yes'))){
//print_r($existLoanResult); //print_r($existLoanResult);
?> ?>
@ -3899,6 +3924,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
// //
} }
elseif (!strcasecmp($is_all_loan_details_availble,'no') && count($out_standing_loan_info))
{
echo '<p>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 '</p>';
}
else {?> else {?>
<p>As per loan applicant he does not have any existing loan obligations.</p> <p>As per loan applicant he does not have any existing loan obligations.</p>
<?php } ?> <?php } ?>

View File

@ -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) : ''; $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : '';
$person_met_details = $person['name']; $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 '<p>'.$person_met_details.'</p>'; echo '<p>'.$person_met_details.'</p>';
//if($display_for_person_met != "" || $display_for_person_met != null){ //if($display_for_person_met != "" || $display_for_person_met != null){
@ -1497,13 +1500,19 @@ if($total_no_of_business > 0) {
?> ?>
<h3 contenteditable="true">BUSINESS INFORMATION:</h3> <h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php <?php
//print_r($businessResult); $company_firm_name_heading = 'Company / Firm Name : ';
$business_entity_type_heading = 'Business Entity Type :';
if( !strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$company_firm_name_heading = 'Nature of Services : ';
$business_entity_type_heading = 'Entity Type :';
}
foreach($businessResult as $bKey=>$fetchRow){ foreach($businessResult as $bKey=>$fetchRow){
?> ?>
<p> <p>
<br><strong>Company / Firm Name : </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br> <br><strong><?php echo $company_firm_name_heading ?></strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br>
<br><strong>Business Entity Type : </strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br> <br><strong><?php echo $business_entity_type_heading ?></strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br>
<?php if($fetchRow['company_details']['formed_on']){ ?> <?php if($fetchRow['company_details']['formed_on']){ ?>
<br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br> <br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br>
<?php } ?> <?php } ?>

View File

@ -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) : ''; $display_for_person_met =$person['relations'] != "" ? substr_replace($person['relations'],'.',strrpos($person['relations'],','),1) : '';
$person_met_details = $person['name']; $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 '<p>'.$person_met_details.'</p>'; echo '<p>'.$person_met_details.'</p>';
//if($display_for_person_met != "" || $display_for_person_met != null){ //if($display_for_person_met != "" || $display_for_person_met != null){
@ -1495,12 +1498,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<h3 contenteditable="true">BUSINESS INFORMATION:</h3> <h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php <?php
//print_r($businessResult); //print_r($businessResult);
$company_firm_name_heading = 'Company / Firm Name : ';
$business_entity_type_heading = 'Business Entity Type :';
if( !strcasecmp($pd_master_details[0]['customer_segment_abbr'],'SEP_INDV'))
{
$company_firm_name_heading = 'Nature of Services : ';
$business_entity_type_heading = 'Entity Type :';
}
foreach($businessResult as $bKey=>$fetchRow){ foreach($businessResult as $bKey=>$fetchRow){
?> ?>
<p> <p>
<br><strong>Company / Firm Name : </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br> <br><strong><?php echo $company_firm_name_heading ?> </strong><span><?php echo $fetchRow['company_details']['company_name'];?></span><br>
<br><strong>Business Entity Type : </strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br> <br><strong><?php echo $business_entity_type_heading ?> </strong><span><?php echo $fetchRow['company_details']['type_of_activity'];?></span><br>
<?php if($fetchRow['company_details']['formed_on']){ ?> <?php if($fetchRow['company_details']['formed_on']){ ?>
<br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br> <br><strong>Date of Incorporation : </strong><span><?php echo $fetchRow['company_details']['formed_on'];?></span><br>
<?php } ?> <?php } ?>