diff --git a/api/application/config/autoload.php b/api/application/config/autoload.php
index 97f44d6b..496398af 100644
--- a/api/application/config/autoload.php
+++ b/api/application/config/autoload.php
@@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
-$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check');
+$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','data_dump');
/*
| -------------------------------------------------------------------
diff --git a/api/application/config/routes.php b/api/application/config/routes.php
index b856f733..d16728d6 100644
--- a/api/application/config/routes.php
+++ b/api/application/config/routes.php
@@ -249,6 +249,9 @@ $route['alertPDTAT'] = 'Dash_Board_Controller/alertPDTAT';
$route['pdTATReport'] = 'Dash_Board_Controller/pdTATReport';
$route['testCognito'] = 'Branch_Controller/testCognito';
+
+
+$route['(getRawData/:any)'] = 'Data_Dump_Controller/getRawData';
//$route['(getPDReportHTML/:any)'] = 'Welcome/getPDReportHTML';
//miscellanous
diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index d60ba550..cc205b5c 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -4185,7 +4185,7 @@ public function getPDFormDetailsJSON_post()
if(count($other_business_income)){$other_business_income_flag = 1;}
- if(($business_expenses_flag == 1) && ($sales_declared_by_customer_flag == 1 && $purchase_declared_by_customer_flag) || ($sales_calculated_by_itemwise_flag == 1 && $purchases_flag = 1))
+ if(($business_expenses_flag == 1) && ($sales_declared_by_customer_flag == 1 || $purchase_declared_by_customer_flag) || ($sales_calculated_by_itemwise_flag == 1 || $purchases_flag = 1))
{
$total_sales_itemwise = 0;
$sales_monthwise = array();
@@ -4233,7 +4233,7 @@ public function getPDFormDetailsJSON_post()
}
- if($sales_calculated_by_itemwise_flag == 1 && $purchases_flag == 1)
+ if($sales_calculated_by_itemwise_flag == 1 || $purchases_flag == 1)
{
@@ -4312,7 +4312,15 @@ public function getPDFormDetailsJSON_post()
$temp_purchases = $overall_purchase_total;
$temp_grossprofit = ($total_sales_itemwise + $total_sales_monthwise) - $temp_purchases;
$temp_netprofit = $temp_grossprofit - $overall_business_expenses_total;
- $temp_netmargin = ($temp_netprofit/ ($total_sales_itemwise + $total_sales_monthwise)) * 100;
+
+ if($temp_netprofit != 0 && $total_sales_itemwise != 0 && $total_sales_monthwise != 0)
+ {
+ $temp_netmargin = ($temp_netprofit/ ($total_sales_itemwise + $total_sales_monthwise)) * 100;
+ }
+ else
+ {
+ $temp_netmargin = 0;
+ }
}
else
{
@@ -4321,7 +4329,10 @@ public function getPDFormDetailsJSON_post()
$temp_grossprofit = $temp_netprofit;// + $overall_business_expenses_total;
$temp_netprofit = $temp_grossprofit - $overall_business_expenses_total;
$temp_purchases = ($total_sales_itemwise + $total_sales_monthwise) - $temp_grossprofit;
- $temp_netmargin = ($temp_netprofit/( $total_sales_itemwise + $total_sales_monthwise) * 100);
+ if($temp_netprofit != 0 && ( $total_sales_itemwise + $total_sales_monthwise) != 0 ){
+ $temp_netmargin = ($temp_netprofit/( $total_sales_itemwise + $total_sales_monthwise) * 100);
+ }
+ else { $temp_netmargin = 0;}
}
$overall_summary_report['sales_calculated_by_itemwise']['sales_revenue'] = round($total_sales_itemwise + $total_sales_monthwise);
@@ -4475,8 +4486,14 @@ public function getPDFormDetailsJSON_post()
$overall_summary_report['consolidated_report']['consolidated_nerprofit'] = round(array_sum($temp_netmargin_array) / count($temp_netmargin_array));
- $overall_summary_report['consolidated_report']['consolidated_nermagin'] = round((($overall_summary_report['consolidated_report']['consolidated_nerprofit']/$overall_summary_report['consolidated_report']['consolidated_sales_revenue'])*100),2);
-
+ if($overall_summary_report['consolidated_report']['consolidated_nerprofit'] != 0 && $overall_summary_report['consolidated_report']['consolidated_sales_revenue'] != 0)
+ {
+ $overall_summary_report['consolidated_report']['consolidated_nermagin'] = round((($overall_summary_report['consolidated_report']['consolidated_nerprofit']/$overall_summary_report['consolidated_report']['consolidated_sales_revenue'])*100),2);
+ }
+ else
+ {
+ $overall_summary_report['consolidated_report']['consolidated_nermagin'] = 0;
+ }
return ($overall_summary_report);
}
@@ -5765,7 +5782,7 @@ public function getPDFormDetailsJSON_post()
{
//echo $this->assignPDTempalate(1325);die();
- //$this->getSatelliteImage(283);die();//velmurugan.s@venbainfotech.com
+ //$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com
//PDALERTS::sendMail($this,'vitvelz@gmail.com','PDGENIE TEST',array());die();
$records = $this->post('records');
$pdid = $records['pd_id'];
@@ -5849,7 +5866,7 @@ public function getPDFormDetailsJSON_post()
// die();
// foreach($u as $v)
// {
- // $this->aws_cognito->adminSetUserPassword($v['email']);
+ ///$this->aws_cognito->adminSetUserPassword('subashish.mohapatra@imgc.com');
// }
// die();
@@ -5983,7 +6000,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++)
@@ -7025,6 +7042,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$title = $doc['Name'];
$is_show_report = isset($doc['is_show_report']) ? $doc['is_show_report'] : null;
//$external_path = $this->config->item('external_data_path');
+ $co_applicant_id = isset($doc['co_applicant_id']) ? $doc['co_applicant_id'] : null;
+ $img_type = isset($doc['img_type']) ? $doc['img_type'] : null;
$output_file = $this->external_path."/pd_reports/". $pd_id ."/temp_base64_image.jpeg";
@@ -7087,7 +7106,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
- $record_data = array('fk_pd_id' => $pd_id,'pd_document_title'=>$title,'pd_document_name'=>$tempdocname,'fk_form_id'=>$form_id,'is_show_report' =>$is_show_report,'rental_count_id' => $rental_count_id,'location' => $doc['link']);
+ $record_data = array('fk_pd_id' => $pd_id,'pd_document_title'=>$title,'pd_document_name'=>$tempdocname,'fk_form_id'=>$form_id,'is_show_report' =>$is_show_report,'rental_count_id' => $rental_count_id,'location' => $doc['link'],'co_applicant_id' => $co_applicant_id,'img_type' => $img_type);
$record_data['company_id'] = $company_id ? $company_id : null;
$id = $this->PD_Model->saveRecords($record_data,PDDOCUMENTS);
if($id != null || $id != "") { $count++; $pks[] = $id;}
@@ -9028,17 +9047,17 @@ 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']);
+ $img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link'],'co_applicant_id' => $applicant_id);
}
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']);
+ $img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link'],'co_applicant_id' => $applicant_id);
}
}
//print_r( $img_data );
if($current_operation == 2) // Make inactive old entries with same data
{
- $sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'];
+ $sql = 'UPDATE '. PDDOCUMENTS.' SET isactive = 0 where fk_pd_id = '.$records['fk_pd_id'].' WHERE co_applicant_id = '.$records['pd_co_applicant_id'];
$where1 = '';
$where2 = '';
if($records['is_person_met_pic'] != "" && !substr_count($records['is_person_met_pic'],'https'))
@@ -9046,16 +9065,26 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$img_data[] = array('Name' => $records['applicant_name'], 'image' => $records['is_person_met_pic'], 'link' => $records['link']);
$where1 = $records['applicant_name'];
}
+ else
+ {
+ $this->PD_Model->updateRecords(array('pd_document_title' => $records['applicant_name']),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 1,'isactive' => 1));// 1- person met img
+ }
+
if($records['is_person_met_id_proof'] != "" && !substr_count($records['is_person_met_id_proof'],'https'))
{
$img_data[] = array('Name' => ($records['applicant_name'].'-id_proof'), 'image' => $records['is_person_met_id_proof'], 'link' => $records['link']);
$where2 = ($records['applicant_name'].'-id_proof');
}
+ else
+ {
+ $this->PD_Model->updateRecords(array('pd_document_title' => ($records['applicant_name'].'-id_proof')),PDDOCUMENTS,array('fk_pd_id' => $records['fk_pd_id'],'fk_form_id' => 18,'co_applicant_id' => $records['pd_co_applicant_id'],'img_type' => 2,'isactive' => 1));// 2- person met ID proof img
+ }
- if($where1 != '' && $where2 != '')
+ if($where1 != '' || $where2 != '')
{
$sql .= ' and (pd_document_title = ? or pd_document_title = ?)';
$this->db->query($sql, array($where1, $where2));
+ //print_r($this->db->last_query());
}
}
diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php
index f1a861dd..222a636f 100644
--- a/api/application/helpers/assetsform_helper.php
+++ b/api/application/helpers/assetsform_helper.php
@@ -144,7 +144,7 @@ public static function getOthersAssetsDetails($values){
// business asset details
public static function getBusinessAssetsDetails($business_assets){
- $total_tables = count($business_assets) / 7;
+ $total_tables = count($business_assets) / 5;
$total_tables = ceil($total_tables);
$overall_data = array();
//$i = 10;
@@ -279,7 +279,7 @@ public static function getOthersAssetsDetails($values){
unset($business_assets[$bsk]);
- if($bsk == 6)
+ if($bsk == 4)
{
break;
}
diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php
index e4241cd2..612c9ed1 100644
--- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php
+++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php
@@ -2044,7 +2044,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
// customer
if(strtoupper($businessFinancialRow['is_financial_customer'])!='YES' && (!isset($businessFinancialRow['estimated_value']))){
- $bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
+ $bindBusinessFinancial["financial_customer"] ="";
+ //$bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
$bindBusinessFinancial['customer_statements']=array();
$bindBusinessFinancial['customer_statements_header']=array();
$bindBusinessFinancial['is_customer_statement'] = 0;
@@ -2052,7 +2053,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
else if(strtoupper($businessFinancialRow['is_financial_customer'])!='YES' && count($businessFinancialRow['estimated_value'])>0)
{
- $bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
+ $bindBusinessFinancial["financial_customer"] ="";
+ //$bindBusinessFinancial["financial_customer"] ="As per Loan Applicant(s) met, the financials are as below :";
$bindBusinessFinancial['customer_statements']=FINANCIALFORM::getBusinessCustomerFinancialDetails($businessFinancialRow['estimated_value']);
$bindBusinessFinancial['customer_statements_header']=FINANCIALFORM::getBusinessCustomerHeader($businessFinancialRow['estimated_value']);
$bindBusinessFinancial['is_customer_statement'] = 1;
@@ -2188,7 +2190,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
-
+
' . $intro_text . ' ' . $residence_text . ' ' . $intro_text . ' ' . $residence_text . '
";echo $residence_text;echo "
";echo $clix_dependency_text;
+ echo '
";echo $residence_text;
+ echo '
";echo $residence_text;
+ echo '
' . $intro_text . '
';echo '' . $residence_text . '
'; ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_RI.php b/api/application/views/report_templates/JSONTOREPORT_RI.php index 6a6fa187..056f463f 100644 --- a/api/application/views/report_templates/JSONTOREPORT_RI.php +++ b/api/application/views/report_templates/JSONTOREPORT_RI.php @@ -1051,7 +1051,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']); - $loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')'); + $loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => ($loan_form['emv_per_customer'] != "" ? $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')' : 'Not Provided')); } } @@ -1394,7 +1394,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $residence_text ='This is a '. $fmValue['residence_ownership'].' Family Information - Ownership of Residence residence, where the applicant has been staying for '. $fmValue['residence_No_of_years'].'Family Information - No of Yrs in current residence .'; $residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? ' The rent paid '.$rupee_symbol.' '.$fmValue['rent'].' per month.' : ''; - echo $intro_text;echo "' . $intro_text . '
';echo '' . $residence_text . '
'; ?>