FEAT_NONEB_TERMS,AUTO_SAVE,EDLI-GDLI_TERMS_SRI
This commit is contained in:
parent
65b405d3e4
commit
8d47a6d9c9
@ -2302,52 +2302,109 @@ class ClientController extends AdminController
|
||||
|
||||
// print_r($data);die;
|
||||
|
||||
$data['waiverofpreexistingdiseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
$data['waiverof1,2,3&4thyearexclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||
$data['waiverof30dayswaitingperiod'] = $this->request->getPost("waiverof30dayswaitingperiod");
|
||||
$data['waiver_of_90_days_waiting_period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
|
||||
$data['waiver_of_other_waiting_periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
|
||||
$data['maternity_benefit'] = $this->request->getPost("maternity_benefit");
|
||||
$data['9monthwaitingperiodwaived'] = str_replace(',', '', $this->request->getPost("9monthwaitingperiodwaived"));
|
||||
$data['maternitycoverage'] = str_replace(',', '', $this->request->getPost("maternitycoverage"));
|
||||
$data['twindelivery'] = str_replace(',', '', $this->request->getPost("twindelivery"));
|
||||
$data['well_baby_well_mother_expenses'] = str_replace(',', '', $this->request->getPost("well_baby_well_mother_expenses"));
|
||||
$data['preandpostnatal'] = str_replace(',', '', $this->request->getPost("preandpostnatal"));
|
||||
$data['infertility_treatment_coverage'] = str_replace(',', '', $this->request->getPost("infertility_treatment_coverage"));
|
||||
$data['babyday1cover'] = str_replace(',', '', $this->request->getPost("babyday1cover"));
|
||||
$data['coverfromthedateofjoining'] = str_replace(',', '', $this->request->getPost("coverfromthedateofjoining"));
|
||||
$data['mid_term_addition_of_new_born_newly_wedded_spouse'] = str_replace(',', '', $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse"));
|
||||
$data['prehospitalizationcover'] = str_replace(',', '', $this->request->getPost("prehospitalizationcover"));
|
||||
$data['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover");
|
||||
$data['congenitaldiseasesinternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesinternal"));
|
||||
$data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal"));
|
||||
$data['copayzonewisecopay'] = $this->request->getPost("copayzonewisecopay");
|
||||
$data['roomrentlimit'] = str_replace(',', '', $this->request->getPost("roomrentlimit"));
|
||||
$data['icu_limit'] = str_replace(',', '', $this->request->getPost("icu_limit"));
|
||||
$data['proportionatedeductionclause'] = str_replace(',', '', $this->request->getPost("proportionatedeductionclause"));
|
||||
$data['ailmentcapping'] = $this->request->getPost("ailmentcapping");
|
||||
$data['ailment_capping_details'] = str_replace(',', '', $this->request->getPost("ailment_capping_details"));
|
||||
$data['corporatebuffer'] = str_replace(',', '', $this->request->getPost("corporatebuffer"));
|
||||
$data['non_admissible_contingency_corporate_buffer'] = str_replace(',', '', $this->request->getPost("non_admissible_contingency_corporate_buffer"));
|
||||
$data['ambulancecharges'] = str_replace(',', '', $this->request->getPost("ambulancecharges"));
|
||||
$data['airambulance'] = str_replace(',', '', $this->request->getPost("airambulance"));
|
||||
$data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges"));
|
||||
$data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment"));
|
||||
$data['lasiksurgery'] = str_replace(',', '', $this->request->getPost("lasiksurgery"));
|
||||
$data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover"));
|
||||
$data['moderntreatmentsasperirdai'] = str_replace(',', '', $this->request->getPost("moderntreatmentsasperirdai"));
|
||||
$data['opd_treatment'] = str_replace(',', '', $this->request->getPost("opd_treatment"));
|
||||
$data['days_of_discharge'] = str_replace(',', '', $this->request->getPost("days_of_discharge"));
|
||||
$data['days_from_dod'] = str_replace(',', '', $this->request->getPost("days_from_dod"));
|
||||
$data['terrorism'] = str_replace(',', '', $this->request->getPost("terrorism"));
|
||||
$data['widower_cover'] = str_replace(',', '', $this->request->getPost("widower_cover"));
|
||||
$data['breavement_cover'] = str_replace(',', '', $this->request->getPost("breavement_cover"));
|
||||
// $data['waiverofpreexistingdiseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
// $data['waiverof1,2,3&4thyearexclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||
// $data['waiverof30dayswaitingperiod'] = $this->request->getPost("waiverof30dayswaitingperiod");
|
||||
// $data['waiver_of_90_days_waiting_period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
|
||||
// $data['waiver_of_other_waiting_periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
|
||||
// $data['maternity_benefit'] = $this->request->getPost("maternity_benefit");
|
||||
// $data['9monthwaitingperiodwaived'] = str_replace(',', '', $this->request->getPost("9monthwaitingperiodwaived"));
|
||||
// $data['maternitycoverage'] = str_replace(',', '', $this->request->getPost("maternitycoverage"));
|
||||
// $data['twindelivery'] = str_replace(',', '', $this->request->getPost("twindelivery"));
|
||||
// $data['well_baby_well_mother_expenses'] = str_replace(',', '', $this->request->getPost("well_baby_well_mother_expenses"));
|
||||
// $data['preandpostnatal'] = str_replace(',', '', $this->request->getPost("preandpostnatal"));
|
||||
// $data['infertility_treatment_coverage'] = str_replace(',', '', $this->request->getPost("infertility_treatment_coverage"));
|
||||
// $data['babyday1cover'] = str_replace(',', '', $this->request->getPost("babyday1cover"));
|
||||
// $data['coverfromthedateofjoining'] = str_replace(',', '', $this->request->getPost("coverfromthedateofjoining"));
|
||||
// $data['mid_term_addition_of_new_born_newly_wedded_spouse'] = str_replace(',', '', $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse"));
|
||||
// $data['prehospitalizationcover'] = str_replace(',', '', $this->request->getPost("prehospitalizationcover"));
|
||||
// $data['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover");
|
||||
// $data['congenitaldiseasesinternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesinternal"));
|
||||
// $data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal"));
|
||||
// $data['copayzonewisecopay'] = $this->request->getPost("copayzonewisecopay");
|
||||
// $data['roomrentlimit'] = str_replace(',', '', $this->request->getPost("roomrentlimit"));
|
||||
// $data['icu_limit'] = str_replace(',', '', $this->request->getPost("icu_limit"));
|
||||
// $data['proportionatedeductionclause'] = str_replace(',', '', $this->request->getPost("proportionatedeductionclause"));
|
||||
// $data['ailmentcapping'] = $this->request->getPost("ailmentcapping");
|
||||
// $data['ailment_capping_details'] = str_replace(',', '', $this->request->getPost("ailment_capping_details"));
|
||||
// $data['corporatebuffer'] = str_replace(',', '', $this->request->getPost("corporatebuffer"));
|
||||
// $data['non_admissible_contingency_corporate_buffer'] = str_replace(',', '', $this->request->getPost("non_admissible_contingency_corporate_buffer"));
|
||||
// $data['ambulancecharges'] = str_replace(',', '', $this->request->getPost("ambulancecharges"));
|
||||
// $data['airambulance'] = str_replace(',', '', $this->request->getPost("airambulance"));
|
||||
// $data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges"));
|
||||
// $data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment"));
|
||||
// $data['lasiksurgery'] = str_replace(',', '', $this->request->getPost("lasiksurgery"));
|
||||
// $data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover"));
|
||||
// $data['moderntreatmentsasperirdai'] = str_replace(',', '', $this->request->getPost("moderntreatmentsasperirdai"));
|
||||
// $data['opd_treatment'] = str_replace(',', '', $this->request->getPost("opd_treatment"));
|
||||
// $data['days_of_discharge'] = str_replace(',', '', $this->request->getPost("days_of_discharge"));
|
||||
// $data['days_from_dod'] = str_replace(',', '', $this->request->getPost("days_from_dod"));
|
||||
// $data['terrorism'] = str_replace(',', '', $this->request->getPost("terrorism"));
|
||||
// $data['widower_cover'] = str_replace(',', '', $this->request->getPost("widower_cover"));
|
||||
// $data['breavement_cover'] = str_replace(',', '', $this->request->getPost("breavement_cover"));
|
||||
|
||||
$data['suminsuredenhancement'] = str_replace(',', '', $this->request->getPost("suminsuredenhancement"));
|
||||
// $data['suminsuredenhancement'] = str_replace(',', '', $this->request->getPost("suminsuredenhancement"));
|
||||
|
||||
$data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? [];
|
||||
$data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? [];
|
||||
$data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
// $data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? [];
|
||||
// $data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? [];
|
||||
// $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
$fields = [
|
||||
'waiverofpreexistingdiseases' => false,
|
||||
'waiverof1,2,3&4thyearexclusions' => false,
|
||||
'waiverof30dayswaitingperiod' => false,
|
||||
'waiver_of_90_days_waiting_period' => false,
|
||||
'waiver_of_other_waiting_periods' => false,
|
||||
'maternity_benefit' => false,
|
||||
'9monthwaitingperiodwaived' => true,
|
||||
'maternitycoverage' => true,
|
||||
'twindelivery' => true,
|
||||
'well_baby_well_mother_expenses' => true,
|
||||
'preandpostnatal' => true,
|
||||
'infertility_treatment_coverage' => true,
|
||||
'babyday1cover' => true,
|
||||
'coverfromthedateofjoining' => true,
|
||||
'mid_term_addition_of_new_born_newly_wedded_spouse' => true,
|
||||
'prehospitalizationcover' => true,
|
||||
'posthospitalizationcover' => false,
|
||||
'congenitaldiseasesinternal' => true,
|
||||
'congenitaldiseasesexternal' => true,
|
||||
'copayzonewisecopay' => false,
|
||||
'roomrentlimit' => true,
|
||||
'icu_limit' => true,
|
||||
'proportionatedeductionclause' => true,
|
||||
'ailmentcapping' => false,
|
||||
'ailment_capping_details' => true,
|
||||
'corporatebuffer' => true,
|
||||
'non_admissible_contingency_corporate_buffer' => true,
|
||||
'ambulancecharges' => true,
|
||||
'airambulance' => true,
|
||||
'reasonableandcustomarycharges' => true,
|
||||
'daycaretreatment' => true,
|
||||
'lasiksurgery' => true,
|
||||
'ayudhtreatmentcover' => true,
|
||||
'moderntreatmentsasperirdai' => true,
|
||||
'opd_treatment' => true,
|
||||
'days_of_discharge' => true,
|
||||
'days_from_dod' => true,
|
||||
'terrorism' => true,
|
||||
'widower_cover' => true,
|
||||
'breavement_cover' => true,
|
||||
'suminsuredenhancement' => true,
|
||||
'special_condition_label' => true,
|
||||
'special_condition_input' => true,
|
||||
'multiple_sum_insured' => true,
|
||||
];
|
||||
|
||||
// $data = [];
|
||||
|
||||
foreach ($fields as $field => $needsCleanup) {
|
||||
$value = $this->request->getPost($field);
|
||||
|
||||
if ($value !== null && $value !== '') {
|
||||
$data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data['enrollment_display_key'] = $this->enrollmentGMCDisplayValueTransform();
|
||||
|
||||
@ -2616,33 +2673,79 @@ class ClientController extends AdminController
|
||||
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
|
||||
$data['is_payable_employee']['self'] = 0;
|
||||
|
||||
$data['accidentalDeathBenefit'] = str_replace(',', '', $this->request->getPost("accidentalDeathBenefit"));
|
||||
$data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement"));
|
||||
$data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
$data['temporaryTotalDisablementBenefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
$data['medical_expenses_medical_extension'] = str_replace(',', '', $this->request->getPost("medical_expenses_medical_extension"));
|
||||
$data['opd_treatment_cover'] = str_replace(',', '', $this->request->getPost("opd_treatment_cover"));
|
||||
$data['ambulanceCharges'] = str_replace(',', '', $this->request->getPost("ambulanceCharges"));
|
||||
$data['repatriation_of_mortal_remains'] = str_replace(',', '', $this->request->getPost("repatriation_of_mortal_remains"));
|
||||
$data['childrenEducationWelfareFund'] = str_replace(',', '', $this->request->getPost("childrenEducationWelfareFund"));
|
||||
$data['terrorism'] = $this->request->getPost("terrorism");
|
||||
$data['worldwideCover'] = $this->request->getPost("worldwideCover");
|
||||
$data['family_transportation_benefits'] = $this->request->getPost("family_transportation_benefits");
|
||||
$data['fractures_dislocation_burns'] = $this->request->getPost("fractures_dislocation_burns");
|
||||
$data['coma'] = $this->request->getPost("coma");
|
||||
$data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody");
|
||||
$data['compassionateVisitExpenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
$data['travel_expenses_for_medical_treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
|
||||
$data['daily_cash_allowance'] = $this->request->getPost("daily_cash_allowance");
|
||||
$data['artifical_limb_and_prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
|
||||
$data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
$data['air_ambulance'] = $this->request->getPost("air_ambulance");
|
||||
// $data['accidentalDeathBenefit'] = str_replace(',', '', $this->request->getPost("accidentalDeathBenefit"));
|
||||
// $data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement"));
|
||||
// $data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
// $data['temporaryTotalDisablementBenefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
// $data['medical_expenses_medical_extension'] = str_replace(',', '', $this->request->getPost("medical_expenses_medical_extension"));
|
||||
// $data['opd_treatment_cover'] = str_replace(',', '', $this->request->getPost("opd_treatment_cover"));
|
||||
// $data['ambulanceCharges'] = str_replace(',', '', $this->request->getPost("ambulanceCharges"));
|
||||
// $data['repatriation_of_mortal_remains'] = str_replace(',', '', $this->request->getPost("repatriation_of_mortal_remains"));
|
||||
// $data['childrenEducationWelfareFund'] = str_replace(',', '', $this->request->getPost("childrenEducationWelfareFund"));
|
||||
// $data['terrorism'] = $this->request->getPost("terrorism");
|
||||
// $data['worldwideCover'] = $this->request->getPost("worldwideCover");
|
||||
// $data['family_transportation_benefits'] = $this->request->getPost("family_transportation_benefits");
|
||||
// $data['fractures_dislocation_burns'] = $this->request->getPost("fractures_dislocation_burns");
|
||||
// $data['coma'] = $this->request->getPost("coma");
|
||||
// $data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody");
|
||||
// $data['compassionateVisitExpenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
// $data['travel_expenses_for_medical_treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
|
||||
// $data['daily_cash_allowance'] = $this->request->getPost("daily_cash_allowance");
|
||||
// $data['artifical_limb_and_prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
|
||||
// $data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
// $data['air_ambulance'] = $this->request->getPost("air_ambulance");
|
||||
|
||||
|
||||
$data['gpa_special_condition_label'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_label")) ?? [];
|
||||
$data['gpa_special_condition_input'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_input")) ?? [];
|
||||
$data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
// $data['gpa_special_condition_label'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_label")) ?? [];
|
||||
// $data['gpa_special_condition_input'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_input")) ?? [];
|
||||
// $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
|
||||
$fieldsWithCommaRemoval = [
|
||||
'accidentalDeathBenefit',
|
||||
'permanentTotalDisablement',
|
||||
'medical_expenses_medical_extension',
|
||||
'opd_treatment_cover',
|
||||
'ambulanceCharges',
|
||||
'repatriation_of_mortal_remains',
|
||||
'childrenEducationWelfareFund',
|
||||
'gpa_special_condition_label',
|
||||
'gpa_special_condition_input',
|
||||
'multiple_sum_insured',
|
||||
];
|
||||
|
||||
$fieldsWithoutCommaRemoval = [
|
||||
'permanentPartialDisablement',
|
||||
'temporaryTotalDisablementBenefit',
|
||||
'terrorism',
|
||||
'worldwideCover',
|
||||
'family_transportation_benefits',
|
||||
'fractures_dislocation_burns',
|
||||
'coma',
|
||||
'carriageOfDeadBody',
|
||||
'compassionateVisitExpenses',
|
||||
'travel_expenses_for_medical_treatment',
|
||||
'daily_cash_allowance',
|
||||
'artifical_limb_and_prosthesis',
|
||||
'animalSnakeInsectBite',
|
||||
'air_ambulance'
|
||||
];
|
||||
|
||||
// Remove commas and assign if present
|
||||
foreach ($fieldsWithCommaRemoval as $field) {
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = str_replace(',', '', $value);
|
||||
}
|
||||
}
|
||||
|
||||
// Direct assign if present
|
||||
foreach ($fieldsWithoutCommaRemoval as $field) {
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$data['enrollment_display_key'] = $this->enrollmentGPADisplayValueTransform();
|
||||
|
||||
// print_r($data); die;
|
||||
@ -3268,11 +3371,29 @@ class ClientController extends AdminController
|
||||
|
||||
$client_policy_id = $this->request->getPost("client_policy_id");
|
||||
$policy_terms = $this->request->getPost("policy_terms");
|
||||
$policy_terms = json_decode($policy_terms, true);
|
||||
|
||||
if (!empty($policy_terms)) {
|
||||
$policy_terms = json_decode($policy_terms, true);
|
||||
$data = [];
|
||||
|
||||
foreach ($policy_terms as $key => $value) {
|
||||
|
||||
if (str_ends_with($key, '_display')) {
|
||||
|
||||
$original_key = substr($key, 0, -8);
|
||||
|
||||
$newKey = implode(' ', array_map('ucfirst', explode('_', $original_key)));
|
||||
|
||||
$data['enrollment_display_key'][$newKey] = $policy_terms[$original_key] ?? " ";
|
||||
|
||||
} else {
|
||||
|
||||
$data[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($data)) {
|
||||
$policy_terms['is_payable_employee']['self'] = 0;
|
||||
$policy_terms = json_encode($policy_terms);
|
||||
$policy_terms = json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2874,6 +2874,7 @@ class LeadsController extends BaseController
|
||||
$JSON = json_decode($QCRData['json'], true);
|
||||
$converted_json = $this->transformProposelData($JSON, $proposel_data['proposel_name'], $proposel_data['insurer_name']);
|
||||
|
||||
// log_message('error', 'Converted JSON: ' . json_encode($converted_json));
|
||||
return $this->convertQCRJsonToPolicyTerms($converted_json, $data['policy_type_id'], $proposel_data['proposel_name'], $proposel_data['insurer_name']);
|
||||
} catch (\Throwable $e) {
|
||||
$this->myLogger->logme('error','preparePolicyTermsFromRFQ');
|
||||
@ -2925,7 +2926,7 @@ class LeadsController extends BaseController
|
||||
foreach ($dataRow['data'] as $cellData) {
|
||||
$parentth = $cellData['parentth'] ?? '';
|
||||
$subth = $cellData['subth'] ?? '';
|
||||
$input_value = $cellData['input_value'] ?? '';
|
||||
$input_value = $cellData['input_value'] != "" ? $cellData['input_value'] : ($cellData['value'] ?? '');
|
||||
$value = $cellData['value'] ?? '';
|
||||
|
||||
// Skip unwanted keys
|
||||
@ -2937,7 +2938,9 @@ class LeadsController extends BaseController
|
||||
|
||||
// CASE 1: Handle special conditions
|
||||
case str_starts_with($item, 'special_condition') && $parentth === $proposel_name && $subth === $insurer_name:
|
||||
// log_message("error","INPUT".json_encode($input_value));
|
||||
$parts = explode('-', $input_value);
|
||||
|
||||
$labelKey = $policy_type == 1 ? 'gpa_special_condition_label' : 'special_condition_label';
|
||||
$inputKey = $policy_type == 1 ? 'gpa_special_condition_input' : 'special_condition_input';
|
||||
|
||||
@ -3015,7 +3018,15 @@ class LeadsController extends BaseController
|
||||
|
||||
// Set the value directly, overwriting with latest encountered
|
||||
if (!empty($item) && !empty($value)) {
|
||||
$terms_array[$item] = $value;
|
||||
|
||||
$finalItem = $item;
|
||||
|
||||
if (strpos($tableGroup['tableId'], 'summary') !== false) {
|
||||
$policy_type = explode('_', $tableGroup['tableId'])[0] ?? '';
|
||||
$finalItem = $policy_type . ' - ' . $item;
|
||||
|
||||
}
|
||||
$terms_array[$finalItem] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,6 +188,7 @@ class TicketController extends BaseController
|
||||
} else {
|
||||
|
||||
$isFromDashboard = $this->request->getPost("is_dashboard");
|
||||
log_message('error', 'Is From Dashboard: ' . $isFromDashboard);
|
||||
|
||||
if (isset($isFromDashboard) && !empty($isFromDashboard)){
|
||||
$data['page_name'] = "Claims";
|
||||
@ -223,7 +224,7 @@ class TicketController extends BaseController
|
||||
public function ticketSearch($action = null)
|
||||
{
|
||||
$db = db_connect();
|
||||
|
||||
// log_message('error', 'Ticket Search Action: ' . $action);
|
||||
$subquery = $db->table('ticket_master tm')
|
||||
->select([
|
||||
'tm.id AS ticket_id',
|
||||
|
||||
@ -243,7 +243,8 @@ function linkRedirectForBDS(input, team)
|
||||
console.log(link);
|
||||
|
||||
if(link){
|
||||
window.location.href = link;
|
||||
|
||||
window.open(link, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -268,8 +268,8 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
}
|
||||
|
||||
function linkRedirectForClaims(ticketTypeId, status,ids) {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
// $.ajax({
|
||||
// url: "<?= base_url("/dashboard/prepareClaimSearchData") ?>",
|
||||
// type: "POST",
|
||||
@ -305,13 +305,14 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
|
||||
|
||||
|
||||
redirectWithPost("<?= base_url("ticket/list") ?>", data);
|
||||
redirectWithPost2("<?= base_url("ticket/list") ?>", data);
|
||||
}
|
||||
|
||||
function redirectWithPost(url, data = {}) {
|
||||
function redirectWithPost2(url, data = {}) {
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = url;
|
||||
form.target = '_blank';
|
||||
|
||||
for (const key in data) {
|
||||
if (data.hasOwnProperty(key)) {
|
||||
|
||||
@ -179,7 +179,7 @@ body {
|
||||
}
|
||||
|
||||
function client_policies() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
var check_client_id = $('#general_PrimaryKey').val();
|
||||
|
||||
|
||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
<input type="text" class="form-control" placeholder="GST (%)" id="gst_no" name="gst" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-4 EB">
|
||||
<label class="switch" style="position: relative;top: 43px;left: 20px;">
|
||||
<input id="inception_type" type="checkbox" name="inception_type">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
@ -161,12 +161,12 @@
|
||||
<input value="" type="text" class="form-control dateofdata" placeholder="Enter Remainder Dates( eg, 28,29,30 )" name="reminder_date" id="reminder_date" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group col-md-12 EB">
|
||||
<label for="disclaimer">Disclaimer<span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" placeholder="Enter Disclaimer" name="disclaimer" id="disclaimer" ></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-4 EB">
|
||||
<label class="switch" style="position: relative;top: 43px;left: 20px;">
|
||||
<input id="policy_visibility" type="checkbox" name="enrolment_visibility" checked>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
@ -175,7 +175,7 @@
|
||||
<label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Enrollment App</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-4 EB">
|
||||
<label class="switch" style="position: relative;top: 43px;left: 20px;">
|
||||
<input id="is_lgbtq" type="checkbox" name="is_lgbtq">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
@ -897,6 +897,16 @@
|
||||
|
||||
}
|
||||
|
||||
if (res.data.policy_type_id > 7) {
|
||||
|
||||
$('#first').show();
|
||||
$('#second').show();
|
||||
$('#third').show();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
|
||||
$(".EB").hide();
|
||||
}
|
||||
|
||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||
|
||||
|
||||
@ -306,11 +306,13 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
|
||||
}
|
||||
|
||||
function redirectWithPost(url, data = {}, method = "GET") {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
const form = document.createElement('form');
|
||||
form.method = method;
|
||||
form.action = url;
|
||||
form.target = '_blank';
|
||||
|
||||
|
||||
for (const key in data) {
|
||||
if (data.hasOwnProperty(key)) {
|
||||
|
||||
@ -87,7 +87,25 @@ label {
|
||||
<input type="hidden" name="client_policy_id" id="other_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id" />
|
||||
<input type="hidden" id="emp_count" />
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div id="sumInsuredDiv">
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordOthers' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sum_insured_add_more" ></div>
|
||||
</div>
|
||||
<div id="append_html_for_other_policy_terms"></div>
|
||||
|
||||
<hr>
|
||||
@ -164,6 +182,9 @@ $("#otherPolicyTerms").submit(function(event) {
|
||||
// Append the JSON string to the FormData object
|
||||
formData.append('policy_terms', jsonString);
|
||||
|
||||
formData.forEach((value, key) => {
|
||||
console.log(key + ': ' + value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
@ -207,17 +228,17 @@ $("#otherPolicyTerms").submit(function(event) {
|
||||
|
||||
});
|
||||
|
||||
|
||||
var policy_type_id = "";
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
var client_policy_id = $(this).data('id');
|
||||
var policy_type_id = $(this).data('typeid');
|
||||
policy_type_id = $(this).data('typeid');
|
||||
console.log('policy_type_id', policy_type_id);
|
||||
console.log('client_policy_id :', client_policy_id);
|
||||
|
||||
$('#other_client_policy_id').val(client_policy_id);
|
||||
|
||||
appendPolicyTermsHTML(policy_type_id);
|
||||
// appendPolicyTermsHTML(policy_type_id);
|
||||
|
||||
var gpa_policy_type_id = $(this).attr('id');
|
||||
// console.log('gpa_policy_type_id', gpa_policy_type_id)
|
||||
@ -265,13 +286,14 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
if (res) {
|
||||
|
||||
//special conditions fields
|
||||
let gpaJsonObjectForSpecialCondition = JSON.parse(res.data);
|
||||
Object.keys(gpaJsonObjectForSpecialCondition).forEach(function(key) {
|
||||
if (key.includes("other_special_condition_label") || key.includes(
|
||||
"other_special_condition_input")) {
|
||||
if (key.includes("other_special_condition_label")) {
|
||||
let otherTermsJsonObjectSpecialCondition = JSON.parse(res.data);
|
||||
Object.keys(otherTermsJsonObjectSpecialCondition).forEach(function(key) {
|
||||
if (key.includes("special_condition_label") || key.includes(
|
||||
"special_condition_input")) {
|
||||
if (key.includes("special_condition_label")) {
|
||||
|
||||
for (let index = 0; index <
|
||||
gpaJsonObjectForSpecialCondition[key].length; index++) {
|
||||
otherTermsJsonObjectSpecialCondition[key].length; index++) {
|
||||
specialConditionForOthers();
|
||||
}
|
||||
}
|
||||
@ -280,26 +302,55 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
if (elements) {
|
||||
elements.forEach((element, index) => {
|
||||
|
||||
if (gpaJsonObjectForSpecialCondition[key][
|
||||
if (otherTermsJsonObjectSpecialCondition[key][
|
||||
index
|
||||
] == undefined) {
|
||||
element.value = " ";
|
||||
} else {
|
||||
element.value =
|
||||
gpaJsonObjectForSpecialCondition[key][
|
||||
otherTermsJsonObjectSpecialCondition[key][
|
||||
index
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!key.startsWith("special_condition") && !key.startsWith("sum_insured") && !key.startsWith("enrollment_display_key") ) {
|
||||
|
||||
termsHTML = `
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" name="${key}_display"
|
||||
id="${key}_display" class="unchecked" checked>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label for="${key}">${beautifyString(key)}</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="${key}" id="${key}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
$("#append_html_for_other_policy_terms").append(termsHTML);
|
||||
}
|
||||
|
||||
if (key.includes("multiple_sum_insured")) {
|
||||
gpaJsonObjectForSpecialCondition[key].forEach((value, index) => {
|
||||
appendOtherSIAddMore(value);
|
||||
});
|
||||
|
||||
const value = otherTermsJsonObjectSpecialCondition[key];
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(item => appendOtherSIAddMore(item));
|
||||
} else if (typeof value === 'object' && value !== null) {
|
||||
Object.values(value).forEach(item => appendOtherSIAddMore(item));
|
||||
}
|
||||
// else if (typeof value === 'string') {
|
||||
// appendOtherSIAddMore(value); // Use directly, no loop
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@ -367,6 +418,11 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
}
|
||||
|
||||
if(policy_type_id > 7) {
|
||||
|
||||
$("#sumInsuredDiv").empty();
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -395,11 +451,11 @@ function specialConditionForOthers(count = 0) {
|
||||
var appendElement = `<div class="form-group col-md-6 form-group-client-policy-masters removeDom">
|
||||
|
||||
<label for="specialconditionlabel" class="special_condition_label[]" style="width: 450px;position: relative;bottom: 6px;">
|
||||
<input class="form-control" name="other_special_condition_label[]" id="other_special_condition_label[]" style="position: relative;right: 15px;">
|
||||
<input class="form-control" name="special_condition_label[]" id="special_condition_label[]" style="position: relative;right: 0px;">
|
||||
<span class="specialConditionClose" style="color: red; float: right;position: relative;bottom: 28px;left: 15px;">X</span>
|
||||
</label>
|
||||
|
||||
<input type="text" name="other_special_condition_input[]" id="other_special_condition_input[]" class="form-control s special_condition_input[]">
|
||||
<input type="text" name="special_condition_input[]" id="special_condition_input[]" class="form-control s special_condition_input[]">
|
||||
</div>`;
|
||||
console.log($(this));
|
||||
$('.other_special_condition').each(function() {
|
||||
@ -465,208 +521,208 @@ function appendPolicyTermsHTML(policy_type) {
|
||||
var termsHTML = ""
|
||||
$('#append_html_for_other_policy_terms').empty();
|
||||
|
||||
if (policy_type == 7) {
|
||||
// if (policy_type == 7) {
|
||||
|
||||
termsHTML = `
|
||||
// termsHTML = `
|
||||
|
||||
<div class="form-group">
|
||||
// <div class="form-group">
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordOthers' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="sumInsured">Sum Insured</label>
|
||||
// </div>
|
||||
// <div class="col-md-4">
|
||||
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
|
||||
// </div>
|
||||
// <div class="col-md-2" style="position: relative;left: 88px;">
|
||||
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <div id='numberToWordOthers' class="text-danger-2" ></div>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div id="sum_insured_add_more" ></div>
|
||||
// <div id="sum_insured_add_more" ></div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Policy Type</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="policy_type" id="policy_type" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Policy Type</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="policy_type" id="policy_type" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Existing Insurer</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Existing Insurer</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="renewal_lives">Renewal Lives</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="renewal_lives">Renewal Lives</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Total Sum Assured</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" style="width: 100% !important;" class="form-control" name="total_sum_insured"
|
||||
id="total_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Total Sum Assured</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" style="width: 100% !important;" class="form-control" name="total_sum_insured"
|
||||
// id="total_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <div id='numberToWordTotalSumInsured' class="text-danger-2"></div>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="lives_at_inception">Lives at Inception</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="lives_at_inception">Lives at Inception</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Total Sum Insured at Inception</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
|
||||
class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Total Sum Insured at Inception</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
|
||||
// class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Premium at Inception (Excl GST)</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="premium_at_inception" id="premium_at_inception" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Premium at Inception (Excl GST)</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="premium_at_inception" id="premium_at_inception" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="coverage">Coverage</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="coverage " id="coverage" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="coverage">Coverage</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="coverage " id="coverage" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="free_cover_limit">Free Cover Limit</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="free_cover_limit" id="free_cover_limit" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="free_cover_limit">Free Cover Limit</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="free_cover_limit" id="free_cover_limit" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
</div>
|
||||
// </div>
|
||||
|
||||
`
|
||||
// `
|
||||
|
||||
} else if (policy_type == 6) {
|
||||
// } else if (policy_type == 6) {
|
||||
|
||||
termsHTML = `
|
||||
// termsHTML = `
|
||||
|
||||
<div class="form-group EDLI">
|
||||
// <div class="form-group EDLI">
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4" >
|
||||
<input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordOthers' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="sumInsured">Sum Insured</label>
|
||||
// </div>
|
||||
// <div class="col-md-4" >
|
||||
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
|
||||
// </div>
|
||||
// <div class="col-md-2" style="position: relative;left: 88px;">
|
||||
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <div id='numberToWordOthers' class="text-danger-2" ></div>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div id="sum_insured_add_more" ></div>
|
||||
// <div id="sum_insured_add_more" ></div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Existing Insurer</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Existing Insurer</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="renewal_lives">Renewal Lives</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="renewal_lives">Renewal Lives</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="lives_at_inception">Lives at Inception</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="lives_at_inception">Lives at Inception</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Total Sum Insured at Inception</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
|
||||
class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="totalSumInsured">Total Sum Insured at Inception</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
|
||||
// class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="coverage">Coverage</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="coverage " id="coverage" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="coverage">Coverage</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="coverage " id="coverage" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;display:true;">
|
||||
<div class="col-md-6">
|
||||
<label for="free_cover_limit">Free Cover Limit for Base Cover</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="free_cover_limit_for_base_cover" id="free_cover_limit_for_base_cover" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
// <div class="row" style="margin-bottom: 10px;display:true;">
|
||||
// <div class="col-md-6">
|
||||
// <label for="free_cover_limit">Free Cover Limit for Base Cover</label>
|
||||
// </div>
|
||||
// <div class="col-md-6">
|
||||
// <input type="text" name="free_cover_limit_for_base_cover" id="free_cover_limit_for_base_cover" class="form-control">
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
</div>
|
||||
// </div>
|
||||
|
||||
`
|
||||
}
|
||||
// `
|
||||
// }
|
||||
|
||||
$('#append_html_for_other_policy_terms').append(termsHTML);
|
||||
}
|
||||
@ -699,4 +755,13 @@ function appendOtherSIAddMore(data = null) {
|
||||
|
||||
addMoreContainer.insertAdjacentHTML('beforeend', html);
|
||||
}
|
||||
|
||||
function beautifyString(str) {
|
||||
return str
|
||||
.split('_') // Split the string by underscores
|
||||
.map(word =>
|
||||
word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() // Capitalize each word
|
||||
)
|
||||
.join(' '); // Join with spaces instead of underscores
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@ -784,6 +784,7 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
.next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
disableUnwantedTermsforGPA(jsonObject);
|
||||
|
||||
Object.keys(jsonObject).forEach(function(key) {
|
||||
|
||||
@ -853,6 +854,34 @@ $('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
<script>
|
||||
|
||||
const gpaFields = [
|
||||
'accidentalDeathBenefit',
|
||||
'permanentTotalDisablement',
|
||||
'permanentPartialDisablement',
|
||||
'temporaryTotalDisablementBenefit',
|
||||
'medical_expenses_medical_extension',
|
||||
'opd_treatment_cover',
|
||||
'ambulanceCharges',
|
||||
'repatriation_of_mortal_remains',
|
||||
'childrenEducationWelfareFund',
|
||||
'terrorism',
|
||||
'worldwideCover',
|
||||
'family_transportation_benefits',
|
||||
'fractures_dislocation_burns',
|
||||
'coma',
|
||||
'carriageOfDeadBody',
|
||||
'compassionateVisitExpenses',
|
||||
'travel_expenses_for_medical_treatment',
|
||||
'daily_cash_allowance',
|
||||
'artifical_limb_and_prosthesis',
|
||||
'animalSnakeInsectBite',
|
||||
'air_ambulance',
|
||||
'gpa_special_condition_label',
|
||||
'gpa_special_condition_input',
|
||||
'multiple_sum_insured'
|
||||
];
|
||||
|
||||
|
||||
document.getElementById('gpaButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
console.log('specialConditionForGPA callback clicked')
|
||||
@ -1040,4 +1069,37 @@ function processJsonObject2(jsonObject) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function disableUnwantedTermsforGPA(jsonObject) {
|
||||
// alert("Disabling unwanted terms");
|
||||
|
||||
fields.forEach(function(key) {
|
||||
// If key NOT in jsonObject, then hide and disable its associated elements
|
||||
if (!jsonObject.hasOwnProperty(key)) {
|
||||
const elements = document.getElementsByName(key);
|
||||
|
||||
elements.forEach(element => {
|
||||
element.style.display = "none";
|
||||
element.disabled = true;
|
||||
|
||||
const label = document.querySelector(`label[for="${element.id}"]`);
|
||||
if (label) {
|
||||
label.style.display = "none";
|
||||
}
|
||||
|
||||
const displayElement = document.getElementById(`${element.id}_display`);
|
||||
if (displayElement) {
|
||||
displayElement.checked = false;
|
||||
displayElement.disabled = true;
|
||||
displayElement.style.display = "none";
|
||||
}
|
||||
|
||||
const rowDiv = element.closest('.row');
|
||||
if (rowDiv) {
|
||||
rowDiv.style.display = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -11,11 +11,11 @@
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_with_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_with_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi with Floter</label>
|
||||
<label class="form-check-label">Multi with Floater</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_without_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_without_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi without Floter</label>
|
||||
<label class="form-check-label">Multi without Floater</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_with_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_with_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi with Floter</label>
|
||||
<label class="form-check-label">Multi with Floater</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_without_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_without_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi without Floter</label>
|
||||
<label class="form-check-label">Multi without Floater</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_with_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_with_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi with Floter</label>
|
||||
<label class="form-check-label">Multi with Floater</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="risk_location" value="multi_without_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_without_floter' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label">Multi without Floter</label>
|
||||
<label class="form-check-label">Multi without Floater</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -297,11 +297,12 @@ $(document).ready(function() {
|
||||
|
||||
function viewTicket(ticket_id){
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
let url = '<?= base_url('ticket/view/'); ?>' + ticket_id;
|
||||
window.open(url, '_blank');
|
||||
|
||||
let url = '<?= base_url('ticket/view/'); ?>' + ticket_id
|
||||
window.location.href = url
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -295,6 +295,7 @@
|
||||
|
||||
|
||||
<input type="hidden" id="lead_id" value="<?= htmlspecialchars($lead_data['id'] ?? "", ENT_QUOTES, 'UTF-8') ?>" />
|
||||
<input type="hidden" id="rfq_primaryKey" name="rfq_primaryKey" value="<?= isset($rfq_data['id']) ? $rfq_data['id'] : '' ?>">
|
||||
|
||||
<div id="allTableContainer">
|
||||
<div id="tablesContainer"></div>
|
||||
@ -629,6 +630,27 @@
|
||||
myModal = new bootstrap.Modal(document.getElementById('policyRegisterModel'));
|
||||
// monitorTableChanges();
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
console.log("Document ready");
|
||||
|
||||
let lead_status = '<?= isset($lead_data['status']) ? $lead_data['status'] : '' ?>';
|
||||
console.log('Lead status retrieved:', lead_status);
|
||||
|
||||
if (lead_status != "won") {
|
||||
console.log("Lead status is not 'won', setting interval for submitData");
|
||||
|
||||
setInterval(function () {
|
||||
console.log("Calling submitData(1) at 20-second interval");
|
||||
saveRFQ(true);
|
||||
}, 20000);
|
||||
} else {
|
||||
console.log("Lead status is 'won', submitData will not be called");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var tableCount = 0;
|
||||
const policies = <?= json_encode($policies) ?>;
|
||||
// // console.log('policies', policies);
|
||||
@ -2473,10 +2495,7 @@
|
||||
table_type: "new",
|
||||
table_id: `${policyName}_summary_` + locationIndex,
|
||||
table_editable: true,
|
||||
table_name: "Risk Location " + locationIndex + "- " +
|
||||
storedData.locations[i].policyRisk['occupancy'] + "- " +
|
||||
storedData.locations[i].policyRisk['address1'] + " " +
|
||||
storedData.locations[i].policyRisk['address2'],
|
||||
table_name: "Risk Location " + locationIndex,
|
||||
table_row_contents: rowContents
|
||||
});
|
||||
}
|
||||
@ -2548,17 +2567,17 @@
|
||||
return null; // If canceled, return null
|
||||
}
|
||||
|
||||
function saveRFQ() {
|
||||
function saveRFQ(isAutoSave = false) {
|
||||
// alert("Function Called");
|
||||
isSaved = true;
|
||||
// // console.log("save button clicked");
|
||||
leadJson = tablesToJson();
|
||||
// // console.log("json from function ", leadJson);
|
||||
console.log("json from function ", leadJson);
|
||||
var policyJson = localStorage.getItem("policyData") ?? null;
|
||||
saveRFQTODB(leadJson, policyJson);
|
||||
saveRFQTODB(leadJson, policyJson, isAutoSave);
|
||||
}
|
||||
|
||||
function saveRFQTODB(tableJSON, policyJson) {
|
||||
function saveRFQTODB(tableJSON, policyJson,isAutoSave = false) {
|
||||
|
||||
let submit_type = "RFQ"
|
||||
if(rfq_or_qcr == 2){submit_type = 'QCR'}
|
||||
@ -2570,9 +2589,20 @@
|
||||
registration_json: policyJson
|
||||
}
|
||||
|
||||
let rfq_primaryKey = $('#rfq_primaryKey').val();
|
||||
|
||||
if (isAutoSave) {
|
||||
formData['rfq_primaryKey'] = rfq_primaryKey;
|
||||
}
|
||||
|
||||
var url = '<?= base_url('rfq/create') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
if (!isAutoSave) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
@ -2583,24 +2613,27 @@
|
||||
console.log('RFQ NON EB FORM SUBMIT RESPONSE : ', response);
|
||||
|
||||
if (response.status == true) {
|
||||
localStorage.removeItem('policyData');
|
||||
|
||||
toastr.success(response.message, "Success");
|
||||
// // console.log(rfq_data.length);
|
||||
|
||||
$('.actionBtns').show();
|
||||
if (rfq_or_qcr == 2) {
|
||||
$("#openQCR").hide();
|
||||
if (!isAutoSave) {
|
||||
|
||||
localStorage.removeItem('policyData');
|
||||
|
||||
$('.actionBtns').show();
|
||||
if (rfq_or_qcr == 2) {
|
||||
$("#openQCR").hide();
|
||||
}
|
||||
}
|
||||
|
||||
// window.location.reload();
|
||||
} else {
|
||||
toastr.error(response.message, "Error");
|
||||
$('.actionBtns').hide();
|
||||
}
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
window.location.reload();
|
||||
if (!isAutoSave) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('.loader').fadeOut();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user