FIX_CLAIM_HISTORY_SHOW_ROLL_OVER

This commit is contained in:
VENKATESHWARAN 2026-05-16 09:55:02 +05:30
parent 20329dfa20
commit 528d8dcb26
4 changed files with 25 additions and 5 deletions

View File

@ -5321,6 +5321,8 @@ class PolicyTransactionController extends BaseController
try {
$bdsInstallmentData = [];
try {
$bdsInstallmentData = $this->BdsPlacementModel->getClientInstallmentDetails();
@ -5328,6 +5330,7 @@ class PolicyTransactionController extends BaseController
$this->myLogger->logme('error', 'Exception: ' . $e->getMessage() . 'Page: ' . $e->getFile() . ' Line: ' . $e->getLine());
}
$this->myLogger->logme("error", "Data for BDS Installment " . json_encode($bdsInstallmentData));
// dd($bdsInstallmentData);

View File

@ -1162,7 +1162,7 @@
if (lead_type == 1) {
$('.claim-row').hide();
} else {
} else if (!shouldShowClaimHistorySwitch(lead_type, policy_type_id)) {
$('.claim-row').show();
if (policy_type_id == 1) {
@ -1174,6 +1174,10 @@
}
}
if ($('#claim_history').length && typeof claimHistoryToggle === 'function') {
claimHistoryToggle();
}
if (lead_type != 1 && policy_type_id != 1 && policy_type_id != 6 && policy_type_id != 7) {
if (lead_type == 1) {
updateRenewalFields(dataIncrement);
@ -2188,6 +2192,14 @@
// toggleRequiredFields();
// }
function isClaimHistoryPolicyType(policyTypeId) {
return ['1', '6', '7'].includes(String(policyTypeId));
}
function shouldShowClaimHistorySwitch(leadType, policyTypeId) {
return (leadType == 2 || leadType == 3) && isClaimHistoryPolicyType(policyTypeId);
}
function appendThreeYearsClaims(count) {
// let count = $('#appendAreaForClaim').data('count');
@ -2197,7 +2209,7 @@
console.log('policy_type_id', policy_type_id);
let lead_type = $('#lead_type').val();
let showClaimHistorySwitch = lead_type == 2 && (policy_type_id == 1 || policy_type_id == 6 || policy_type_id == 7);
let showClaimHistorySwitch = shouldShowClaimHistorySwitch(lead_type, policy_type_id);
console.log('claimIndex from parent', claimIndex);
let increment = claimIndex;
@ -2432,7 +2444,6 @@
} else if (value == 3) {
$('.btnDiv').hide();
$('.claim-row').show();
$('.emp_title_text').text('No of Employees at Inception')
$('.depnd_title_text').text(' No of Dependents at Inception')
@ -2546,6 +2557,10 @@
}
if ($('#claim_history').length && typeof claimHistoryToggle === 'function') {
claimHistoryToggle();
}
toggleRequiredFields();
restoreActualLeadGstNumber();
restoreActualLeadContactDetails();

View File

@ -851,7 +851,9 @@ if (isset($selected_lead_type)) {
if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide();
if (lead_type == 1 || !shouldShowClaimHistorySwitch(lead_type, policy_type_id)) {
$('.claim-row').hide();
}
if(!isExistingClient){
$('#exixting_client').prop('checked', false);

View File

@ -45,7 +45,7 @@
$savedClaims = !empty($lead_edit_data['fin_years_claims_array']) ? $lead_edit_data['fin_years_claims_array'] : [];
$isClaimHistoryChecked = (isset($lead_edit_data['claim_history']) && (int) $lead_edit_data['claim_history'] === 1) || !empty($savedClaims);
$showClaimHistorySwitch = isset($lead_edit_data['lead_type'], $lead_edit_data['policy_type_id'])
&& (int) $lead_edit_data['lead_type'] === 2
&& in_array((int) $lead_edit_data['lead_type'], [2, 3], true)
&& in_array((int) $lead_edit_data['policy_type_id'], [1, 6, 7], true);
?>
<?php if ($showClaimHistorySwitch) { ?>