MERGE_TEST_BDS&CLAIMS_LIVE_FEEDBACK

This commit is contained in:
Venba 2025-03-13 08:59:41 +00:00
commit 80e03fb478
8 changed files with 77 additions and 14 deletions

View File

@ -3679,7 +3679,10 @@ class ClientController extends AdminController
{
// ---------for client-----------------------------------------------------------------------------
$clients = $this->clientModel->where('is_active', 1)->findAll();
$clients = $this->clientModel
->select("*, DATE_FORMAT(dob, '%d-%m-%Y') as dob")
->where('is_active', 1)
->findAll();
$clientIds = array_column($clients, 'id');
@ -3814,7 +3817,7 @@ class ClientController extends AdminController
// Add additional fields if client type is 2
if ($client_type == 2) {
$client_data = array_merge($client_data, [
'dob' => $postData['dob'],
'dob' => change_date_format($postData['dob'],'d/m/Y','Y-m-d'),
'aadhar' => $postData['aadhar'],
'phone' => $postData['phone'],
'email' => $postData['email'],

View File

@ -1640,6 +1640,7 @@ class EmployeeServiceController extends AdminController
$value['updated_by'] = $file['created_by'];
$value['id'] = $employee[0]['id'];
$value['emp_status'] = 'active';
$value['family_floater_key'] = generate_family_floater_key($value['relationship']);
$value['client_branch_id'] = $file['client_branch_id'];
$value['file_id'] = isset($employee[0]['file_id']) && $employee[0]['file_id'] != '' ? $employee[0]['file_id'] : $file['id'] ;
$log_message = 'Update Employee - '.$employee[0]['name'].'('.$employee[0]['emp_code'].') with PK '.$employee[0]['id'];

View File

@ -1347,8 +1347,11 @@ class TicketController extends BaseController
if (!empty($empData) && $empData != "" && $empData != null ) {
foreach ($empData as &$emp) { // Loop through the data
$doi = $this->employeePolicyModel->select('date_coverage,basic_cover_si')->where('client_policy_id',$client_policy_id)->first();
$emp['dob'] = date('d/m/Y', strtotime($emp['dob']));
$emp['doj'] = date('d/m/Y', strtotime($emp['doj']));
$emp['date_of_inception'] = date('d/m/Y', strtotime($doi['date_coverage']));
$emp['basic_cover_si'] = $doi['basic_cover_si'];
}
}
@ -1387,7 +1390,7 @@ class TicketController extends BaseController
// Fetch all policy names and IDs in one query
$policyNameandID = $this->clientPolicyModel
->select('CONCAT(policy_type.policy_type, "-", client_policy.policy_no) as client_policy_name, client_policy.id as client_policy_value,client_policy.policy_type_id')
->select('CONCAT(policy_type.policy_type, "-", client_policy.policy_no) as client_policy_name, client_policy.id as client_policy_value,client_policy.policy_type_id,client_policy.policy_no')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id AND policy_type.is_active = 1')
->whereIn('client_policy.id', $policy_ids)
->findAll();

View File

@ -802,8 +802,8 @@
</div>
<div class="form-group col-md-12">
<label for="cost_center">PAN<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN No" name="pan" onchange="validateInput(this, 'clients', 'pan')" required>
<label for="cost_center">PAN</label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN No" name="pan" onchange="validateInput(this, 'clients', 'pan')">
</div>
</div>
@ -827,9 +827,8 @@
<label for="cost_center">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" placeholder="Enter Email" name="email">
</div>
<div class="form-group col-md-12">
<label for="aadhar">Aadhar<span class="text-danger">*</span></label>
<label for="aadhar">Aadhar</label>
<input type="text" class="form-control" id="aadhar" placeholder="Enter Aadher No" name="aadhar" maxlength="12" onchange="validateInput(this, 'clients', 'aadhar')">
</div>
@ -1052,6 +1051,9 @@ $(document).ready(function(){
}
});
$('#aadhar').attr('data-parsley-required', 'false');
$('#aadhar').removeAttr('required');
team_id = <?php echo json_encode(user_team()); ?>;
console.log('team_id', team_id);
@ -2655,7 +2657,7 @@ function appendOwner(data) {
let client_show_name = item.client_name;
if (item.client_type == 2) {
client_show_name = item.client_name + ' - ' + (item.pan ?? 'N/A');
client_show_name = item.client_name + ' - ' + (item.dob ?? 'N/A');
}
var option = $('<option>', {
@ -3129,6 +3131,12 @@ $("#client_form").submit(function(event) {
console.log('client_type', $('#client_type').val());
event.preventDefault();
$('#aadhar').attr('data-parsley-required', 'false');
$('#aadhar').removeAttr('required');
isClientFormSubmitting = true;
var isValid = $('#client_form').parsley().validate();
if (!isValid) {
@ -3525,7 +3533,8 @@ $('#client_type').on('change', function() {
let client_show_name = item.client_name;
if (item.client_type == 2) {
client_show_name = item.client_name + ' - ' + (item.pan ?? 'N/A');
// client_show_name = item.client_name + ' - ' + (item.dob ?? '') + (item.pan ?? '');
client_show_name = item.client_name + (item.dob ? ('- (' + item.dob + ' )' ) : '') + (item.pan ? ('- ' + item.pan ) : '');
}
var option = $('<option>', {
value: item.id,

View File

@ -737,7 +737,8 @@ function appendClients(data)
let client_show_name = item.client_name;
if (item.client_type == 2) {
client_show_name = item.client_name + ' - ' + (item.pan ?? 'N/A');
client_show_name = item.client_name + (item.dob ? ('- (' + item.dob + ' )' ) : '') + (item.pan ? ('- ' + item.pan ) : '');
// console.log(client_show_name);
}
var option = $('<option>', {

View File

@ -931,7 +931,8 @@
value: '',
text: 'Select Client Policy'
}));
console.log("got data from backend ",data);
let policyCount = 1;
var policyAppendCount = 0;
$.each(data, function(index, item) {
// console.log(item);
@ -941,6 +942,15 @@
value: item.client_policy_value,
text: item.client_policy_name
}));
$("#policy_no").val("");
if (policyCount == 1){
console.log("policy count from if",item.policy_no);
$("#policy_no").val(item.policy_no);
}else{
console.log("policy count from greter if ","");
$("#policy_no").val("");
}
policyCount++;
policyAppendCount++;
if (hiddenData['searchType'] != null && hiddenData['searchType'] != "" && hiddenData['policy_id'] != null && hiddenData['policy_id'] != "") {
// $('#emp_client_policy').select2();
@ -962,12 +972,18 @@
}
// $('#emp_client_policy').select2();
$("#emp_client_policy").on('change', function() {
var policy_name = $("#emp_client_policy option:selected").text();
var policy_no = policy_name.split("-")[1];
$("#policy_no").val(policy_no);
console.log("change function called ");
policy_id = $("#emp_client_policy").val();
setMinDateDOA(policy_id);
})
function setMinDateDOA(policy_id) {
var policy_name = $("#emp_client_policy option:selected").text();
var policy_no = policy_name.split("-")[1];
$("#policy_no").val(policy_no);
console.log("Function set min date called ");
console.log("Existing DOA instance: ", doa);
console.log('sent data ',policy_id);

View File

@ -642,14 +642,26 @@
}));
var policyAppendCount = 0;
console.log("got data from backend ",data);
let policyCount = 1;
$.each(data, function(index, item) {
// console.log(item);
// console.log("item len",item.length);
if (ticket_type != 1 && item.policy_type_id != 2) {
$('#emp_client_policy').append($('<option>', {
value: item.client_policy_value,
text: item.client_policy_name
}));
console.log("policy count from loop","");
$("#policy_no").val("");
if (policyCount == 1){
console.log("policy count from if",item.policy_no);
$("#policy_no").val(item.policy_no);
}else{
console.log("policy count from greter if ","");
$("#policy_no").val("");
}
policyCount++;
policyAppendCount++;
if (hiddenData['searchType'] != null && hiddenData['searchType'] != "" && hiddenData['policy_id'] != null && hiddenData['policy_id'] != "") {
// $('#emp_client_policy').select2();
@ -671,12 +683,20 @@
// $('#emp_client_policy').select2();
$("#emp_client_policy").on('change', function() {
console.log("change function called ");
policy_id = $("#emp_client_policy").val();
policy_id = $("#emp_client_policy").val();
// setMinDateDOA(policy_id);
setDateValidation(policy_id, true);
})
function setPolicyNo(){
var policy_name = $("#emp_client_policy option:selected").text();
var policy_no = policy_name.split("-")[1];
$("#policy_no").val(policy_no);
console.log("after text split",policy_no);
}
function setDateValidation(policy_id, memberset = null) {
setPolicyNo();
$.ajax({
url: '<?= base_url("ticket/getPolicyStartDate") ?>',
method: "POST",
@ -688,17 +708,27 @@
console.log(response);
if (response.status) {
if (memberset) {
var dateOfInception = response.empData[0].date_of_inception;
var dobValue = response.empData[0].dob;
var doj = response.empData[0].doj;
var basicCoverSI = response.empData[0].basic_cover_si
console.log('data received fro controller ', dob, doj);
if (dobValue) {
$("#dob").val(dobValue);
$("#dob").addClass('readonly-select');
}
if (dateOfInception){
$("#date_of_incep").val(dateOfInception);
$("#date_of_incep").addClass('readonly-select');
}
if (doj) {
$("#date_of_join").val(doj);
$("#date_of_join").addClass('readonly-select');
}
$("#si_amt").val(basicCoverSI);
$("#si_amt").addClass('readonly-select');
}else{
if ($("#dob").hasClass('readonly-select')){
$("#dob").removeClass('readonly-select')

View File

@ -817,7 +817,7 @@ if (!isset($view_ticket_page)) {
$('#tpa_no').val(tpaNo);
$('#insured_emp_id').val(empId);
$('#insured_name').val(empName);
$('#policy_no').val(policyNo);
// $('#policy_no').val(policyNo);
$('#relationship option').each(function() {
if ($(this).text() === relationship) {