CHANGE_ADD_THE_ICON_FOR_CASH_AND_CASHLES_FOR_CLAIM

This commit is contained in:
VENKATESHWARAN 2026-04-20 15:53:06 +05:30
parent 6f62808b9b
commit 74664e49be
2 changed files with 45 additions and 2 deletions

View File

@ -539,6 +539,7 @@ class TicketController extends BaseController
'tm.emp_personal_mail',
'tm.mode_of_intimation',
'tm.claim_type',
'tm.tpa_claim_type',
'tm.hospital_name',
'tm.doa',
'tm.dod',
@ -673,6 +674,7 @@ class TicketController extends BaseController
'tm.emp_personal_mail',
'tm.mode_of_intimation',
'tm.claim_type',
'tm.tpa_claim_type',
'tm.hospital_name',
'tm.doa',
'tm.dod',

View File

@ -30,6 +30,22 @@ table.dataTable tbody td {
color: #6c757d !important;
}
.policy-type-icon {
display: inline-flex;
align-items: center;
margin-right: 6px;
font-size: 0.95rem;
vertical-align: middle;
}
.policy-type-icon--cashless {
color: #0ea5e9;
}
.policy-type-icon--reimbursement {
color: #f59e0b;
}
/* Claim source pill — text only, fixed width (DUMP_TPA); hidden when no value */
.claim-source-badge {
display: inline-flex;
@ -221,7 +237,19 @@ table.dataTable tbody td {
];
$claimSrcClass = $claimSrcClassMap[$claimSrc] ?? null;
$policyTypeLabel = str_replace('Claim-', '', $ticket_type[$row['ticket_type_id']] ?? 'N/A');
echo esc($policyTypeLabel);
$tpaClaimTypeRaw = trim((string)($row['tpa_claim_type'] ?? ''));
$tpaClaimType = strtolower($tpaClaimTypeRaw);
$policyTypeIconHtml = '';
if ($tpaClaimType !== '') {
if (strpos($tpaClaimType, 'cash') !== false) {
$policyTypeIconHtml = '<span class="policy-type-icon policy-type-icon--cashless" title="Cashless"><i class="mdi mdi-hospital-box-outline" aria-hidden="true"></i></span>';
} elseif (strpos($tpaClaimType, 'reimburse') !== false) {
$policyTypeIconHtml = '<span class="policy-type-icon policy-type-icon--reimbursement" title="Reimbursement"><i class="mdi mdi-cash-refund" aria-hidden="true"></i></span>';
}
}
echo $policyTypeIconHtml . esc($policyTypeLabel);
if ($claimSrcClass !== null) {
echo '<br><span class="claim-source-badge ' . esc($claimSrcClass, 'attr') . '">' . esc($claimSrc) . '</span>';
}
@ -368,6 +396,18 @@ function getClaimSourceBadgeHtml(claimCreatedBy) {
return '<span class="claim-source-badge ' + cls + '">' + escapeHtml(key) + '</span>';
}
function getPolicyTypeIconHtml(tpaClaimType) {
var type = (tpaClaimType || '').toString().trim().toLowerCase();
if (!type) return '';
if (type.indexOf('cash') !== -1) {
return '<span class="policy-type-icon policy-type-icon--cashless" title="Cashless"><i class="mdi mdi-hospital-box-outline" aria-hidden="true"></i></span>';
}
if (type.indexOf('reimburse') !== -1) {
return '<span class="policy-type-icon policy-type-icon--reimbursement" title="Reimbursement"><i class="mdi mdi-cash-refund" aria-hidden="true"></i></span>';
}
return '';
}
function getStatusDisplay(row) {
var status = row.status || '';
var claimStatusId = Number(row.claim_status_id || 0);
@ -413,6 +453,7 @@ function buildTicketRowHtml(row) {
var statusUpdated = row.ticket_updated_date ? '<span class="text-custom-grey"><br>Updated at ' + escapeHtml(row.ticket_updated_date) + '</span>' : '';
var claimCreated = row.ticket_created_date ? '<span class="text-custom-grey"><br>Created at ' + escapeHtml(row.ticket_created_date) + '</span>' : '';
var policyType = (window.ticketTypeMap[row.ticket_type_id] || '').replace('Claim-', '');
var policyTypeIcon = getPolicyTypeIconHtml(row.tpa_claim_type);
var claimSourceBadge = getClaimSourceBadgeHtml(row.claim_created_by);
var modeOfIntimation = window.modeOfIntimateMap[row.mode_of_intimation] || '';
var priority = window.priorityTypeMap[row.priority || 0] || '';
@ -423,7 +464,7 @@ function buildTicketRowHtml(row) {
'<span class="status-tooltip">' + getStatusDisplay(row) + '</span>' +
statusUpdated +
'</td>' +
'<td>' + asText(policyType) + (claimSourceBadge ? '<br>' + claimSourceBadge : '') + '</td>' +
'<td>' + policyTypeIcon + asText(policyType) + (claimSourceBadge ? '<br>' + claimSourceBadge : '') + '</td>' +
'<td>' + asText(row.claim_no) + claimCreated + '</td>' +
'<td>' + asText(row.tpa_no) + '</td>' +
'<td>' + asText(row.emp_code) + '</td>' +