Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
velz 2025-11-05 09:35:37 +05:30
commit dfc883e0f9
24 changed files with 374 additions and 206 deletions

View File

@ -213,6 +213,7 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) {
$routes->post("edit", "MasterController::editInsurerBranch");
$routes->get("editget/(:any)", "MasterController::editInsurerGet/$1");
$routes->get("list/(:any)", "MasterController::insurerBranchList/$1");
$routes->post("getList", "MasterController::getInsurerBranchList");
$routes->get("remove/(:any)", "MasterController::removeInsurerBranch/$1");
});
});
@ -500,12 +501,16 @@ $routes->cli('cli/sendMailWithAutoQuery','TicketController::sendMailWithAutoQuer
//Employee login api's
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
$routes->post("/employeeRest/updateEmpOTP", "RestAuthenticationController::updateEmpOTP");
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("/employeeRest/updateEmpMPIN", "RestAuthenticationController::updateEmpMPIN");
$routes->post("employeeRest/forgotMPIN", "RestAuthenticationController::forgotMPIN");
$routes->post("employeeRest/updateMobileNumber", "RestAuthenticationController::updateMobileNumber");
// $routes->post("/employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
@ -529,8 +534,6 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
});
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("employeeRest/getPostEmployeeDataForAuth", "RestAuthenticationController::getPostEmployeeDataForAuth");
// $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity");

View File

@ -181,7 +181,7 @@ class BDSReportController extends AdminController
'Client' => 'client'
];
$data['page_name'] = "IRBA Report";
$data['page_name'] = "IRDA Report";
return $this->loadLayout('irba_report', $data);
} else {
@ -202,9 +202,11 @@ class BDSReportController extends AdminController
$viewData = [];
}
$view_name = "bds_report_Insurer_wise_Data" ;
$html = view('bds_report_Insurer_wise_Data', $viewData);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
} else if ($report_type == 'bap') {
$life = $category == 'life' ? 1 : 0;
@ -217,33 +219,40 @@ class BDSReportController extends AdminController
$viewData = [];
}
$view_name = "bds_report_bap_wise_data";
$html = view('bds_report_bap_wise_data', $viewData);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
} else if ($report_type == 'bapInsurer') {
//Condition for BAP Insurer wise date
$category = $category == 'life' ? 1 : 0;
$viewData['data'] = $this->getBAPInsurerData($category, $fromDate, $toDate);
$view_name = "irda_bap_insurer_report_list";
$html = view('irda_bap_insurer_report_list', $viewData);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
} else if ($report_type == 'bapClient') {
//Condition for BAP Client wise date
$category = $category == 'life' ? 1 : 0;
$viewData['data'] = $this->getBAPClientData($category, $fromDate, $toDate);
$view_name = "irda_bap_client_report_list";
$html = view('irda_bap_client_report_list', $viewData);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
} else if ($report_type == 'client') {
//Condition for Client wise date
$category = $category == 'life' ? 1 : 0;
$viewData['data'] = $this->getClientData($category, $fromDate, $toDate);
$view_name = "irda_client_report_list";
$html = view('irda_client_report_list', $viewData);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
}
}
}
@ -932,8 +941,9 @@ class BDSReportController extends AdminController
$data['client_type'] = [1 => 'Group', 2 => 'Individual'];
$data['renewal_data'] = $this->policyTransactionModel->getRenewalReportData($fromDate, $toDate, $client_type, $client_id, $issuer);
// print_r($data); die;
$view_name = "bds_renewal_report_list";
$html = view('bds_renewal_report_list', $data);
return $this->respond(['status' => true, 'html' => $html], 200);
return $this->respond(['status' => true, 'html' => $html , 'view_name' => $view_name], 200);
}
}

View File

