FLYHI Report key changed : ps
This commit is contained in:
parent
6ab786d646
commit
d092634876
@ -34,6 +34,9 @@ class Flyhi_Controller extends REST_Controller {
|
||||
array('table' => ENTITY. ' as ENTITY',
|
||||
'condition' =>'SALES_PD_DATA.lender_id = ENTITY.entity_id',
|
||||
'jointype' => 'INNER'),
|
||||
// array('table' => PRODUCTS. ' as PRODUCT',
|
||||
// 'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
|
||||
// 'jointype' => 'INNER'),
|
||||
array('table' => CITY. ' as CITY',
|
||||
'condition' =>'SALES_PD_DATA.city_id = CITY.city_id',
|
||||
'jointype' => 'LEFT'),
|
||||
@ -101,6 +104,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$pd_branch_id = null;
|
||||
$lender_sales_person = null;
|
||||
$lender_credit_person = null;
|
||||
// $product_short_name = $this->Sales_PD_Model->selectCustomRecords(array('abbr'),array('product_id' => $records['product_id']),PRODUCTS);
|
||||
|
||||
log_message('ERROR','####FLYHI-PD SAVE CALLED');
|
||||
|
||||
@ -133,11 +137,11 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$applicant_name = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'city')
|
||||
if($g_value['question_key'] == 'residence_address_city')
|
||||
{
|
||||
$city = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'lender_id')
|
||||
if($g_value['question_key'] == 'lender_name')
|
||||
{
|
||||
$lender_id = $g_value['answer_value'];
|
||||
}
|
||||
@ -145,7 +149,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$loan_amount = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'pd_branch_id')
|
||||
if($g_value['question_key'] == 'branch')
|
||||
{
|
||||
$pd_branch_id = $g_value['answer_value'];
|
||||
}
|
||||
@ -192,6 +196,9 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$records['completed_date'] = date('Y-m-d H:i:s');
|
||||
$flyhi_pd_id = $this->Flyhi_Model->updateRecords($records,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id']));
|
||||
$completed_sections = $this->Flyhi_Model->selectCustomRecords(array('section_id'),array('status' => 1,'sales_pd_id' => $records['sales_pd_id'],'isactive' => 1),SALESPD_SECTION_DATA);
|
||||
$this->prepareFlyhiPDReport($records['sales_pd_id'],false);
|
||||
sleep(10);
|
||||
log_message('ERROR','####FLYHI-PD AFTER 10 PREPARED REPORT'.$records['sales_pd_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -211,11 +218,11 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$applicant_name = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'city')
|
||||
if($g_value['question_key'] == 'residence_address_city')
|
||||
{
|
||||
$city = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'lender_id')
|
||||
if($g_value['question_key'] == 'lender_name')
|
||||
{
|
||||
$lender_id = $g_value['answer_value'];
|
||||
}
|
||||
@ -223,7 +230,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$loan_amount = $g_value['answer_value'];
|
||||
}
|
||||
if($g_value['question_key'] == 'pd_branch_id')
|
||||
if($g_value['question_key'] == 'branch')
|
||||
{
|
||||
$pd_branch_id = $g_value['answer_value'];
|
||||
}
|
||||
@ -296,11 +303,13 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
$records = $this->post('records');
|
||||
$lender_id = $records['lender_id'];
|
||||
$sales_pd_type = $records['sales_pd_type'];
|
||||
// $product = $records['product_id'];
|
||||
$sales_pd_type = $records['sales_pd_type'] ? $records['sales_pd_type'] : null;
|
||||
$product = $records['product_id'];
|
||||
$pd_type = 2;
|
||||
if(isset($records['pd_type'])){ $pd_type = $records['pd_type'];}
|
||||
$template = $this->Flyhi_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'pd_type' => $pd_type,'sales_pd_type' => $sales_pd_type,'isactive' => 1),SALESPDTEMPLATE);
|
||||
// $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'product_id' => $product,'pd_type' => $pd_type,'sales_pd_type' => $sales_pd_type,'isactive' => 1),SALESPDTEMPLATE);
|
||||
if(is_array($template) && count($template))
|
||||
{
|
||||
$data['dataStatus'] = true;
|
||||
@ -327,18 +336,23 @@ class Flyhi_Controller extends REST_Controller {
|
||||
function prepareFlyhiPDReport($pd_id,$api = true)
|
||||
{
|
||||
log_message('ERROR','####PREPARE Flyhi PD REPORT CALLED'.$pd_id);
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','USERPROFILE.smc_emp_code');
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr','USERPROFILE.smc_emp_code');
|
||||
// $columns = array('SALES_PD_DATA.*','ENTITY.short_name','USERPROFILE.smc_emp_code');
|
||||
$table = SALES_PD_DATA.' as SALES_PD_DATA';
|
||||
$joins = array(
|
||||
array('table' => ENTITY. ' as ENTITY',
|
||||
'condition' =>'SALES_PD_DATA.lender_id = ENTITY.entity_id',
|
||||
'jointype' => 'INNER'),
|
||||
// array('table' => PRODUCTS. ' as PRODUCT',
|
||||
// 'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
|
||||
// 'jointype' => 'INNER'),
|
||||
array('table' => USERPROFILE. ' as USERPROFILE',
|
||||
'condition' =>'SALES_PD_DATA.createdby = USERPROFILE.userid',
|
||||
'jointype' => 'LEFT')
|
||||
);
|
||||
|
||||
$where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $pd_id);
|
||||
// $where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $sales_pd_id);
|
||||
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
|
||||
$pd_type = "";
|
||||
if($sales_pd_data[0]['sales_pd_type'] == 3){$pd_type = "Office FI PD-"; }else if($sales_pd_data[0]['sales_pd_type'] == 4){$pd_type = "Residence FI PD-";}
|
||||
@ -349,7 +363,8 @@ class Flyhi_Controller extends REST_Controller {
|
||||
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id'];
|
||||
// 1st Type Key name. (name,abbr and date).
|
||||
$pdf_name = strtolower(trim($sales_pd_data[0]['applicant_name']));
|
||||
$pdf_name .= '-'.$pd_type;
|
||||
// $pdf_name .= '-'.$pd_type;
|
||||
$pdf_name .= '-'.$pd_type.$sales_pd_data[0]['abbr'];
|
||||
$pdf_name .= '-'.(date('dmY',strtotime($sales_pd_data[0]['completed_date'])));
|
||||
$key = 'sales_pd/'.$pd_id.'/'.$pdf_name.'.pdf';
|
||||
//$this->Sales_PD_Model->updateRecords(array('pd_report_filename' => 'PD_Report-'.$pdf_name),SALES_PD_DATA,array('sales_pd_id' => $pd_id));
|
||||
@ -366,6 +381,7 @@ class Flyhi_Controller extends REST_Controller {
|
||||
// print_r(json_decode($all_section_data[0]['section_data'],true));die();
|
||||
$view_data['master'] = $sales_pd_data;
|
||||
$common_fields = array('pdid'=>$sales_pd_data[0]['sales_pd_id'],
|
||||
// 'product'=>$sales_pd_data[0]['abbr'],
|
||||
'caseno'=>$sales_pd_data[0]['sales_pd_sno']);
|
||||
foreach ($all_section_data as $sec_key => $section)
|
||||
{
|
||||
@ -472,7 +488,12 @@ class Flyhi_Controller extends REST_Controller {
|
||||
{
|
||||
|
||||
$temp_array[ $question['question_key'] ] = isset($question['answer_value']) ? $question['answer_value'] : null;
|
||||
if($question['question_key'] == 'state' || $question['question_key'] == 'city' || $question['question_key'] == 'pincode' || $question['question_key'] == 'loan_purpose' || $question['question_key'] == 'constitution' || $question['question_key'] == 'about_locality' || $question['question_key'] == 'equipment_list' || $question['question_key'] == 'vendor_list' || $question['question_key'] == 'person_met_designation')
|
||||
if($question['question_key'] == 'residence_state' || $question['question_key'] == 'residence_address_city' || $question['question_key'] == 'residence_pincode' ||
|
||||
$question['question_key'] == 'business_state'|| $question['question_key'] == 'business_city'|| $question['question_key'] == 'business_city' ||
|
||||
$question['question_key'] == 'permanent_state' || $question['question_key'] == 'permanent_address_city' || $question['question_key'] == 'permanent_pincode' ||
|
||||
$question['question_key'] == 'employer_business_state' || $question['question_key'] == 'employer_business_address_city' || $question['question_key'] == 'employer_business_pincode' ||
|
||||
$question['question_key'] == 'educational_institute_state' || $question['question_key'] == 'educational_institute_address_city' || $question['question_key'] == 'educational_institute_pincode'
|
||||
)
|
||||
{
|
||||
//if($question['type'] == 4) { print_r($question['answer_value']); }
|
||||
$temp_array[ $question['question_key'] ] = $this->getMasterData($question['answer_value'],$question['answers']);
|
||||
|
||||
@ -8,8 +8,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
$product_name = "";
|
||||
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
|
||||
$title = "";
|
||||
if($master[0]['sales_pd_type'] == 3){$title = "Office FI PD "; }else if($master[0]['sales_pd_type'] == 4){$title = "Residence FI PD ";}
|
||||
if($section1['verification_type'] == "Office verification"){$title = "Office FI PD "; }else if($section1['verification_type'] == "Residence verification"){$title = "Residence FI PD ";}
|
||||
$smc_emp_code = $master[0]['smc_emp_code'];
|
||||
$residence_ownership_arr = array("self_owned" => "Self-Owned","parental"=>"Parental","family_owned"=>"Family Owned","rented"=>"Rented");
|
||||
$residence_yr_arr = array("0"=>"< 1 yr","1"=>"1-2 yrs","2"=>"2 to 5 yrs","3"=>"> 5 yrs");
|
||||
$occupation_arr = array("0"=>"Salaried","1"=>"SENP","2"=>"SEP");
|
||||
$constitution_arr = array("0"=>"Ltd","1"=>"Pvt","2"=>"Ltd","3"=>"Trust/Society","4"=>"Partnership/LLP","5"=>"Proprietorship");
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -186,43 +191,42 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['verification_type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="2" ><?php if($master[0]['sales_pd_type'] == 4){echo 'Residence Address Details'; }else{ echo 'Office Address Details'; } ?></td>
|
||||
<td class = "tdcenteralign" colspan="7"><?php if($master[0]['sales_pd_type'] == 4){ echo $section1['residence_address']; }else{ echo $section1['residence_address']; }?></td>
|
||||
</tr>
|
||||
<td colspan="3" rowspan="2" ><?php if($section1['verification_type'] == "Residence verification"){echo 'Residence Address Details'; }else{ echo 'Office Address Details'; } ?></td>
|
||||
<td class = "tdcenteralign" colspan="7"><?php if($section1['verification_type'] == "Residence verification"){ echo $section1['residence_address']; }else{ echo $section1['residence_address']; }?></td>
|
||||
</tr>
|
||||
<?php if( $section1['verification_type'] == "Residence verification"){ ?>
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['residence_city']?></td>
|
||||
<td>State</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['residence_state']?></td>
|
||||
<td>PIN</td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['residence_address_pincode_others'])){ echo $section1['residence_pincode_others']; } else { echo $section1['residence_pincode']; }?></td>
|
||||
</tr>
|
||||
|
||||
<?php if( $master[0]['sales_pd_type'] == 4){ ?>
|
||||
<tr>
|
||||
<td colspan="3">Residence Ownership</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['residence_ownership'];?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $residence_ownership_arr[$section1['residence_ownership']];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Years at current Residence</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['years_at_current_residence'];?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $residence_yr_arr[$section1['years_at_current_residence']];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Same as current residence address</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['Same_as_current_residence_address'];?></td>
|
||||
</tr>
|
||||
<?php if($section1['Same_as_current_residence_address'] == 0){?>
|
||||
<?php if($section1['Same_as_current_residence_address'] == 'No'){?>
|
||||
<tr>
|
||||
<td colspan="3">Permanent Address</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['permanent_address'];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['permanent_address_city']?></td>
|
||||
<td>State</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['permanent_address_state']?></td>
|
||||
<td>PIN</td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['permanent_address_pincode_others'])){ echo $section1['permanent_address_pincode_others']; } else { echo $section1['permanent_address_pincode']; }?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
@ -234,10 +238,18 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['number_of_dependents'] ? $section1['number_of_dependents'] : 'Not Provided'?> </td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php if( $master[0]['sales_pd_type'] == 3){ ?>
|
||||
<?php if( $section1['verification_type'] == "Office verification"){ ?>
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['officer_city']?></td>
|
||||
<td>State</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['officer_state']?></td>
|
||||
<td>PIN</td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['officer_pincode_others'])){ echo $section1['officer_pincode_others']; } else { echo $section1['officer_pincode']; }?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Occupation of the loan applicant</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['occupation_of_the_loan_applicant'];?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $occupation_arr[$section1['occupation_of_the_loan_applicant']];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Employer/Business Name</td>
|
||||
@ -245,25 +257,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">Employer/Business Address</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['employer_business_address'];?></td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['business_address'];?></td>
|
||||
</tr>
|
||||
<?php if($section1['employer_business_address'] == 0){?>
|
||||
<tr>
|
||||
<!-- <?php if($section1['employer_business_address'] == 0){?> -->
|
||||
<!-- <tr>
|
||||
<td colspan="3">Address</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['address'];?></td>
|
||||
</tr>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['employer_business_address'];?></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>City</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['business_city']?></td>
|
||||
<td>State</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['business_state']?></td>
|
||||
<td>PIN</td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['business_pincode_others'])){ echo $section1['business_pincode_others']; } else { echo $section1['business_pincode']; }?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<!-- <?php } ?> -->
|
||||
<tr>
|
||||
<td colspan="3"> Constitution of Employer /Business applicant</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['constitution_of_employer_business_applicant'] ? $section1['constitution_of_employer_business_applicant'] : 'Not Provided'?> </td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['constitution_of_employer_business_applicant'] ? $constitution_arr[$section1['constitution_of_employer_business_applicant']] : 'Not Provided'?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> Years at Current employment/Business</td>
|
||||
@ -303,14 +315,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<td colspan="3" rowspan="2" >Educational Institute Address</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['educational_institute_address'] ? $section1['educational_institute_address'] : 'Not Provided'?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <tr>
|
||||
<td>City</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['city']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['educational_institute_address_city']?></td>
|
||||
<td>State</td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['state']?></td>
|
||||
<td class = "tdcenteralign"><?php echo $section1['educational_institute_address_state']?></td>
|
||||
<td>PIN</td>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['pincode_others'])){ echo $section1['pincode_others']; } else { echo $section1['pincode']; }?></td>
|
||||
</tr>
|
||||
<td class = "tdcenteralign" colspan="2"><?php if(isset($section1['educational_institute_address_pincode_others'])){ echo $section1['educational_institute_address_pincode_others']; } else { echo $section1['educational_institute_address_pincode']; }?></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td colspan="3"> Class /Section/ Course Name</td>
|
||||
<td class = "tdcenteralign" colspan="7"> <?php echo $section1['class_section_course_name'] ? $section1['class_section_course_name'] : 'Not Provided'?> </td>
|
||||
@ -332,8 +344,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<tr>
|
||||
<td colspan="3" >Loan Tenure (Months)</td>
|
||||
<td class = "tdcenteralign" colspan="3" ><?php echo $section1['loan_tenure']?></td>
|
||||
<td colspan="2" >Loan Purpose (End-Use)</td>
|
||||
<td class = "tdcenteralign" colspan="2" ><?php echo $section1['loan_purpose']?></td>
|
||||
<!-- <td colspan="2" >Loan Purpose (End-Use)</td>
|
||||
<td class = "tdcenteralign" colspan="2" ><?php echo $section1['loan_purpose']?></td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user