CHANGE_POST_ENROLLMENT_CHANGES : RV
This commit is contained in:
parent
5691483bd1
commit
58854568e8
@ -3831,14 +3831,15 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
public function sendextraparam()
|
public function sendextraparam()
|
||||||
{
|
{
|
||||||
// $batch_data = [
|
$batch_data = [
|
||||||
// 'client_id' => 17,
|
'client_id' => 17,
|
||||||
// 'client_policy_id' => 30,
|
'client_policy_id' => 30,
|
||||||
// 'client_branch_id' => 18,
|
'client_branch_id' => 18,
|
||||||
// ];
|
'event_type' => "inception",
|
||||||
|
];
|
||||||
|
|
||||||
// $batch_data['insurer_or_tpa'] = 'insurer';
|
// $batch_data['insurer_or_tpa'] = 'insurer';
|
||||||
// $batch_data['insurer_or_tpa'] = 'tpa';
|
$batch_data['insurer_or_tpa'] = 'tpa';
|
||||||
|
|
||||||
|
|
||||||
// dd($this->request);
|
// dd($this->request);
|
||||||
@ -3881,6 +3882,7 @@ class ClientController extends AdminController
|
|||||||
// $EmpDataServiceController->importInceptionFileValidation(['file_id' => 162]);
|
// $EmpDataServiceController->importInceptionFileValidation(['file_id' => 162]);
|
||||||
// $EmpDataServiceController->importDeletionValidation(['file_id' => 171]);
|
// $EmpDataServiceController->importDeletionValidation(['file_id' => 171]);
|
||||||
// $EmpDataServiceController->importDeletionUpdateEndorsementID(['file_id' => 171]);
|
// $EmpDataServiceController->importDeletionUpdateEndorsementID(['file_id' => 171]);
|
||||||
|
// $EmpDataServiceController->importCorrectionUpdateEndorsementID(['file_id' => 188]);
|
||||||
$array = [
|
$array = [
|
||||||
"employeeIds" => ["12800", "12798", "12797", "12799"],
|
"employeeIds" => ["12800", "12798", "12797", "12799"],
|
||||||
"client_id" => "159",
|
"client_id" => "159",
|
||||||
@ -3894,11 +3896,14 @@ class ClientController extends AdminController
|
|||||||
"user_id" => "1"
|
"user_id" => "1"
|
||||||
];
|
];
|
||||||
|
|
||||||
$EmpDataServiceController->cashDepositCalculationForDeletion($array);
|
// $EmpDataServiceController->cashDepositCalculationForDeletion($array);
|
||||||
|
|
||||||
// $employeeRestController = new EmployeeServiceController();
|
// $employeeRestController = new EmployeeServiceController();
|
||||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 757]);
|
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 757]);
|
||||||
|
|
||||||
|
// $result = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($batch_data);
|
||||||
|
// dd(db_connect()->getLastQuery());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -289,7 +289,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'column_index' => 14,
|
'column_index' => 14,
|
||||||
'column_name' => 'UHID',
|
'column_name' => 'RISK ID',
|
||||||
'db_column_name' => 'uhid'
|
'db_column_name' => 'uhid'
|
||||||
],
|
],
|
||||||
// [
|
// [
|
||||||
@ -399,7 +399,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'column_index' => 14,
|
'column_index' => 14,
|
||||||
'column_name' => 'UHID',
|
'column_name' => 'RISK ID',
|
||||||
'db_column_name' => 'uhid'
|
'db_column_name' => 'uhid'
|
||||||
],
|
],
|
||||||
// [
|
// [
|
||||||
@ -540,6 +540,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
$ids = [];
|
$ids = [];
|
||||||
|
|
||||||
$objects = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data);
|
$objects = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data);
|
||||||
|
// dd(db_connect()->getLastQuery(),$objects);
|
||||||
|
|
||||||
foreach ($objects as $obj) {
|
foreach ($objects as $obj) {
|
||||||
$ids[] = $obj->id;
|
$ids[] = $obj->id;
|
||||||
@ -552,15 +553,29 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
if ($count == 0) {
|
if ($count == 0) {
|
||||||
$this->myLogger->logme('error', 'No Record found. Endorsement ID Alread Updated. Correction export data count : {data}', ['data' => $count]);
|
$this->myLogger->logme('error', 'No Record found. Endorsement ID Alread Updated. Correction export data count : {data}', ['data' => $count]);
|
||||||
// return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->removeOldExportInfoFromBatchFile($export_data);
|
$this->removeOldExportInfoFromBatchFile($export_data);
|
||||||
|
|
||||||
|
|
||||||
$this->myLogger->logme('error', 'Correction export file name : {data}', ['data' => $export_data['file_name']]);
|
$this->myLogger->logme('error', 'Correction export file name : {data}', ['data' => $export_data['file_name']]);
|
||||||
|
|
||||||
|
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
||||||
|
|
||||||
|
$excel_header_columns = [
|
||||||
|
['column_index' => 0, 'column_name' => 'Emp Code', 'db_column_name' => 'emp_code'],
|
||||||
|
['column_index' => 1, 'column_name' => 'RISK ID', 'db_column_name' => 'uhid'],
|
||||||
|
['column_index' => 1, 'column_name' => 'NAME OF EMP/DEP', 'db_column_name' => 'emp_name'],
|
||||||
|
['column_index' => 3, 'column_name' => 'EMP/DEP TYPE', 'db_column_name' => 'emp_type'],
|
||||||
|
['column_index' => 4, 'column_name' => 'RELATION', 'db_column_name' => 'emp_relationship'],
|
||||||
|
['column_index' => 5, 'column_name' => 'DOB', 'db_column_name' => 'emp_dob'],
|
||||||
|
['column_index' => 6, 'column_name' => 'GENDER', 'db_column_name' => 'emp_gender'],
|
||||||
|
['column_index' => 7, 'column_name' => 'Wrong Data', 'db_column_name' => 'old_value'],
|
||||||
|
['column_index' => 8, 'column_name' => 'Correct Data', 'db_column_name' => 'new_value'],
|
||||||
|
['column_index' => 9, 'column_name' => 'Remarks', 'db_column_name' => 'remarks'],
|
||||||
|
['column_index' => 10, 'column_name' => 'Endorsement_Id', 'db_column_name' => null]
|
||||||
|
];
|
||||||
|
}else{
|
||||||
|
|
||||||
// get excel export format structure array
|
// get excel export format structure array
|
||||||
$template_json = $this->clientPolicyModel
|
$template_json = $this->clientPolicyModel
|
||||||
@ -577,23 +592,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
}else{
|
}else{
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
|
||||||
|
|
||||||
$excel_header_columns = [
|
|
||||||
['column_index' => 0, 'column_name' => 'Emp Code', 'db_column_name' => 'emp_code'],
|
|
||||||
['column_index' => 1, 'column_name' => 'RISK ID', 'db_column_name' => 'uhid'],
|
|
||||||
['column_index' => 1, 'column_name' => 'NAME OF EMP/DEP', 'db_column_name' => 'emp_name'],
|
|
||||||
['column_index' => 3, 'column_name' => 'EMP/DEP TYPE', 'db_column_name' => 'emp_type'],
|
|
||||||
['column_index' => 4, 'column_name' => 'RELATION', 'db_column_name' => 'relationship_code'],
|
|
||||||
['column_index' => 5, 'column_name' => 'DOB', 'db_column_name' => 'emp_dob'],
|
|
||||||
['column_index' => 6, 'column_name' => 'GENDER', 'db_column_name' => 'emp_gender'],
|
|
||||||
['column_index' => 7, 'column_name' => 'Wrong Data', 'db_column_name' => 'old_value'],
|
|
||||||
['column_index' => 8, 'column_name' => 'Correct Data', 'db_column_name' => 'new_value'],
|
|
||||||
['column_index' => 9, 'column_name' => 'Remarks', 'db_column_name' => 'remarks'],
|
|
||||||
['column_index' => 10, 'column_name' => 'Endorsement_Id', 'db_column_name' => null]
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -790,7 +788,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
$ids = [];
|
$ids = [];
|
||||||
|
|
||||||
$objects = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($export_data);
|
$objects = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($export_data);
|
||||||
|
// dd(db_connect()->getLastQuery());
|
||||||
// dd($objects);
|
// dd($objects);
|
||||||
|
|
||||||
$totals = 0;
|
$totals = 0;
|
||||||
@ -816,6 +814,29 @@ class EmpDataServiceController extends BaseController
|
|||||||
$this->removeOldExportInfoFromBatchFile($export_data);
|
$this->removeOldExportInfoFromBatchFile($export_data);
|
||||||
$this->myLogger->logme('error', 'Deletion export file name : {data}', ['data' => $export_data['file_name']]);
|
$this->myLogger->logme('error', 'Deletion export file name : {data}', ['data' => $export_data['file_name']]);
|
||||||
|
|
||||||
|
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
||||||
|
|
||||||
|
$excel_header_columns = [
|
||||||
|
['column_index' => 0, 'column_name' => 'S.No', 'db_column_name' => 'index'],
|
||||||
|
['column_index' => 1, 'column_name' => 'EMP ID', 'db_column_name' => 'emp_code'],
|
||||||
|
['column_index' => 2, 'column_name' => 'EMP NAME', 'db_column_name' => 'emp_name'],
|
||||||
|
['column_index' => 3, 'column_name' => 'DOB', 'db_column_name' => 'emp_dob'],
|
||||||
|
['column_index' => 4, 'column_name' => 'GENDER', 'db_column_name' => 'emp_gender'],
|
||||||
|
['column_index' => 5, 'column_name' => 'RELATIONSHIP', 'db_column_name' => 'emp_relationship'],
|
||||||
|
['column_index' => 6, 'column_name' => 'SUM INSURED', 'db_column_name' => 'basic_cover_si'],
|
||||||
|
['column_index' => 7, 'column_name' => 'Date of Leaving', 'db_column_name' => 'dateofexit'],
|
||||||
|
['column_index' => 8, 'column_name' => 'Policy End Date', 'db_column_name' => 'policy_end_date'],
|
||||||
|
['column_index' => 9, 'column_name' => 'No Of Days', 'db_column_name' => 'no_of_days'],
|
||||||
|
['column_index' => 10, 'column_name' => 'Premium', 'db_column_name' => 'premium'],
|
||||||
|
['column_index' => 11, 'column_name' => 'Pro Rata Premium', 'db_column_name' => 'pro_rata_premium'],
|
||||||
|
['column_index' => 12, 'column_name' => 'GST', 'db_column_name' => 'gst'],
|
||||||
|
['column_index' => 13, 'column_name' => 'Total', 'db_column_name' => 'total'],
|
||||||
|
['column_index' => 14, 'column_name' => 'Claim Status', 'db_column_name' => 'claim_status'],
|
||||||
|
['column_index' => 15, 'column_name' => 'ENDORSEMENT_ID', 'db_column_name' => null]
|
||||||
|
];
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
// get excel export format structure array
|
// get excel export format structure array
|
||||||
$template_json = $this->clientPolicyModel
|
$template_json = $this->clientPolicyModel
|
||||||
->select('insurer_excel_export_template.jsoncolumns')
|
->select('insurer_excel_export_template.jsoncolumns')
|
||||||
@ -832,27 +853,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
|
||||||
|
|
||||||
$excel_header_columns = [
|
|
||||||
['column_index' => 0, 'column_name' => 'S.No', 'db_column_name' => 'index'],
|
|
||||||
['column_index' => 1, 'column_name' => 'EMP ID', 'db_column_name' => 'emp_code'],
|
|
||||||
['column_index' => 2, 'column_name' => 'EMP NAME', 'db_column_name' => 'emp_name'],
|
|
||||||
['column_index' => 3, 'column_name' => 'DOB', 'db_column_name' => 'emp_dob'],
|
|
||||||
['column_index' => 4, 'column_name' => 'GENDER', 'db_column_name' => 'emp_gender'],
|
|
||||||
['column_index' => 5, 'column_name' => 'RELATIONSHIP', 'db_column_name' => 'emp_relationship_code'],
|
|
||||||
['column_index' => 6, 'column_name' => 'SUM INSURED', 'db_column_name' => 'basic_cover_si'],
|
|
||||||
['column_index' => 7, 'column_name' => 'Date of Leaving', 'db_column_name' => 'date_of_leaving'],
|
|
||||||
['column_index' => 8, 'column_name' => 'Policy End Date', 'db_column_name' => 'policy_end_date'],
|
|
||||||
['column_index' => 9, 'column_name' => 'No Of Days', 'db_column_name' => 'no_of_days'],
|
|
||||||
['column_index' => 10, 'column_name' => 'Premium', 'db_column_name' => 'premium'],
|
|
||||||
['column_index' => 11, 'column_name' => 'Pro Rata Premium', 'db_column_name' => 'pro_rata_premium'],
|
|
||||||
['column_index' => 12, 'column_name' => 'GST', 'db_column_name' => 'gst'],
|
|
||||||
['column_index' => 13, 'column_name' => 'Total', 'db_column_name' => 'total'],
|
|
||||||
['column_index' => 14, 'column_name' => 'Claim Status', 'db_column_name' => null],
|
|
||||||
['column_index' => 15, 'column_name' => 'ENDORSEMENT_ID', 'db_column_name' => null]
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$excel_data_info = generate_insurer_based_excel($excel_header_columns, $objects);
|
$excel_data_info = generate_insurer_based_excel($excel_header_columns, $objects);
|
||||||
@ -1338,7 +1338,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
'POLICY END DATE',
|
'POLICY END DATE',
|
||||||
'NO OF DAYS',
|
'NO OF DAYS',
|
||||||
'TPA ID',
|
'TPA ID',
|
||||||
'UHID',
|
'RISK ID',
|
||||||
// 'PREMIUM',
|
// 'PREMIUM',
|
||||||
'PRO RATA PREMIUM',
|
'PRO RATA PREMIUM',
|
||||||
'GST',
|
'GST',
|
||||||
@ -1932,7 +1932,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
//Endorsement Correction
|
//Endorsement Correction
|
||||||
public function importCorrectionValidation($params)
|
public function importCorrectionValidation($params)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->myLogger->logme('error', 'Correction File Validation -- Function called');
|
$this->myLogger->logme('error', 'Correction File Validation -- Function called');
|
||||||
|
|
||||||
$file_id = $params['file_id'];
|
$file_id = $params['file_id'];
|
||||||
@ -1944,6 +1943,14 @@ class EmpDataServiceController extends BaseController
|
|||||||
$batch_code = $file['batch_code'];
|
$batch_code = $file['batch_code'];
|
||||||
$user_id = $file['created_by'];
|
$user_id = $file['created_by'];
|
||||||
|
|
||||||
|
$ref_data = [
|
||||||
|
'client_id' => $client_id,
|
||||||
|
'client_policy_id' => $client_policy_id,
|
||||||
|
'client_branch_id' => $client_branch_id,
|
||||||
|
'insurer_or_tpa' => $file['insurer_or_tpa'],
|
||||||
|
'event_type' => $file['event_type'],
|
||||||
|
];
|
||||||
|
|
||||||
$file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name'];
|
$file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name'];
|
||||||
|
|
||||||
if (!file_exists($file_name_with_path)) {
|
if (!file_exists($file_name_with_path)) {
|
||||||
@ -1961,7 +1968,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
$headers = ['Emp Code','RISK ID','NAME OF EMP/DEP','EMP/DEP TYPE','RELATION','DOB','GENDER','Wrong Data','Correct Data','Remarks','Endorsement_Id'];
|
$headers = ['Emp Code','RISK ID','NAME OF EMP/DEP','EMP/DEP TYPE','RELATION','DOB','GENDER','Wrong Data','Correct Data','Remarks','Endorsement_Id'];
|
||||||
|
|
||||||
|
|
||||||
foreach ($headers as $key => $value) {
|
foreach ($headers as $key => $value) {
|
||||||
if($excel_header[$key] != $value){
|
if($excel_header[$key] != $value){
|
||||||
$data = [
|
$data = [
|
||||||
@ -1978,45 +1984,9 @@ class EmpDataServiceController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$endorsement_data = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($ref_data, 1);
|
||||||
|
|
||||||
|
// dd($endorsement_data, $excel_data);
|
||||||
$endorsement_data = $this->empEndorsementModel
|
|
||||||
->select("
|
|
||||||
emp_endorsement.id,
|
|
||||||
emp_endorsement.pk,
|
|
||||||
emp_endorsement.emp_code,
|
|
||||||
emp_endorsement.endorsement_id,
|
|
||||||
emp_endorsement.old_value,
|
|
||||||
emp_endorsement.new_value,
|
|
||||||
emp_endorsement.field_name,
|
|
||||||
emp_endorsement.remarks,
|
|
||||||
emp_endorsement.actions,
|
|
||||||
employees.id AS primaryKey,
|
|
||||||
employees.name AS emp_name,
|
|
||||||
employees.dob AS emp_dob,
|
|
||||||
employees.gender AS emp_gender,
|
|
||||||
employees.client_id AS emp_client_id,
|
|
||||||
'Has Define' AS emp_type,
|
|
||||||
employee_polices.uhid,
|
|
||||||
employees.relationship_code
|
|
||||||
")
|
|
||||||
->join("employees", "employees.id = emp_endorsement.pk", "left")
|
|
||||||
->join("employee_polices", "employees.id = employee_polices.employee_id", "left")
|
|
||||||
->where("employees.client_id", $client_id)
|
|
||||||
->where("employee_polices.client_policy_id", $client_policy_id)
|
|
||||||
->where("employees.client_branch_id", $client_branch_id)
|
|
||||||
->where("employees.is_active", 1)
|
|
||||||
->where("employees.emp_status", "active")
|
|
||||||
->where("emp_endorsement.actions", "c")
|
|
||||||
->where("emp_endorsement.is_active", 1)
|
|
||||||
->where("emp_endorsement.status !=", "truncated")
|
|
||||||
->where("(emp_endorsement.endorsement_id IS NULL OR emp_endorsement.endorsement_id = '')")
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dd($endorsement_data, $excel_data);
|
|
||||||
|
|
||||||
|
|
||||||
if ($endorsement_data == null || empty($endorsement_data)) {
|
if ($endorsement_data == null || empty($endorsement_data)) {
|
||||||
|
|
||||||
@ -2052,8 +2022,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
$this->myLogger->logme('error', 'correctionFileValidation excel file count partially : {data}', ['data' => $partially_updated_data]);
|
$this->myLogger->logme('error', 'correctionFileValidation excel file count partially : {data}', ['data' => $partially_updated_data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($endorsement_data_count < $excel_data_count) {
|
if ($endorsement_data_count < $excel_data_count) {
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -2069,7 +2037,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
return 'The Excel record count exceeds the DB record count. excel file count : ' . $excel_data_count . 'db count : ' . $endorsement_data_count;
|
return 'The Excel record count exceeds the DB record count. excel file count : ' . $excel_data_count . 'db count : ' . $endorsement_data_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$errors = []; // Initialize an array to store errors
|
$errors = []; // Initialize an array to store errors
|
||||||
$missing_id = [];
|
$missing_id = [];
|
||||||
$batch_list_id = [];
|
$batch_list_id = [];
|
||||||
@ -2159,17 +2126,14 @@ class EmpDataServiceController extends BaseController
|
|||||||
$batch_list_id[] = $endorsement_value['primaryKey'];
|
$batch_list_id[] = $endorsement_value['primaryKey'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$error_count = count($errors);
|
$error_count = count($errors);
|
||||||
$json_errors = json_encode($errors);
|
$json_errors = json_encode($errors);
|
||||||
|
|
||||||
|
|
||||||
$missing_id_count = count($missing_id);
|
$missing_id_count = count($missing_id);
|
||||||
$json_missing_id = json_encode($missing_id);
|
$json_missing_id = json_encode($missing_id);
|
||||||
|
|
||||||
// dd($error_count, $missing_id_count, $json_errors, $json_missing_id, $batch_list_id);
|
// dd($error_count, $missing_id_count, $json_errors, $json_missing_id, $batch_list_id);
|
||||||
|
|
||||||
|
|
||||||
if ($missing_id_count > 0) {
|
if ($missing_id_count > 0) {
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -2188,7 +2152,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($error_count > 0) {
|
if ($error_count > 0) {
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -2234,7 +2197,8 @@ class EmpDataServiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function importCorrectionUpdateEndorsementID($params){
|
public function importCorrectionUpdateEndorsementID($params)
|
||||||
|
{
|
||||||
|
|
||||||
$this->myLogger->logme('error', 'importCorrectionUpdateEndorsementID called');
|
$this->myLogger->logme('error', 'importCorrectionUpdateEndorsementID called');
|
||||||
|
|
||||||
@ -2286,7 +2250,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
$emp_count = count($excel_data);
|
$emp_count = count($excel_data);
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
|
|
||||||
|
|
||||||
foreach ($excel_data as $key => $value) {
|
foreach ($excel_data as $key => $value) {
|
||||||
|
|
||||||
$emp_code = $value[0];
|
$emp_code = $value[0];
|
||||||
@ -2294,6 +2257,14 @@ class EmpDataServiceController extends BaseController
|
|||||||
$endorsement_id[] = $value[10];
|
$endorsement_id[] = $value[10];
|
||||||
$uhid = $value[1];
|
$uhid = $value[1];
|
||||||
|
|
||||||
|
$isDate = \DateTime::createFromFormat('d-M-Y', $old_value) && \DateTime::createFromFormat('d-M-Y', $old_value)->format('d-M-Y') === $old_value;
|
||||||
|
|
||||||
|
if($isDate){
|
||||||
|
$old_value = change_date_format($old_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// dd($old_value, $isDate);
|
||||||
|
|
||||||
$result = $this->empEndorsementModel
|
$result = $this->empEndorsementModel
|
||||||
->select('emp_endorsement.*, employees.id as emp_id')
|
->select('emp_endorsement.*, employees.id as emp_id')
|
||||||
->join('employees', 'employees.id = emp_endorsement.pk')
|
->join('employees', 'employees.id = emp_endorsement.pk')
|
||||||
@ -2313,9 +2284,17 @@ class EmpDataServiceController extends BaseController
|
|||||||
->where("emp_endorsement.status !=", "truncated")
|
->where("emp_endorsement.status !=", "truncated")
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
// print_r($result); die;
|
||||||
|
|
||||||
if (isset($result['id']) && $result['id'] !== null) {
|
if (isset($result['id']) && $result['id'] !== null) {
|
||||||
// return $result;
|
// return $result;
|
||||||
$enrollment_file_id = $result['file_id'];
|
$enrollment_file_id = $result['file_id'];
|
||||||
|
|
||||||
|
if($result['field_name'] == 'dob'){
|
||||||
|
$value[8] = change_date_format($value[8]);
|
||||||
|
}
|
||||||
|
// dd($value[8]);
|
||||||
|
|
||||||
$emp_details[] = array('id' => $result['emp_id'], $result['field_name'] => $value[8]);
|
$emp_details[] = array('id' => $result['emp_id'], $result['field_name'] => $value[8]);
|
||||||
$endorsement_details[] = array('group_key' => $result['group_key'], 'id' => $result['id'], 'endorsement_id' => $value[10], 'status' => 'complete');
|
$endorsement_details[] = array('group_key' => $result['group_key'], 'id' => $result['id'], 'endorsement_id' => $value[10], 'status' => 'complete');
|
||||||
}
|
}
|
||||||
@ -2356,7 +2335,6 @@ class EmpDataServiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Endorsement SIEnhancement
|
//Endorsement SIEnhancement
|
||||||
public function importSIEnhancementValidation($params)
|
public function importSIEnhancementValidation($params)
|
||||||
{
|
{
|
||||||
@ -3379,7 +3357,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
$enrollment_file_id = $result['file_id']; //files table primary key
|
$enrollment_file_id = $result['file_id']; //files table primary key
|
||||||
$employee_policy_table_primaryKey[] = $result['emp_policy_primarykey']; //for cash deposite
|
$employee_policy_table_primaryKey[] = $result['emp_policy_primarykey']; //for cash deposite
|
||||||
$employee_policy_table_data[] = array('id' => $result['emp_policy_primarykey'], 'date_of_exit' => $result['date_of_exit'], 'reason_for_exit' => $result['reason_for_exit'], 'claim_status' => $result['claim_status'], 'status' => $result['status']);
|
$employee_policy_table_data[] = array('id' => $result['emp_policy_primarykey'], 'date_of_exit' => change_date_format($result['date_of_exit']), 'reason_for_exit' => $result['reason_for_exit'], 'claim_status' => $result['claim_status'], 'status' => $result['status']);
|
||||||
// $employees_table_data[] = array('id' => $result['employees_id'], 'emp_status' => $result['status']);
|
// $employees_table_data[] = array('id' => $result['employees_id'], 'emp_status' => $result['status']);
|
||||||
$emp_endorsement_table_data[] = array('id' => $result['emp_endorsement_primarykey'], 'group_key' => $result['group_key'], 'endorsement_id' => $value[15], 'status' => 'complete');
|
$emp_endorsement_table_data[] = array('id' => $result['emp_endorsement_primarykey'], 'group_key' => $result['group_key'], 'endorsement_id' => $value[15], 'status' => 'complete');
|
||||||
}
|
}
|
||||||
@ -4223,7 +4201,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
$result[] = array(
|
$result[] = array(
|
||||||
"field_name" => 'Exit on',
|
"field_name" => 'Exit on',
|
||||||
"data" => change_date_format($obj->date_of_leaving, 'Y-m-d', 'd-M-Y'),
|
"data" => change_date_format($obj->dateofexit, 'Y-m-d', 'd-M-Y'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$result[] = array(
|
$result[] = array(
|
||||||
@ -4389,6 +4367,10 @@ class EmpDataServiceController extends BaseController
|
|||||||
employees.email_corporate,
|
employees.email_corporate,
|
||||||
employees.name,
|
employees.name,
|
||||||
employees.mobile,
|
employees.mobile,
|
||||||
|
employees.basic_cover_si,
|
||||||
|
|
||||||
|
cp.policy_type_id,
|
||||||
|
cp.is_addon,
|
||||||
|
|
||||||
employee_polices.id as emp_policy_id,
|
employee_polices.id as emp_policy_id,
|
||||||
employee_polices.client_policy_id,
|
employee_polices.client_policy_id,
|
||||||
@ -4396,6 +4378,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
employee_polices.tpa_id
|
employee_polices.tpa_id
|
||||||
')
|
')
|
||||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||||
|
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id')
|
||||||
->where('employees.emp_status', 'active')
|
->where('employees.emp_status', 'active')
|
||||||
->where('employees.is_active', '1')
|
->where('employees.is_active', '1')
|
||||||
->where('employee_polices.status', 'active')
|
->where('employee_polices.status', 'active')
|
||||||
@ -4406,7 +4389,8 @@ class EmpDataServiceController extends BaseController
|
|||||||
if ($emp_details) {
|
if ($emp_details) {
|
||||||
$this->myLogger->logme('error', 'sendMailForDownloadingECard - Processing employee_policy_id: {id}', ['id' => $id]);
|
$this->myLogger->logme('error', 'sendMailForDownloadingECard - Processing employee_policy_id: {id}', ['id' => $id]);
|
||||||
|
|
||||||
if (!empty($emp_details['email_corporate']) && $emp_details['relationship'] === 'Self') {
|
if (!empty($emp_details['email_corporate'])) {
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'rand_string' => $emp_details['rand_string'],
|
'rand_string' => $emp_details['rand_string'],
|
||||||
'tpa_id' => $emp_details['tpa_id'],
|
'tpa_id' => $emp_details['tpa_id'],
|
||||||
@ -4428,6 +4412,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
// $wholeMailData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
|
// $wholeMailData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$processedCount++;
|
$processedCount++;
|
||||||
|
|
||||||
// Send batch emails or handle single email
|
// Send batch emails or handle single email
|
||||||
|
|||||||
@ -631,6 +631,7 @@ class EmployeeController extends AdminController
|
|||||||
session()->setFlashdata('error', $return);
|
session()->setFlashdata('error', $return);
|
||||||
return redirect()->to(base_url('employee/upload'));
|
return redirect()->to(base_url('employee/upload'));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ($event_type == 'si_enhancement') {
|
} else if ($event_type == 'si_enhancement') {
|
||||||
|
|
||||||
|
|
||||||
@ -1136,7 +1137,8 @@ class EmployeeController extends AdminController
|
|||||||
|
|
||||||
// Step 3: Prepare template path
|
// Step 3: Prepare template path
|
||||||
$template_data_path = WRITEPATH . 'e_card_template/';
|
$template_data_path = WRITEPATH . 'e_card_template/';
|
||||||
$tpa_short_name = strtolower(str_replace(' ', '_', $get_emp_code_and_client_policy_id['short_name'])) . '.html';
|
// $tpa_short_name = strtolower(str_replace(' ', '_', $get_emp_code_and_client_policy_id['short_name'])) . '.html';
|
||||||
|
$tpa_short_name = 'common.html';
|
||||||
$final_path = $template_data_path . $tpa_short_name;
|
$final_path = $template_data_path . $tpa_short_name;
|
||||||
|
|
||||||
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
|
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
|
||||||
@ -1156,6 +1158,9 @@ class EmployeeController extends AdminController
|
|||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
$htmlContent = $tmplt_data;
|
$htmlContent = $tmplt_data;
|
||||||
|
|
||||||
|
$value['front_card'] = "Nhance_Ecard_working_1_front.png";
|
||||||
|
$value['back_card'] = "Nhance_Ecard_working_1_Back.png";
|
||||||
|
|
||||||
$placeholders = [
|
$placeholders = [
|
||||||
'{CLIENT_NAME}' => $value['client_name'],
|
'{CLIENT_NAME}' => $value['client_name'],
|
||||||
'{TPA_ID}' => $value['tpa_id'],
|
'{TPA_ID}' => $value['tpa_id'],
|
||||||
@ -1839,6 +1844,13 @@ class EmployeeController extends AdminController
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$placeholders['{LEVELS}'] = '
|
||||||
|
<span style="font-family: sans-serif;">Level 1</span><br><br>
|
||||||
|
<span style="font-family: sans-serif;">1. Gowtham / 8754081806 / gowtham@gmail.com</span><br>
|
||||||
|
<span style="font-family: sans-serif;">2. Gowtham / 8754081806 / gowtham@gmail.com</span><br><br>';
|
||||||
|
|
||||||
|
// dd($placeholders);
|
||||||
|
|
||||||
// Get the values to replace the placeholders
|
// Get the values to replace the placeholders
|
||||||
$replaceValues = array_values($placeholders);
|
$replaceValues = array_values($placeholders);
|
||||||
|
|
||||||
@ -2189,7 +2201,9 @@ class EmployeeController extends AdminController
|
|||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
// print_rr($data);die();
|
// print_rr($data);die();
|
||||||
// $data['dob'] = date('Y-m-d', strtotime($data['dob']));
|
// $data['dob'] = date('Y-m-d', strtotime($data['dob']));
|
||||||
|
if(isset( $data['dob'])){
|
||||||
$data['dob'] = change_date_format($data['dob'], 'd/m/Y', 'Y-m-d');
|
$data['dob'] = change_date_format($data['dob'], 'd/m/Y', 'Y-m-d');
|
||||||
|
}
|
||||||
// print_rr($data); die;
|
// print_rr($data); die;
|
||||||
|
|
||||||
// Fetch current employee data
|
// Fetch current employee data
|
||||||
@ -2197,6 +2211,8 @@ class EmployeeController extends AdminController
|
|||||||
|
|
||||||
if ($employee_data['relationship'] == 'Self') {
|
if ($employee_data['relationship'] == 'Self') {
|
||||||
|
|
||||||
|
if(isset($data['gender'])){
|
||||||
|
|
||||||
if ($employee_data['gender'] != $data['gender']) {
|
if ($employee_data['gender'] != $data['gender']) {
|
||||||
|
|
||||||
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
||||||
@ -2207,6 +2223,7 @@ class EmployeeController extends AdminController
|
|||||||
->update();
|
->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update the employee data
|
// Update the employee data
|
||||||
$result = $this->employeeModel->where('id', $data['employee_primary_id'])->set($data)->update();
|
$result = $this->employeeModel->where('id', $data['employee_primary_id'])->set($data)->update();
|
||||||
@ -2647,4 +2664,27 @@ class EmployeeController extends AdminController
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getBatchFileData()
|
||||||
|
{
|
||||||
|
$file_id = $this->request->getGet('file_id');
|
||||||
|
|
||||||
|
if(!empty($file_id)){
|
||||||
|
|
||||||
|
|
||||||
|
$batch_file_data = $this->batchFileModel
|
||||||
|
->where('id', $file_id)
|
||||||
|
->where('is_active', 1)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if(!empty($batch_file_data)){
|
||||||
|
return $this->respond(['status' => true, 'code' => 200, 'batch_file_data' => $batch_file_data], 200);
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => false, 'code' => 200, 'message' => 'No data found.'], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No data to found. File ID Not found'], 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,7 +255,6 @@ class EmployeePolicyModel extends Model
|
|||||||
SELECT
|
SELECT
|
||||||
employees.name AS emp_name,
|
employees.name AS emp_name,
|
||||||
employees.emp_code AS emp_code,
|
employees.emp_code AS emp_code,
|
||||||
employees.dob AS emp_dob,
|
|
||||||
employees.gender AS emp_gender,
|
employees.gender AS emp_gender,
|
||||||
employees.relationship AS emp_relationship,
|
employees.relationship AS emp_relationship,
|
||||||
employees.relationship_code AS emp_relationship_code,
|
employees.relationship_code AS emp_relationship_code,
|
||||||
@ -263,7 +262,6 @@ class EmployeePolicyModel extends Model
|
|||||||
employees.change_event AS change_event,
|
employees.change_event AS change_event,
|
||||||
|
|
||||||
|
|
||||||
employees.doj AS emp_doj,
|
|
||||||
employees.mobile AS emp_mobile,
|
employees.mobile AS emp_mobile,
|
||||||
employees.email_corporate AS emp_email_c,
|
employees.email_corporate AS emp_email_c,
|
||||||
employees.email_personal AS emp_email_p,
|
employees.email_personal AS emp_email_p,
|
||||||
@ -280,8 +278,6 @@ class EmployeePolicyModel extends Model
|
|||||||
employee_polices.uhid,
|
employee_polices.uhid,
|
||||||
employee_polices.pre_existing_alignments,
|
employee_polices.pre_existing_alignments,
|
||||||
employee_polices.basic_cover_si,
|
employee_polices.basic_cover_si,
|
||||||
employee_polices.date_coverage as date_of_coverage,
|
|
||||||
employee_polices.policy_end_date,
|
|
||||||
employee_polices.days as no_of_days,
|
employee_polices.days as no_of_days,
|
||||||
employee_polices.premium,
|
employee_polices.premium,
|
||||||
employee_polices.rata_premimum as pro_rata_premium,
|
employee_polices.rata_premimum as pro_rata_premium,
|
||||||
@ -291,6 +287,12 @@ class EmployeePolicyModel extends Model
|
|||||||
batch_data.bl AS batch_list_batch_code,
|
batch_data.bl AS batch_list_batch_code,
|
||||||
batch_data.bf AS batch_files_batch_code,
|
batch_data.bf AS batch_files_batch_code,
|
||||||
|
|
||||||
|
DATE_FORMAT(employees.dob, '%d-%b-%Y') AS emp_dob,
|
||||||
|
DATE_FORMAT(employees.doj, '%d-%b-%Y') AS emp_doj,
|
||||||
|
DATE_FORMAT(employee_polices.policy_end_date, '%d-%b-%Y') AS policy_end_date,
|
||||||
|
DATE_FORMAT(employee_polices.date_coverage, '%d-%b-%Y') AS date_of_coverage,
|
||||||
|
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN client_branch.sez = 0 THEN 'NON-SEZ'
|
WHEN client_branch.sez = 0 THEN 'NON-SEZ'
|
||||||
WHEN client_branch.sez = 1 THEN 'SEZ'
|
WHEN client_branch.sez = 1 THEN 'SEZ'
|
||||||
@ -334,7 +336,7 @@ class EmployeePolicyModel extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getCorrectionEmployeesDataForExportExcel($ref_data)
|
public function getCorrectionEmployeesDataForExportExcel($ref_data, $return_type = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$client_id = $ref_data['client_id'];
|
$client_id = $ref_data['client_id'];
|
||||||
@ -342,7 +344,7 @@ class EmployeePolicyModel extends Model
|
|||||||
$client_branch_id = $ref_data['client_branch_id'];
|
$client_branch_id = $ref_data['client_branch_id'];
|
||||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||||
|
|
||||||
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (emp_endorsement.endorsement_id IS NOT NULL OR emp_endorsement.endorsement_id != '')" : "AND (emp_endorsement.endorsement_id IS NULL OR emp_endorsement.endorsement_id = '')";
|
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (emp_endorsement.endorsement_id IS NULL OR emp_endorsement.endorsement_id = '')" : "AND (emp_endorsement.endorsement_id IS NULL OR emp_endorsement.endorsement_id = '')";
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
@ -350,14 +352,11 @@ class EmployeePolicyModel extends Model
|
|||||||
emp_endorsement.pk,
|
emp_endorsement.pk,
|
||||||
emp_endorsement.emp_code,
|
emp_endorsement.emp_code,
|
||||||
emp_endorsement.endorsement_id,
|
emp_endorsement.endorsement_id,
|
||||||
emp_endorsement.old_value,
|
|
||||||
emp_endorsement.new_value,
|
|
||||||
emp_endorsement.field_name,
|
emp_endorsement.field_name,
|
||||||
emp_endorsement.remarks,
|
emp_endorsement.remarks,
|
||||||
emp_endorsement.actions,
|
emp_endorsement.actions,
|
||||||
employees.id AS primaryKey,
|
employees.id AS primaryKey,
|
||||||
employees.name AS emp_name,
|
employees.name AS emp_name,
|
||||||
employees.dob AS emp_dob,
|
|
||||||
employees.gender AS emp_gender,
|
employees.gender AS emp_gender,
|
||||||
employees.client_id AS emp_client_id,
|
employees.client_id AS emp_client_id,
|
||||||
employees.emp_type as emp_type,
|
employees.emp_type as emp_type,
|
||||||
@ -367,7 +366,23 @@ class EmployeePolicyModel extends Model
|
|||||||
employees.relationship as emp_relationship,
|
employees.relationship as emp_relationship,
|
||||||
'C' as event_type_data,
|
'C' as event_type_data,
|
||||||
|
|
||||||
employees.doj AS emp_doj,
|
CASE
|
||||||
|
WHEN emp_endorsement.field_name = 'dob' THEN
|
||||||
|
DATE_FORMAT(emp_endorsement.old_value, '%d-%b-%Y')
|
||||||
|
ELSE
|
||||||
|
emp_endorsement.old_value
|
||||||
|
END AS old_value,
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN emp_endorsement.field_name = 'dob' THEN
|
||||||
|
DATE_FORMAT(emp_endorsement.new_value, '%d-%b-%Y')
|
||||||
|
ELSE
|
||||||
|
emp_endorsement.new_value
|
||||||
|
END AS new_value,
|
||||||
|
|
||||||
|
DATE_FORMAT(employees.dob, '%d-%b-%Y') AS emp_dob,
|
||||||
|
DATE_FORMAT(employees.doj, '%d-%b-%Y') AS emp_doj,
|
||||||
|
|
||||||
employees.mobile AS emp_mobile,
|
employees.mobile AS emp_mobile,
|
||||||
employees.email_corporate AS emp_email_c,
|
employees.email_corporate AS emp_email_c,
|
||||||
employees.email_personal AS emp_email_p,
|
employees.email_personal AS emp_email_p,
|
||||||
@ -407,19 +422,21 @@ class EmployeePolicyModel extends Model
|
|||||||
AND employee_polices.status = 'active'
|
AND employee_polices.status = 'active'
|
||||||
AND employees.is_active = 1
|
AND employees.is_active = 1
|
||||||
AND employees.emp_status = 'active'
|
AND employees.emp_status = 'active'
|
||||||
AND (employee_polices.tpa_id IS NOT NULL AND employee_polices.tpa_id != '')
|
|
||||||
AND (employee_polices.uhid IS NOT NULL AND employee_polices.uhid != '')
|
|
||||||
$endorsement_condition";
|
$endorsement_condition";
|
||||||
|
|
||||||
// Execute the raw query
|
// Execute the raw query
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
// Get the result set
|
// Get the result set
|
||||||
$result = $query->getResult();
|
if($return_type == 1){
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
}else{
|
||||||
|
$results = $query->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
// dd($this->db->getLastQuery(), $result);
|
// dd($this->db->getLastQuery(), $result);
|
||||||
|
|
||||||
return $result;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,10 +781,10 @@ class EmployeePolicyModel extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
$status_condition = "{$insurer_or_tpa}" === 'tpa'
|
$status_condition = "{$insurer_or_tpa}" === 'tpa'
|
||||||
? "employee_polices.status = 'inactive' AND employees.emp_status = 'inactive'"
|
? "employee_polices.status = 'active' AND employees.emp_status = 'active'"
|
||||||
: "employee_polices.status = 'active' AND employees.emp_status = 'active'";
|
: "employee_polices.status = 'active' AND employees.emp_status = 'active'";
|
||||||
|
|
||||||
$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 = '')";
|
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
|
||||||
|
|
||||||
$query = $this->db->query("
|
$query = $this->db->query("
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
@ -776,7 +793,6 @@ class EmployeePolicyModel extends Model
|
|||||||
employee_polices.id as primaryKey,
|
employee_polices.id as primaryKey,
|
||||||
employees.name AS emp_name,
|
employees.name AS emp_name,
|
||||||
employees.emp_code AS emp_code,
|
employees.emp_code AS emp_code,
|
||||||
employees.dob AS emp_dob,
|
|
||||||
employees.gender AS emp_gender,
|
employees.gender AS emp_gender,
|
||||||
employees.relationship AS emp_relationship,
|
employees.relationship AS emp_relationship,
|
||||||
employees.relationship_code AS emp_relationship_code,
|
employees.relationship_code AS emp_relationship_code,
|
||||||
@ -784,7 +800,6 @@ class EmployeePolicyModel extends Model
|
|||||||
'D' as event_type_data,
|
'D' as event_type_data,
|
||||||
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
|
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
|
||||||
|
|
||||||
employees.doj AS emp_doj,
|
|
||||||
employees.mobile AS emp_mobile,
|
employees.mobile AS emp_mobile,
|
||||||
employees.email_corporate AS emp_email_c,
|
employees.email_corporate AS emp_email_c,
|
||||||
employees.email_personal AS emp_email_p,
|
employees.email_personal AS emp_email_p,
|
||||||
@ -794,7 +809,6 @@ class EmployeePolicyModel extends Model
|
|||||||
|
|
||||||
employee_polices.basic_cover_si,
|
employee_polices.basic_cover_si,
|
||||||
employee_polices.uhid as uhid,
|
employee_polices.uhid as uhid,
|
||||||
employee_polices.policy_end_date,
|
|
||||||
employee_polices.rata_premimum as premium,
|
employee_polices.rata_premimum as premium,
|
||||||
employee_polices.claim_status,
|
employee_polices.claim_status,
|
||||||
|
|
||||||
@ -804,29 +818,34 @@ class EmployeePolicyModel extends Model
|
|||||||
|
|
||||||
deletiondata.empstatus,
|
deletiondata.empstatus,
|
||||||
deletiondata.changeevent,
|
deletiondata.changeevent,
|
||||||
deletiondata.dateofexit,
|
|
||||||
deletiondata.reasonforexit,
|
deletiondata.reasonforexit,
|
||||||
deletiondata.status,
|
deletiondata.status,
|
||||||
deletiondata.claimstatus,
|
deletiondata.claimstatus,
|
||||||
|
|
||||||
|
DATE_FORMAT(employees.dob, '%d-%b-%Y') AS emp_dob,
|
||||||
|
DATE_FORMAT(employees.doj, '%d-%b-%Y') AS emp_doj,
|
||||||
|
DATE_FORMAT(employee_polices.policy_end_date, '%d-%b-%Y') AS policy_end_date,
|
||||||
|
DATE_FORMAT(deletiondata.dateofexit, '%d-%b-%Y') AS dateofexit,
|
||||||
|
|
||||||
|
|
||||||
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + '$add_one_day' AS no_of_days,
|
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + '$add_one_day' AS no_of_days,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365, 2)
|
ROUND((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365, 2)
|
||||||
ELSE
|
ELSE
|
||||||
0
|
0
|
||||||
END AS pro_rata_premium,
|
END AS pro_rata_premium,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18, 2)
|
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18, 2)
|
||||||
ELSE
|
ELSE
|
||||||
0
|
0
|
||||||
END AS gst,
|
END AS gst,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) +
|
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) +
|
||||||
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
||||||
ELSE
|
ELSE
|
||||||
@ -834,7 +853,8 @@ class EmployeePolicyModel extends Model
|
|||||||
END AS total,
|
END AS total,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
|
|
||||||
'No claim'
|
'No claim'
|
||||||
ELSE
|
ELSE
|
||||||
'Claim'
|
'Claim'
|
||||||
@ -1536,21 +1556,21 @@ class EmployeePolicyModel extends Model
|
|||||||
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + '$add_one_day' AS no_of_days,
|
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + '$add_one_day' AS no_of_days,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365, 2)
|
ROUND((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365, 2)
|
||||||
ELSE
|
ELSE
|
||||||
0
|
0
|
||||||
END AS pro_rata_premium,
|
END AS pro_rata_premium,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18, 2)
|
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18, 2)
|
||||||
ELSE
|
ELSE
|
||||||
0
|
0
|
||||||
END AS gst,
|
END AS gst,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) +
|
ROUND(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) +
|
||||||
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
||||||
ELSE
|
ELSE
|
||||||
@ -1558,7 +1578,7 @@ class EmployeePolicyModel extends Model
|
|||||||
END AS total,
|
END AS total,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN deletiondata.claimstatus = 0 THEN
|
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||||
'No claim'
|
'No claim'
|
||||||
ELSE
|
ELSE
|
||||||
'Claim'
|
'Claim'
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
<th class="font-weight-medium">(₹)Amount</th>
|
<th class="font-weight-medium">(₹)Amount</th>
|
||||||
<th class="font-weight-medium">User/Time</th>
|
<th class="font-weight-medium">User/Time</th>
|
||||||
<th class="font-weight-medium">Status</th>
|
<th class="font-weight-medium">Status</th>
|
||||||
|
<th class="font-weight-medium">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@ -69,6 +70,7 @@
|
|||||||
<td class="reload">
|
<td class="reload">
|
||||||
<?php echo change_date_format($file['created_at'],'Y-m-d H:i:s', 'd M Y h:i a') ?> by <?php echo get_username($file['created_by']) ?>
|
<?php echo change_date_format($file['created_at'],'Y-m-d H:i:s', 'd M Y h:i a') ?> by <?php echo get_username($file['created_by']) ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php if ($file['status'] == 'failed') { ?>
|
<?php if ($file['status'] == 'failed') { ?>
|
||||||
<?php echo $file['status']; ?>
|
<?php echo $file['status']; ?>
|
||||||
@ -77,70 +79,81 @@
|
|||||||
class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank"
|
class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank"
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to show the error"></a>
|
data-toggle="tooltip" data-placement="top" title="Click to show the error"></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'partially success') { ?>
|
<?php } else if ($file['status'] == 'partially success') { ?>
|
||||||
|
|
||||||
<?php echo $file['status']; ?>
|
<?php echo $file['status']; ?>
|
||||||
<?php if ($file['error_data'] != 0) { ?>
|
<?php if ($file['error_data'] != 0) { ?>
|
||||||
|
|
||||||
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } else if ($file['status'] == 'failed-1') { ?>
|
<?php } else if ($file['status'] == 'failed-1') { ?>
|
||||||
|
|
||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top"
|
data-placement="top"
|
||||||
title="<?= $file['event_type'] == 'inception' ? 'The list of employees provided has already been updated with the TPA ID.' : 'The list of employees provided has already been updated with the ENDORSEMENT ID.' ?> "></a>
|
title="<?= $file['event_type'] == 'inception' ? 'The list of employees provided has already been updated with the TPA ID.' : 'The list of employees provided has already been updated with the ENDORSEMENT ID.' ?> "></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'failed-2') { ?>
|
<?php } else if ($file['status'] == 'failed-2') { ?>
|
||||||
|
|
||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top"
|
data-placement="top"
|
||||||
title="<?= $file['event_type'] == 'inception' ? 'The list of employees provided has already been updated with the UHID.' : 'The list of employees provided has already been updated with the ENDORSEMENT ID.' ?>"></a>
|
title="<?= $file['event_type'] == 'inception' ? 'The list of employees provided has already been updated with the UHID.' : 'The list of employees provided has already been updated with the ENDORSEMENT ID.' ?>"></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'failed-3') { ?>
|
<?php } else if ($file['status'] == 'failed-3') { ?>
|
||||||
|
|
||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top"
|
data-placement="top"
|
||||||
title="The Excel record count exceeds the DB record count."></a>
|
title="The Excel record count exceeds the DB record count."></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'failed-4') { ?>
|
<?php } else if ($file['status'] == 'failed-4') { ?>
|
||||||
|
|
||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top" title="Physical File Not Found."></a>
|
data-placement="top" title="Physical File Not Found."></a>
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'failed-5') { ?>
|
<?php } else if ($file['status'] == 'failed-5') { ?>
|
||||||
|
|
||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top" title="Wrong File Uploaded"></a>
|
data-placement="top" title="Wrong File Uploaded"></a>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<?php echo $file['status']; ?>
|
<?php echo $file['status']; ?>
|
||||||
|
|
||||||
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>"
|
|
||||||
class="fa fa-download" style="color: #000;" aria-hidden="true" target="_blank"
|
|
||||||
data-toggle="tooltip" data-placement="top" title="Click to Download"></a>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="btn-group dropdown">
|
||||||
|
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm"
|
||||||
|
data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
|
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
|
||||||
|
<?php if (str_starts_with($file['status'], 'failed')) { ?>
|
||||||
|
<a href="#"
|
||||||
|
data-id="<?= $file['id'] ?>"
|
||||||
|
data-client_id="<?= $file['client_id'] ?>"
|
||||||
|
data-client_policy_id="<?= $file['client_policy_id'] ?>"
|
||||||
|
data-insurer_or_tpa="<?= $file['insurer_or_tpa'] ?>"
|
||||||
|
data-event_type="<?= $file['event_type'] ?>"
|
||||||
|
data-actions="<?= $file['actions'] ?>"
|
||||||
|
data-client_branch_id="<?= $file['client_branch_id'] ?>"
|
||||||
|
|
||||||
|
onclick="getBatchFileData(this)" class="dropdown-item upload_button" ><i class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if (str_starts_with($file['status'], 'failed')) { ?>
|
||||||
|
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>" class="dropdown-item" style="color: #000;" aria-hidden="true" target="_blank" ><i class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
} ?>
|
} ?>
|
||||||
@ -153,7 +166,36 @@
|
|||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
|
||||||
|
<!-- Center modal content for reupload file-->
|
||||||
|
<div class="modal fade" id="batch_file_upload_modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="myCenterModalLabel">Re-Upload the file</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form class="parsley-examples" id="re_upload_import_export_excel_form" action="<?php echo base_url() . 'util/import-export' ?>" method="post" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" id="batch_file_client_id" name="client_id">
|
||||||
|
<input type="hidden" id="batch_file_policy_id" name="client_policy_id">
|
||||||
|
<input type="hidden" id="batch_file_branch_id" name="client_branch_id">
|
||||||
|
<input type="hidden" id="batch_file_insurer_or_tpa" name="insurer_or_tpa">
|
||||||
|
<input type="hidden" id="batch_file_action_type" name="action_type">
|
||||||
|
<input type="hidden" id="batch_file_event_type" name="event_type">
|
||||||
|
<input type="file" id="import_file_data" name="import_file_data" required
|
||||||
|
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary">Upload</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#datatable-buttons').DataTable({
|
$('#datatable-buttons').DataTable({
|
||||||
@ -181,9 +223,7 @@
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Function to format a number in Indian Rupees format
|
// Function to format a number in Indian Rupees format
|
||||||
function formatNumberInIndianRupees(number) {
|
function formatNumberInIndianRupees(number) {
|
||||||
|
|
||||||
@ -222,4 +262,73 @@
|
|||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
function getBatchFileData(input){
|
||||||
|
|
||||||
|
let client_id = $(input).data('client_id')
|
||||||
|
let client_policy_id = $(input).data('client_policy_id')
|
||||||
|
let client_branch_id = $(input).data('client_branch_id')
|
||||||
|
let insurer_or_tpa = $(input).data('insurer_or_tpa')
|
||||||
|
let event_type = $(input).data('event_type')
|
||||||
|
let actions = $(input).data('actions')
|
||||||
|
|
||||||
|
console.log('client_id', client_id);
|
||||||
|
console.log('client_policy_id', client_policy_id);
|
||||||
|
console.log('client_branch_id', client_branch_id);
|
||||||
|
console.log('insurer_or_tpa', insurer_or_tpa);
|
||||||
|
console.log('event_type', event_type);
|
||||||
|
console.log('actions', actions);
|
||||||
|
|
||||||
|
$('#batch_file_client_id').val(client_id);
|
||||||
|
$('#batch_file_policy_id').val(client_policy_id);
|
||||||
|
$('#batch_file_branch_id').val(client_branch_id);
|
||||||
|
$('#batch_file_insurer_or_tpa').val(insurer_or_tpa);
|
||||||
|
$('#batch_file_action_type').val(actions);
|
||||||
|
$('#batch_file_event_type').val(event_type);
|
||||||
|
|
||||||
|
|
||||||
|
var myModal = new bootstrap.Modal(document.getElementById('batch_file_upload_modal'));
|
||||||
|
myModal.show();
|
||||||
|
|
||||||
|
|
||||||
|
// $('.loader').fadeIn();
|
||||||
|
// $('.loader-mask').fadeIn();
|
||||||
|
|
||||||
|
// console.log('file_id', file_id);
|
||||||
|
// let url = '<?= base_url('util/getBatchFileData') ?>';
|
||||||
|
|
||||||
|
// // Data to send in the AJAX request
|
||||||
|
// let requestData = {
|
||||||
|
// file_id: file_id,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // Send AJAX request
|
||||||
|
// sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||||
|
|
||||||
|
// console.log('Data fetched successfully:', response);
|
||||||
|
// console.log('Data fetched successfully:', response.batch_file_data);
|
||||||
|
// console.log('response.batch_file_data.client_branch_id:', response.batch_file_data.client_branch_id);
|
||||||
|
|
||||||
|
// if (response.status == true) {
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
// toastr.warning(response.message || 'Unable to fetch data', 'WARNING');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $('.loader').fadeOut();
|
||||||
|
// $('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
|
// }, function(xhr, status, error) {
|
||||||
|
// console.error('Error fetching data:', error);
|
||||||
|
// console.error(xhr.responseText);
|
||||||
|
// toastr.error('An error occurred while checking the SI amount.', 'ERROR');
|
||||||
|
|
||||||
|
// $('.loader').fadeOut();
|
||||||
|
// $('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
// // addRow();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -38,6 +38,12 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.readonly-select {
|
||||||
|
pointer-events: none;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php $pro_rata_total = 0; $gst_total = 0 ?>
|
<?php $pro_rata_total = 0; $gst_total = 0 ?>
|
||||||
@ -141,8 +147,14 @@
|
|||||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
|
||||||
<?php if(($employee['emp_status'] == 'draft' || $employee['emp_status'] == 'enrolled') && ($employee['status'] == 'draft' || $employee['status'] == 'enrolled')) { ?>
|
<?php
|
||||||
<a class="dropdown-item" onclick="get_emp_master_data_for_update(this, '<?= $employee['employee_id'];?>')" ><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
if (
|
||||||
|
(in_array($employee['emp_status'], ['draft', 'enrolled']) && in_array($employee['status'], ['draft', 'enrolled'])) ||
|
||||||
|
($employee['status'] == 'active' && $employee['emp_status'] == 'active' && (empty($employee['email_corporate']) || empty($employee['mobile'])))
|
||||||
|
) {
|
||||||
|
?>
|
||||||
|
|
||||||
|
<a class="dropdown-item" onclick="get_emp_master_data_for_update(this, '<?= $employee['employee_id'];?>', '<?= $employee['status'];?>')" ><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if($employee['policy_type'] == 'GMC' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
<?php if($employee['policy_type'] == 'GMC' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||||
@ -238,12 +250,12 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="email">Email<span class="text-danger">*</span></label>
|
<label for="email">Email<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="email_corporate" placeholder="Enter Email" name="email_corporate" data-parsley-trigger="change" data-parsley-type="email" required>
|
<input type="text" class="form-control" id="email_corporate" placeholder="Enter Email" name="email_corporate" data-parsley-trigger="change" data-parsley-type="email" onchange="validateInput(this, 'employees', 'email_corporate')" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="mobile">Mobile Number<span class="text-danger">*</span></label>
|
<label for="mobile">Mobile Number<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="mobile" placeholder="Enter Mobile Number" name="mobile" onkeypress = "return onlyNumbers(event)" maxlength="10" minlength="10" required>
|
<input type="text" class="form-control" id="mobile" placeholder="Enter Mobile Number" name="mobile" onkeypress = "return onlyNumbers(event)" maxlength="10" minlength="10" onchange="validateInput(this, 'employees', 'mobile')" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -339,10 +351,21 @@
|
|||||||
$('#email_corporate').val(data.email_corporate);
|
$('#email_corporate').val(data.email_corporate);
|
||||||
$('#mobile').val(data.mobile);
|
$('#mobile').val(data.mobile);
|
||||||
|
|
||||||
|
if(data.emp_status == "active"){
|
||||||
|
$('#name').prop('disabled', true);
|
||||||
|
$('#gender').prop('disabled', true);
|
||||||
|
$('#dob').prop('disabled', true);
|
||||||
|
}else{
|
||||||
|
$('#name').prop('disabled', false);
|
||||||
|
$('#gender').prop('disabled', false);
|
||||||
|
$('#dob').prop('disabled', false);
|
||||||
|
}
|
||||||
|
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
|
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$('#employee_primary_id').val('');
|
$('#employee_primary_id').val('');
|
||||||
$('#emp_code_for_edit').val('');
|
$('#emp_code_for_edit').val('');
|
||||||
$('#name').val('');
|
$('#name').val('');
|
||||||
@ -351,6 +374,10 @@
|
|||||||
$('#email_corporate').val('');
|
$('#email_corporate').val('');
|
||||||
$('#mobile').val('');
|
$('#mobile').val('');
|
||||||
|
|
||||||
|
$('#name').prop('disabled', false);
|
||||||
|
$('#gender').prop('disabled', false);
|
||||||
|
$('#dob').prop('disabled', false);
|
||||||
|
|
||||||
toastr.warning(res.message, 'WARNING');
|
toastr.warning(res.message, 'WARNING');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -489,4 +516,23 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateInput(input, table, field){
|
||||||
|
|
||||||
|
let value = $(input).val();
|
||||||
|
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||||
|
|
||||||
|
let message = "Value is duplicate!";
|
||||||
|
if(label){
|
||||||
|
message = label + " already exists!";
|
||||||
|
}
|
||||||
|
|
||||||
|
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||||
|
if (isDuplicate) {
|
||||||
|
toastr.warning(message, 'WARNING');
|
||||||
|
$(input).val('')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="branch_name">Account Maneger summary mail</label>
|
<label for="branch_name">Account Manager summary mail</label>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
|
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
|
||||||
<span class="slider round" style="height: 27px;"></span>
|
<span class="slider round" style="height: 27px;"></span>
|
||||||
@ -547,7 +547,7 @@
|
|||||||
<label for="emp_code">Template Name</label>
|
<label for="emp_code">Template Name</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
<input type="text" id="template_name" name="template_name" value="Account Maneger Summary Mail" readonly class="form-control" placeholder="Template Name">
|
<input type="text" id="template_name" name="template_name" value="Account Manager Summary Mail" readonly class="form-control" placeholder="Template Name">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1222,7 +1222,7 @@
|
|||||||
console.log('get Mail Template Data', res);
|
console.log('get Mail Template Data', res);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
$(`#${template_name}_form`).find('#template_name').val(snakeCaseToCamelCase(res.template_name));
|
// $(`#${template_name}_form`).find('#template_name').val(snakeCaseToCamelCase(res.template_name));
|
||||||
$(`#${template_name}_form`).find('#subject').val(res.subject);
|
$(`#${template_name}_form`).find('#subject').val(res.subject);
|
||||||
$(`#${template_name}_form`).find('.jodit-wysiwyg').html(res.mail_content);
|
$(`#${template_name}_form`).find('.jodit-wysiwyg').html(res.mail_content);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user