@ -121,16 +121,17 @@ class EmpDataServiceController extends BaseController
$insert = $this->batchFileModel->insert($data);
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
if ($insert) {
foreach ($objects as $value) {
$batch_list_data['batch_code'] = $batch_file_batch_code['batch_code'];
$batch_list_data['emp_policy_id'] = $value->primaryKey ?? $value->employee_policy_id ?? '';
$batch_list_data['created_by'] = get_session_userid();
$this->batchListModel->insert($batch_list_data);
}
}
// if ($insert) {
// foreach ($objects as $value) {
// $batch_list_data['batch_code'] = $batch_file_batch_code['batch_code'];
// $batch_list_data['emp_policy_id'] = $value->primaryKey ?? $value->employee_policy_id ?? '';
// $batch_list_data['created_by'] = get_session_userid();
// $this->batchListModel->insert($batch_list_data);
// }
// }
return true;
return $insert;
// return true;
}
@ -526,8 +527,8 @@ class EmpDataServiceController extends BaseController
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $objects]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $objects]]);
// If batch operation is successful
@ -640,7 +641,13 @@ class EmpDataServiceController extends BaseController
foreach ($ids as $key => $id) {
$group_key = $this->empEndorsementModel->select('group_key')->where('id', $id)->first();
if ($group_key) {
$this->empEndorsementModel->where('group_key', $group_key)->set('status', 'inprogress')->update();
$endorsement_update_data['status'] = 'inprogress';
if( $export_data['insurer_or_tpa'] == 'tpa'){
$endorsement_update_data['is_tpa_export'] = $return ?? generate_random_string(4);
}
$this->empEndorsementModel->where('group_key', $group_key)->set($endorsement_update_data)->update();
}
}
@ -794,13 +801,21 @@ class EmpDataServiceController extends BaseController
$success = generate_excel($excel_data_info['header'], $excel_data_info['data'], $tempFile);
if ($success) {
$return = $this->batchFilesAndBatchListEntry($export_data, $objects);
if ($return) {
foreach ($ids as $key => $id) {
$group_key = $this->empEndorsementModel->select('group_key')->where('id', $id)->first();
if ($group_key) {
$this->empEndorsementModel->where('group_key', $group_key)->set('status', 'inprogress')->update();
$endorsement_update_data['status'] = 'inprogress';
if( $export_data['insurer_or_tpa'] == 'tpa'){
$endorsement_update_data['is_tpa_export'] = $return ?? generate_random_string(4);
}
$this->empEndorsementModel->where('group_key', $group_key)->set($endorsement_update_data)->update();
}
}
@ -914,7 +929,11 @@ class EmpDataServiceController extends BaseController
foreach ($ids as $key => $id) {
$group_key = $this->empEndorsementModel->select('group_key')->where('id', $id)->first();
if ($group_key) {
$this->empEndorsementModel->where('group_key', $group_key)->set('status', 'inprogress')->update();
$endorsement_update_data['status'] = 'inprogress';
if( $export_data['insurer_or_tpa'] == 'tpa'){
$endorsement_update_data['is_tpa_export'] = $return ?? generate_random_string(4);
}
$this->empEndorsementModel->where('group_key', $group_key)->set($endorsement_update_data)->update();
}
}
@ -1002,12 +1021,12 @@ class EmpDataServiceController extends BaseController
return 5;
}
$cash_balance = $this->clientDepositModel
->where('cd_ac_pk', $policy_details['cd_ac_pk'])
// ->where('cd_ac_no', $policy_details['cd_ac_no'])
->where('is_active', 1)
->orderBy('id', 'DESC')
->first();
$cash_balance = $this->clientDepositModel
->where('cd_ac_pk', $policy_details['cd_ac_pk'])
// ->where('cd_ac_no', $policy_details['cd_ac_no'])
->where('is_active', 1)
->orderBy('id', 'DESC')
->first();
if ($cash_balance == null) {
$balance = $this->CDMasterModel
@ -1028,7 +1047,7 @@ class EmpDataServiceController extends BaseController
$totals = round($totals, 2);
if($export_data['insurer_or_tpa'] != 'tpa')// check overal emp premium amt with cd balance only for insurer export, not tpa export
if($export_data['insurer_or_tpa'] != 'tpa')// check overal emp premium amt with cd balance only for insurer export, not tpa export
{
if (!empty($cash_balance)) {
if ((int) $cash_balance['balance'] < (int) $totals) {
@ -1112,6 +1131,7 @@ class EmpDataServiceController extends BaseController
$export_data['batch_code'] = session()->get('batch_code');
$export_data['created_by'] = get_session_userid();
$insert = null;
if($value == 'addition'){
if(!empty($additionData) && $additionData != null){
@ -1125,8 +1145,8 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $additionData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $additionData]]);
}
@ -1143,8 +1163,8 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $inceptionData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $inceptionData]]);
}
}else if($value == 'dependent_addition'){
@ -1160,8 +1180,8 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $dependentAdditionData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $dependentAdditionData]]);
}
}else if($value == 'deletion'){
@ -1176,8 +1196,8 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $deletionData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $deletionData]]);
}
}else if($value == 'si_enhancement'){
@ -1193,8 +1213,8 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $enhancementData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $enhancementData]]);
}
}else if($value == 'correction'){
@ -1210,11 +1230,43 @@ class EmpDataServiceController extends BaseController
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $correctionData]]);
// $job_details = new Jobs();
// $r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $correctionData]]);
}
}
if(in_array($value, ['deletion', 'si_enhancement', 'correction']) && $insert){
$endorsement_data_for_update = [];
if($value == 'deletion'){
$endorsement_data_for_update = $deletionData;
}else if($value == 'si_enhancement') {
$endorsement_data_for_update = $enhancementData;
}else if($value == 'correction') {
$endorsement_data_for_update = $correctionData;
}
foreach ($endorsement_data_for_update as $key => $edata) {
$id = $edata->id ?? $edata->endorsement_primarykey ?? null;
if($id){
$group_key = $this->empEndorsementModel->select('group_key')->where('id', $id)->first();
if ($group_key) {
$endorsement_update_data['status'] = 'inprogress';
if( $export_data['insurer_or_tpa'] == 'tpa'){
$endorsement_update_data['is_tpa_export'] = $return ?? generate_random_string(4);
}
$this->empEndorsementModel->where('group_key', $group_key)->set($endorsement_update_data)->update();
}
}
}
}
}
session()->remove('batch_code');
@ -3173,7 +3225,8 @@ class EmpDataServiceController extends BaseController
$emp_policy_ids[] = array('id' => $result['emp_policy_id'], 'is_active' => 0);
$employeeIds[] = $result['emp_policy_id'];
$endorsement_details[] = array('id' => $result['id'], 'group_key' => $result['group_key'], 'endorsement_id' => $value[19], 'status' => 'complete');
// $endorsement_details[] = array('id' => $result['id'], 'group_key' => $result['group_key'], 'endorsement_id' => $value[19], 'status' => 'complete');
$endorsement_details[] = array('group_key' => $result['group_key'], 'endorsement_id' => $value[19], 'status' => 'complete');
if (strtolower($result['relationship']) == 'self') {
$no_of_insured[] = ['emp_id' => $result['emp_id'], 'emp_code' => $result['emp_code'], 'emp_name' => $result['emp_name'] ];
}else{
@ -3258,10 +3311,12 @@ class EmpDataServiceController extends BaseController
'pk' => $pk,
'si_adjustment' => $si_adjustment
];
}
// dd($insertedIds);
} // dd($insertedIds);
$this->employeePolicyModel->bulkUpdateForEndorsement($endorsement_details);
// update si enhancement endorsement complete
$this->empEndorsementModel->updateBatch($endorsement_details, 'group_key');
// $this->employeePolicyModel->bulkUpdateForEndorsement($endorsement_details); // do not remove this
$this->storeEndorsementNumber($file_id, $endorsement_id, $enrollment_file_id);
}
@ -5084,6 +5139,7 @@ class EmpDataServiceController extends BaseController
'tpa_id' => $filedata['tpa_id'],
'endorsement_no' => $endorsement_no,
'file_id' => $enrollment_file_id,
'batch_file_id' => $file_id,
'endorsement_type' => $filedata['event_type'],
'created_by' => $filedata['created_by'],
]);

