diff --git a/api/application/config/constants.php b/api/application/config/constants.php
index 18cc4bfa..0ad4d91f 100644
--- a/api/application/config/constants.php
+++ b/api/application/config/constants.php
@@ -605,5 +605,8 @@ defined('D_BUSINESS_FORM') OR define('D_BUSINESS_FORM','d_business_form');
defined('D_BUSINESS_RELATINSHIP') OR define('D_BUSINESS_RELATINSHIP','d_business_relatinship');
defined('D_BUSINESS_PARTNERS') OR define('D_BUSINESS_PARTNERS','d_business_partners');
+defined('SALESPDTEMPLATE') OR define('SALESPDTEMPLATE','m_sales_pd_template');
+defined('SALES_PD_DATA') OR define('SALES_PD_DATA','t_sales_pd_data');
+
diff --git a/api/application/config/routes.php b/api/application/config/routes.php
index d16728d6..7062f4f8 100644
--- a/api/application/config/routes.php
+++ b/api/application/config/routes.php
@@ -252,7 +252,8 @@ $route['testCognito'] = 'Branch_Controller/testCognito';
$route['(getRawData/:any)'] = 'Data_Dump_Controller/getRawData';
-//$route['(getPDReportHTML/:any)'] = 'Welcome/getPDReportHTML';
-//miscellanous
-//$route['showBusinessScorecard'] = 'PD_Controller/';
+$route['loadSalesPDTemplate'] = 'Sales_PD_Controller/loadSalesPDTemplate';
+$route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD';
+$route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
+
diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index f77e904f..94227712 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -4801,7 +4801,7 @@ public function getPDFormDetailsJSON_post()
//Get Common Images
$data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report');
$temp = 'DEFAULT DATA';
- if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX' || ($data['pd_master_details'][0]['lender_short_name'] == 'MONEYWISE' && $data['pd_master_details'][0]['product_abbr'] == 'BL'))
+ if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX' || ($data['pd_master_details'][0]['lender_short_name'] == 'SMC' && $data['pd_master_details'][0]['product_abbr'] == 'BL'))
{
$temp = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true);
}
@@ -5897,10 +5897,10 @@ public function getPDFormDetailsJSON_post()
// die();
// foreach($u as $v)
// {
- $this->aws_cognito->adminSetUserPassword('harshita.nadigatla@imgc.com');
+ //$this->aws_cognito->adminSetUserPassword('harshita.nadigatla@imgc.com');
// }
- die();
+ //die();
$is_regenerate = 0;
@@ -6024,7 +6024,7 @@ public function getPDFormDetailsJSON_post()
$t = "";
if(!count($add_on_pd))
{
- if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX' || ($data['pd_master_details'][0]['lender_short_name'] == 'MONEYWISE' && $data['pd_master_details'][0]['product_abbr'] == 'BL'))
+ if($data['pd_master_details'][0]['lender_short_name'] == 'CLIX' || ($data['pd_master_details'][0]['lender_short_name'] == 'SMC' && $data['pd_master_details'][0]['product_abbr'] == 'BL'))
{
$t = $this->load->view('report_templates/JSONTOREPORT_CLIX',$data,true);
}
@@ -6240,7 +6240,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, 'MONEYWISE')) && !strcasecmp($product_abbr,'BL'))
+ if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'SMC')) && !strcasecmp($product_abbr,'LFMP'))
{
$form_array[] = array('form_id' => 23,'form_name' => 'Future Plans & Business Environments');
}
@@ -6257,7 +6257,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, 'MONEYWISE')) && !strcasecmp($product_abbr,'BL'))
+ if(!strcasecmp($lender_short_name, 'CLIX') || (!strcasecmp($lender_short_name, 'SMC')) && !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
new file mode 100644
index 00000000..ee191f98
--- /dev/null
+++ b/api/application/controllers/Sales_PD_Controller.php
@@ -0,0 +1,145 @@
+load->model('Sales_PD_Model');
+ $this->external_path = $this->config->item('external_data_path');
+ $this->load->library('AWS_S3');
+ $this->load->library('pdfgenerator');
+
+ }
+
+ public function loadSalesPDTemplate_post()
+ {
+ $records = $this->post('records');
+ $lender_id = $records['lender_id'];
+ $product = $records['product_id'];
+
+ $template = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'product_id' => $product,'isactive' => 1),SALESPDTEMPLATE);
+ if(is_array($template) && count($template))
+ {
+ $data['dataStatus'] = true;
+ $data['status'] = REST_Controller::HTTP_OK;
+ $data['records'] = $template[0];
+ $this->response($data,REST_Controller::HTTP_OK);
+ }
+ else
+ {
+ $data['dataStatus'] = false;
+ $data['status'] = REST_Controller::HTTP_NO_CONTENT;
+ $data['msg'] = 'No Tempate Found!';
+ $this->response($data,REST_Controller::HTTP_OK);
+
+ }
+ }
+
+
+ public function saveSalesPD_post()
+ {
+ $records = $this->post('records');
+ // $pd_data = $records['pd_json'];
+ // $lender_id = $records['lender_id'];
+ // $product_id = $records['product_id'];
+ // $created_by = $records['created_by'];//
+ //sales_pd_id, pd_json, lender_id, product_id, createdby, updatedby, createdon, updatedon, isactive
+ $id = null;
+ if(!$records['sales_pd_id'])
+ {
+ $id = $this->Sales_PD_Model->saveRecords($records,SALES_PD_DATA);
+ }
+ else
+ {
+ $id = $this->Sales_PD_Model->updateRecords($records,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id']));
+ }
+
+ if($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_NO_CONTENT;
+ $data['msg'] = 'Something went wrong! Try Later';
+ $this->response($data,REST_Controller::HTTP_OK);
+ }
+
+ }
+
+ public function getSalesPDReport_get()
+ {
+ $sales_pd_id = $this->uri->segment(2);
+
+ $columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
+ $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')
+ );
+
+ $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);
+ print_r($sales_pd_data);//die();
+
+ if($sales_pd_data)
+ {
+ $bucket_name = LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id'];
+ $key = 'sales_pd/'.$sales_pd_id;
+
+ if(!file_exists($this->external_path.'/sales_pd/'.$sales_pd_id))
+ {
+ mkdir($this->external_path.'/sales_pd/'.$sales_pd_id,0761);
+ }
+
+ if(!$sales_pd_data[0]['is_pdf'] || $sales_pd_data[0]['is_edited'])
+ {
+ $view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
+ $html_content = $this->load->view('sale_pd_templates/'.$view_name,$data = array(),true);
+
+ $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
+ //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();
+ $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key.'/1.pdf','sourcefile'=>$this->external_path.'/sales_pd/'.$sales_pd_id.'/temp.pdf');
+ $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data);
+
+ if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
+ {
+ echo 'SUCESS';
+ }
+ }
+ else
+ {
+
+ }
+ }
+
+ }
+
+}
+
+
+
\ No newline at end of file
diff --git a/api/application/helpers/external_dir_check_helper.php b/api/application/helpers/external_dir_check_helper.php
index c5a0199c..c876b689 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');
+ $array = array($path.'/ci_logs',$path.'/api_request_logs',$path.'/app_logs',$path.'/pd_reports',$path.'/sales_pd');
foreach ($array as $key => $value)
{
if(!file_exists($value))
diff --git a/api/application/models/Sales_PD_Model.php b/api/application/models/Sales_PD_Model.php
new file mode 100644
index 00000000..34a78e11
--- /dev/null
+++ b/api/application/models/Sales_PD_Model.php
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Personal Discussion Sheet - LFMP (For Sales Team) |
+
+
+ | Application ID |
+ SAMPLEDATA |
+
+
+ | Name of the Company/Firm |
+ SAMPLEDATA |
+
+
+ | Name of Person Met during visit |
+ SAMPLEDATA |
+
+
+ | Address Visited |
+ SAMPLEDATA |
+
+
+ | City |
+ SAMPLEDATA |
+ State |
+ SAMPLEDATA |
+ PIN |
+ SAMPLEDATA |
+
+
+
+
+
+
+
+ | Fund Requirement |
+
+
+ | Loan Amount Applied for (Rs) |
+ SAMPLEDATA |
+ Total Fund Requirement (Rs) |
+ SAMPLEDATA |
+
+
+ | Loan Tenure (Months) |
+ SAMPLEDATA |
+ Loan Purpose (End-Use) |
+ SAMPLEDATA |
+
+
+
+
+
+
+ | Details of Key Stakeholders in the Business |
+
+
+ | Name |
+ Share Holding |
+ Vintage in Current Biz |
+ Total Work Exp |
+ Previous Experience Details |
+ Started Biz (Yes / No) |
+
+
+ | Kumaralingam |
+ 100% |
+ 5yrs & 2 Mns |
+ 10 yrs & 6 Mns |
+ >SAMPLEDATA >SAMPLEDATA SAMPLEDATASAMPLEDATA |
+ Yes |
+
+
+
+ | Brief of the Business / Service |
+
+
+ | SAMPLEDATA |
+
+
+
+
+
+
+
+
+ | Financial Information |
+
+
+ | Name of the Company / Firm whose financials are noted >> |
+ SAMPLEDATA |
+
+
+
+
+ | Particulars of Financials as per books of Accounts (Can be captured prior to PD) |
+ FY 1 |
+ FY 2 |
+ FY 3 |
+
+
+
+
+ | Sales / Revenue (Rs) |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | Net Profit / (Net Loss) (Rs) |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | Net Profit or (Net Loss) to Sales % |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | % (↑ /↓) in Sales over PY |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | % (↑ /↓) in Net Profit over PY |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | % (↑ /↓) in Net Profit % over PY |
+
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | Income to be Considered (Rs Per Annum) >> |
+ SAMPLEDATA |
+ Income Considered (Rs Per Mth) >> |
+ SAMPLEDATA |
+
+
+ | Income assessment Program Recommended >> |
+ SAMPLEDATA |
+ Fixed Obligations (Rs per month) >> |
+ SAMPLEDATA |
+
+
+
+
+
+
+ | Property Information |
+
+
+ | Property Address (With Landmark & PIN) |
+ SAMPLEDATA |
+
+
+ | Property Type |
+ Bungalow / Apartment / Row House / Builder Floor / Others (Specify) |
+ Occupancy Status |
+ Self-Occupied / Rented / Vacant |
+
+
+ | >Permitted Property Usage |
+ Residential / Commercial / Industrial |
+ Actual Property Usage |
+ Residential / Commercial / Industrial |
+
+
+ | Built-Up Area (Sq. Ft.) |
+ |
+ Approx Mkt. Val (Rs) |
+ As declared by Applicant |
+
+
+ | Property Ownership Status (Enter the names of the Property Owner(s) and their relationships) |
+ SAMPLEDATA |
+
+
+
+
+
+
+ | Final Remarks of PD officer |
+
+
+ | Business activity seen during visit (Yes / No) |
+ SAMPLEDATA |
+ Location of workplace suits the business (Yes/No) |
+ SAMPLEDATA |
+
+
+ | Overall Assessment (Positive / Negative) |
+ SAMPLE GAVSHS |
+ Recommended ROI for the case |
+ SAMPLEDATA |
+
+
+ | Any Other remarks >> |
+ SAMPLEDATA |
+
+
+
+
+
+
+
+ | Name of Sales Team Member >> |
+ SAMPLEDATA |
+
+
+ | Designation of Sales Team Member >> |
+ SAMPLEDATA |
+
+
+ | Date of PD Visit >> |
+ SAMPLEDATA |
+
+
+ | Signature of PD Officer >> |
+ SAMPLEDATA |
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api/application/views/sale_pd_templates/OMONEYWISE_LFMP.php b/api/application/views/sale_pd_templates/OMONEYWISE_LFMP.php
new file mode 100644
index 00000000..b8eb5161
--- /dev/null
+++ b/api/application/views/sale_pd_templates/OMONEYWISE_LFMP.php
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Personal Discussion Sheet - LFMP (For Sales Team) |
+
+
+ | Application ID |
+ SAMPLEDATA |
+
+
+ | Name of the Company/Firm |
+ SAMPLEDATA |
+
+
+ | Name of Person Met during visit |
+ SAMPLEDATA |
+
+
+ | Address Visited |
+ SAMPLEDATA |
+
+
+ | City |
+ SAMPLEDATA |
+ State |
+ SAMPLEDATA |
+ PIN |
+ SAMPLEDATA |
+
+
+
+
+
+
+
+ | Fund Requirement |
+
+
+ | Loan Amount Applied for (Rs) |
+ SAMPLEDATA |
+ Total Fund Requirement (Rs) |
+ SAMPLEDATA |
+
+
+ | Loan Tenure (Months) |
+ SAMPLEDATA |
+ Loan Purpose (End-Use) |
+ SAMPLEDATA |
+
+
+
+
+
+
+ | Details of Key Stakeholders in the Business |
+
+
+ | Name |
+ Share Holding |
+ Vintage in Current Biz |
+ Total Work Exp |
+ Previous Experience Details |
+ Started Biz (Yes / No) |
+
+
+ | Kumaralingam |
+ 100% |
+ 5yrs & 2 Mns |
+ 10 yrs & 6 Mns |
+ >SAMPLEDATA >SAMPLEDATA SAMPLEDATASAMPLEDATA |
+ Yes |
+
+
+
+ | Brief of the Business / Service |
+
+
+ SAMPLEDATA |
+
+
+
+
+
+
+
+ | Financial Information |
+
+
+ | Name of the Company / Firm whose financials are noted >> |
+ SAMPLEDATA |
+
+
+
+
+ | Particulars of Financials as per books of Accounts (Can be captured prior to PD) |
+ FY 1 |
+ FY 2 |
+ FY 3 |
+
+
+ | Sales / Revenue (Rs) |
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+ | Net Profit / (Net Loss) (Rs) |
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+ SAMPLEDATA |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file