report changes : ps

This commit is contained in:
sanjeev 2022-02-21 10:24:07 +05:30
parent 2932e968ff
commit 00705fff8b
10 changed files with 53 additions and 16 deletions

View File

@ -1111,11 +1111,17 @@ class PD_Controller extends REST_Controller {
$this->load->model('User_Management_Model');
$user_details = $this->User_Management_Model->getUserDetails($pd_details['fk_updatedby']);
$role = $user_details['data'][0]['user_role'];
if($is_mwise_lender && (!empty($agency_id)) && ($agency_id != null) && ((int)$agency_id != 0) && ($pd_details['pd_status'] == "TRIGGERED") && ($role == 30)){
$pd_details['vendor_status'] = null;
$pd_details['pd_agency_id'] = null;
$pd_details['pd_status'] = $pd_details['pd_status'];
}
if($is_mwise_lender && (!empty($agency_id)) && ($agency_id != null) && ((int)$agency_id != 0) && ($pd_details['pd_status'] != "TRIGGERED" || $pd_details['pd_status'] != "QC_COMPLETED"))
{
//newly implemented
if(($pd_details['pd_status'] == "CANCELLED") && ($role == 27 || $role == 26)){
if(($pd_details['pd_status'] == "CANCELLED") && ($role == 27 || $role == 26 || $role == 30)){
$pd_details['vendor_status'] = null;
$pd_details['pd_agency_id'] = null;
$pd_details['pd_status'] = $pd_details['pd_status'];

View File

@ -1549,6 +1549,7 @@ public function filterSalesPDList_post() {
// print_r($view_data['pd_section_data'][15]);die();
$view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS);
$view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS);
// print_r($view_data['smc_images']);die();
//print_r(count($view_data['smc_images']));die();
//score card part
@ -1627,7 +1628,7 @@ public function filterSalesPDList_post() {
$html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true);
}
// echo $html_content;exit();
echo $html_content;exit();
$pdf_name = $view_data['pd_master_details'][0]['main_applicant'];
$pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
//End of PDF Gen using DOM PDF
@ -1813,7 +1814,7 @@ public function filterSalesPDList_post() {
$this->response($data,REST_Controller::HTTP_OK);
}
//2 roles = SMC Vendor PD officer and SMC Vendor PD manager
//3 roles = SMC Vendor PD officer and SMC Vendor PD manager,lender admin
function getSMCVendorPDOfficersList_get(){
// $role_id = $this->get('role_id');

View File

@ -214,7 +214,8 @@ class Sales_PD_Controller extends REST_Controller {
//$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
$view_name = $sales_pd_data[0]['short_name'];if( $sales_pd_data[0]['abbr'] == 'MEQ'){ $view_name = $sales_pd_data[0]['abbr']; }
$html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true);
// echo $html_content;die();
print_r($view_data);die();
echo $html_content;die();
$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";

View File

@ -1028,6 +1028,8 @@ class Template_Management_Controller extends REST_Controller {
// API 3 : to save and Update the Mapping Details and return the Pkid
public function saveTemplateV2_post(){
// draft,approve,completed
// strtoupper(str_replace(' ', '', $form_status));
$records = $this->post("records");
// print_r($records);die();
if( (!isset($records['entity_id'])) || (!isset($records['product_id'])) || (!isset($records['customer_segment_id'])) )
@ -1084,16 +1086,27 @@ class Template_Management_Controller extends REST_Controller {
$map_id = $records['map_id'];
$form_id = $records['form_id'];
$fields = array('id');
$status = strtoupper(str_replace(' ', '',$records['form_status']));
$where_condition_array = array('map_id'=>$map_id,"form_id"=>$form_id,"isactive"=>1);
$json_table = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATE_JSON_V2);
if(count($json_table)>0){
$this->db->where('id',$json_table[0]['id']);
$this->db->set('isactive',0);
$this->db->update(TEMPLATE_JSON_V2);
}
$json = json_encode($records['json'],true);
$fields = array('form_id' => $form_id,'json' => $json,'map_id'=>$map_id);
$json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
if(count($json_table)>0 && $status == "COMPLETED"){
$this->db->where('id',$json_table[0]['id']);
$this->db->set('isactive',0);
$this->db->update(TEMPLATE_JSON_V2);
}else if(count($json_table)>0 && ($status == "DRAFT" || $status == "APPROVED" )){
$json = json_encode($records['json'],true);
$this->db->where('id',$json_table[0]['id']);
$this->db->where('map_id',$map_id);
$this->db->where('form_id',$form_id);
$this->db->where('is_form_status',$status);
$this->db->set('json',$json);
$this->db->update(TEMPLATE_JSON_V2);
$json_pk_id = $json_table[0]['id'];
}else{
$json = json_encode($records['json'],true);
$fields = array('form_id' => $form_id,'json' => $json,'map_id'=>$map_id,'is_form_status'=>$status);
$json_pk_id = $this->Template_Management_Model->saveTemplateMapping($fields,TEMPLATE_JSON_V2);
}
if($json_pk_id)
{
$data['dataStatus'] = true;

View File

@ -2313,7 +2313,7 @@ class PD_Model extends SPARQ_Model {
function getSMCVendorPDOfficersList($agency_id){
// if(empty($role)){
// $role = array(28,29);
$role = array(29);
$role = array(29,30);
// }
$this->db->select('USERPROFILE.userid,USERPROFILE.first_name,USERPROFILE.last_name,USERPROFILE.first_name as name,USERPROFILEROLES.user_role');
$this->db->from(USERPROFILE.' as USERPROFILE');

View File

@ -135,7 +135,7 @@ class SMC_Credit_PD_Model extends SPARQ_Model {
$result = $CMusers;
}
}else if($role == 27){
}else if($role == 27 || $role == 30){
$result = $RCMusers;
}
return $result;

View File

@ -617,6 +617,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['designation']?></td>
</tr>
<tr>
<td colspan="3" >Employee ID </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['designation']?></td>
</tr>
<tr>
<?php if($master[0]['sales_pd_type'] == 1){?>
<td colspan="3" >Date of PD Visit </td>

View File

@ -597,6 +597,10 @@ if(isset($section6))
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['designation']?></td>
</tr>
<tr>
<td colspan="3" >Employee ID </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['smc_emp_code']?></td>
</tr>
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $section8['date']?></td>

View File

@ -1539,7 +1539,11 @@ if(count($smc_images))
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby_designation']?></td>
</tr> -->
<tr>
<tr>
<td colspan="3" >Employee ID </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['smc_emp_code']?></td>
</tr>
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['pd_visit_date']?></td>
</tr>

View File

@ -583,6 +583,10 @@ if(count($smc_images))
<td colspan="3" >Designation of Sales Team Member </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['updatedby_designation']?></td>
</tr> -->
<tr>
<td colspan="3" >Employee ID </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['smc_emp_code']?></td>
</tr>
<tr>
<td colspan="3" >Date of PD Visit </td>
<td class="tdcenteralign" colspan="7" ><?php echo $pd_master_details[0]['pd_visit_date']?></td>