View File

@ -668,6 +668,11 @@ class EmployeeController extends AdminController
} else if ($actions == 'import') {
if($insurer_or_tpa == "tpa" && in_array($event_type, ['correction', 'deletion', 'si_enhancement'])){
session()->setFlashdata('error', "TPA upload is not applicable for this event.");
return redirect()->to(base_url('employee/upload'));
}
$batch_data['file'] = $this->request->getFile('import_file_data');
$file = $this->request->getFile('import_file_data');

View File

@ -2831,7 +2831,7 @@ class EmployeeRestController extends AdminController
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
->where('client_policy.is_active', 1 )
->where('client_policy.policy_status', $policy_status)
->where('client_policy.enrolment_visibility', 1 )
->where('client_policy.enrolment_visibility', 1)
->orderby('client_policy.id' , 'ASC')
->findAll();
@ -2840,16 +2840,25 @@ class EmployeeRestController extends AdminController
->where('client_id',$this->request->getGet('client_id'))
->where('client_branch_id',$this->request->getGet('client_branch_id'))
->where('is_active', 1 )->findAll();
$employeeName = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
$employeeSelfData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
->where('client_id',$this->request->getGet('client_id'))
->where('client_branch_id',$this->request->getGet('client_branch_id'))
->where('family_floater_key','self')->where('is_active', 1 )
->get()->getRow()->name;
->get()->getRow();
$employeeName = $employeeSelfData->name ?? "";
//for get the pre enrollment policy count
$empMobileNo = $this->request->getGet('mobile_no');
$clientId = $this->request->getGet('client_id');
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId);
if(!empty($employeeSelfData) && isset($employeeSelfData->email_corporate)){
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId, $employeeSelfData->email_corporate);
}else{
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId);
}
$whereArrayForId = [];
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
@ -2972,7 +2981,11 @@ class EmployeeRestController extends AdminController
function policyTermsFiter($terms , $type)
{
{
if(empty($terms)){
return [];
}
$gpa = [
"sumInsured2" => "Sum Insured",
"totalSumInsured" => "Total Sum Assured",
@ -4082,18 +4095,19 @@ class EmployeeRestController extends AdminController
// }
// }
public function getPreEmployeePolicyCount($mobile_no, $clientId = null)
{
log_message('error', 'STEP 1: getPreEmployeePolicyCount called with params: ' . json_encode(['mobile_no' => $mobile_no, 'client_id' => $clientId]));
public function getPreEmployeePolicyCount($mobile_no, $clientId = null, $email = null)
{
log_message('error', 'STEP 1: getPreEmployeePolicyCount called with params: ' . json_encode(['mobile_no' => $mobile_no, 'client_id' => $clientId, 'email' => $email]));
if (empty($mobile_no)) {
log_message('error', 'STEP 2: Mobile number is empty or null. Returning 0.');
if (empty($mobile_no) && empty($email)) {
log_message('error', 'STEP 2: Mobile number and Email is empty or null. Returning 0.');
return 0;
}
$client_short_name = null;
if (!empty($clientId)) {
log_message('error', 'STEP 3: Fetching client short name for client ID: ' . $clientId);
$client_data = $this->clientModel->where('is_active', 1)->where('id', $clientId)->first();
@ -4103,14 +4117,25 @@ class EmployeeRestController extends AdminController
} else {
log_message('error', 'STEP 4: No client found for ID: ' . $clientId);
}
} else {
log_message('error', 'STEP 3: No clientId provided. Skipping client lookup.');
}
$post_data = [
'mobile_number' => $mobile_no,
'client_short_name' => $client_short_name
];
if(!empty($email)){
$post_data = [
'email_id' => $email,
'client_short_name' => $client_short_name
];
}else{
$post_data = [
'mobile_number' => $mobile_no,
'client_short_name' => $client_short_name
];
}
log_message('error', 'STEP 5: Calling third-party API with payload: ' . json_encode($post_data));

View File

@ -1514,9 +1514,9 @@ class EmployeeServiceController extends AdminController
->where('employees.client_id',$file['client_id'])
->where('employees.client_branch_id',$file['client_branch_id'])
->where('employee_polices.client_policy_id',$file['policy_id'])
->where('employees.emp_status !=','truncated')
->where('employees.emp_status','active')
->where('employees.is_active', 1)
->where('employee_polices.status !=','truncated')
->where('employee_polices.status','active')
->where('employee_polices.is_active', 1)
->first();
@ -1550,7 +1550,7 @@ class EmployeeServiceController extends AdminController
$employee_policy = $this->employeePolicyModel
->where('employee_id',$employee['id'])
->where('client_policy_id',$file['policy_id'])
->where('status !=','truncated')
->where('status','active')
->where('is_active', 1)
->first();

View File

@ -354,6 +354,15 @@ class MasterController extends AdminController
exit();
}
public function getInsurerBranchList()
{
$id = $this->request->getPost('insurer_id');
$insurer_branch_list = $this->insurerBranchModel->where(['insurer_id' => $id, 'is_active' => 1])->findAll()??[];
return $this->response->setJSON([ 'data' => $insurer_branch_list ])->setStatusCode(200);
}
public function editInsurerGeneralInfo()
{
$this->myLogger->logme('error','edit Insurer general info function called');

View File

@ -26,7 +26,8 @@ class EmpEndorsementModel extends Model
"updated_by",
"is_active",
"remarks",
"file_id"
"file_id",
"is_tpa_export",
];
// Callbacks

View File

@ -382,6 +382,7 @@ class EmployeePolicyModel extends Model
{
return $this->where('employee_id',$arr['employee_id'])
->where('client_policy_id',$arr['client_policy_id'])
->where('status', 'active')
->where('is_active',1)
->find();
}
@ -607,9 +608,11 @@ class EmployeePolicyModel extends Model
$client_branch_id = $ref_data['client_branch_id'];
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NOT NULL OR a.endorsement_id != '')" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
$subquery_endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "WHERE (endorsement_id IS NOT NULL OR endorsement_id != '')" : "WHERE (endorsement_id IS NULL OR endorsement_id = '')";
// $endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NOT NULL OR a.endorsement_id != '')" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
// $subquery_endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "WHERE (endorsement_id IS NOT NULL OR endorsement_id != '')" : "WHERE (endorsement_id IS NULL OR endorsement_id = '')";
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NULL OR a.is_tpa_export IS NULL)" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
$subquery_endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "WHERE (endorsement_id IS NULL OR is_tpa_export IS NULL)" : "WHERE (endorsement_id IS NULL OR endorsement_id = '')";
/*
ROUND(sidata.new_si_premium - sidata.old_si_premium, 2) AS difference_premium,

View File

@ -25,7 +25,8 @@ class EndorsementModel extends Model
'updated_by',
'updated_at',
'file_id',
'is_active'
'is_active',
'batch_file_id',
];
}

View File

@ -39,7 +39,7 @@
// Get headers dynamically
$headers = array_keys($data[0]);
foreach ($headers as $header): ?>
<th><?= esc($header) ?></th>
<th><?= esc(str_replace('_', ' ', $header)) ?></th>
<?php endforeach; ?>
<th>TOTAL</th>
</tr>

View File

@ -154,35 +154,18 @@ $(document).ready(function() {
// Global DataTables defaults
$.extend(true, $.fn.dataTable.defaults, {
language: {
search: "", // remove "Search:" label
search: `
<div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
},
paging: true,
pageLength: 10,
ordering: false
});
// Global init hook
$(document).on('init.dt', function (e, settings) {
let $filter = $(settings.nTableWrapper).find('.dataTables_filter');
let $input = $filter.find('input');
if (!$filter.hasClass('custom-search')) {
// Wrap in Bootstrap input-group
$input
.addClass('form-control')
.wrap('<div class="input-group"></div>');
// Append icon
$input.after(`
<span class="input-group-text bg-white border-0">
<i class="mdi mdi-magnify"></i>
</span>
`);
// Align to right
$filter.addClass('text-right custom-search');
}
});
</script>

View File

@ -19,6 +19,10 @@ table.dataTable tbody td {
.right-align-input {
text-align: right;
}
#scroll-horizontal-datatable tfoot .right-align-input {
text-align: right !important;
}
</style>
<div class="col-12">
@ -84,6 +88,7 @@ table.dataTable tbody td {
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Insurer-Wise-Report-List',
footer: true
},
{
extend: 'excel',
@ -93,6 +98,7 @@ table.dataTable tbody td {
orthogonal: 'sort'
},
className: 'app-btn-primary ',
footer: true
}
]
}

View File

@ -19,6 +19,12 @@ table.dataTable tbody td {
.right-align-input {
text-align: right;
}
#scroll-horizontal-datatable tfoot .right-align-input {
text-align: right !important;
}
</style>
<div class="col-12">
@ -84,6 +90,7 @@ table.dataTable tbody td {
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Bap-Wise-Report-List',
footer: true
},
{
extend: 'excel',
@ -93,6 +100,7 @@ table.dataTable tbody td {
},
className: 'app-btn-primary ',
title: 'Bap-Wise-Report-List',
footer: true
}
]
}

View File

@ -64,6 +64,7 @@
</div>
</div>
<!-- <div id="view_name"></div> -->
<div id="report"></div>
</div>
@ -131,19 +132,26 @@
var toDate = $('#endDate').val();
var category = $('#category').val();
var report_type = $('#report_type').val();
if(category == false || report_type == false){
alert("Please Fill the Mandatory Fields Category and Report Type to Proceed ..!! ");
return ;
}
var requestData = {
fromDate: fromDate,
toDate: toDate,
category: category,
report_type: report_type
};
console.log(typeof fromDate);
var url = '<?= base_url('/bdsReport/irba_report') ?>';
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
if (response.status == true) {
$('#report').html(response.html);
// $('#view_name').html(response.view_name);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');

View File

@ -31,6 +31,10 @@ table.dataTable tbody td {
background-color: #ffffff; /* White shade */
}
#scroll-horizontal-datatable tfoot .right-align-input {
text-align: right !important;
}
</style>
<div class="col-12" id="second_page">
@ -216,6 +220,7 @@ $(document).ready(function() {
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-CLIENT-List',
footer:true
},
{
extend: 'excel',
@ -225,6 +230,7 @@ $(document).ready(function() {
orthogonal: 'sort'
},
className: 'app-btn-primary ',
footer:true
}
]
}

