FIX_BUG : RV

This commit is contained in:
VENKATESHWARAN 2025-08-07 10:48:56 +05:30
parent e006d76a99
commit 71d0e4dbf8
2 changed files with 306 additions and 292 deletions

View File

@ -2180,6 +2180,7 @@ class ClientController extends AdminController
$insurer_id = $client_policy_data['insurer_id'];
$client_id = $client_policy_data['client_id'];
$insurer_branch_id = $client_policy_data['insurer_branch_id'];
if (!empty($client_policy_data['policy_start_date'])) {
$client_policy_data['source_policy_start_date'] = change_date_format($client_policy_data['policy_start_date'], 'Y-m-d', 'd/m/Y');
@ -2200,7 +2201,8 @@ class ClientController extends AdminController
->findAll();
$client_policy_list = $this->clientPolicyModel->getPolicyTypeForPolicyBinding($client_id);
$cd_data = $this->CDMasterModel->where('client_id', $client_id)->where('insurer_id', $insurer_id)->where('is_active', 1)->findAll();
// $cd_data = $this->CDMasterModel->where('client_id', $client_id)->where('insurer_id', $insurer_id)->where('is_active', 1)->findAll();
$cd_data = $this->get_cd_ac($client_id, $insurer_id, $insurer_branch_id, "internal");
// $client_policy_data['policy_end_date'] = date('d/m/Y', strtotime($client_policy_data['policy_end_date']));
$fromDate = new \DateTime($client_policy_data['policy_end_date']);
$fromDate->modify('+1 year');
@ -2607,17 +2609,15 @@ class ClientController extends AdminController
'multiple_sum_insured' => true,
];
// $data = [];
foreach ($fields as $field => $needsCleanup) {
$value = $this->request->getPost($field);
// foreach ($fields as $field => $needsCleanup) {
// $value = $this->request->getPost($field);
// if ($value !== null && $value !== '') {
// $data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value;
// }else{
// $data[$field] = $value;
// }
// }
if ($value !== null && $value !== '') {
$data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value;
}else{
$data[$field] = $value;
}
}
$data['enrollment_display_key'] = $this->enrollmentGMCDisplayValueTransform();
@ -2949,25 +2949,25 @@ class ClientController extends AdminController
'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);
// }else{
// $data[$field] = $value;
// }
// }
// Remove commas and assign if present
foreach ($fieldsWithCommaRemoval as $field) {
$value = $this->request->getPost($field);
if ($value !== null) {
$data[$field] = str_replace(',', '', $value);
}else{
$data[$field] = $value;
}
}
// // Direct assign if present
// foreach ($fieldsWithoutCommaRemoval as $field) {
// $value = $this->request->getPost($field);
// if ($value !== null) {
// $data[$field] = $value;
// }else{
// $data[$field] = $value;
// }
// }
// Direct assign if present
foreach ($fieldsWithoutCommaRemoval as $field) {
$value = $this->request->getPost($field);
if ($value !== null) {
$data[$field] = $value;
}else{
$data[$field] = $value;
}
}
$data['enrollment_display_key'] = $this->enrollmentGPADisplayValueTransform();
@ -3573,7 +3573,7 @@ class ClientController extends AdminController
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Additionaly Rack Rate Data Remove Successfully'], 200);
}
public function get_cd_ac($client_id, $insurer_id, $insurer_branch_id)
public function get_cd_ac($client_id, $insurer_id, $insurer_branch_id, $return_type = null)
{
// Get client data
$client_data = $this->clientModel
@ -3605,6 +3605,14 @@ class ClientController extends AdminController
$cd_data = array_merge($cd_data, $client_cd_data);
if($return_type == "internal"){
if(!empty($cd_data)){
return $cd_data;
}else{
return [];
}
}
if (!empty($cd_data)) {
return $this->respond([
'status' => true,

View File

@ -1136,6 +1136,7 @@
let jsonObject = JSON.parse(response.data);
disableUnwantedTerms(jsonObject);
if(jsonObject){
Object.keys(jsonObject).forEach(function(key) {
if (key.includes("special_condition_label") || key.includes("special_condition_input")) {
@ -1418,6 +1419,7 @@
});
}
}
$("#sum_insured").trigger("keyup");
$(".multiple_sum_insured").trigger("keyup");
@ -1886,11 +1888,14 @@
}
function disableUnwantedTerms(jsonObject) {
// alert("Disabling unwanted terms");
console.log("Disabling unwanted terms");
console.log("jsonObject : ", jsonObject);
if(jsonObject){
fields.forEach(function(key) {
// If key NOT in jsonObject, then hide and disable its associated elements
if (!jsonObject.hasOwnProperty(key)) {
if (!jsonObject?.hasOwnProperty(key)) {
const elements = document.getElementsByName(key);
elements.forEach(element => {
@ -1917,6 +1922,7 @@
}
});
}
}
function autoSaveGmcTerms()
{