MERGE_TEST_LIVE_FIXS
This commit is contained in:
commit
e1759263f0
@ -256,7 +256,9 @@ class EmployeeMultiEventServiceController extends BaseController
|
||||
'is_mandatory' => ['A', 'DA', 'D'],
|
||||
'data_type' => 'str',
|
||||
'format' => null,
|
||||
'allowed_values' => null
|
||||
'allowed_values' => null,
|
||||
'custom' => 'check_change_event',
|
||||
'params' => ['row', 'file']
|
||||
],
|
||||
'date_of_exit' => [
|
||||
'col_idx' => 16,
|
||||
@ -2348,6 +2350,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
||||
// echo 'insert emp';
|
||||
} else {
|
||||
$value['emp_status'] = 'active';
|
||||
$value['change_event'] = normalize_file_action($file['action']);
|
||||
$value['created_by'] = $file['created_by'];
|
||||
$value['client_branch_id'] = $file['client_branch_id'];
|
||||
$value['family_floater_key'] = generate_family_floater_key($value['relationship']);
|
||||
|
||||
@ -259,7 +259,10 @@ class EmployeeServiceController extends AdminController
|
||||
'is_mandatory' => ['A', 'DA', 'D'],
|
||||
'data_type' => 'str',
|
||||
'format' => null,
|
||||
'allowed_values' => null
|
||||
'allowed_values' => null,
|
||||
'custom' => 'check_change_event',
|
||||
'params' => ['row', 'file']
|
||||
|
||||
],
|
||||
'date_of_exit' => [
|
||||
'col_idx' => 16,
|
||||
@ -1957,6 +1960,7 @@ class EmployeeServiceController extends AdminController
|
||||
else
|
||||
{
|
||||
$value['emp_status'] = 'active';
|
||||
$value['change_event'] = normalize_file_action($file['action']);
|
||||
$value['created_by'] = $file['created_by'];
|
||||
$value['client_branch_id'] = $file['client_branch_id'];
|
||||
$value['family_floater_key'] = generate_family_floater_key($value['relationship']);
|
||||
|
||||
@ -4149,12 +4149,18 @@ class TicketController extends BaseController
|
||||
|
||||
|
||||
$status = 'inprogress';
|
||||
$claim_dump_date = null;
|
||||
$claim_dump_date_input = trim((string) ($this->request->getPost('claim_dump_date') ?? ''));
|
||||
if (!empty($claim_dump_date_input)) {
|
||||
$claim_dump_date = change_date_format($claim_dump_date_input, 'd/m/Y', 'Y-m-d');
|
||||
}
|
||||
$insert_data = [
|
||||
'file_name' => $filename,
|
||||
'status' => $status,
|
||||
'client_id' => !empty($this->request->getPost('client_id')) ? $this->request->getPost('client_id') : null,
|
||||
'client_policy_id' => !empty($this->request->getPost('client_policy_id')) ? $this->request->getPost('client_policy_id') : null,
|
||||
'tpa_id' => !empty($this->request->getPost('tpa_id')) ? $this->request->getPost('tpa_id') : null,
|
||||
'claim_dump_date' => $claim_dump_date,
|
||||
];
|
||||
|
||||
$file_id = $this->claimDumpFileModel->insert($insert_data);
|
||||
|
||||
@ -2582,6 +2582,72 @@ if (!function_exists('normalizeGender')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('check_change_event')) {
|
||||
function check_change_event($row, $file)
|
||||
{
|
||||
$change_event = isset($row[15]) ? $row[15] : '';
|
||||
$action = isset($file['action']) ? $file['action'] : '';
|
||||
$allowed_values = [
|
||||
'inception' => ['inception'],
|
||||
'addition' => ['addition'],
|
||||
'dependent_addition' => ['dependent addition', 'd-addition'],
|
||||
'missed_inception' => ['missed inception'],
|
||||
];
|
||||
|
||||
$normalize = function ($value) {
|
||||
return strtolower(trim((string) $value)); // ✅ Added `return`
|
||||
};
|
||||
|
||||
$change_event = $normalize($change_event);
|
||||
|
||||
// Allow inception with no change_event
|
||||
if ($action === 'inception' && empty($change_event)) {
|
||||
return ['status' => true];
|
||||
}
|
||||
|
||||
// Validate change_event against allowed values for the given action
|
||||
if (isset($allowed_values[$action]) && in_array($change_event, $allowed_values[$action])) {
|
||||
return ['status' => true];
|
||||
}
|
||||
|
||||
// Build error message
|
||||
$expected_values = $allowed_values[$action] ?? [];
|
||||
$expected_message = "'" . implode("' or '", array_map('strtoupper', $expected_values)) . "'";
|
||||
if ($action === 'inception') {
|
||||
$expected_message .= " or blank";
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => false,
|
||||
'error' => "Rule Conflict: Invalid Change Event for this action\n\n'{$action}'. Expected {$expected_message}", ];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('normalize_file_action')) {
|
||||
function normalize_file_action($file_action)
|
||||
{
|
||||
if($file_action == 'inception'){
|
||||
return 'Inception';
|
||||
}else if($file_action == 'addition'){
|
||||
return 'Addition';
|
||||
}else if($file_action == 'dependent_addition'){
|
||||
return 'Dependent Addition';
|
||||
}else if($file_action == 'deletion'){
|
||||
return 'Deletion';
|
||||
}else if($file_action == 'correction'){
|
||||
return 'Correction';
|
||||
}else if($file_action == 'si_enhancement'){
|
||||
return 'SI Enhancement';
|
||||
}else if($file_action == 'enrollment'){
|
||||
return 'Enrollment';
|
||||
}else if($file_action == 'missed_inception'){
|
||||
return 'Missed Inception';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------- FUNCTION FOR LEAD MEMBER DATA LIST VALIDATIONS --------------------------------------
|
||||
|
||||
if (!function_exists('check_columns_name_exist')) {
|
||||
|
||||
@ -108,6 +108,8 @@ if (! function_exists('file_Upload_for_lead')) {
|
||||
}
|
||||
$fileName = sanitize_upload_filename($fileToUpload->getName());
|
||||
$fileToUpload->move($filepath, $fileName);
|
||||
$fileName = $fileToUpload->getName();
|
||||
|
||||
return $fileName;
|
||||
} else {
|
||||
return "";
|
||||
|
||||
@ -361,6 +361,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_status_id'] = $this->checkStatusMapping($this->statusMapping, $row['claim_status']);
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = isset($row['mainclaim_prepost_type']) && !empty($row['mainclaim_prepost_type']) && strtolower($row['mainclaim_prepost_type']) == 'normal' ? 1 : 3;
|
||||
$item['priority'] = 1;
|
||||
|
||||
@ -427,6 +427,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_status_id'] = $this->checkStatusMapping($this->statusMapping, $row['current_claim_status']) ?? 61;
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
|
||||
@ -342,6 +342,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_status_id'] = $this->checkStatusMapping($this->statusMapping, $row['updated_status']) ?? 61;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
|
||||
@ -375,6 +375,7 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_status_id'] = $this->checkStatusMapping($this->statusMapping, $row['claim_status']) ?? 61;
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
|
||||
@ -328,6 +328,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
$item['file_id'] = $file_id;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
|
||||
@ -568,6 +568,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_status_id'] = $this->checkStatusMapping($this->statusMapping, $row['claim_status']) ?? 61;
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = isset($row['mainclaim_prepost_type']) && !empty($row['mainclaim_prepost_type']) && strtolower($row['mainclaim_prepost_type']) == 'normal' ? 1 : 3;
|
||||
$item['priority'] = 1;
|
||||
@ -599,6 +600,8 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
public function mapClaimMasterDataOld($file_id): array
|
||||
{
|
||||
$claimDumpFileModel = new ClaimDumpFileModel();
|
||||
$file_data = $claimDumpFileModel->where('id', $file_id)->first();
|
||||
|
||||
$tpaClaimDumpData = $this->db
|
||||
->table('claims_dump_vidal')
|
||||
@ -686,6 +689,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Meta fields
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_date'] = $file_data['claim_dump_date'] ?? null;
|
||||
$item['created_by'] = get_session_userid() ?? null;
|
||||
$item['claim_type'] = isset($row['mainclaim_prepost_type']) && !empty($row['mainclaim_prepost_type']) && strtolower($row['mainclaim_prepost_type']) == 'normal' ? 1 : 3;
|
||||
$item['claim_created_by'] = 'DUMP_TPA';
|
||||
|
||||
@ -13,6 +13,7 @@ class ClaimDumpFileModel extends Model
|
||||
"client_id",
|
||||
"client_policy_id",
|
||||
"tpa_id",
|
||||
"claim_dump_date",
|
||||
"file_name",
|
||||
"status",
|
||||
"reason",
|
||||
|
||||
@ -97,6 +97,8 @@ class TicketMasterModel extends Model
|
||||
'last_updated_by',
|
||||
'tpa_shortfall_no',
|
||||
'claim_created_by',
|
||||
'claim_dump_date'
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
@ -267,6 +267,10 @@
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="claim_dump_date">Claim Dump Date</label>
|
||||
<input type="text" class="form-control" id="claim_dump_date" name="claim_dump_date" placeholder="Select claim dump date" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row" id="file_upload">
|
||||
|
||||
@ -326,6 +330,11 @@
|
||||
|
||||
$('#client_id').select2();
|
||||
$('#client_policy_id').select2();
|
||||
flatpickr("#claim_dump_date", {
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false,
|
||||
maxDate: "today"
|
||||
});
|
||||
|
||||
// AJAX Form Submit Function
|
||||
$('#claim-upload-form').on('submit', function(e) {
|
||||
|
||||
@ -499,6 +499,13 @@
|
||||
return String(item.url || '');
|
||||
}
|
||||
|
||||
function claimFileDownloadOpenUrl(item, base_url) {
|
||||
if (item.file_type == 2 || item.file_type === '2') {
|
||||
return base_url + 'downloadClaimFile/' + encodeURIComponent(item.id);
|
||||
}
|
||||
return String(item.url || '');
|
||||
}
|
||||
|
||||
function create_url_list(data) {
|
||||
$('#table_bd').empty(); // clear existing rows
|
||||
|
||||
@ -513,23 +520,20 @@
|
||||
const tpaLabel = sentToTpa ? 'Yes' : 'No';
|
||||
const viewOk = claimFileViewSupported(item);
|
||||
const viewHref = escapeClaimFileListAttr(claimFileViewOpenUrl(item, base_url));
|
||||
const viewSupportedAttr = viewOk ? '1' : '0';
|
||||
const viewIconClass = viewOk ? 'text-primary' : 'text-muted';
|
||||
const viewTitle = viewOk ? 'View in new tab' : 'Preview not available for this format';
|
||||
const downloadHref = escapeClaimFileListAttr(claimFileDownloadOpenUrl(item, base_url));
|
||||
const fileNameLinkHref = viewOk ? viewHref : downloadHref;
|
||||
const fileNameLinkTitle = viewOk ? 'View in new tab' : 'Download';
|
||||
html += `
|
||||
<tr>
|
||||
<td class="text-center">${index + 1}</td>
|
||||
<td>${item.doc_name}</td>
|
||||
<td><a href="${item.url}" target="_blank">${item.file_type == 1 ? item.url : item.doc_name}</a></td>
|
||||
<td><a href="${fileNameLinkHref}" target="_blank" rel="noopener noreferrer" title="${fileNameLinkTitle}">${item.file_type == 1 ? item.url : item.doc_name}</a></td>
|
||||
<td class="text-center">
|
||||
<span class="badge ${tpaBadgeClass}" style="font-size:13px; padding:8px 12px; font-weight:600;">${tpaLabel}</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="view-claim-file ${viewIconClass} mr-2" title="${viewTitle}"
|
||||
style="${viewOk ? '' : 'opacity:0.7;'}"
|
||||
data-view-url="${viewHref}"
|
||||
data-view-supported="${viewSupportedAttr}">
|
||||
<i class="mdi mdi-eye"></i>
|
||||
<a href="${downloadHref}" target="_blank" rel="noopener noreferrer" class="text-primary mr-2" title="Download">
|
||||
<i class="mdi mdi-download"></i>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="delete-url"
|
||||
style="bacolor:black;"
|
||||
@ -547,19 +551,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('click', '.view-claim-file', function (e) {
|
||||
e.preventDefault();
|
||||
var supported = $(this).data('view-supported') == 1 || $(this).data('view-supported') === '1';
|
||||
var viewUrl = $(this).attr('data-view-url');
|
||||
if (!supported) {
|
||||
toastr.warning('Not supported format. Only PDF and images (PNG, JPG, JPEG) can be previewed.', 'View file');
|
||||
return;
|
||||
}
|
||||
if (viewUrl) {
|
||||
window.open(viewUrl, '_blank', 'noopener,noreferrer');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete-url', function (e) {
|
||||
e.preventDefault();
|
||||
const url = $(this).data('href');
|
||||
|
||||
@ -251,7 +251,7 @@ table.dataTable tbody td {
|
||||
|
||||
echo $policyTypeIconHtml . esc($policyTypeLabel);
|
||||
if ($claimSrcClass !== null) {
|
||||
echo '<br><span class="claim-source-badge ' . esc($claimSrcClass, 'attr') . '">' . esc($claimSrc) . '</span>';
|
||||
echo '<br><span class="claim-source-badge ' . esc($claimSrcClass, 'attr') . '">' . esc($claimSrc == "CRM" ? "STAFF" : $claimSrc) . '</span>';
|
||||
}
|
||||
?></td>
|
||||
<td><?php echo $row['claim_no'] ?: 'N/A' ; ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user