View File

@ -20,6 +20,10 @@ table.dataTable tbody td {
.right-align-input {
text-align: right;
}
#scroll-horizontal-datatable tfoot .right-align-input {
text-align: right !important;
}
</style>
<div class="col-12" id="second_page">
@ -167,7 +171,7 @@ table.dataTable tbody td {
<?php } ?>
</tbody>
<tfoot>
<tfoot align="right">
<tr>
<th></th>
<th>Grand Total</th>
@ -299,12 +303,14 @@ $(document).ready(function() {
buttons: [
{
extend: 'csv',
footer:true,
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-INSURER-List',
},
{
extend: 'excel',
footer:true,
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-INSURER-List',

View File

@ -355,6 +355,7 @@
.content-page {
padding: 80px 15px 65px 15px !important;
min-height: 1000px ;
}
/* Media query for small screens */
@ -1861,25 +1862,6 @@
</li>
<?php } ?>
<!-- leads -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())) { ?>
<li class="li-seperate" id="leads-li">
<a href="<?= base_url('/leads/list') ?>" class="img-inactive">
<img
src="<?= base_url() . "public"; ?>/assets/images/leads_sb.png" alt="Logo" height="20">
<span> Leads </span>
</a>
</li>
<?php } ?>
<!-- Tickets -->
<?php if (in_array(get_role_id(), [1, 2, 3, 4, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?>
<li class="li-seperate" id="tickets-li">
<a id="tickets" href="<?= base_url('/ticketList?return_type=web') ?>" class="waves-effect img-inactive">
<img src="<?= base_url() . "public"; ?>/assets/images/ticket.png" alt="Logo" height="20">
<span>Tickets</span>
</a>
</li>
<?php } ?>
<!-- BDS -->
<?php if ((get_role_id() == 1 || get_role_id() == 5 || get_role_id() == 4) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
<li class="li-seperate" id="policy-transactions-li">
@ -2034,6 +2016,26 @@
</li>
<?php } ?>
<!-- leads -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())) { ?>
<li class="li-seperate" id="leads-li">
<a href="<?= base_url('/leads/list') ?>" class="img-inactive">
<img
src="<?= base_url() . "public"; ?>/assets/images/leads_sb.png" alt="Logo" height="20">
<span> Leads </span>
</a>
</li>
<?php } ?>
<!-- Tickets -->
<?php if (in_array(get_role_id(), [1, 2, 3, 4, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?>
<li class="li-seperate" id="tickets-li">
<a id="tickets" href="<?= base_url('/ticketList?return_type=web') ?>" class="waves-effect img-inactive">
<img src="<?= base_url() . "public"; ?>/assets/images/ticket.png" alt="Logo" height="20">
<span>Tickets</span>
</a>
</li>
<?php } ?>
<!-- Ad -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5])) { ?>
<li class="li-seperate" id="app-content-mng-li">

View File

@ -32,6 +32,10 @@
width: 100%; /* default: allow full width */
}
p{
margin:0 !important;
}
/* On screens smaller than 600px → force 100% */
@media screen and (max-width: 600px) {
.mail-template-footer {
@ -52,12 +56,18 @@
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mail-template-header">
<tr style="height:90px; background-color: #ffffff !important;">
<td align="left" valign="middle" style="padding:20px;" width="50%">
<img src="<?= $client_logo?>"
alt="Client Logo"
style="max-height:80px; max-width: 160px;">
<td align="left" valign="middle" style="padding:5px;" width="50%">
<div style="
width:160px;
height:80px;
background-image:url('<?= $client_logo ?>');
background-size:contain;
background-repeat:no-repeat;
">
</div>
</td>
<td align="right" valign="middle" style="padding:20px;" width="50%">
<td align="right" valign="middle" style="padding:5px;" width="50%">
<img src="<?= base_url('/public/assets/images/Nhance-Logo-Final.png'); ?>"
alt="Default Logo"
style="height:auto; max-width: 120px;">

View File

@ -1523,6 +1523,8 @@
submitButton.innerText = 'Submit';
}
});
}
function removeAttachment(id) {

View File

@ -40,24 +40,10 @@
<div class="form-group">
<div class="form-row">
<!-- <div class="form-group col-md-3">
<label for="client_branch">Client<span class="text-danger"></span></label>
<select class="form-control" id="client_id" name="client_id">
<option value="0">Select Client</option>
<?php
if (isset($clients) && count($clients)) {
foreach ($clients as $key => $value) {
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
}
}
?>
</select>
</div> -->
<div class="form-group col-md-4">
<label for="addon_policy"> Insurer <span id="base_danger"
class="text-danger"></span></label>
<select class="form-control" id="insurer_id" name="insurer_id">
<label for="addon_policy"> Insurer <span
class="text-danger">*</span></label>
<select class="form-control" id="insurer_id" name="insurer_id" onchange="getInsurerBranch()">
<option value="0" selected>Select Insurer</option>
<?php if (isset($insurer) && count($insurer)) { ?>
<?php foreach ($insurer as $value) { ?>
@ -68,65 +54,13 @@
</div>
<div class="form-group col-md-4">
<label for="addon_policy"> Insurer Branch<span id="base_danger"
class="text-danger"></span></label>
<select class="form-control" id="insurer_id" name="insurer_id">
<label for="addon_policy"> Insurer Branch<span
class="text-danger">*</span></label>
<select class="form-control" id="insurer_branch_id" name="insurer_branch_id">
<option value="0" selected>Select Insurer Branch</option>
<?php if (isset($insurer) && count($insurer)) { ?>
<?php foreach ($insurer as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
<!-- <div class="form-group col-md-3">
<label for="email"> Policy Type <span class="text-danger"></span></label>
<select class="form-control" id="policy_type_id" name="policy_type_id">
<option value="0">Select Policy Type</option>
<?php
if (isset($policy_types) && count($policy_types)) {
foreach ($policy_types as $key => $value) {
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
}
}
?>
</select>
</div> -->
<!-- <div class="form-group col-md-3">
<label for="client_branch">Issuer<span class="text-danger">*</span></label>
<select class="form-control" id="issuer" name="issuer" required>
<option value="0">Select Issure</option>
<?php
if (isset($issuer) && count($issuer)) {
foreach ($issuer as $key => $value) {
echo "<option value=" . $key . ">" . $value . "</option>";
}
}
?>
</select>
</div> -->
<!-- </div>
<div class="form-row"> -->
<!-- <div class="form-group col-md-3">
<label>Date Type<span class="text-danger"></span></label>
<select class="form-control" id="date_type" name="date_type"
onchange="hideDateField()">
<option value="0">Select Date Type</option>
<?php
if (isset($date_type) && count($date_type)) {
foreach ($date_type as $key => $value) {
echo "<option value='" . $key . "'>" . $value . "</option>";
}
}
?>
</select>
</div> -->
<div class="form-group col-md-4" style="display: true;" id="date_div">
<label>Statement Month<span class="text-danger"></span></label>
<div class="input-icon">
@ -294,6 +228,7 @@
getURLParams()
$('#client_id').select2();
$('#insurer_id').select2();
$('#insurer_branch_id').select2();
$('#policy_type_id').select2();
})
@ -304,10 +239,17 @@
var end_date = $('#endDate').val();
var client_id = $('#client_id').val();
var insurer_id = $('#insurer_id').val();
var insurer_branch_id = $('#insurer_branch_id').val();
var policy_type_id = $('#policy_type_id').val();
var date_type = $('#date_type').val();
var issuer = $('#issuer').val();
if(insurer_id == false || insurer_branch_id == false){
alert("Please Choose Insurer and its branch to Proceed .. !!");
return;
}
console.log(start_date + '-' + end_date);
var queryParams = {
@ -315,6 +257,7 @@
end_date: end_date,
client_id: client_id,
insurer_id: insurer_id,
insurer_branch_id : insurer_branch_id,
policy_type_id: policy_type_id,
date_type: date_type,
issuer: issuer,
@ -338,6 +281,7 @@
const endDate = params.get('end_date') || 0; // Default to 0 if not found
const client_id = params.get('client_id') || 0; // Default to 0 if not found
const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found
const insurer_branch_id = params.get('insurer_branch_id') || 0 ; // Default to 0 if not found
const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found
const date_type = params.get('date_type') || 0; // Default to 0 if not found
const issuer = params.get('issuer') || 0; // Default to 0 if not found
@ -348,6 +292,7 @@
console.log('endDate', endDate)
console.log('client_id', client_id)
console.log('insurer_id', insurer_id)
console.log('insurer_branch_id',insurer_branch_id)
console.log('policy_type_id', policy_type_id)
console.log('date_type', date_type)
console.log('issuer', issuer)
@ -361,7 +306,8 @@
$('#start_date').val(startDate)
$('#end_date').val(endDate)
$('#client_id').val(client_id).change()
$('#insurer_id').val(insurer_id).change()
$('#insurer_id').val(insurer_id)
$('#insurer_branch_id').val(insurer_branch_id).change()
$('#policy_type_id').val(policy_type_id).change()
$('#date_type').val(date_type)
$('#issuer').val(issuer)
@ -415,6 +361,7 @@
// Reset all select dropdowns to the first option
$('#client_id').val('0').change();
$('#insurer_id').val('0').change();
$('#insurer_branch_id').val('0').change();
$('#policy_type_id').val('0').change();
$('#date_type').val('0');
$('#issuer').val('0');
@ -457,4 +404,68 @@
console.log(apiURL);
window.location.href = apiURL;
}
function getInsurerBranch(){
let insurer_id = $('#insurer_id').val();
if(insurer_id == 0){
return;
}
$('.loader').fadeIn();
$('.loader-mask').fadeIn('slow');
$.ajax({
url: '<?= base_url('master/insurer/branch/getList?') ?>',
type: 'POST',
data: {insurer_id},
success: function(response) {
console.log(response)
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if (response.data && response.data != []) {
let options ="";
let insurer_branch_list = response.data;
insurer_branch_list.forEach(element => {
options += `<option value="${element['id']}"> ${element['branch_name']} </option>`;
});
$('#insurer_branch_id').html('<option value="0" selected>Select Insurer Branch</option>' + options);
}
},
error: function(xhr, status, error) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
// Handle error
console.error('Upload error occurred:');
console.error('Status: ', status); // Status of the request
console.error('Error: ', error); // Specific error message
console.error('XHR Object: ', xhr); // Full XHR object with response details
// Optionally log server response, if available
if (xhr.responseText) {
console.error('Response Text: ', xhr.responseText);
}
toastr.warning('Error uploading file', 'WARNING');
console.error('Upload error:', error);
},
complete: function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log("Ajax call completed successfully");
}
});
}
</script>

View File

@ -287,23 +287,36 @@ $(document).ready(function() {
data = data.replace(/&nbsp;/g, '').replace(/\s+/g, ' ').trim();
// If it's the first column (index 0), remove link and special chars
if (column === 0 || column === 20 || column === 11 ) {
// Remove all <a> tags and their contents
data = data.replace(/<a[^>]*>(.*?)<\/a>/gi, '');
// Also remove other HTML tags and &nbsp;
data = $('<div>').html(data).text().replace(/\u00a0/g, ' ').trim();
// If it's the first, 20th, 10th, or 11th column, clean the data
if (column === 0 || column === 20 || column === 10 || column === 11) {
// Remove all <a> tags and their contents first
data = data.replace(/<a[^>]*>.*?<\/a>/gi, '');
// Convert any HTML entities / remaining tags to plain text
// (jQuery used only for HTML decoding; you can replace with DOMParser if you prefer)
data = $('<div>').html(data).text();
// Normalize NBSP to space
data = data.replace(/\u00A0/g, ' ');
// Remove BOM, zero-width, and control characters
data = data.replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200F\uFEFF]/g, '').trim();
}
// Force K and L columns to string
// Do NOT prepend \u200C. Return raw cleaned value.
// If you need to force Excel as string, use the formula trick or prepend a single apostrophe.
if (column === 10 || column === 11) {
// Option 1: prepend single quote
return '\u200C' + data;
// Option 2: use Excel formula trick
// Option A: return as Excel formula to preserve formatting
// return '="' + data + '"';
// Option B: prepend apostrophe (visible in Excel formula bar, not in cell)
// return "'" + data;
return data;
}
return data;
}
}
},

View File

@ -208,7 +208,7 @@
echo base_url('policy_tranction/endorsement/list') . '?pt_id=' . $row['id'] ;
}
?>" class="mdi mdi-pencil" ></a> </td>
<td ><?php echo $row['statement_uploaded'] == 'statement uploaded' && $row['multiple_months'] == true ? 'rewards': $row['user_name']??'N/A' ; ?></td>
<td ><?php echo $row['statement_uploaded'] == 'statement uploaded' && $row['multiple_months'] == true && $row['reward'] != "0" ? 'rewards': $row['user_name']??'N/A' ; ?></td>
<td><?php echo $row['policy_issue_month'] ?: 'N/A'; ?></td>
<td style="display: none;"><?php echo $row['statement_uploaded'] ?: 'N/A'; ?></td>
<!-- <td style="display: none;"><?php echo $row['revenue_type'] ?: 'N/A'; ?></td> -->

View File

@ -231,12 +231,12 @@
buttons: [{
extend: 'csv',
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-BDS-List',
title: 'Variance-Report-List',
},
{
extend: 'excel',
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Policy-Tranction-BDS-List',
title: 'Variance-Report-List',
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0;