Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
144ca73d4b
@ -3831,14 +3831,15 @@ class ClientController extends AdminController
|
||||
|
||||
public function sendextraparam()
|
||||
{
|
||||
// $batch_data = [
|
||||
// 'client_id' => 17,
|
||||
// 'client_policy_id' => 30,
|
||||
// 'client_branch_id' => 18,
|
||||
// ];
|
||||
$batch_data = [
|
||||
'client_id' => 17,
|
||||
'client_policy_id' => 30,
|
||||
'client_branch_id' => 18,
|
||||
'event_type' => "inception",
|
||||
];
|
||||
|
||||
// $batch_data['insurer_or_tpa'] = 'insurer';
|
||||
// $batch_data['insurer_or_tpa'] = 'tpa';
|
||||
$batch_data['insurer_or_tpa'] = 'tpa';
|
||||
|
||||
|
||||
// dd($this->request);
|
||||
@ -3881,6 +3882,7 @@ class ClientController extends AdminController
|
||||
// $EmpDataServiceController->importInceptionFileValidation(['file_id' => 162]);
|
||||
// $EmpDataServiceController->importDeletionValidation(['file_id' => 171]);
|
||||
// $EmpDataServiceController->importDeletionUpdateEndorsementID(['file_id' => 171]);
|
||||
// $EmpDataServiceController->importCorrectionUpdateEndorsementID(['file_id' => 188]);
|
||||
$array = [
|
||||
"employeeIds" => ["12800", "12798", "12797", "12799"],
|
||||
"client_id" => "159",
|
||||
@ -3894,11 +3896,14 @@ class ClientController extends AdminController
|
||||
"user_id" => "1"
|
||||
];
|
||||
|
||||
$EmpDataServiceController->cashDepositCalculationForDeletion($array);
|
||||
// $EmpDataServiceController->cashDepositCalculationForDeletion($array);
|
||||
|
||||
// $employeeRestController = new EmployeeServiceController();
|
||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 757]);
|
||||
|
||||
// $result = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($batch_data);
|
||||
// dd(db_connect()->getLastQuery());
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -157,7 +157,14 @@ class EmpDataServiceController extends BaseController
|
||||
return 5;
|
||||
}
|
||||
|
||||
$cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->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();
|
||||
|
||||
// dd(db_connect()->getLastQuery(), $cash_balance);
|
||||
|
||||
if ($cash_balance == null) {
|
||||
$balance = $this->CDMasterModel
|
||||
@ -289,7 +296,7 @@ class EmpDataServiceController extends BaseController
|
||||
],
|
||||
[
|
||||
'column_index' => 14,
|
||||
'column_name' => 'UHID',
|
||||
'column_name' => 'RISK ID',
|
||||
'db_column_name' => 'uhid'
|
||||
],
|
||||
// [
|
||||
@ -399,7 +406,7 @@ class EmpDataServiceController extends BaseController
|
||||
],
|
||||
[
|
||||
'column_index' => 14,
|
||||
'column_name' => 'UHID',
|
||||
'column_name' => 'RISK ID',
|
||||
'db_column_name' => 'uhid'
|
||||
],
|
||||
// [
|
||||
@ -540,6 +547,7 @@ class EmpDataServiceController extends BaseController
|
||||
$ids = [];
|
||||
|
||||
$objects = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data);
|
||||
// dd(db_connect()->getLastQuery(),$objects);
|
||||
|
||||
foreach ($objects as $obj) {
|
||||
$ids[] = $obj->id;
|
||||
@ -552,33 +560,13 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
if ($count == 0) {
|
||||
$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->myLogger->logme('error', 'Correction export file name : {data}', ['data' => $export_data['file_name']]);
|
||||
|
||||
|
||||
// get excel export format structure array
|
||||
$template_json = $this->clientPolicyModel
|
||||
->select('insurer_excel_export_template.jsoncolumns')
|
||||
->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id')
|
||||
->where('client_policy.id', $export_data['client_policy_id'])
|
||||
->where('insurer_excel_export_template.event_name', $export_data['event_type'])
|
||||
->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024
|
||||
->where('insurer_excel_export_template.type_name', $export_data['actions'])
|
||||
->first();
|
||||
|
||||
if(!empty($template_json) && $template_json != null){
|
||||
$excel_header_columns = json_decode($template_json['jsoncolumns'], true);
|
||||
}else{
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
||||
|
||||
$excel_header_columns = [
|
||||
@ -586,7 +574,7 @@ class EmpDataServiceController extends BaseController
|
||||
['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' => 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'],
|
||||
@ -594,6 +582,23 @@ class EmpDataServiceController extends BaseController
|
||||
['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
|
||||
$template_json = $this->clientPolicyModel
|
||||
->select('insurer_excel_export_template.jsoncolumns')
|
||||
->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id')
|
||||
->where('client_policy.id', $export_data['client_policy_id'])
|
||||
->where('insurer_excel_export_template.event_name', $export_data['event_type'])
|
||||
->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024
|
||||
->where('insurer_excel_export_template.type_name', $export_data['actions'])
|
||||
->first();
|
||||
|
||||
if(!empty($template_json) && $template_json != null){
|
||||
$excel_header_columns = json_decode($template_json['jsoncolumns'], true);
|
||||
}else{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -649,7 +654,12 @@ class EmpDataServiceController extends BaseController
|
||||
return 1;
|
||||
}
|
||||
|
||||
$cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->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) {
|
||||
|
||||
@ -790,7 +800,7 @@ class EmpDataServiceController extends BaseController
|
||||
$ids = [];
|
||||
|
||||
$objects = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($export_data);
|
||||
|
||||
// dd(db_connect()->getLastQuery());
|
||||
// dd($objects);
|
||||
|
||||
$totals = 0;
|
||||
@ -816,22 +826,6 @@ class EmpDataServiceController extends BaseController
|
||||
$this->removeOldExportInfoFromBatchFile($export_data);
|
||||
$this->myLogger->logme('error', 'Deletion export file name : {data}', ['data' => $export_data['file_name']]);
|
||||
|
||||
// get excel export format structure array
|
||||
$template_json = $this->clientPolicyModel
|
||||
->select('insurer_excel_export_template.jsoncolumns')
|
||||
->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id')
|
||||
->where('client_policy.id', $export_data['client_policy_id'])
|
||||
->where('insurer_excel_export_template.event_name', $export_data['event_type'])
|
||||
->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024
|
||||
->where('insurer_excel_export_template.type_name', $export_data['actions'])
|
||||
->first();
|
||||
|
||||
if(!empty($template_json) && $template_json != null){
|
||||
$excel_header_columns = json_decode($template_json['jsoncolumns'], true);
|
||||
}else{
|
||||
return 6;
|
||||
}
|
||||
|
||||
if( $export_data['insurer_or_tpa'] == 'tpa'){
|
||||
|
||||
$excel_header_columns = [
|
||||
@ -840,19 +834,37 @@ class EmpDataServiceController extends BaseController
|
||||
['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' => 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' => 'date_of_leaving'],
|
||||
['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' => null],
|
||||
['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
|
||||
$template_json = $this->clientPolicyModel
|
||||
->select('insurer_excel_export_template.jsoncolumns')
|
||||
->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id')
|
||||
->where('client_policy.id', $export_data['client_policy_id'])
|
||||
->where('insurer_excel_export_template.event_name', $export_data['event_type'])
|
||||
->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024
|
||||
->where('insurer_excel_export_template.type_name', $export_data['actions'])
|
||||
->first();
|
||||
|
||||
if(!empty($template_json) && $template_json != null){
|
||||
$excel_header_columns = json_decode($template_json['jsoncolumns'], true);
|
||||
}else{
|
||||
return 6;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$excel_data_info = generate_insurer_based_excel($excel_header_columns, $objects);
|
||||
@ -952,7 +964,12 @@ class EmpDataServiceController extends BaseController
|
||||
return 5;
|
||||
}
|
||||
|
||||
$cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->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
|
||||
@ -1338,7 +1355,7 @@ class EmpDataServiceController extends BaseController
|
||||
'POLICY END DATE',
|
||||
'NO OF DAYS',
|
||||
'TPA ID',
|
||||
'UHID',
|
||||
'RISK ID',
|
||||
// 'PREMIUM',
|
||||
'PRO RATA PREMIUM',
|
||||
'GST',
|
||||
@ -1367,7 +1384,6 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$emp_count = count($excel_data);
|
||||
|
||||
//get the employee data for excel file validation
|
||||
@ -1444,6 +1460,8 @@ class EmpDataServiceController extends BaseController
|
||||
$errors = []; // Initialize an array to store errors
|
||||
$missing_id = [];
|
||||
$batch_list_id = [];
|
||||
$tpa_id_all = []; //this array to store all TPA ID
|
||||
$tpa_id_duplicate = []; //store duplicate TPA ID
|
||||
|
||||
foreach ($employee_data as $key => $emp_value) {
|
||||
|
||||
@ -1453,6 +1471,36 @@ class EmpDataServiceController extends BaseController
|
||||
break;
|
||||
}
|
||||
|
||||
//--- TPA ID Duplicate check start ---
|
||||
|
||||
$current_tpa_id = $excel_data[$key][13];
|
||||
|
||||
if (isset($tpa_id_all[$current_tpa_id])) {
|
||||
|
||||
// Add the current row to errors
|
||||
$errors[$key][] = [
|
||||
'row' => $key,
|
||||
'column' => 13,
|
||||
'db_data' => "Duplicate TPA ID Found",
|
||||
'excel_data' => $current_tpa_id
|
||||
];
|
||||
|
||||
// Add all existing rows with the same TPA ID to errors
|
||||
foreach ($tpa_id_all[$current_tpa_id] as $existing_row) {
|
||||
$errors[$existing_row][] = [
|
||||
'row' => $existing_row,
|
||||
'column' => 13,
|
||||
'db_data' => "Duplicate TPA ID Found",
|
||||
'excel_data' => $current_tpa_id
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
$tpa_id_all[$current_tpa_id][] = $key;
|
||||
}
|
||||
|
||||
//--- TPA ID Duplicate check end ---
|
||||
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
|
||||
if ($excel_data[$key][13] === null) {
|
||||
@ -1610,7 +1658,8 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_list_id[] = $emp_value['primaryKey'];
|
||||
}
|
||||
|
||||
|
||||
// dd($errors);
|
||||
|
||||
$error_count = count($errors);
|
||||
$json_errors = json_encode($errors);
|
||||
|
||||
@ -1932,7 +1981,6 @@ class EmpDataServiceController extends BaseController
|
||||
//Endorsement Correction
|
||||
public function importCorrectionValidation($params)
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error', 'Correction File Validation -- Function called');
|
||||
|
||||
$file_id = $params['file_id'];
|
||||
@ -1944,6 +1992,14 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_code = $file['batch_code'];
|
||||
$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'];
|
||||
|
||||
if (!file_exists($file_name_with_path)) {
|
||||
@ -1961,7 +2017,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'];
|
||||
|
||||
|
||||
foreach ($headers as $key => $value) {
|
||||
if($excel_header[$key] != $value){
|
||||
$data = [
|
||||
@ -1978,45 +2033,9 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$endorsement_data = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($ref_data, 1);
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
// dd($endorsement_data, $excel_data);
|
||||
|
||||
if ($endorsement_data == null || empty($endorsement_data)) {
|
||||
|
||||
@ -2052,8 +2071,6 @@ class EmpDataServiceController extends BaseController
|
||||
$this->myLogger->logme('error', 'correctionFileValidation excel file count partially : {data}', ['data' => $partially_updated_data]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($endorsement_data_count < $excel_data_count) {
|
||||
|
||||
$data = [
|
||||
@ -2069,7 +2086,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;
|
||||
}
|
||||
|
||||
|
||||
$errors = []; // Initialize an array to store errors
|
||||
$missing_id = [];
|
||||
$batch_list_id = [];
|
||||
@ -2159,17 +2175,14 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_list_id[] = $endorsement_value['primaryKey'];
|
||||
}
|
||||
|
||||
|
||||
$error_count = count($errors);
|
||||
$json_errors = json_encode($errors);
|
||||
|
||||
|
||||
$missing_id_count = count($missing_id);
|
||||
$json_missing_id = json_encode($missing_id);
|
||||
|
||||
// dd($error_count, $missing_id_count, $json_errors, $json_missing_id, $batch_list_id);
|
||||
|
||||
|
||||
if ($missing_id_count > 0) {
|
||||
|
||||
$data = [
|
||||
@ -2188,7 +2201,6 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($error_count > 0) {
|
||||
|
||||
$data = [
|
||||
@ -2234,7 +2246,8 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function importCorrectionUpdateEndorsementID($params){
|
||||
public function importCorrectionUpdateEndorsementID($params)
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error', 'importCorrectionUpdateEndorsementID called');
|
||||
|
||||
@ -2286,7 +2299,6 @@ class EmpDataServiceController extends BaseController
|
||||
$emp_count = count($excel_data);
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
|
||||
foreach ($excel_data as $key => $value) {
|
||||
|
||||
$emp_code = $value[0];
|
||||
@ -2294,28 +2306,44 @@ class EmpDataServiceController extends BaseController
|
||||
$endorsement_id[] = $value[10];
|
||||
$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
|
||||
->select('emp_endorsement.*, employees.id as emp_id')
|
||||
->join('employees', 'employees.id = emp_endorsement.pk')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.client_branch_id', $client_branch_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->where('emp_endorsement.old_value', $old_value)
|
||||
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', 'active')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.emp_status', 'active')
|
||||
->where("emp_endorsement.is_active", 1)
|
||||
->where("emp_endorsement.status !=", "truncated")
|
||||
->first();
|
||||
->select('emp_endorsement.*, employees.id as emp_id')
|
||||
->join('employees', 'employees.id = emp_endorsement.pk')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.client_branch_id', $client_branch_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->where('emp_endorsement.old_value', $old_value)
|
||||
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', 'active')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.emp_status', 'active')
|
||||
->where("emp_endorsement.is_active", 1)
|
||||
->where("emp_endorsement.status !=", "truncated")
|
||||
->first();
|
||||
|
||||
// print_r($result); die;
|
||||
|
||||
if (isset($result['id']) && $result['id'] !== null) {
|
||||
// return $result;
|
||||
$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]);
|
||||
$endorsement_details[] = array('group_key' => $result['group_key'], 'id' => $result['id'], 'endorsement_id' => $value[10], 'status' => 'complete');
|
||||
}
|
||||
@ -2356,7 +2384,6 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Endorsement SIEnhancement
|
||||
public function importSIEnhancementValidation($params)
|
||||
{
|
||||
@ -3379,7 +3406,7 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$enrollment_file_id = $result['file_id']; //files table primary key
|
||||
$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']);
|
||||
$emp_endorsement_table_data[] = array('id' => $result['emp_endorsement_primarykey'], 'group_key' => $result['group_key'], 'endorsement_id' => $value[15], 'status' => 'complete');
|
||||
}
|
||||
@ -4223,7 +4250,7 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$result[] = array(
|
||||
"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(
|
||||
@ -4389,6 +4416,10 @@ class EmpDataServiceController extends BaseController
|
||||
employees.email_corporate,
|
||||
employees.name,
|
||||
employees.mobile,
|
||||
employees.basic_cover_si,
|
||||
|
||||
cp.policy_type_id,
|
||||
cp.is_addon,
|
||||
|
||||
employee_polices.id as emp_policy_id,
|
||||
employee_polices.client_policy_id,
|
||||
@ -4396,6 +4427,7 @@ class EmpDataServiceController extends BaseController
|
||||
employee_polices.tpa_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.is_active', '1')
|
||||
->where('employee_polices.status', 'active')
|
||||
@ -4406,7 +4438,8 @@ class EmpDataServiceController extends BaseController
|
||||
if ($emp_details) {
|
||||
$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 = [
|
||||
'rand_string' => $emp_details['rand_string'],
|
||||
'tpa_id' => $emp_details['tpa_id'],
|
||||
@ -4428,6 +4461,7 @@ class EmpDataServiceController extends BaseController
|
||||
// $wholeMailData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
|
||||
$count++;
|
||||
}
|
||||
|
||||
$processedCount++;
|
||||
|
||||
// Send batch emails or handle single email
|
||||
|
||||
@ -313,14 +313,8 @@ class EmployeeController extends AdminController
|
||||
'c.short_name',
|
||||
'cb.branch_name',
|
||||
'cp.id as client_policy_id',
|
||||
'(SELECT COUNT(*)
|
||||
FROM employees e
|
||||
JOIN employee_polices ep ON e.id = ep.employee_id
|
||||
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as employee_count',
|
||||
'(SELECT SUM(ep.rata_premimum) + SUM(ep.gst)
|
||||
FROM employees e
|
||||
JOIN employee_polices ep ON e.id = ep.employee_id
|
||||
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as total',
|
||||
'"0" as employee_count',
|
||||
'"0" as total',
|
||||
'policy_type.policy_type' ,
|
||||
'cp.policy_no' ,
|
||||
])
|
||||
@ -335,20 +329,46 @@ class EmployeeController extends AdminController
|
||||
->find();
|
||||
// dd($data['fileList']);
|
||||
|
||||
$data['batch_list'] = $this->batchFileModel->select(
|
||||
'batch_files.*,
|
||||
$data['batch_list'] = $this->batchFileModel->select("
|
||||
|
||||
batch_files.id,
|
||||
batch_files.client_id,
|
||||
batch_files.client_policy_id,
|
||||
batch_files.batch_code,
|
||||
batch_files.file_name,
|
||||
batch_files.insurer_or_tpa,
|
||||
batch_files.event_type,
|
||||
batch_files.actions,
|
||||
batch_files.count,
|
||||
batch_files.created_by,
|
||||
batch_files.created_at,
|
||||
batch_files.updated_by,
|
||||
batch_files.updated_at,
|
||||
batch_files.is_active,
|
||||
batch_files.amount,
|
||||
batch_files.status,
|
||||
batch_files.client_branch_id,
|
||||
|
||||
CASE
|
||||
WHEN batch_files.status = 'partially success' THEN
|
||||
batch_files.error_data
|
||||
ELSE
|
||||
error_data = null
|
||||
END AS error_data,
|
||||
|
||||
clients.short_name as client_short_name,
|
||||
client_branch.branch_name,
|
||||
client_policy.policy_no,
|
||||
policy_type.policy_type
|
||||
')
|
||||
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
|
||||
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||
->join('clients', 'clients.id = client_policy.client_id')
|
||||
->orderBy('batch_files.id', 'desc')
|
||||
->limit(100)
|
||||
->find();
|
||||
|
||||
")
|
||||
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
|
||||
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||
->join('clients', 'clients.id = client_policy.client_id')
|
||||
->orderBy('batch_files.id', 'desc')
|
||||
->limit(100)
|
||||
->find();
|
||||
|
||||
|
||||
// dd($data['fileList']);die();
|
||||
@ -631,6 +651,7 @@ class EmployeeController extends AdminController
|
||||
session()->setFlashdata('error', $return);
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
} else if ($event_type == 'si_enhancement') {
|
||||
|
||||
|
||||
@ -1136,7 +1157,8 @@ class EmployeeController extends AdminController
|
||||
|
||||
// Step 3: Prepare template path
|
||||
$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;
|
||||
|
||||
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
|
||||
@ -1155,6 +1177,9 @@ class EmployeeController extends AdminController
|
||||
$html = "";
|
||||
foreach ($data as $key => $value) {
|
||||
$htmlContent = $tmplt_data;
|
||||
|
||||
$value['front_card'] = "Nhance_Ecard_working_1_front.png";
|
||||
$value['back_card'] = "Nhance_Ecard_working_1_Back.png";
|
||||
|
||||
$placeholders = [
|
||||
'{CLIENT_NAME}' => $value['client_name'],
|
||||
@ -1839,6 +1864,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
|
||||
$replaceValues = array_values($placeholders);
|
||||
|
||||
@ -2189,7 +2221,9 @@ class EmployeeController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
// print_rr($data);die();
|
||||
// $data['dob'] = date('Y-m-d', strtotime($data['dob']));
|
||||
$data['dob'] = change_date_format($data['dob'], 'd/m/Y', 'Y-m-d');
|
||||
if(isset( $data['dob'])){
|
||||
$data['dob'] = change_date_format($data['dob'], 'd/m/Y', 'Y-m-d');
|
||||
}
|
||||
// print_rr($data); die;
|
||||
|
||||
// Fetch current employee data
|
||||
@ -2197,14 +2231,17 @@ class EmployeeController extends AdminController
|
||||
|
||||
if ($employee_data['relationship'] == 'Self') {
|
||||
|
||||
if ($employee_data['gender'] != $data['gender']) {
|
||||
if(isset($data['gender'])){
|
||||
|
||||
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
||||
$this->employeeModel
|
||||
->where('emp_code', $employee_data['emp_code'])
|
||||
->where('relationship', 'Spouse')
|
||||
->set(['gender' => $spouse_gender])
|
||||
->update();
|
||||
if ($employee_data['gender'] != $data['gender']) {
|
||||
|
||||
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
||||
$this->employeeModel
|
||||
->where('emp_code', $employee_data['emp_code'])
|
||||
->where('relationship', 'Spouse')
|
||||
->set(['gender' => $spouse_gender])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2647,4 +2684,27 @@ class EmployeeController extends AdminController
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1113,7 +1113,7 @@ class EmployeeRestController extends AdminController
|
||||
$array->GridMaster = $getSlabAndGridData['grid_master'];
|
||||
|
||||
if($array->tpa_id != null){
|
||||
$array->eCardDownload = base_url('download-e-card/') . $array->rand_string;
|
||||
$array->eCardDownload = base_url('download-e-card/') . $array->rand_string.'/1';
|
||||
}else{ $array->eCardDownload = null; }
|
||||
|
||||
|
||||
@ -1356,7 +1356,7 @@ class EmployeeRestController extends AdminController
|
||||
{
|
||||
|
||||
if($tpaArray[0]->tpa_id != null)
|
||||
$array->eCardDownload = base_url('download-e-card/') . $tpaArray[0]->rand_string;
|
||||
$array->eCardDownload = base_url('download-e-card/') . $tpaArray[0]->rand_string.'/1';
|
||||
else
|
||||
$array->eCardDownload = null;
|
||||
|
||||
@ -1519,7 +1519,7 @@ class EmployeeRestController extends AdminController
|
||||
if($employee_policy){
|
||||
|
||||
if($employee_policy->tpa_id != null){
|
||||
$array->eCardDownload = base_url('download-e-card/') . $employee_policy->rand_string;
|
||||
$array->eCardDownload = base_url('download-e-card/') . $employee_policy->rand_string.'/1';
|
||||
}else{ $array->eCardDownload = null; }
|
||||
|
||||
$self['is_value_exist'] = true;
|
||||
@ -1742,7 +1742,7 @@ class EmployeeRestController extends AdminController
|
||||
if(count($tpaArray))
|
||||
{
|
||||
if($tpaArray[0]->tpa_id != null)
|
||||
$responce['eCardDownload'] = base_url('download-e-card/') . $tpaArray[0]->rand_string;
|
||||
$responce['eCardDownload'] = base_url('download-e-card/') . $tpaArray[0]->rand_string.'/1';
|
||||
else
|
||||
$responce['eCardDownload'] = null;
|
||||
|
||||
@ -2540,7 +2540,7 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
|
||||
if($employee_policy[0]['tpa_id'] != null)
|
||||
$data['eCardDownload'] = base_url('download-e-card/') . $employee_policy[0]['rand_string'];
|
||||
$data['eCardDownload'] = base_url('download-e-card/') . $employee_policy[0]['rand_string'].'/1';
|
||||
else
|
||||
$data['eCardDownload'] = null;
|
||||
|
||||
@ -2639,7 +2639,7 @@ class EmployeeRestController extends AdminController
|
||||
$finalarray[$value] = $termsValue;
|
||||
}
|
||||
}
|
||||
if(is_array($terms->gpa_special_condition_label) && is_array($terms->gpa_special_condition_input)){
|
||||
if(isset(($terms->gpa_special_condition_label)) && is_array($terms->gpa_special_condition_label) && is_array($terms->gpa_special_condition_input)){
|
||||
for ($i=0; $i < count($terms->gpa_special_condition_label); $i++) {
|
||||
$finalarray[$terms->gpa_special_condition_label[$i]] = $terms->gpa_special_condition_input[$i];
|
||||
}
|
||||
@ -2661,7 +2661,7 @@ class EmployeeRestController extends AdminController
|
||||
$finalarray[$value] = $termsValue;
|
||||
}
|
||||
}
|
||||
if(is_array($terms->special_condition_label) && is_array($terms->special_condition_input)){
|
||||
if(isset(($terms->special_condition_label)) && is_array($terms->special_condition_label) && is_array($terms->special_condition_input)){
|
||||
for ($i=0; $i < count($terms->special_condition_label); $i++) {
|
||||
$finalarray[$terms->special_condition_label[$i]] = $terms->special_condition_input[$i];
|
||||
}
|
||||
|
||||
@ -1492,6 +1492,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['rata_premimum'] = 0;
|
||||
$emp_data['policy_details']['gst'] = 0;
|
||||
$emp_data['policy_details']['days'] = 0;
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
}
|
||||
else { $log_message .= '- skipping, slab rate not found'; }
|
||||
$myLogger->logme('error',$log_message);
|
||||
|
||||
@ -115,6 +115,7 @@ class EmployeePolicyModel extends Model
|
||||
'client_branch.branch_name as client_branch_name',
|
||||
'client_branch.branch_code as client_branch_code',
|
||||
'cp.policy_no',
|
||||
'cp.policy_type_id',
|
||||
])
|
||||
->join('employees emp', 'employee_polices.employee_id = emp.id')
|
||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||
@ -192,7 +193,7 @@ class EmployeePolicyModel extends Model
|
||||
$result = $this->select([
|
||||
'employee_polices.id'
|
||||
])
|
||||
->join('employees emp', 'employee_polices.employee_id = emp.id AND emp.relationship = "Self" ');
|
||||
->join('employees emp', 'employee_polices.employee_id = emp.id');
|
||||
if ($policy_id !=0 && !empty($policy_id)) {
|
||||
$result->where('employee_polices.client_policy_id', $policy_id);
|
||||
}
|
||||
@ -201,7 +202,9 @@ class EmployeePolicyModel extends Model
|
||||
->where('employee_polices.status', 'active')
|
||||
->where('employee_polices.tpa_id is not null')
|
||||
->where('employee_polices.ecard_sent_status',0)
|
||||
->where('emp.relationship','Self');
|
||||
// ->where('emp.relationship','Self');
|
||||
->where('emp.email_corporate !=','')
|
||||
->where('emp.email_corporate is not null');
|
||||
|
||||
return $result->findAll();
|
||||
// $result->findAll();
|
||||
@ -222,6 +225,7 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
public function getInceptionEmployeeDataForExportExcel($ref_data, $return_type = 0)
|
||||
{
|
||||
$client_id = $ref_data['client_id'];
|
||||
$client_policy_id = $ref_data['client_policy_id'];
|
||||
$client_branch_id = $ref_data['client_branch_id'];
|
||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||
@ -255,7 +259,6 @@ class EmployeePolicyModel extends Model
|
||||
SELECT
|
||||
employees.name AS emp_name,
|
||||
employees.emp_code AS emp_code,
|
||||
employees.dob AS emp_dob,
|
||||
employees.gender AS emp_gender,
|
||||
employees.relationship AS emp_relationship,
|
||||
employees.relationship_code AS emp_relationship_code,
|
||||
@ -263,7 +266,6 @@ class EmployeePolicyModel extends Model
|
||||
employees.change_event AS change_event,
|
||||
|
||||
|
||||
employees.doj AS emp_doj,
|
||||
employees.mobile AS emp_mobile,
|
||||
employees.email_corporate AS emp_email_c,
|
||||
employees.email_personal AS emp_email_p,
|
||||
@ -280,8 +282,6 @@ class EmployeePolicyModel extends Model
|
||||
employee_polices.uhid,
|
||||
employee_polices.pre_existing_alignments,
|
||||
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.premium,
|
||||
employee_polices.rata_premimum as pro_rata_premium,
|
||||
@ -291,6 +291,12 @@ class EmployeePolicyModel extends Model
|
||||
batch_data.bl AS batch_list_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
|
||||
WHEN client_branch.sez = 0 THEN 'NON-SEZ'
|
||||
WHEN client_branch.sez = 1 THEN 'SEZ'
|
||||
@ -309,6 +315,9 @@ class EmployeePolicyModel extends Model
|
||||
WHERE batch_files.event_type = '{$event}'
|
||||
AND batch_files.actions = 'export'
|
||||
AND batch_files.insurer_or_tpa = '{$insurer_or_tpa}'
|
||||
AND batch_files.client_policy_id = '{$client_policy_id}'
|
||||
AND batch_files.client_policy_id = '{$client_id}'
|
||||
|
||||
) as batch_data ON employee_polices.id = batch_data.emp_policy_id
|
||||
WHERE employee_polices.client_policy_id = '{$client_policy_id}'
|
||||
AND (employee_polices.{$id} IS NULL OR employee_polices.{$id} = '')
|
||||
@ -334,7 +343,7 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getCorrectionEmployeesDataForExportExcel($ref_data)
|
||||
public function getCorrectionEmployeesDataForExportExcel($ref_data, $return_type = 0)
|
||||
{
|
||||
|
||||
$client_id = $ref_data['client_id'];
|
||||
@ -342,22 +351,19 @@ 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 (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 = "
|
||||
SELECT DISTINCT
|
||||
emp_endorsement.id,
|
||||
emp_endorsement.pk,
|
||||
emp_endorsement.emp_code,
|
||||
emp_endorsement.endorsement_id,
|
||||
emp_endorsement.old_value,
|
||||
emp_endorsement.new_value,
|
||||
emp_endorsement.endorsement_id,
|
||||
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,
|
||||
employees.emp_type as emp_type,
|
||||
@ -367,7 +373,23 @@ class EmployeePolicyModel extends Model
|
||||
employees.relationship as emp_relationship,
|
||||
'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.email_corporate AS emp_email_c,
|
||||
employees.email_personal AS emp_email_p,
|
||||
@ -407,19 +429,21 @@ class EmployeePolicyModel extends Model
|
||||
AND employee_polices.status = 'active'
|
||||
AND employees.is_active = 1
|
||||
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";
|
||||
|
||||
// Execute the raw query
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
// Get the result set
|
||||
$result = $query->getResult();
|
||||
if($return_type == 1){
|
||||
$results = $query->getResultArray();
|
||||
}else{
|
||||
$results = $query->getResult();
|
||||
}
|
||||
|
||||
// dd($this->db->getLastQuery(), $result);
|
||||
|
||||
return $result;
|
||||
return $results;
|
||||
|
||||
}
|
||||
|
||||
@ -764,10 +788,10 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
$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'";
|
||||
|
||||
$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("
|
||||
SELECT DISTINCT
|
||||
@ -776,7 +800,6 @@ class EmployeePolicyModel extends Model
|
||||
employee_polices.id as primaryKey,
|
||||
employees.name AS emp_name,
|
||||
employees.emp_code AS emp_code,
|
||||
employees.dob AS emp_dob,
|
||||
employees.gender AS emp_gender,
|
||||
employees.relationship AS emp_relationship,
|
||||
employees.relationship_code AS emp_relationship_code,
|
||||
@ -784,7 +807,6 @@ class EmployeePolicyModel extends Model
|
||||
'D' as event_type_data,
|
||||
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
|
||||
|
||||
employees.doj AS emp_doj,
|
||||
employees.mobile AS emp_mobile,
|
||||
employees.email_corporate AS emp_email_c,
|
||||
employees.email_personal AS emp_email_p,
|
||||
@ -794,7 +816,6 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
employee_polices.basic_cover_si,
|
||||
employee_polices.uhid as uhid,
|
||||
employee_polices.policy_end_date,
|
||||
employee_polices.rata_premimum as premium,
|
||||
employee_polices.claim_status,
|
||||
|
||||
@ -804,29 +825,34 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
deletiondata.empstatus,
|
||||
deletiondata.changeevent,
|
||||
deletiondata.dateofexit,
|
||||
deletiondata.reasonforexit,
|
||||
deletiondata.status,
|
||||
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,
|
||||
|
||||
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)
|
||||
ELSE
|
||||
0
|
||||
END AS pro_rata_premium,
|
||||
|
||||
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)
|
||||
ELSE
|
||||
0
|
||||
END AS gst,
|
||||
|
||||
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) +
|
||||
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
||||
ELSE
|
||||
@ -834,7 +860,8 @@ class EmployeePolicyModel extends Model
|
||||
END AS total,
|
||||
|
||||
CASE
|
||||
WHEN deletiondata.claimstatus = 0 THEN
|
||||
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||
|
||||
'No claim'
|
||||
ELSE
|
||||
'Claim'
|
||||
@ -1536,21 +1563,21 @@ class EmployeePolicyModel extends Model
|
||||
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + '$add_one_day' AS no_of_days,
|
||||
|
||||
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)
|
||||
ELSE
|
||||
0
|
||||
END AS pro_rata_premium,
|
||||
|
||||
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)
|
||||
ELSE
|
||||
0
|
||||
END AS gst,
|
||||
|
||||
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) +
|
||||
(((employee_polices.rata_premimum * (DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) + $add_one_day)) / 365) * 0.18), 2)
|
||||
ELSE
|
||||
@ -1558,7 +1585,7 @@ class EmployeePolicyModel extends Model
|
||||
END AS total,
|
||||
|
||||
CASE
|
||||
WHEN deletiondata.claimstatus = 0 THEN
|
||||
WHEN deletiondata.claimstatus = 0 OR deletiondata.claimstatus IS NULL THEN
|
||||
'No claim'
|
||||
ELSE
|
||||
'Claim'
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
<th class="font-weight-medium">(₹)Amount</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -69,77 +70,89 @@
|
||||
<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']) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php if ($file['status'] == 'failed') { ?>
|
||||
<?php echo $file['status']; ?>
|
||||
<?php echo $file['status']; ?>
|
||||
|
||||
<a href="<?= base_url('/util/export-import-error-list/') . $file['id'] ?>"
|
||||
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>
|
||||
|
||||
<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 echo $file['status']; ?>
|
||||
<?php if ($file['error_data'] != 0) { ?>
|
||||
|
||||
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
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 } else if ($file['status'] == 'failed-1') { ?>
|
||||
|
||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
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>
|
||||
|
||||
<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') { ?>
|
||||
|
||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
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>
|
||||
|
||||
<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') { ?>
|
||||
|
||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
data-placement="top"
|
||||
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') { ?>
|
||||
|
||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
data-placement="top" title="Physical File Not Found."></a>
|
||||
|
||||
<?php } else if ($file['status'] == 'failed-5') { ?>
|
||||
|
||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||
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 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 echo $file['status']; ?>
|
||||
|
||||
<?php } ?>
|
||||
</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>
|
||||
<?php }
|
||||
@ -153,73 +166,169 @@
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#datatable-buttons').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Batch List',
|
||||
className: 'my_class',
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
position: "relative",
|
||||
left: "50px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true
|
||||
});
|
||||
<!-- 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() {
|
||||
|
||||
$('#datatable-buttons').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Batch List',
|
||||
className: 'my_class',
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
position: "relative",
|
||||
left: "50px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Function to format a number in Indian Rupees format
|
||||
function formatNumberInIndianRupees(number) {
|
||||
|
||||
const maxLength = 16;
|
||||
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
|
||||
});
|
||||
|
||||
// Limit the number of digits
|
||||
value = value.slice(0, maxLength);
|
||||
// Function to format a number in Indian Rupees format
|
||||
function formatNumberInIndianRupees(number) {
|
||||
|
||||
// Format the number with commas using Indian numbering system
|
||||
const formattedNumber = Number(value).toLocaleString('en-IN');
|
||||
const maxLength = 16;
|
||||
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
|
||||
|
||||
return formattedNumber;
|
||||
}
|
||||
// Limit the number of digits
|
||||
value = value.slice(0, maxLength);
|
||||
|
||||
// Function to format numbers based on a class
|
||||
function formatNumbersByClass(className) {
|
||||
const elements = document.querySelectorAll(`.${className}`);
|
||||
console.log('element', elements)
|
||||
elements.forEach(element => {
|
||||
const number = parseFloat(element.innerText.replace(/,/g, ''));
|
||||
console.log('number', number)
|
||||
// Format the number with commas using Indian numbering system
|
||||
const formattedNumber = Number(value).toLocaleString('en-IN');
|
||||
|
||||
if (!isNaN(number)) {
|
||||
console.log(formatNumberInIndianRupees(number))
|
||||
element.innerText = formatNumberInIndianRupees(number);
|
||||
}
|
||||
});
|
||||
}
|
||||
return formattedNumber;
|
||||
}
|
||||
|
||||
// Format numbers when the DOM content is loaded
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
setTimeout(() => {
|
||||
// Function to format numbers based on a class
|
||||
function formatNumbersByClass(className) {
|
||||
const elements = document.querySelectorAll(`.${className}`);
|
||||
console.log('element', elements)
|
||||
elements.forEach(element => {
|
||||
const number = parseFloat(element.innerText.replace(/,/g, ''));
|
||||
console.log('number', number)
|
||||
|
||||
formatNumbersByClass('indian-number');
|
||||
|
||||
}, 500);
|
||||
if (!isNaN(number)) {
|
||||
console.log(formatNumberInIndianRupees(number))
|
||||
element.innerText = formatNumberInIndianRupees(number);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
// Format numbers when the DOM content is loaded
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
setTimeout(() => {
|
||||
|
||||
formatNumbersByClass('indian-number');
|
||||
|
||||
}, 500);
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
background-color: #f0f0f0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php $pro_rata_total = 0; $gst_total = 0 ?>
|
||||
@ -141,15 +147,21 @@
|
||||
<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(($employee['emp_status'] == 'draft' || $employee['emp_status'] == 'enrolled') && ($employee['status'] == 'draft' || $employee['status'] == 'enrolled')) { ?>
|
||||
<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>
|
||||
<?php
|
||||
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 if($employee['policy_type'] == 'GMC' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($employee['policy_type'] == 'GMC' && $employee['relationship'] == 'Self' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['email_corporate'] != '' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a class="dropdown-item" onclick="send_mail_for_individual_employee_ecard('<?= $employee['id'];?>')" ><i class="mdi mdi-email-alert mr-2 text-muted font-18 vertical-middle"></i>Send E-Card Mail</a>
|
||||
<?php } ?>
|
||||
|
||||
@ -238,12 +250,12 @@
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<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 class="form-group col-md-12">
|
||||
<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>
|
||||
@ -339,10 +351,21 @@
|
||||
$('#email_corporate').val(data.email_corporate);
|
||||
$('#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'));
|
||||
myModal.show();
|
||||
|
||||
}else{
|
||||
|
||||
$('#employee_primary_id').val('');
|
||||
$('#emp_code_for_edit').val('');
|
||||
$('#name').val('');
|
||||
@ -351,6 +374,10 @@
|
||||
$('#email_corporate').val('');
|
||||
$('#mobile').val('');
|
||||
|
||||
$('#name').prop('disabled', false);
|
||||
$('#gender').prop('disabled', false);
|
||||
$('#dob').prop('disabled', false);
|
||||
|
||||
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>
|
||||
|
||||
@ -146,7 +146,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<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">
|
||||
<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>
|
||||
@ -547,7 +547,7 @@
|
||||
<label for="emp_code">Template Name</label>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@ -1222,7 +1222,7 @@
|
||||
console.log('get Mail Template Data', 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('.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