diff --git a/app/Config/Acl.php b/app/Config/Acl.php index 107c754d..b59905ff 100644 --- a/app/Config/Acl.php +++ b/app/Config/Acl.php @@ -122,7 +122,7 @@ class Acl // ===================== POLICY TRANSACTION / BDS ===================== '#^/policy_tranction#' => [ - 'roles' => [ HEAD_ROLE_ID,ADMIN_ROLE_ID, MANAGER_ROLE_ID, ACCOUNT_MANAGER_ROLE_ID], + 'roles' => [ HEAD_ROLE_ID,ADMIN_ROLE_ID, MANAGER_ROLE_ID, ACCOUNT_MANAGER_ROLE_ID,STAFF_ROLE_ID], 'teams' => [FINANCE_TEAM_ID,POS_TEAM_ID] ], '#^/dmsSearch#' => [ diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a21e6106..7ed357a6 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -609,7 +609,7 @@ $routes->group("employeeRest/api/v1", ["filter" => ['ratelimit', 'authJWT']], fu $routes->post('create', 'Api\NonEbClaimApiController::createClaim'); $routes->post('list', 'Api\NonEbClaimApiController::listClaims'); $routes->get('history/(:num)', 'Api\NonEbClaimApiController::claimHistory/$1'); - $routes->post('(:num)/upload-required-doc', 'Api\NonEbClaimApiController::uploadRequiredDoc/$1'); + $routes->post('upload-required-doc', 'Api\NonEbClaimApiController::uploadRequiredDoc'); $routes->get('statuses', 'Api\NonEbClaimApiController::listClaimStatuses'); $routes->post('policies', 'Api\NonEbClaimApiController::listPolicies'); }); diff --git a/app/Controllers/Api/NonEbClaimApiController.php b/app/Controllers/Api/NonEbClaimApiController.php index 87347903..0e2355b5 100644 --- a/app/Controllers/Api/NonEbClaimApiController.php +++ b/app/Controllers/Api/NonEbClaimApiController.php @@ -260,7 +260,7 @@ class NonEbClaimApiController extends BaseController ->first(); if (!$acm) { - $this->myLogger->logme('error', "[NON_EB_API] No ACM found for client_id: {$cp['client_id']}"); + $this->myLogger->logme('error', "[NON_EB_API][createClaim] No ACM found for client_id: {$cp['client_id']}"); } // Auto-set first claim_status_id for this policy type @@ -349,7 +349,7 @@ class NonEbClaimApiController extends BaseController $this->saveAssets($claim_id, $body); $this->putHistoryAfterInsert($ticket_data, $claim_id); - $this->myLogger->logme('error', "[NON_EB_API] Claim created. ID: $claim_id, user: {$authUser['id']}"); + $this->myLogger->logme('error', "[NON_EB_API][createClaim] Claim created. ID: $claim_id, user: {$authUser['id']}"); return $this->respond([ 'status' => true, @@ -439,6 +439,8 @@ class NonEbClaimApiController extends BaseController $data = $builder->get()->getResultArray(); + $this->myLogger->logme('error', "[NON_EB_API][listClaims] user: {$authUser['id']}, page: $page, total: $total"); + return $this->respond([ 'status' => true, 'code' => 200, @@ -456,18 +458,61 @@ class NonEbClaimApiController extends BaseController return $this->respond(['status' => false, 'code' => 401, 'message' => 'Unauthorized'], 401); } - // Verify claim exists - $claim = $this->nonEbTicketModel - ->select('id, client_id, policy_type_id') - ->where('id', $claim_id) - ->where('is_active', 1) - ->first(); + // Fetch full claim row with joins (client, insurer, status, policy type, ACM, branch) + $raw = $this->nonEbTicketModel->getTicketDataByTicketID($claim_id); - if (!$claim) { + if (!$raw) { return $this->respond(['status' => false, 'code' => 404, 'message' => 'Claim not found'], 404); } - // Fetch only claim_status_id history rows, oldest first + // claims_data — major display fields only + $claims_data = [ + 'id' => $raw['id'], + 'nhance_claim_ref_no' => $raw['nhance_claim_ref_no'], + 'claim_number' => $raw['claim_number'], + 'policy_no' => $raw['policy_no'], + 'policy_type_name' => $raw['policy_type_name'], + 'client_name' => $raw['client_name'], + 'branch_name' => $raw['branch_name'], + 'insurer_name' => $raw['insurer_name'], + 'claim_status' => $raw['claim_status'], + 'status_display_name' => $raw['status_display_name'], + 'insured_contact_name' => $raw['insured_contact_name'], + 'insured_contact_number' => $raw['insured_contact_number'], + 'insured_contact_email' => $raw['insured_contact_email'], + 'nature_of_loss' => $raw['nature_of_loss'], + 'loss_location' => $raw['loss_location'], + 'loss_date' => $raw['loss_date'], + 'loss_description' => $raw['loss_description'], + 'loss_estimate' => $raw['loss_estimate'], + 'loss_assessed_value' => $raw['loss_assessed_value'], + 'settled_amount' => $raw['settled_amount'], + 'settlement_utr' => $raw['settlement_utr'], + 'intimation_recd_date' => $raw['intimation_recd_date'], + 'intimated_to_insurer_date'=> $raw['intimated_to_insurer_date'], + 'surveyor_name' => $raw['surveyor_name'], + 'surveyor_contact_person' => $raw['surveyor_contact_person'], + 'surveyor_contact_number' => $raw['surveyor_contact_number'], + 'acm' => $raw['acm'], + 'acm_mobile' => $raw['acm_mobile'], + 'asset_file' => $raw['asset_file'], + 'priority' => $raw['priority'], + 'created_at' => $raw['created_at'], + 'updated_at' => $raw['updated_at'], + ]; + + // required_docs — decoded separately + $required_docs = json_decode($raw['required_docs'] ?? '{}', true) ?: []; + + // claims_files + $claims_files = $this->claimFilesModel + ->select('id, doc_name, file_name, mime_type, file_type, docs_for_ir, created_at') + ->where('ticket_id', $claim_id) + ->where('ticket_type', 2) + ->where('is_active', 1) + ->findAll(); + + // ticket_data — claim status history, oldest first $history_rows = $this->ticketHistoryModel ->select('new_value, created_at') ->where('ticket_id', $claim_id) @@ -476,14 +521,9 @@ class NonEbClaimApiController extends BaseController ->orderBy('created_at', 'ASC') ->findAll(); - if (empty($history_rows)) { - return $this->respond(['status' => true, 'code' => 200, 'claim_id' => $claim_id, 'history' => []], 200); - } - - // Build display_name map for this policy type — only statuses with a display_name are user-visible $statuses = $this->claimStatusModel ->select('id, claim_status, display_name') - ->where('ticket_type', $claim['policy_type_id']) + ->where('ticket_type', $raw['policy_type_id']) ->where('display_name IS NOT NULL') ->where("display_name != ''") ->where('is_active', 1) @@ -491,24 +531,28 @@ class NonEbClaimApiController extends BaseController $display_map = array_column($statuses, 'display_name', 'id'); - // Filter and format — skip statuses with no display_name - $history = []; + $ticket_data = []; foreach ($history_rows as $row) { - $status_id = (int)$row['new_value']; + $status_id = (int)$row['new_value']; $display_name = $display_map[$status_id] ?? null; if (!$display_name) continue; - $history[] = [ + $ticket_data[] = [ 'status' => $display_name, 'changed_at' => date('d-m-Y h:i A', strtotime($row['created_at'])), ]; } + $this->myLogger->logme('error', "[NON_EB_API][claimHistory] claim_id: $claim_id, steps: " . count($ticket_data) . ", user: {$authUser['id']}"); + return $this->respond([ - 'status' => true, - 'code' => 200, - 'claim_id' => $claim_id, - 'history' => $history, + 'status' => true, + 'code' => 200, + 'claim_id' => $claim_id, + 'claims_data' => $claims_data, + 'required_docs' => $required_docs, + 'claims_files' => $claims_files, + 'ticket_data' => $ticket_data, ], 200); } @@ -530,6 +574,8 @@ class NonEbClaimApiController extends BaseController ->orderBy('id', 'ASC') ->findAll(); + $this->myLogger->logme('error', "[NON_EB_API][listClaimStatuses] user: {$authUser['id']}, count: " . count($statuses)); + return $this->respond([ 'status' => true, 'code' => 200, @@ -597,6 +643,8 @@ class NonEbClaimApiController extends BaseController $policies = $builder->get()->getResultArray(); + $this->myLogger->logme('error', "[NON_EB_API][listPolicies] user: {$authUser['id']}, client_md5: $client_id_md5, branch: $client_branch_id, count: " . count($policies)); + return $this->respond([ 'status' => true, 'code' => 200, @@ -605,7 +653,61 @@ class NonEbClaimApiController extends BaseController ], 200); } - public function uploadRequiredDoc(int $claim_id) + public function uploadRequiredDoc() + { + $authUser = $this->getAuthUser(); + if (!$authUser) { + return $this->respond(['status' => false, 'code' => 401, 'message' => 'Unauthorized'], 401); + } + + $ticket_id = $this->request->getPost('ticket_id') ?? null; + $get_file_data = $this->request->getFiles('claim_docs') ?? null; + $get_docs_name = $this->request->getPost('claim_doc_names') ?? []; + $required_docs = $this->request->getPost('required_docs') ?? null; + + if (is_string($get_docs_name)) { + $decoded = json_decode($get_docs_name, true); + $get_docs_name = json_last_error() === JSON_ERROR_NONE ? $decoded : []; + } elseif (!is_array($get_docs_name)) { + $get_docs_name = []; + } + + $file_data = []; + if (!empty($get_file_data)) { + $file_path = WRITEPATH . 'uploads/claim_files/'; + $file_data = multi_file_Upload($get_file_data, $file_path, $get_docs_name, UPLOAD_EXT_CLAIM_DOCS); + } + + if (!empty($file_data) && !empty($ticket_id)) { + foreach ($file_data as $value) { + $this->claimFilesModel->insert([ + 'ticket_id' => $ticket_id, + 'ticket_type' => 2, + 'doc_name' => $value['doc_name'], + 'file_name' => $value['file_name'], + 'url' => $value['file_path'], + 'file_type' => 2, + 'mime_type' => getMimeTypeByFileName($value['file_name']), + 'docs_for_ir' => 1, + 'is_active' => 1, + 'created_by' => self::API_SYSTEM_USER_ID, + ]); + } + + db_connect()->query( + 'UPDATE non_eb_ticket_master SET required_docs = ? WHERE id = ?', + [$required_docs, $ticket_id] + ); + + $this->myLogger->logme('error', "[NON_EB_API][uploadRequiredDoc] Docs uploaded. ticket_id: $ticket_id, count: " . count($file_data) . ", user: {$authUser['id']}"); + + return $this->respond(['status' => true, 'code' => 200, 'message' => 'Files uploaded successfully'], 200); + } + + return $this->respond(['status' => false, 'code' => 400, 'message' => 'Failed to upload the file'], 400); + } + + public function uploadRequiredDoc_v1(int $claim_id) { $authUser = $this->getAuthUser(); if (!$authUser) { @@ -702,12 +804,15 @@ class NonEbClaimApiController extends BaseController $db->transComplete(); if (!$db->transStatus()) { + $this->myLogger->logme('error', "[NON_EB_API][uploadRequiredDoc] Transaction failed. claim_id: $claim_id, doc: $document_name, user: {$authUser['id']}"); return $this->respond(['status' => false, 'code' => 500, 'message' => 'Failed to save document. Please try again.'], 500); } $file_id = $this->claimFilesModel->insertID(); $download_url = base_url('downloadClaimFile/') . $file_id; + $this->myLogger->logme('error', "[NON_EB_API][uploadRequiredDoc] Doc uploaded. claim_id: $claim_id, doc: $document_name, file: $file_name, user: {$authUser['id']}"); + return $this->respond([ 'status' => true, 'code' => 200, diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index d1bc5d9b..cf931aa6 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -649,7 +649,7 @@ class ClientController extends AdminController $headerData['page_name'] = 'Clients'; $data['entity'] = $this->kycEntityTypeModel->findAll(); - $data['kyc_docs'] = $this->kycDocsModel->findAll(); + $data['kyc_docs'] = $this->kycDocsModel->where('is_active', 1)->findAll(); $data['police'] = $this->policesModel->findAll(); $data['insurer'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames(); $data['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames(); @@ -916,7 +916,7 @@ class ClientController extends AdminController $editData['insurers'] = $this->insurerModel->where('is_active', 1)->findAll(); $editData['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll(); $editData['clients'] = $this->clientModel->where('is_active', 1)->findAll(); - $editData['kyc_docs'] = $this->kycDocsModel->findAll(); + $editData['kyc_docs'] = $this->kycDocsModel->where('is_active', 1)->findAll(); $editData['policyGridData'] = $this->policyGridModel->findAll(); $editData['policy_types'] = $this->policyTypeModel->findAll(); $editData['policy_type'] = ['1' => 'Base Policy', '2' => 'SI Topup', '3' => 'Dependent Addon']; @@ -931,7 +931,7 @@ class ClientController extends AdminController $editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll(); $editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll(); $editData['client_branch']['role'] = get_role_id(); - $editData['lead_data'] = $this->leadsModel->getLeadForInsertClientList(2, $id); + $editData['lead_data'] = $this->leadsModel->getLeadForInsertClientList(null, $id); $clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id); foreach ($clientPoliceData as $key => $value) { @@ -3761,6 +3761,8 @@ class ClientController extends AdminController 'left' ); $builder->where('c.id', $client_id); + $builder->where('kd.is_active',1); + $builder->groupBy(['kd.id', 'ck.file_name']); $query = $builder->get(); diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 9a8ec5f1..12f9ed38 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -4083,9 +4083,16 @@ class LeadsController extends BaseController private function prepareClientPolicyData($data, $client_id, $branch_id) { - $proposel_data = json_decode($data['proposel_data'], true); - // print_r($proposel_data); die; - list($insurer_branch_id, $insurer_id) = explode('-', $proposel_data['insurer'], 2); + $proposel_data = json_decode($data['proposel_data'] ?? '', true) ?? []; + + if ($data['lead_form_type'] == 1) { + // EB: insurer stored as "{insurer_branch_id}-{insurer_id}" inside proposel_data + list($insurer_branch_id, $insurer_id) = explode('-', $proposel_data['insurer'] ?? '-', 2); + } else { + // Non-EB: insurer IDs are direct columns on the lead row + $insurer_id = $data['insurer_id'] ?? null; + $insurer_branch_id = $data['insurer_branch_id'] ?? null; + } $client_policy_data = [ 'client_id' => $client_id, @@ -4315,7 +4322,7 @@ class LeadsController extends BaseController public function getPlacementJson(array $data): ?string { - $proposel_data = json_decode($data['proposel_data'], true); + $proposel_data = json_decode($data['proposel_data'] ?? '', true) ?? []; $QCRData = $this->RFQModel ->where('is_active', 1) diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 50e1dd16..da5c0612 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -5263,6 +5263,7 @@ class PolicyTransactionController extends BaseController bds_dump_files.file_name, bds_dump_files.status, bds_dump_files.created_at, + bds_dump_files.created_by, up.first_name as user_name ') ->join('user_profiles as up', 'bds_dump_files.created_by = up.id', 'left') @@ -5270,6 +5271,12 @@ class PolicyTransactionController extends BaseController ->orderBy('bds_dump_files.id', 'desc') ->findAll(); + if (in_array(get_role_id(), [2, 3, 4])) { + $data['bds_dump_file_data'] = array_values(array_filter($data['bds_dump_file_data'], function ($file) { + return (int) ($file['created_by'] ?? 0) === (int) get_session_userid(); + })); + } + return $this->loadLayout('bds_dump_file_list', $data); } else { @@ -5313,7 +5320,8 @@ class PolicyTransactionController extends BaseController $status = 'inprogress'; $insert_data = [ 'file_name' => $filename, - 'status' => $status + 'status' => $status, + 'created_by' => get_session_userid() ]; $file_id = $this->bdsDumpModel->insert($insert_data); diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 44d25abe..49d4e615 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -1307,7 +1307,13 @@ class TicketController extends BaseController 'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']], 'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []], 'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []], - 'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']], + 'utr_details' => [ + 'label' => 'UTR Details', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]', + 'errors' => [ + 'regex_match' => 'UTR Details allows only alphanumeric characters, spaces, and / _ -' + ] + ], 'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']], 'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []], 'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']], @@ -1418,7 +1424,13 @@ class TicketController extends BaseController 'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']], 'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []], 'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []], - 'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']], + 'utr_details' => [ + 'label' => 'UTR Details', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]', + 'errors' => [ + 'regex_match' => 'UTR Details allows only alphanumeric characters, spaces, and / _ -' + ] + ], 'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']], 'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []], 'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']], @@ -1672,7 +1684,13 @@ class TicketController extends BaseController 'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']], 'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []], 'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []], - 'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']], + 'utr_details' => [ + 'label' => 'UTR Details', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]', + 'errors' => [ + 'regex_match' => 'UTR Details allows only alphanumeric characters, spaces, and / _ -' + ] + ], 'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']], 'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []], 'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']], @@ -1783,7 +1801,13 @@ class TicketController extends BaseController 'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']], 'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []], 'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []], - 'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']], + 'utr_details' => [ + 'label' => 'UTR Details', + 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]', + 'errors' => [ + 'regex_match' => 'UTR Details allows only alphanumeric characters, spaces, and / _ -' + ] + ], 'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']], 'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []], 'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']], diff --git a/app/Models/LeadsModel.php b/app/Models/LeadsModel.php index 5ed42522..d194375a 100644 --- a/app/Models/LeadsModel.php +++ b/app/Models/LeadsModel.php @@ -186,13 +186,19 @@ class LeadsModel extends Model public function getLeadForInsertClientList($type = null, $client_id = null) { $query = $this->db->table('leads') - ->select('leads.*, user_profiles.first_name as user_name') + ->select('leads.*, user_profiles.first_name as user_name, policy_type.allocg') ->join('user_profiles', 'leads.created_by = user_profiles.id') + ->join('policy_type', 'leads.policy_type_id = policy_type.id', 'left') ->where('leads.is_active', 1) ->where('leads.status', 'won') - ->where("leads.proposel_data IS NOT NULL AND leads.proposel_data <> ''") - ->where("(leads.is_client_created = '' OR leads.is_client_created IS NULL)") - ->where("(leads.is_policy_created = '' OR leads.is_policy_created IS NULL)"); + ->groupStart() + ->where("(leads.is_client_created = '' OR leads.is_client_created IS NULL)") + ->orWhere("(leads.is_policy_created = '' OR leads.is_policy_created IS NULL)") + ->groupEnd() + ->groupStart() + ->where("policy_type.allocg != 'EB'") + ->orWhere("(policy_type.allocg = 'EB' AND leads.proposel_data IS NOT NULL AND leads.proposel_data <> '')") + ->groupEnd(); if ($type) { $query->where('leads.lead_type', $type); diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index e8720c97..b45d5d11 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -357,7 +357,7 @@ input:checked + .slider_blue::before {