SALES PD FILTER & CALCEL PD REMARK

This commit is contained in:
Velz2020 2021-01-04 15:16:09 +05:30
parent 94b20d2808
commit 838343e68c
5 changed files with 22 additions and 7 deletions

View File

@ -886,6 +886,7 @@ class PD_Controller extends REST_Controller {
{
$pd_details = $this->post('records');
//print_r($pd_details);die();
$pd_cancel_remark = '';
log_message('ERROR',"UpdatePD Called");
// log_message('ERROR',print_r($pd_details));
if((isset($pd_details['pd_id']) && $pd_details['pd_id'] != "" ) && (isset($pd_details['random_string']) && $pd_details['random_string'] != " "))
@ -1045,10 +1046,20 @@ class PD_Controller extends REST_Controller {
$pd_details['pd_status'] == INPROGRESS;
}
if(isset($pd_details['pd_status']) && ($pd_details['pd_status'] == CANCELLED ))
{
$pd_cancel_remark = $pd_details['remark'];
unset($pd_details['remark']);
}
$where_condition_array = array('pd_id' => $pd_details['pd_id'],'random_string' => $pd_details['random_string']);
$pd_id_modified = $this->PD_Model->updateRecords($pd_details,PDTRIGGER,$where_condition_array);
// print_r($this->db->last_query());
//update pd cancel remrks if any
if($pd_cancel_remark)
{
$this->PD_Model->saveRecords(array('fk_pd_id' => $pd_details['pd_id'],'remark' => $pd_cancel_remark,'createdby' => $pd_details['fk_updatedby'],),PDREMARKS);
}
//Update Address table,if primary address choosed
if($primary_address_id != null)
{
@ -1861,7 +1872,7 @@ public function assignPDTempalate($data)
$fields = array('pdteam_id');
$where_condition_array = array('team_name' => "General");
$general_team_id = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDTEAM);
// print_r($general_team_id);die();
if(count($general_team_id))
{

View File

@ -525,7 +525,7 @@ class Sales_PD_Controller extends REST_Controller {
$section_names = array('1' => 'General Section','2' => 'Fund Requirement','3' => 'stakeholders','4' => 'Institution Details','5' => 'Product Information','6' => 'Financial Information','7' => 'Final Remraks','8' => 'Officer Details','9' => 'Photography');
}
$count = $this->Sales_PD_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $records['lender_id'],'product_id' => $records['product_id']),SALES_PD_DATA);
$count = $this->Sales_PD_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $records['lender_id'],'product_id' => $records['product_id'],'isactive' => 1),SALES_PD_DATA);
// die();
if($records['sales_pd_id'] == '' || $records['sales_pd_id'] == null)
@ -983,8 +983,9 @@ public function filterSalesPDList_post() {
$pd_applicant_name = strtolower($records['pd_applicant_name']);
$pd_officer_name = isset($records['pd_officer']) ? $records['pd_officer'] : null ;
$sales_pd_officer_id = isset($records['sales_pd_officer_id']) ? $records['sales_pd_officer_id'] : null ;
$result_data=$this->Sales_PD_Model->getSalesPDListwithFilters($pd_status,$pd_from_date,$pd_to_date,$pd_products,$pd_lender,$pd_applicant_name,$pd_officer_name,$sales_pd_officer_id);
// print_r ($result_data);
$sales_pd_type = isset($records['sales_pd_type']) ? $records['sales_pd_type'] : null ;
$result_data=$this->Sales_PD_Model->getSalesPDListwithFilters($pd_status,$pd_from_date,$pd_to_date,$pd_products,$pd_lender,$pd_applicant_name,$pd_officer_name,$sales_pd_officer_id,$sales_pd_type);
// print_r (count($result_data));die();
if(count($result_data)){
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;

View File

@ -50,7 +50,7 @@ class CUSTOM_PDALERTS
}
if($core_details[0]['pd_status'] == ALLOCATED_TO_PARTNER && $core_details[0]['vendor_email'] != '')
if($core_details[0]['pd_status'] == ALLOCATED_TO_FIA && $core_details[0]['vendor_email'] != '')
{
$msg = 'Dear Team,\n\n New PD has been Allocated to you. \" {{applicant_name}} \" ID - \" {{applicant_id}} \" .\n\nWarm Regards,\nSineedge Consulting Private Limited.';
$msg = PDALERTS::stringReplace($msg,$core_details,'MAIL');

View File

@ -8,7 +8,7 @@ class Sales_PD_Model extends SPARQ_Model {
public function __construct() {
parent::__construct();
}
public function getSalesPDListwithFilters($pd_status = '',$pd_from_date = '',$pd_to_date = '',$pd_products = '',$pd_lender = '',$pd_applicant_name = '',$pd_officer_name = '',$sales_pd_officer_id) {
public function getSalesPDListwithFilters($pd_status = '',$pd_from_date = '',$pd_to_date = '',$pd_products = '',$pd_lender = '',$pd_applicant_name = '',$pd_officer_name = '',$sales_pd_officer_id,$sales_pd_type = '') {
// SALES_PD_DATA.sales_pd_sno, SALES_PD_DATA.sales_pd_id, SALES_PD_DATA.applicant_name,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name,SALES_PD_DATA.applicant_id,SALES_PD_DATA.lender_id,SALES_PD_DATA.product_id,SALES_PD_DATA.is_pdf,SALES_PD_DATA.is_edited,ENTITY.short_name,PRODUCTS.abbr,DATE_FORMAT(SALES_PD_DATA.createdon, "%d/%m/%Y") as pd_createdon,SALES_PD_DATA.status
$this->db->SELECT(' SALES_PD_DATA.sales_pd_sno, SALES_PD_DATA.sales_pd_id, SALES_PD_DATA.applicant_name,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name,SALES_PD_DATA.applicant_id,SALES_PD_DATA.lender_id,SALES_PD_DATA.product_id,SALES_PD_DATA.is_pdf,SALES_PD_DATA.is_edited,ENTITY.short_name,PRODUCTS.abbr,SALES_PD_DATA.createdon,
DATE_FORMAT(SALES_PD_DATA.createdon, "%Y-%m-%d") as pd_createdon, SALES_PD_DATA.status,SALES_PD_DATA.sales_pd_type,SALES_PD_DATA.rand_string');
@ -44,6 +44,9 @@ class Sales_PD_Model extends SPARQ_Model {
if(!empty($sales_pd_officer_id)) {
$this->db->WHERE('SALES_PD_DATA.createdby',$sales_pd_officer_id);
}
if(!empty($sales_pd_type)) {
$this->db->WHERE('SALES_PD_DATA.sales_pd_type',$sales_pd_type);
}
$this->db->WHERE('SALES_PD_DATA.isactive',1);
$this->db->order_by('SALES_PD_DATA.sales_pd_id','desc');
$this->db->limit(1000,0);

View File

@ -1743,7 +1743,7 @@ font-weight: bolder;;
//echo $pd_offiecer_status_about_neighbor;
if(count($existNeighRefCheck)>0){
print_r($existNeighRefCheck);die();
print_r($existNeighRefCheck);//die();
?>
<?php foreach($existNeighRefCheck as $nkey => $nfValue) {