From 0f5eac6cbccf43565b332e784a4d1e8bf3d600a7 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 29 Nov 2019 16:43:53 +0530 Subject: [PATCH] SALES PD BAC END CHANGES SATELLITE IMG UN FUNCTION PROD ISSUES --- api/application/controllers/PD_Controller.php | 12 +- .../controllers/Sales_PD_Controller.php | 14 +- .../helpers/assessedincome_helper.php | 3 +- .../helpers/external_dir_check_helper.php | 2 +- api/application/helpers/mylog_helper.php | 8 +- .../report_templates/JSONTOREPORT_DI_AI.php | 4 +- .../views/sale_pd_templates/MWISE.php | 137 +++++++++--------- 7 files changed, 94 insertions(+), 86 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index da5aae59..892929a2 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -19,7 +19,7 @@ class PD_Controller extends REST_Controller { //class level variable declaration - protected $external_path; + //protected $external_path; function __construct() { @@ -34,6 +34,7 @@ class PD_Controller extends REST_Controller { $this->load->helper('GETPDFORMDETAILS'); $this->load->helper('GETPROCESSEDJSON'); $this->load->helper('MYUTIL'); + $this->load->helper('satellite_image'); $this->load->library('pdfgenerator'); //$this->load->library('excel'); $this->load->library('phpmailer_library'); @@ -862,7 +863,8 @@ class PD_Controller extends REST_Controller { } unset($pd_details['is_revert_status']); //get satellite image blob and store it in DB - $pd_details['satellite_image_base64_blob'] = $this->getSatelliteImage($pd_details['pd_id']); + //$pd_details['satellite_image_base64_blob'] = $this->getSatelliteImage($pd_details['pd_id']); + $pd_details['satellite_image_base64_blob'] = satellite_image::getSatelliteImage($pd_details['pd_id']); //die(); //If it is Addtional PD ,then update 'COMPLETE' status for primary and all other addtional PD's if($exist_pd_details[0]['is_child'] == 1) @@ -5669,7 +5671,7 @@ public function getPDFormDetailsJSON_post() //PDALERTS::sendMail($this,'vitvelz@gmail.com','PDGENIE TEST',array());die(); //$this->load->helper('applicantname_grabber'); // print_r(APPLICANTNAME_GRABBER::getLatestApplicantsName(1390));die(); - + //satellite_image::getSatelliteImage(1442);die(); $records = $this->post('records'); $pdid = $records['pd_id']; @@ -6096,7 +6098,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $form_array[] = array('form_id' => 1,'form_name' => 'Supplier Details'); $form_array[] = array('form_id' => 2,'form_name' => 'Client Details'); $form_array[] = array('form_id' => 11,'form_name' => 'Stock Details'); - if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE')) && !strcasecmp($product_abbr,'LFMP')) + if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE'))) { $form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments'); } @@ -6113,7 +6115,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $form_array[] = array('form_id' => 2,'form_name' => 'Client Details'); $form_array[] = array('form_id' => 11,'form_name' => 'Stock Details'); $form_array[] = array('form_id' => 16,'form_name' => 'Assessed Income'); - if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE')) && !strcasecmp($product_abbr,'LFMP')) + if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'MWISE')) )// && !strcasecmp($product_abbr,'LFMP')) { $form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments'); } diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index b4824903..2db1581d 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -21,6 +21,8 @@ class Sales_PD_Controller extends REST_Controller { $this->external_path = $this->config->item('external_data_path'); $this->load->library('AWS_S3'); $this->load->library('pdfgenerator'); + $this->load->helper('satellite_image'); + } @@ -55,10 +57,7 @@ class Sales_PD_Controller extends REST_Controller { $applicant_name = ''; $applicant_id = ''; $officer = ''; - - - - //die(); + //satellite_image::getSatelliteImage(22,2);die(); foreach (json_decode($records['pd_json'],true) as $key => $value) { //print_r($value);die(); @@ -120,6 +119,7 @@ class Sales_PD_Controller extends REST_Controller { //end generate sales pd serial no $records['sales_pd_sno'] = $salepd_serial_no; $id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA); + satellite_image::getSatelliteImage($id,2); } else { @@ -187,7 +187,8 @@ class Sales_PD_Controller extends REST_Controller { $view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section); } - $view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id),SALEPD_DOCS); + $view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite'),SALEPD_DOCS); + $view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite'),SALEPD_DOCS); $view_data['product_id'] = $sales_pd_data[0]['product_id']; //print_r($this->db->last_query());die(); //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr']; @@ -198,7 +199,8 @@ class Sales_PD_Controller extends REST_Controller { //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; $bytes = file_put_contents($output_file, $pdf_doc); - //die(); + // echo $bytes; + // die(); $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$this->external_path.'/sales_pd/'.$sales_pd_id.'/temp.pdf'); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); diff --git a/api/application/helpers/assessedincome_helper.php b/api/application/helpers/assessedincome_helper.php index e8c43838..f9d6480a 100644 --- a/api/application/helpers/assessedincome_helper.php +++ b/api/application/helpers/assessedincome_helper.php @@ -216,11 +216,12 @@ class AssessedIncome $sales_item_wise_header_row .= "Gross Margin %Gross Profit"; } + //print_r($ai_core_details['sales_calculated_by_itemwise']);die(); foreach($ai_core_details['sales_calculated_by_itemwise'] as $itemwise) { $temp['sale_item'] = strcasecmp($itemwise['sales_item'],'others') ? $itemwise['sales_item'] : $itemwise['other_sales_item']; $temp['sales_qty'] = $itemwise['sales_qty'] != 0 ? $itemwise['sales_qty']: '-'; - $temp['uom'] = $itemwise['uom_name'] ? $itemwise['uom_name'] : '-'; + $temp['uom'] = $itemwise['uom_other'] ? $itemwise['uom_other'] : ($itemwise['uom_name'] ? $itemwise['uom_name'] : '-'); $temp['frequency'] = $itemwise['frequency_name'] ? $itemwise['frequency_name'] : '-'; $temp['annual_sale_value'] = $itemwise['annual_sale_value']; $temp['rate_per_unit'] = $itemwise['rate_per_unit']; diff --git a/api/application/helpers/external_dir_check_helper.php b/api/application/helpers/external_dir_check_helper.php index c876b689..9f5e5fd6 100644 --- a/api/application/helpers/external_dir_check_helper.php +++ b/api/application/helpers/external_dir_check_helper.php @@ -21,7 +21,7 @@ class EXTERNAL_DIR_CHECK mkdir($path,0761); } - $array = array($path.'/ci_logs',$path.'/api_request_logs',$path.'/app_logs',$path.'/pd_reports',$path.'/sales_pd'); + $array = array($path.'/ci_logs',$path.'/api_request_logs',$path.'/app_logs',$path.'/pd_reports',$path.'/sales_pd',$path.'/sales_pd_logs'); foreach ($array as $key => $value) { if(!file_exists($value)) diff --git a/api/application/helpers/mylog_helper.php b/api/application/helpers/mylog_helper.php index edff8cf2..332898b7 100644 --- a/api/application/helpers/mylog_helper.php +++ b/api/application/helpers/mylog_helper.php @@ -54,15 +54,15 @@ class MYLOG } - public static function logPD($dynamic = null,$pd_id = null) //$msg,$data,$log_type + public static function logSalesPD($pd_id = null) //$msg,$data,$log_type { $CI =& get_instance(); - $channel = $dynamic ? $dynamic : 'pdgenie_logger'; - $log_folder = $dynamic ? $CI->config->item('external_data_path').'/api_request_logs': $CI->config->item('external_data_path').'/app_logs'; + $channel = 'pdgenie_logger'; + $log_folder = $CI->config->item('external_data_path').'/sales_pd_logs'; $logger = new \Monolog\Logger($channel); $path_file_name = $log_folder.'/ssa_app_'.date('Y-m-d').'.html'; if($pd_id != null) { $path_file_name = $log_folder.'/'.$pd_id.'.html';} - + $streamHandler = new \Monolog\Handler\StreamHandler($path_file_name, $logger::DEBUG); $streamHandler->setFormatter(new \Monolog\Formatter\HtmlFormatter()); $logger->pushHandler($streamHandler); diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index c15ab5dc..c74a08ea 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -3536,7 +3536,7 @@ if($total_no_of_business > 0) { echo $ai_core_details_processed['sales_calculated_by_itemwise_header']; echo ''; echo ''; - + //print_r($ai_core_details_processed['sales_item_wise_to_diaplay']);die(); foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid) { //print_r($sid); @@ -4250,7 +4250,7 @@ if($total_no_of_business > 0) { { echo '
'; echo 'Personal feedback or market intelligence on the case (if any):'; - echo '

'.$final_remark_data['market_intelligence'].''; + echo '

'.$final_remark_data['market_intelligence']; echo '
'; echo '
'; } diff --git a/api/application/views/sale_pd_templates/MWISE.php b/api/application/views/sale_pd_templates/MWISE.php index 6fd74bb9..03d57253 100644 --- a/api/application/views/sale_pd_templates/MWISE.php +++ b/api/application/views/sale_pd_templates/MWISE.php @@ -97,11 +97,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
-
+

@@ -109,31 +109,31 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - Personal Discussion Sheet - (For Sales Team) + Personal Discussion by Sales Team - Application ID - + Name of the Company/Firm - + Name of Person Met during visit - + Address Visited - + City - + State - + PIN - + @@ -145,15 +145,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Loan Amount Applied for (Rs) - + Total Fund Requirement (Rs) - + Loan Tenure (Months) - + Loan Purpose (End-Use) - + @@ -181,7 +181,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ''.$section3_value['share_holding'].'%'. ''.$section3_value['vintage_in_current_biz'].''. ''.$section3_value['total_work_exp'].''. - ''.$section3_value['previous_experience_details'].''. + ''.($section3_value['previous_experience_details'] ? $section3_value['previous_experience_details'] : 'NA' ).''. ''.$section3_value['started_biz'].''. ''; } @@ -194,25 +194,24 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Brief of the Business / Service - + - -
+
- +
Financial Information
Name of the Company / Firm whose financials are noted
- + '. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).'' . abs($sales_over_py). ' '; + echo ''; } $pre_year_sales = $fy_value['sales_revenue']; @@ -314,7 +313,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); else { $net_profit_over_py = round( ((($fy_value['net_profit'] - $pre_year_net_profit) / $pre_year_net_profit ) * 100),2); - echo ''; + echo ''; } $pre_year_net_profit = $fy_value['net_profit']; @@ -340,7 +339,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $year_net_pro_loss_per_over_py = round( ((( (($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ) - $pre_year_net_pro_loss_per) / $pre_year_net_pro_loss_per ) * 100),2); - echo ''; + echo ''; // echo ''; //(($fy_value['net_profit'] / $fy_value['sales_revenue'] ) * 100 ) } @@ -354,15 +353,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
Particulars of Financials as per books of Accounts (Can be captured prior to PD)Particulars of Financials as per books of Accounts '. ((($sales_over_py == 0 ) ? $dash :( $sales_over_py > 0 ? $uparrow : $downarrow))).'' . abs($sales_over_py). ' %'. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($net_profit_over_py). ' '. ((($net_profit_over_py == 0 ) ? $dash :( $net_profit_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($net_profit_over_py). '% '. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($year_net_pro_loss_per_over_py). ' '. ((($year_net_pro_loss_per_over_py == 0 ) ? $dash :( $year_net_pro_loss_per_over_py > 0 ? $uparrow : $downarrow))).' ' . abs($year_net_pro_loss_per_over_py). '% '. (($year_net_pro_loss_per_over_py > 0 )? '' : '').' ( ' . $year_net_pro_loss_per_over_py. ' )
- + - + - + - +
Income to be Considered (Rs Per Annum) Income Considered (Rs Per Mth)
Income assessment Program Recommended Fixed Obligations (Rs per month)
@@ -379,29 +378,29 @@ if(isset($section6)) Property Address (With Landmark & PIN) - + Property Type - + Occupancy Status - + Permitted Property Usage - + Actual Property Usage - + Built-Up Area (Sq. Ft.) - + Approx Mkt. Val (Rs) - + Property Ownership Status (Enter the names of the Property Owner(s) and their relationships) - + @@ -411,49 +410,28 @@ if(isset($section6)) - + - + - + - + - + - - + +
Final Remarks of PD officerFinal Remarks of Sales officer
Business activity seen during visit (Yes / No) Location of workplace suits the business (Yes/No)
Overall Assessment (Positive / Negative) > Recommended ROI for the case
Any Other remarks Any Other remarks


- - - - - - - - - - - - - - - - - - - -
Name of Sales Team Member
Designation of Sales Team Member
Date of PD Visit
Signature of PD Officer
-
- - + +
Satellite Image of PD Location

+ PD Visted Location Satellite Image 'Selfie with person met','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','workplace_interior_image' => 'Workplace interior image'); + $photo_names = array('selfie_with_person_met' => 'Selfie with person met','approach_to_pd_location' => 'Approach to pd location','name_board_seen' => 'Name board seen', 'stock_image' => 'Stock image','workplace_interior_image' => 'Workplace interior image','satellite1' => 'satellite'); // if(count($photos)) $tot_rows = ceil(count($section9) / 3); if(count($section9)) { + echo '
'; echo '
Photograph`s

'; for($row = 0;$row < $tot_rows; $row++) @@ -512,6 +492,29 @@ if(isset($section6)) echo '
'; } ?> +
+ + + + + + + + + + + + + + + + + +
Name of Sales Team Member
Designation of Sales Team Member
Date of PD Visit
+