diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php
index a5c6ebf0..b2a638f7 100644
--- a/app/Controllers/ClientController.php
+++ b/app/Controllers/ClientController.php
@@ -1034,7 +1034,7 @@ class ClientController extends AdminController
'parents-in-law'=> $this->request->getPost('parents-in-law'),
];
- if ($policy_grid_id == 1 || $policy_grid_id == 2 || $policy_grid_id == 6 || $policy_grid_id == 7) {
+ if ($policy_grid_id == 1 || $policy_grid_id == 2 ) {
$relation_data = [
'self' => 1,
'spouse' => 'NA',
@@ -1220,7 +1220,6 @@ class ClientController extends AdminController
$age_from = $this->request->getPost('5_age_from[]');
$age_to = $this->request->getPost('5_age_to[]');
$unit = $this->request->getPost('5_unit[]');
-
for ($i = 0; $i < count($premium); $i++) {
$data['premium'] = str_replace(',', '', $premium[$i]);
$data['si'] = str_replace(',', '', $sum_insure[$i]);
@@ -1427,7 +1426,7 @@ class ClientController extends AdminController
}
} catch (\Exception $e) {
- echo 'Error: ' . $e->getMessage();
+ echo 'Error: ' . $e->getMessage(). ' at line no ' . $e->getLine();
}
}
diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php
index 10ad95c4..584d3dae 100644
--- a/app/Controllers/EmployeeController.php
+++ b/app/Controllers/EmployeeController.php
@@ -1511,8 +1511,11 @@ class EmployeeController extends AdminController
$client_id = $json->client_id;
$policy_id = $json->policy_id;
$branch_id = $json->branch_id;
+ $unit_id = $json->unit_id;
+ $action = $json->action;
+ $family_code = $json->emp_code;
$tabledata = $json->data;
-
+ $existing_famility_details = [];
if(count($tabledata))
{
$family_details = [];
@@ -1523,7 +1526,7 @@ class EmployeeController extends AdminController
{
$temp[0] = $row['column1'];//sno
- $temp[1] = $row['column2'];//emp code
+ $temp[1] = $family_code != "" ? $family_code : $row['column2'];//emp code
$temp[2] = $row['column3'];//name
$temp[3] = $row['column4'];//DOB
$temp[4] = strtoupper($row['column5']);//Gender
@@ -1540,14 +1543,29 @@ class EmployeeController extends AdminController
$temp[15] = '';//RFE
$temp[16] = '';//DOE
$temp[17] = '';//Unit
- $temp[18] = $row['column11'];//unit
+ $temp[18] = $unit_id;//unit
$family_details[] = $temp;
}
}
}
- // print_r($family_details);
- // return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => $family_details], 200);
+ if($action == 'dependent_addition')
+ {
+ $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $family_code,client_id: $client_id,client_policy_id: $policy_id,emp_status: ['active'],policy_status:['active'],client_branch_id: [ $branch_id ]);
+ // ~dd($this->employeeModel->getLastQuery());
+
+ if(!count($existing_famility_details))
+ {
+ return $this->respond(['dataStatus' => false, 'code' => 404, 'data' => [],'messgae' => "No Data found for emp code $family_code"], 200);
+ }
+ //transsform familiy details from db columns to exxcel row with column indexs for checking remaining functionalitites
+ $existing_famility_details = transform_db_data_to_excel($existing_famility_details,[]);
+ // Kint::dump($existing_famility_details);
+ $family_details = array_merge($family_details,$existing_famility_details);
+ $family_details = data_group_by_family($family_details)[ $family_code ];// reason to call this again is bring self to first index of the array
+ // dd($family);
+ }
+
//get policy details
$policy_details = $this->clientPolicyModel->getPolicyDetails($client_id,$policy_id);
$policy_details = (array)$policy_details[0];
@@ -1570,7 +1588,7 @@ class EmployeeController extends AdminController
}
}
- return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => $data], 200);
+ return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => ['new' => $data,'old' => $existing_famility_details], 200]);
}
}
diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php
index f31460b2..264a8aa4 100644
--- a/app/Controllers/EmployeeServiceController.php
+++ b/app/Controllers/EmployeeServiceController.php
@@ -1654,6 +1654,10 @@ class EmployeeServiceController extends AdminController
}// if end
}// is array check end
+ else
+ {
+ $this->myLogger->logme('error','######Incoming value is not an array');
+ }
}// for end
}//function end
diff --git a/app/Views/cd_master_list.php b/app/Views/cd_master_list.php
index 04a52784..cf0f19e8 100644
--- a/app/Views/cd_master_list.php
+++ b/app/Views/cd_master_list.php
@@ -241,6 +241,10 @@ table.dataTable thead th {
$('#opening_bal').val('');
$('#CDMasterForm')[0].reset();
$('#CDMasterForm').parsley().reset();
+ $('#client_id').prop("disabled", false);
+ $('#insurer_id').prop("disabled", false);
+ $('#cd_ac_no').prop("disabled", false);
+
})
@@ -261,9 +265,12 @@ table.dataTable thead th {
$('#CDMasterForm').attr('action', '');
$('#CD_Master_ID').val(res.data.id);
$('#client_id').val(res.data.client_id).change();
+ $('#client_id').prop("disabled", true);
$('#insurer_id').val(res.data.insurer_id).change();
+ $('#insurer_id').prop("disabled", true);
$('#opening_date').val(res.data.opening_date);
$('#cd_ac_no').val(res.data.cd_ac_no);
+ $('#cd_ac_no').prop("disabled", true);
$('#opening_bal').val(res.data.opening_bal);
$('#btnSubmit').html('Update');
@@ -279,6 +286,10 @@ table.dataTable thead th {
$('#cd_ac_no').change(function(){
var cd_ac_no = $(this).val();
+ console.log(cd_ac_no +'-'+cd_ac_no.length);
+ cd_ac_no = cd_ac_no.trim();
+ console.log(cd_ac_no +'-'+cd_ac_no.length);
+
$.ajax({
url: ''+cd_ac_no,
diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php
index 90bc3763..5e544eec 100644
--- a/app/Views/client_policy.php
+++ b/app/Views/client_policy.php
@@ -341,7 +341,7 @@
${policy_name_data} |
${item.branch_name ? item.branch_name : ' - '} |
${tpaValue} |
- ${(item.open_date)} / ${(item.close_date)} |
+ ${(item.policy_start_date)} / ${(item.policy_end_date)} |
${(enrollmentStatus)} |
${checkDateStatus(item.policy_end_date, 1)} |
diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php
index cc94977d..535418cc 100644
--- a/app/Views/employee_upload.php
+++ b/app/Views/employee_upload.php
@@ -1004,7 +1004,12 @@ function checkPolicyTermsAndRackRatesHasDefiend(event)
}else{
$("#event_type").removeAttr("multiple");
$("#event_type").attr("name", "event_type");
- $("#event_type").select2('destroy');
+
+ if ($('event_type').data('select2')) {
+ $('event_type').select2('destroy');
+ }
+
+ // $("#event_type").select2('destroy');
}
diff --git a/app/Views/file_list.php b/app/Views/file_list.php
index 3fcc2609..c2872c70 100644
--- a/app/Views/file_list.php
+++ b/app/Views/file_list.php
@@ -100,7 +100,7 @@
View
- Truncate
+ Truncate
@@ -246,7 +246,7 @@ $('body').on('click', '.upload_button', function() {
})
-$('body').on('click', '.truncate', function(event) {
+$('body').on('click', '.truncate2', function(event) {
event.preventDefault();
// console.log(event);
var fileId = JSON.parse(this.getAttribute('data-id'));
diff --git a/app/Views/policy_grid_excel.php b/app/Views/policy_grid_excel.php
index 1533ccc6..2413c242 100644
--- a/app/Views/policy_grid_excel.php
+++ b/app/Views/policy_grid_excel.php
@@ -36,91 +36,91 @@ const excel_headers = {
1: {
1: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
},
2: {
- "unit": "Units",
+ "unit": "Unit",
"basic_pay": "Basic Pay",
},
3: {
- "unit": "Units",
+ "unit": "Unit",
"band_or_grade": "Band or Grade",
"sum_insured": "Sum Insured",
}
},
2: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
3: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
4: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
5: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
6: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
7: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
8: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"grade": "Grade",
"premium": "Premium"
},
9: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
10: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
11: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"grade": "Grade",
"premium": "Premium",
"max_si": "Max Si"
},
12: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"relationship": "Relationship",
"premium": "Premium"
},
13: {
- "unit": "Units",
+ "unit": "Unit",
"sum_insured": "Sum Insured",
"relationship": "Relationship",
"from_age": "From Age",
@@ -286,8 +286,10 @@ function generateTable(unique_id) {
// console.log('Excepted HEADERS' , JSON.stringify(expectedHeader))
- if (secondKey != 2) {
-
+ if (secondKey != 2 && secondKey != undefined) {
+ console.log('expectedHeader' + secondKey + '-' + formatType);
+ console.log(expectedHeader);
+ console.log(excel_headers[formatType]);
if (JSON.stringify(header) !== JSON.stringify(expectedHeader)) {
const expectedHeaders = JSON.stringify(Object.values(excel_headers[formatType][secondKey]));
const receivedHeaders = JSON.stringify(columnsToKeep.map(i => rows[0].split("\t")[i]));
diff --git a/app/Views/rack_rate_test.php b/app/Views/rack_rate_test.php
index 7573f21e..8036b1cf 100644
--- a/app/Views/rack_rate_test.php
+++ b/app/Views/rack_rate_test.php
@@ -78,10 +78,21 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SNO |
+ Emp code |
+ Name |
+ DOB |
+ Relation |
+ Rack rate name |
+ Grid ID |
+ Is Self |
+ Premium type |
+ SI |
+ premium |
+ Policy days |
+
+ no of days |
+ Rata premium |
+ GST |
+
+
+
+
+
+
+
+
@@ -540,16 +579,31 @@
var policy_id = $('#policies').val();
var branch_id = $('#branch_id').val();
var unit_id = $('#unit_id').val();
+ var action = $('#action').val();
+ var emp_code = $('#emp_code').val();
console.log(client_id + '-' + policy_id);
if (client_id == '0' || policy_id == '0') {
alert('Please select all values in dropdowns.');
return;
}
+ if (action == 'dependent_addition') {
+ if(emp_code.trim() == "")
+ {
+ alert('Enter emp code');
+ return;
+ }
+
+ }
+
+ // return;
var queryParams = {
client_id: client_id,
policy_id: policy_id,
branch_id: branch_id,
+ unit_id: unit_id,
+ action: action,
+ emp_code: emp_code,
data: tabledata,
};
@@ -577,8 +631,10 @@
displayData(response.data);
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
+ alert(response.messgae);
} else {
console.error('Something went wrong!');
+ alert('Something went wrong!');
}
},
error: function(xhr, status, error) {
@@ -659,8 +715,19 @@
function displayData(data)
{
- const tableBody = document.getElementById("restablebody");
- $("#restablebody").empty();
+ displayTable(data.new,"restablebody");
+ if(data.old.length())
+ {
+ $('#oldrestablebody').prop('display','block');
+ displayTable(data.new,"oldrestablebody");
+ }
+ }
+ function displayTable(data,tableID)
+ {
+
+ var old_data = data.old;
+ const tableBody = document.getElementById(tableID);
+ $(("#".tableID)).empty();
const existingRowCount = tableBody.rows.length;
for(i = 0; i < data.length; i++)
{
|