diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1bc86af6..f830a3a3 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -37,7 +37,6 @@ $routes->get("view", "EmployeeController::viewECard/$1"); $routes->get("checkWellnessOnboardStatus/(:any)", "EmployeeController::checkWellnessOnboardStatus/$1"); $routes->get("initiateWellnessOnboard/(:any)", "EmployeeController::initiateWellnessOnboard/$1"); $routes->get("exportQCRandRFQ/(:any)", "LeadsController::exportQCRandRFQ/$1"); -$routes->get("smapletest", "ClientController::smapletest"); $routes->get("testMailAttachments", "ClientController::testMailAttachments"); $routes->get("updatePolicyTermsKey", "ClientController::updatePolicyTermsKey"); $routes->get("updateRemainderDate", "ClientController::updateRemainderDate"); @@ -560,6 +559,8 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) { $routes->get("getSSORedirectUrl", "ApiServiceController::getSSORedirectUrl"); $routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy"); +$routes->get("downloadCdSplitUpFile", "EmployeeRestController::downloadCdSplitUpFile"); + $routes->group("employeeRest", ['filter' => ['appSignature'] ], function ($routes) { @@ -604,7 +605,7 @@ $routes->group("employeeRest", ['filter' => ['appSignature'] ], function ($route }); - $routes->group("employeeRest", ["filter" => ['GlobalPostFileUploadGuard', 'appSignature', 'authJWT']], function ($routes) { +$routes->group("employeeRest", ["filter" => ['GlobalPostFileUploadGuard', 'appSignature', 'authJWT']], function ($routes) { $routes->post('logout', 'RestAuthenticationController::logout'); @@ -686,7 +687,6 @@ $routes->group("employeeRest", ['filter' => ['appSignature'] ], function ($route // get insurer and policy type $routes->get("getPolicyTypeAndInsurer", "EmployeeRestController::getPolicyTypeAndInsurer"); - $routes->get("downloadCdSplitUpFile", "EmployeeRestController::downloadCdSplitUpFile"); $routes->get("getExcelFileErrors/(:any)", "EmployeeController::getExcelFileErrors/$1"); }); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 8ba51997..70f9ee8b 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -141,6 +141,7 @@ class ClientController extends AdminController $isDuplicate = $this->clientModel->isDuplicateByClientBranch($value, $field, $clientId, $branchId); return $this->response->setJSON(['isDuplicate' => $isDuplicate]); } + public function checkDuplicateTableFieldValue() { $table = $this->request->getPost('table'); @@ -162,35 +163,6 @@ class ClientController extends AdminController return $this->response->setJSON(['isDuplicate' => $isDuplicate]); } - public function smapletest() - { - $headers = [ - 'S.No', - 'NAME OF EMP/DEP', - 'EMP ID', - // 'EMP/DEP TYPE', - // 'RELATIONSHIP CODE', - 'DOB', - 'GENDER', - 'PRE EXISTING AILMENTS', - 'BASIC COVER SI', - 'DATE OF COVERAGE', - 'AGE', - 'RELATIONSHIP', - 'REMARKS', - 'POLICY END DATE', - 'NO OF DAYS', - 'TPA ID', - 'UHID', - // 'PREMIUM', - 'PRO RATA PREMIUM', - 'GST', - 'TOTAL AMOUNT' - ]; - $filePath = generateExcelWithHeader($headers); - echo "Excel file created at: $filePath"; - } - public function testMailAttachments($email = 'venkateshraman786@gmail.com') { $message = '

Request for Quotation (RFQ)

Dear {{RECIPIENT_NAME}},

We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.

RFQ Details

Client name{{CLIENT_NAME}}
Coverage Type{{POLICY_LONG_NAME}}
Policy Start Date{{POLICY_START_DATE}}
Policy Duration{{DURATION}}
Please note: Additional terms and details are included in the attachment for your reference.

Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.

Best regards,

Nhance India Pvt Ltd

'; @@ -510,7 +482,6 @@ class ClientController extends AdminController // $this->loadLayout('client_onboarding', $data); } - public function typeList($id = null) { try { @@ -547,7 +518,6 @@ class ClientController extends AdminController } } - public function updateEmpAndPolicyStatus() { $return = $this->clientPolicyModel->updateStatus(); @@ -2088,6 +2058,7 @@ class ClientController extends AdminController $sanitized_post_data['enrolment_visibility'] = $sanitized_post_data['enrolment_visibility'] ?? null ? 1 : 0; $sanitized_post_data['is_lgbtq'] = $sanitized_post_data['is_lgbtq'] ?? null ? 1 : 0; $sanitized_post_data['wellness_vendor_id'] = !empty($sanitized_post_data['wellness_vendor_id']) ? $sanitized_post_data['wellness_vendor_id'] : null; + $sanitized_post_data['cd_ac_pk'] = $sanitized_post_data['cd_ac_no'] ?? null; if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) { @@ -2126,6 +2097,8 @@ class ClientController extends AdminController $insert = $this->clientPolicyModel->insert($sanitized_post_data); if ($insert) { + // this function to create a policy transaction entry at the time of client policy create + $this->createPolicyTransactionInceptionEntry($insert, $sanitized_post_data); $clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($sanitized_post_data['client_id']); $clientPoliceData['role'] = get_role_id(); return $this->respond(['status' => true, 'code' => 200, 'data' => $clientPoliceData, 'client_id' => $client_id, 'method' => 'CERATE', 'post_data' => $insert], 200); @@ -2310,6 +2283,28 @@ class ClientController extends AdminController } } + public function createPolicyTransactionInceptionEntry($client_policy_id, $data) + { + $data['action_type'] = 'inception'; + $data['client_policy_id'] = $client_policy_id; + $data['entry_from'] = 3; + $data['issuer_branch'] = 1; + $data['issuer'] = 2; + $data['status'] = 'completed'; + $data['renewal_date'] = $data['policy_end_date']; + $insert = $this->policyTransactionModel->insert($data); + + if($insert){ + + $pcsd_data['pt_id'] = $insert; + $pcsd_data['insurer_id'] = $data['insurer_id'] ?? null; + $pcsd_data['insurer_branch_id'] = $data['insurer_branch_id'] ?? null; + + $this->PTCOShareDetailsModel->insert($pcsd_data); + } + return $insert; + } + // Save Rack Rate function @@ -2843,7 +2838,6 @@ class ClientController extends AdminController } } - private function updatePTCoShareTableEntry($policy_transaction_data, $old_client_policy_data, $data) { $updated_ids = []; @@ -2889,9 +2883,6 @@ class ClientController extends AdminController ]; } - - - public function uploadVehicleFile($params = null) { $this->myLogger->logme('error', 'uploadVehicleFile function called'); @@ -6463,7 +6454,7 @@ class ClientController extends AdminController // $res = $EmpDataServiceController->importInceptionUpdateTPAandUHID(['file_id' => 310]); dd($res);//for live // $res = $EmpDataServiceController->getInceptionBasePremium(["13332","13333","13334","13335","13336"]); dd($res);//for live // $res = $EmpDataServiceController->getDeletionBasePremium(["13248","13250","13249","13247"], json_decode('{"employeeIds":["13248","13250","13249","13247"],"client_id":"3927","client_policy_id":"6183","client_branch_id":"1874","cd_ac_no":"CD9751909505","endorsement_no":"END1238","count":4,"event_name":"deletion","policy_name":"GMC","user_id":"48"}', true)); dd($res);//for live - // $res = $EmpDataServiceController->makeEntryForBDSPolicyTransaction(json_decode('{"client_policy_id":"6187","endorsement_no":null,"emp_count":5,"action_type":"inception","no_of_insured":3,"no_of_dependent":0}', true)); dd($res);//for live + // $res = $EmpDataServiceController->makeEntryForBDSPolicyTransaction(json_decode('{"client_policy_id":"6187","endorsement_no":"000000001","emp_count":5,"action_type":"addition","no_of_insured":3,"no_of_dependent":0, "base_premium" : "1000", "gst" : "180", "policy_issue_date" : "2025-12-31"}', true)); dd($res);//for live // $res = $EmpDataServiceController->sendMailForDownloadingECard(['ids' => $ids, 'client_policy_id' => $client_policy_id]); // $res = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($batch_data, 1); dd($result); // $res = $this->employeePolicyModel->getSIEnhancementEmployeesDataForExportExcel($batch_data, 1); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 22b1b263..59c5224e 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -4854,7 +4854,7 @@ class EmployeeRestController extends AdminController THEN hr_file_upload.status ELSE CONCAT(UCASE(LEFT(f.status, 1)), LCASE(SUBSTRING(f.status, 2))) END AS status, - '1' as file_error_status + '0' as file_error_status ", false) ->join('clients c', 'c.id = hr_file_upload.client_id AND c.is_active = 1', 'left') ->join('client_branch cb', 'cb.id = hr_file_upload.client_branch_id AND cb.is_active = 1', 'left') diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index 37166f8a..cc850c55 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -316,7 +316,7 @@ table.dataTable tbody td { $row){ ?> - +