FEAT_CREATE_PT_AND_PCSD_ENTRY_WHILE_CLIENT_POLICY_CREATE
This commit is contained in:
parent
3b1762a30e
commit
e70245ff77
@ -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");
|
||||
});
|
||||
|
||||
|
||||
@ -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 = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>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.<h2>RFQ Details</h2><table data-custom-table-css="table" class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
@ -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);
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -316,7 +316,7 @@ table.dataTable tbody td {
|
||||
<?php foreach($inception_data_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $index+1; ?></td>
|
||||
<td><?php echo $issuer[$row['issuer']]; ?></td>
|
||||
<td><?php echo $issuer[$row['issuer']] ?? 'Nhance'; ?></td>
|
||||
<td><?php echo $issuing_type[$row['issue_type']] ?? 'N/A'; ?></td>
|
||||
<td><?php echo $client_type[$row['client_type']] ?? 'N/A'; ?></td>
|
||||
<td><?php echo $row['client_type'] == 2 ? $row['client_name'] . " - " . (!empty($row['pan']) ? $row['pan'] : 'N/A') : $row['client_short_name'] . ' - ' . $row['client_branch_name']; ?></td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user