diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index fc8a0682..6629e5d2 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -10641,6 +10641,16 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() if(isset($records['vendor_status']) && ($records['vendor_status'] == COMPLETED || $records['vendor_status'] == QC_COMPLETED)) { //echo 'sanskl'; + $smc_lender_id = ENVIRONMENT == 'production' ? 7 : 35; //SMC lender id MWISE in live and demo + $current_lender_id = $exist_pd_details[0]['fk_lender_id']; + $agency_id = $exist_pd_details[0]['pd_agency_id']; + // IF Condition - using PDID get the lender and mapped with SMC_lender_id macthed means Vendor status dynamically assigned + if($smc_lender_id == $current_lender_id && isset($agency_id) && $agency_id != null){ + if(isset($records['vendor_status']) && ($records['vendor_status'] == QC_COMPLETED)){ + $records['pd_status'] = $records['vendor_status']; //Here vendor_status is (QC_COMPLETED) means i have to update the Normal Status also. + } + // else{ $records['vendor_status'] = $records['pd_status']; } + } if(!isset($records['complete_override_data'])) { $vendor_form = $this->PD_Model->selectCustomRecords(array('json'),array('isactive' => 1,'fk_form_id' => 25,'fk_pd_id' => $records['pd_id']) @@ -10679,16 +10689,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() - $smc_lender_id = ENVIRONMENT == 'production' ? 7 : 35; //SMC lender id MWISE in live and demo - $current_lender_id = $exist_pd_details[0]['fk_lender_id']; - $agency_id = $exist_pd_details[0]['pd_agency_id']; - // IF Condition - using PDID get the lender and mapped with SMC_lender_id macthed means Vendor status dynamically assigned - if($smc_lender_id == $current_lender_id && isset($agency_id) && $agency_id != null){ - if(isset($records['vendor_status']) && ($records['vendor_status'] == QC_COMPLETED)){ - $records['pd_status'] = $records['vendor_status']; //Here vendor_status is (QC_COMPLETED) means i have to update the Normal Status also. - } - // else{ $records['vendor_status'] = $records['pd_status']; } - } + } // die(); // print_r($fields_to_update);die(); diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 2b0e890e..4621eb79 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1627,7 +1627,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 @@ -1819,7 +1819,8 @@ public function filterSalesPDList_post() { // $role_id = $this->get('role_id'); // $entity_id = $this->get('entity_id'); // $Lenderlist = $this->PD_Model->getSMCVendorPDOfficersList($role_id,$entity_id); - $Lenderlist = $this->PD_Model->getSMCVendorPDOfficersList(); + $agency_id = $this->get('agency_id'); + $Lenderlist = $this->PD_Model->getSMCVendorPDOfficersList($agency_id); $data = (!empty($Lenderlist)) ? array('dataStatus' => true,'status' => REST_Controller::HTTP_OK,'records' => $Lenderlist) : array('dataStatus' => false,'status' => REST_Controller::HTTP_NOT_FOUND,'msg' =>'No Records Found!'); diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index a52f5f36..c6538ea8 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -2300,7 +2300,7 @@ class PD_Model extends SPARQ_Model { } - function getSMCVendorPDOfficersList(){ + function getSMCVendorPDOfficersList($agency_id){ // if(empty($role)){ // $role = array(28,29); $role = array(29); @@ -2310,6 +2310,7 @@ class PD_Model extends SPARQ_Model { $this->db->join(USERPROFILEROLES.' as USERPROFILEROLES','USERPROFILEROLES.fk_userid = USERPROFILE.userid and USERPROFILEROLES.isactive = 1','LEFT'); $this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role and ROLES.isactive = 1','LEFT'); $this->db->where('USERPROFILE.isactive',1); + $this->db->where('USERPROFILE.smc_agency_id',$agency_id); $this->db->where_in('USERPROFILEROLES.user_role',$role); // if(!empty($entity)){ $this->db->where('USERPROFILE.fk_entity_id',$entity); } $result = $this->db->get()->result_array();