From ca503a24f42f9a96baf4e99cf6de626febd6c86a Mon Sep 17 00:00:00 2001
From: Velz2020
Date: Mon, 28 Oct 2019 12:22:34 +0530
Subject: [PATCH] PROD REPORT ISSUES PROD AI ISSUES UPDATE BASE64&CO APPLICANT
---
api/application/config/constants.php | 3 +
api/application/controllers/PD_Controller.php | 109 ++++++++++--------
.../report_templates/JSONTOREPORT_CLIX.php | 7 +-
.../JSONTOREPORT_DI_AI_ADDON.php | 4 +
4 files changed, 71 insertions(+), 52 deletions(-)
diff --git a/api/application/config/constants.php b/api/application/config/constants.php
index 76c0d96b..677e206f 100644
--- a/api/application/config/constants.php
+++ b/api/application/config/constants.php
@@ -595,5 +595,8 @@ defined('ENTITYPREFERENCEID') OR define('ENTITYPREFERENCEID','entity_preference_
defined('APP_VERSION_INFO') OR define('APP_VERSION_INFO','m_app_version_info');
defined('APP_VERSION_INFOID') OR define('APP_VERSION_INFOID','version_info_id');
+defined('D_GEN_RELATIONSHIP') OR define('D_GEN_RELATIONSHIP','d_gen_relationship');
+defined('D_GENERAL_IND') OR define('D_GENERAL_IND','d_general_ind');
+
diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index cc205b5c..258e100a 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -2803,7 +2803,7 @@ public function getPDFormDetailsJSON_post()
$custom_log_info = '###Get Business IMG AWS urls & attach into JSON Function Called - ('. $pd_id.' - '. $pd_form_id.') - ' . date('Y-m-d H:i:s A');
log_message('ERROR',$custom_log_info);
- $result_data = $this->PD_Model->getSignedPDDocsURL($pd_id,13,$company_id,null,null);
+ $result_data = $this->PD_Model->getSignedPDDocsURL($pd_id,13,$company_id,null,null,null,'report');
foreach($result_data as $b_key => $b_value)
{
@@ -2835,6 +2835,10 @@ public function getPDFormDetailsJSON_post()
{
$temp_rec['practice_cert_pic'] = $b_value['doc_url'];
}
+ if($b_value['pd_document_title'] == 'fire_noc_pic')
+ {
+ $temp_rec['fire_noc_pic'] = $b_value['doc_url'];
+ }
if(isset($temp_rec['documents']) && count($temp_rec['documents']))
{
@@ -4309,11 +4313,12 @@ public function getPDFormDetailsJSON_post()
//calculatin part
if($gross_profit_calculation_type[0]['mode'] == 1)
{
+
$temp_purchases = $overall_purchase_total;
$temp_grossprofit = ($total_sales_itemwise + $total_sales_monthwise) - $temp_purchases;
$temp_netprofit = $temp_grossprofit - $overall_business_expenses_total;
- if($temp_netprofit != 0 && $total_sales_itemwise != 0 && $total_sales_monthwise != 0)
+ if($temp_netprofit != 0 && ($total_sales_itemwise + $total_sales_monthwise) != 0)
{
$temp_netmargin = ($temp_netprofit/ ($total_sales_itemwise + $total_sales_monthwise)) * 100;
}
@@ -6000,7 +6005,7 @@ public function getPDFormDetailsJSON_post()
//$t = $this->load->view('temp_html.html',null,true);
echo $t;
- //die();
+ die();
$total_replaces = substr_count($t,'');
for($i = 0 ;$i < $total_replaces;$i++)
@@ -8771,46 +8776,48 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$records = $this->post('records');
$pd_details = $this->PD_Model->getPDMasterDetails($records['fk_pd_id']);
- if(isset($records['isactive']) && ($records['isactive'] == 0 || $records['isactive'] == 1))//de activate the image
+ // if(isset($records['isactive']) && ($records['isactive'] == 0 || $records['isactive'] == 1))//de activate the image
+ // {
+ // unset($records['image']);
+ // $where_condition_array = array('pd_document_id' => $records['pd_document_id']);
+ // $id = $this->PD_Model->updateRecords($records,PDDOCUMENTS,$where_condition_array);
+ // $master = $this->PD_Model->updateRecords(array('is_zip_created' => 0),PDTRIGGER,array('pd_id' => $records['fk_pd_id']));
+ // if($id != null || $id != "")
+ // {
+ // $data['dataStatus'] = true;
+ // $data['status'] = REST_Controller::HTTP_OK;
+ // $data['records'] = $id;
+ // $this->response($data,REST_Controller::HTTP_OK);
+ // }
+ // else
+ // {
+ // $data['dataStatus'] = false;
+ // $data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
+ // $data['msg'] = 'Something Went Wrong! Try Later';
+ // $this->response($data,REST_Controller::HTTP_OK);
+ // }
+ // }
+
+ if(isset($records['image']) && ($records['image'] != ''))
{
- unset($records['image']);
- $where_condition_array = array('pd_document_id' => $records['pd_document_id']);
- $id = $this->PD_Model->updateRecords($records,PDDOCUMENTS,$where_condition_array);
- $master = $this->PD_Model->updateRecords(array('is_zip_created' => 0),PDTRIGGER,array('pd_id' => $records['fk_pd_id']));
- if($id != null || $id != "")
- {
- $data['dataStatus'] = true;
- $data['status'] = REST_Controller::HTTP_OK;
- $data['records'] = $id;
- $this->response($data,REST_Controller::HTTP_OK);
- }
- else
- {
- $data['dataStatus'] = false;
- $data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
- $data['msg'] = 'Something Went Wrong! Try Later';
- $this->response($data,REST_Controller::HTTP_OK);
- }
+ $output_file = APPPATH."/docs/temp_base64_image.jpeg";
+ $temp_file_name = $records['pd_document_name'];
+
+ $ifp = fopen( $output_file, 'wb' );
+ $temp_data = explode( ',', $records['image']);
+ fwrite( $ifp, base64_decode( $temp_data[ 1 ] ) );
+ fclose( $ifp );
+ $tempdoc = $output_file;
+ $tempdocname = $temp_file_name;
+ $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details[0]['fk_lender_id'];
+ $key = 'pd'.$records['fk_pd_id'].'/'.$tempdocname;
+ $sourcefile = $tempdoc;
+
+ $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile);
+ $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
}
-
- $output_file = APPPATH."/docs/temp_base64_image.jpeg";
- $temp_file_name = $records['pd_document_name'];
-
- $ifp = fopen( $output_file, 'wb' );
- $temp_data = explode( ',', $records['image']);
- fwrite( $ifp, base64_decode( $temp_data[ 1 ] ) );
- fclose( $ifp );
- $tempdoc = $output_file;
- $tempdocname = $temp_file_name;
- $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details[0]['fk_lender_id'];
- $key = 'pd'.$records['fk_pd_id'].'/'.$tempdocname;
- $sourcefile = $tempdoc;
-
- $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$sourcefile);
- $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
-
- if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
- {
+ // if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
+ // {
$record_data = array('fk_updatedby' => $records['fk_updatedby']);
if(isset($records['is_show_report'])){ $record_data['is_show_report'] = $records['is_show_report']; }
if(isset($records['pd_document_title'])){ $record_data['pd_document_title'] = $records['pd_document_title']; }
@@ -8831,14 +8838,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$data['msg'] = 'Something Went Wrong! Try later';
$this->response($data,REST_Controller::HTTP_OK);
}
- }
- else
- {
- $data['dataStatus'] = false;
- $data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
- $data['msg'] = 'Something Went Wrong! Try Later';
- $this->response($data,REST_Controller::HTTP_OK);
- }
+ // }
+ // else
+ // {
+ // $data['dataStatus'] = false;
+ // $data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
+ // $data['msg'] = 'Something Went Wrong! Try Later';
+ // $this->response($data,REST_Controller::HTTP_OK);
+ // }
@@ -9047,11 +9054,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if($records['is_person_met_pic'] != "")
{
- $img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $applicant_id);
+ $img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 1);
}
if($records['is_person_met_id_proof'] != "")
{
- $img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id);
+ $img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id,'img_type' => 2);
}
}
//print_r( $img_data );
diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php
index 612c9ed1..ecbb2163 100644
--- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php
+++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php
@@ -2392,6 +2392,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
As per person met, Applicant does not have any current account.
';
+ }
if($business_banking_common_remarks != ""){ echo ''.$business_banking_common_remarks.'
'; }
@@ -3826,9 +3830,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? ' The rent paid '.$rupee_symbol.' '.$fmValue['rent'].' per month.' : '';
$clix_dependency_text = 'There are '.$fmValue['no_family_members_clix'].' family member(s) ';
- $clix_dependency_text .= isset($fmValue['no_dependents_clix']) && $fmValue['no_dependents_clix'] != 0 ? ' in which ' . ($fmValue['no_dependents_clix'] == 1 ? 'One' : $fmValue['no_dependents_clix']). ' of them have dependent on applicant.' : ' and no dependents on applicant.';
+ $clix_dependency_text .= isset($fmValue['no_dependents_clix']) && $fmValue['no_dependents_clix'] != 0 ? ' of which ' . ($fmValue['no_dependents_clix'] == 1 ? 'One is' : $fmValue['no_dependents_clix']. ' are'). ' dependent on applicant.' : ' and none of them dependent on applicant.';
echo '' . $intro_text . '
';echo '' . $residence_text . '
';
+ echo '' . $clix_dependency_text . '
';
?>
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 f4c3c1c0..f4135c99 100644
--- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php
+++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_ADDON.php
@@ -2420,6 +2420,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
As per person met, Applicant does not have any current account.';
+ }
if($business_banking_common_remarks != ""){ echo ''.$business_banking_common_remarks.'
'; }