Enquiry list filtered for report preview : GWM
This commit is contained in:
parent
6e14d804e9
commit
4f7b0528a4
@ -50,6 +50,7 @@ class EnquiryController extends ResourceController
|
||||
$enquiry_status = $this->request->getGet('enquiry_status');
|
||||
|
||||
$only_policy_data = $this->request->getGet('only_policy_data') ?? false;
|
||||
$show_policy_report = $this->request->getGet('show_policy_report') ?? 'All';
|
||||
|
||||
|
||||
// Date filter handling
|
||||
@ -69,15 +70,15 @@ class EnquiryController extends ResourceController
|
||||
|
||||
|
||||
if (!empty($staff_id) && !empty($manager_id)) {
|
||||
$data = $this->enquiryModel->getEnquiry('STAFF&MANAGER', [$staff_id,$manager_id], $only_policy_data, $from_date, $to_date, $status ,$enquiry_status);
|
||||
$data = $this->enquiryModel->getEnquiry('STAFF&MANAGER', [$staff_id,$manager_id], $only_policy_data, $show_policy_report, $from_date, $to_date, $status ,$enquiry_status);
|
||||
} elseif (!empty($agent_id)) {
|
||||
$data = $this->enquiryModel->getEnquiry('AGENT', $agent_id, $only_policy_data, $from_date, $to_date, $status ,$enquiry_status);
|
||||
$data = $this->enquiryModel->getEnquiry('AGENT', $agent_id, $only_policy_data, $show_policy_report, $from_date, $to_date, $status ,$enquiry_status);
|
||||
} elseif (!empty($staff_id)) {
|
||||
$data = $this->enquiryModel->getEnquiry('STAFF', $staff_id, $only_policy_data, $from_date, $to_date, $status ,$enquiry_status);
|
||||
$data = $this->enquiryModel->getEnquiry('STAFF', $staff_id, $only_policy_data, $show_policy_report, $from_date, $to_date, $status ,$enquiry_status);
|
||||
} elseif (!empty($enquiry_id)) {
|
||||
$data = $this->enquiryModel->getEnquiry('ENQUIRY',$enquiry_id, $only_policy_data);
|
||||
$data = $this->enquiryModel->getEnquiry('ENQUIRY',$enquiry_id, $only_policy_data, $show_policy_report);
|
||||
} elseif (!empty($manager_id)) {
|
||||
$data = $this->enquiryModel->getEnquiry('MANAGER',$manager_id, $only_policy_data, $from_date, $to_date, $status ,$enquiry_status);
|
||||
$data = $this->enquiryModel->getEnquiry('MANAGER',$manager_id, $only_policy_data, $show_policy_report, $from_date, $to_date, $status ,$enquiry_status);
|
||||
}elseif (!empty($handler_id)) {
|
||||
|
||||
$staffData = $this->db->table('partner_staff ps')
|
||||
|
||||
@ -128,7 +128,16 @@ class MasterController extends ResourceController
|
||||
//Vehicle type CRUD---------------------------------------------------------------------
|
||||
public function getVehicleTypeMaster()
|
||||
{
|
||||
$data = $this->VehicleTypeMasterModel->findAll();
|
||||
$valueFor = $this->request->getGet('value_for');
|
||||
|
||||
if(isset($valueFor) && $valueFor == 'dropdown')
|
||||
{
|
||||
$isActive = [1];
|
||||
}else{
|
||||
$isActive = [0,1];
|
||||
}
|
||||
|
||||
$data = $this->VehicleTypeMasterModel->whereIn('is_active',$isActive)->findAll();
|
||||
|
||||
if (!$data) {
|
||||
return $this->failNotFound('No data found');
|
||||
|
||||
@ -40,7 +40,7 @@ class EnquiryModel extends Model
|
||||
protected $updatedField = 'updated_on';
|
||||
|
||||
|
||||
public function getEnquiry($getBy = null , $Id = null , $only_policy_data = false, $from_date = null, $to_date = null , $status = null , $enquiry_status = null)
|
||||
public function getEnquiry($getBy = null , $Id = null , $only_policy_data = false, $show_policy_report = 'All', $from_date = null, $to_date = null , $status = null , $enquiry_status = null)
|
||||
{
|
||||
$data = $this->select('partner_enquiry.*, partner_enquiry.name as insured_name,
|
||||
VT.vehicle_type as vehicle_type,
|
||||
@ -88,11 +88,21 @@ class EnquiryModel extends Model
|
||||
|
||||
|
||||
if($only_policy_data){
|
||||
|
||||
$data->where('P.id IS NOT NULL');
|
||||
|
||||
if($from_date != null){
|
||||
$data->where("P.created_on >=", $from_date)
|
||||
->where("P.created_on <=", $to_date);
|
||||
}
|
||||
|
||||
if($show_policy_report == 'Verifyed')
|
||||
{
|
||||
$data->where("P.is_data_accuracy_checked", "1");
|
||||
}else if($show_policy_report == 'Not Verified')
|
||||
{
|
||||
$data->where("P.is_data_accuracy_checked", "0");
|
||||
}
|
||||
}else{
|
||||
if($from_date != null){
|
||||
$data->where("partner_enquiry.created_on >=", $from_date)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user