Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a9fe8303c0
@ -107,4 +107,8 @@ ABHI_PRIMARY_KEY_CONSTANT =
|
||||
|
||||
R_CARE_PRIMARY_KEY_CONSTANT =
|
||||
|
||||
FHPL_PRIMARY_KEY_CONSTANT =
|
||||
FHPL_PRIMARY_KEY_CONSTANT =
|
||||
|
||||
VIDAL_PRIMARY_KEY_CONSTANT =
|
||||
|
||||
MEDI_ASSIST_PRIMARY_KEY_CONSTANT =
|
||||
@ -62,7 +62,7 @@ class AppContentManagementController extends AdminController
|
||||
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = (int) $sanitized_post_data['add_image_id'];
|
||||
$id = ((int) $sanitized_post_data['add_image_id']) ?? null;
|
||||
|
||||
$rules = [
|
||||
'client_id' => [
|
||||
@ -100,7 +100,7 @@ class AppContentManagementController extends AdminController
|
||||
|
||||
|
||||
$file = $this->request->getFile('advertise_image');
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
//1) original file name for vaildations
|
||||
$fileName = $file->getClientName(); //original file name for vaildations
|
||||
$existing = $this->addImgModel->where('name', $fileName)->where('client_id', $fileName)->where('is_active', 1)->first();
|
||||
@ -120,7 +120,7 @@ class AppContentManagementController extends AdminController
|
||||
|
||||
$file->move($uploadPath, $fileName);
|
||||
|
||||
$id = $sanitized_post_data['add_image_id'];
|
||||
$id = $sanitized_post_data['add_image_id'] ?? null;
|
||||
$details = ['name' => $fileName,'client_id'=>$client_id];
|
||||
|
||||
if ($id == 0) {
|
||||
|
||||
@ -194,10 +194,10 @@ class BDSReportController extends AdminController
|
||||
$request_post_data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
|
||||
$fromDate = $sanitized_post_data['fromDate'];
|
||||
$toDate = $sanitized_post_data['toDate'];
|
||||
$category = $sanitized_post_data['category'];
|
||||
$report_type = $sanitized_post_data['report_type'];
|
||||
$fromDate = $sanitized_post_data['fromDate'] ?? null;
|
||||
$toDate = $sanitized_post_data['toDate'] ?? null;
|
||||
$category = $sanitized_post_data['category'] ?? null;
|
||||
$report_type = $sanitized_post_data['report_type'] ?? null;
|
||||
// log_message('error',json_encode($_POST));die();
|
||||
if ($report_type == 'insurer') {
|
||||
$life = $category == 'life' ? 1 : 0;
|
||||
@ -942,11 +942,11 @@ class BDSReportController extends AdminController
|
||||
|
||||
$request_post_data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
$fromDate = $sanitized_post_data['fromDate'];
|
||||
$toDate = $sanitized_post_data['toDate'];
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$client_type = $sanitized_post_data['client_type'];
|
||||
$issuer_branch = $sanitized_post_data['issuer_branch'];
|
||||
$fromDate = $sanitized_post_data['fromDate'] ?? null;
|
||||
$toDate = $sanitized_post_data['toDate'] ?? null;
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$client_type = $sanitized_post_data['client_type'] ?? null;
|
||||
$issuer_branch = $sanitized_post_data['issuer_branch'] ?? null;
|
||||
|
||||
$data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();
|
||||
$data['client_type'] = [1 => 'Group', 2 => 'Individual'];
|
||||
|
||||
@ -480,11 +480,28 @@ class ClientController extends AdminController
|
||||
$this->myLogger->logme('error', 'Client list function called');
|
||||
$headerData['tab_name'] = 'Clients';
|
||||
$headerData['page_name'] = 'Clients'; // Both Browser Tab name And Page name are same.
|
||||
$data['clientList'] = $this->clientModel->getCreatedByUserName(1); // passing client_type
|
||||
// $data['clientList'] = $this->clientModel->getCreatedByUserName(1); // passing client_type
|
||||
$data['client_rm'] = $this->clientRMModel->getAllClientRM();
|
||||
$data['lead_data'] = $this->leadsModel->getLeadForInsertClientList();
|
||||
|
||||
$rawList = $this->clientModel->getCreatedByUserName(1);
|
||||
$clientRM = $data['client_rm'];
|
||||
$rmMap = [];
|
||||
foreach ($clientRM as $rm) {
|
||||
$rmMap[$rm->client_id][] = $rm->account_manager;
|
||||
}
|
||||
$data['clientList'] = (!empty($rawList) && is_array($rawList)) ? array_map(function($item) use ($rmMap) {
|
||||
$managers = isset($rmMap[$item->id]) ? implode(", ", $rmMap[$item->id]) : "N/A";
|
||||
return (object) [
|
||||
'id' => $item->id,
|
||||
'client_name' => $item->client_name,
|
||||
'short_name' => $item->short_name,
|
||||
'account_managers' => $managers
|
||||
];
|
||||
}, $rawList) : [];
|
||||
|
||||
// dd($data);
|
||||
// dd($data['clientList']);
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('client_list', $data);
|
||||
@ -497,7 +514,22 @@ class ClientController extends AdminController
|
||||
public function typeList($id = null)
|
||||
{
|
||||
try {
|
||||
$data = $this->clientModel->getCreatedByUserName($id); // passing client_type
|
||||
$rawList = $this->clientModel->getCreatedByUserName($id); // passing client_type
|
||||
$clientRM = $this->clientRMModel->getAllClientRM();;
|
||||
$rmMap = [];
|
||||
foreach ($clientRM as $rm) {
|
||||
$rmMap[$rm->client_id][] = $rm->account_manager;
|
||||
}
|
||||
$data['clientList'] = (!empty($rawList) && is_array($rawList)) ? array_map(function($item) use ($rmMap) {
|
||||
$managers = isset($rmMap[$item->id]) ? implode(", ", $rmMap[$item->id]) : "N/A";
|
||||
return (object) [
|
||||
'id' => $item->id,
|
||||
'client_name' => $item->client_name,
|
||||
'short_name' => $item->short_name,
|
||||
'account_managers' => $managers
|
||||
];
|
||||
}, $rawList) : [];
|
||||
|
||||
if (empty($data)) {
|
||||
return $this->response
|
||||
->setJSON(['status' => 'error', 'message' => 'No Records found'])
|
||||
@ -832,11 +864,11 @@ class ClientController extends AdminController
|
||||
// Retrieve form data from POST request
|
||||
$loggedInUserID = get_session_userid();
|
||||
// print_rr($sanitized_post_data);die();
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$insurer_id = $sanitized_post_data['insurer_id'];
|
||||
$record_date = $sanitized_post_data['record_date'];
|
||||
$cd_ac_pk = $sanitized_post_data['cd_ac_pk'];
|
||||
$cd_ac_no = $sanitized_post_data['cd_ac_no'];
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$insurer_id = $sanitized_post_data['insurer_id'] ?? null;
|
||||
$record_date = $sanitized_post_data['record_date'] ?? null;
|
||||
$cd_ac_pk = $sanitized_post_data['cd_ac_pk'] ?? null;
|
||||
$cd_ac_no = $sanitized_post_data['cd_ac_no'] ?? null;
|
||||
|
||||
|
||||
|
||||
@ -856,15 +888,15 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
$data = [
|
||||
'amount' => $sanitized_post_data['amount'],
|
||||
'sub_type_id' => $sanitized_post_data['sub_type_id'],
|
||||
'client_id' => $sanitized_post_data['client_id'],
|
||||
'amount' => $sanitized_post_data['amount'] ?? null,
|
||||
'sub_type_id' => $sanitized_post_data['sub_type_id'] ?? null,
|
||||
'client_id' => $sanitized_post_data['client_id'] ?? null,
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $cd_ac_no ?? null,
|
||||
'cd_ac_pk' => $cd_ac_pk ?? null,
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'],
|
||||
'description' => $sanitized_post_data['description'],
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'] ?? null,
|
||||
'description' => $sanitized_post_data['description'] ?? null,
|
||||
'transaction_type' => $sanitized_post_data['transaction_type'] ?: 'Credit',
|
||||
'updated_by' => 1,
|
||||
'record_date' => $record_date
|
||||
@ -925,6 +957,29 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
$editData['client_policy'] = $clientPoliceData;
|
||||
//Notes : $editData['client_policy'] this on called in client_policy page
|
||||
$rawList = $editData['client_policy'];
|
||||
|
||||
$editData['client_policy'] = (!empty($rawList) && is_array($rawList))
|
||||
? array_values(array_map(function ($item) {
|
||||
return (object) [
|
||||
'id' => $item->id,
|
||||
'policy_no' => $item->policy_no,
|
||||
'policy_type_name' => $item->policy_type_name,
|
||||
'policy_start_date' => $item->policy_start_date,
|
||||
'policy_end_date' => $item->policy_end_date,
|
||||
'insurer_short' => $item->insurer_short,
|
||||
'insurer_branch_name' => $item->insurer_branch_name,
|
||||
'branch_name' => $item->branch_name ?? ' - ',
|
||||
'tpa_short' => $item->tpa_short,
|
||||
'policy_type_name' => $item->policy_type_name,
|
||||
'policy_type_id' => $item->policy_type_id,
|
||||
'lead_cd_amount' => $item->lead_cd_amount,
|
||||
'tpa_branch_code' => $item->tpa_branch_code,
|
||||
'branch_name' => $item->branch_name ?? ' - ',
|
||||
'policy_type_id' => $item->policy_type_id,
|
||||
];
|
||||
}, $rawList)) : [];
|
||||
$editData['client_policy']['role'] = get_role_id();
|
||||
$editData['notification'] = $this->notificationModel->select('template_name,enabled')->where('client_id', $id)->findAll();
|
||||
$editData['placeHolders'] = ['member_name', 'member_mobile', 'nhance_logo', 'tpa_id', 'ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
|
||||
@ -1778,13 +1833,13 @@ class ClientController extends AdminController
|
||||
$this->myLogger->logme('error', 'Client branch EDIT function called');
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['branch_id_primarykey'];
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$id = $sanitized_post_data['branch_id_primarykey'] ?? null;
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$pre_branch_id = $sanitized_post_data['pre_branch_id'] ?? '';
|
||||
|
||||
$data['pre_branch_id'] = $pre_branch_id;
|
||||
|
||||
$units = $sanitized_post_data['units'];
|
||||
$units = $sanitized_post_data['units'] ?? null;
|
||||
|
||||
$emp_unit_count = 0;
|
||||
$rr_unit_count = 0;
|
||||
@ -1980,23 +2035,23 @@ class ClientController extends AdminController
|
||||
|
||||
$this->myLogger->logme('error', 'Client policy CREATE function called');
|
||||
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$request_post_data = $this->request->getPost();
|
||||
$$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
|
||||
$policy_type_id = $sanitized_post_data['policy_type_id'];
|
||||
$client_branch_id = $sanitized_post_data['client_branch_id'];
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$base_policy = $sanitized_post_data['base_policy'];
|
||||
$policy_type_id = $sanitized_post_data['policy_type_id'] ?? null;
|
||||
$client_branch_id = $sanitized_post_data['client_branch_id'] ?? null;
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$base_policy = $sanitized_post_data['base_policy'] ?? null;
|
||||
|
||||
|
||||
$insurerValue = (string) $sanitized_post_data['insurer'];
|
||||
$insurerValue = (string) $sanitized_post_data['insurer'] ?? null;
|
||||
list($insurerBranchId, $insurerId) = explode('-', $insurerValue);
|
||||
|
||||
|
||||
$data['insurer_branch_id'] = $insurerBranchId;
|
||||
$data['insurer_id'] = $insurerId;
|
||||
$sanitized_post_data['insurer_branch_id'] = $insurerBranchId;
|
||||
$sanitized_post_data['insurer_id'] = $insurerId;
|
||||
|
||||
$tpaValue = (string) $sanitized_post_data['tpa'];
|
||||
$tpaValue = (string) $sanitized_post_data['tpa'] ?? null;
|
||||
|
||||
if ($tpaValue === null || $tpaValue === '') {
|
||||
$tpaBranchId = null;
|
||||
@ -2006,76 +2061,67 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
$insert_data['client_id'] = $client_id;
|
||||
$insert_data['tpa_branch_id'] = $tpaBranchId;
|
||||
$insert_data['tpa_id'] = $tpaId;
|
||||
$insert_data['policy_type_id'] = $sanitized_post_data['policy_type_id'];
|
||||
$sanitized_post_data['client_id'] = $client_id;
|
||||
$sanitized_post_data['tpa_branch_id'] = $tpaBranchId;
|
||||
$sanitized_post_data['tpa_id'] = $tpaId;
|
||||
$sanitized_post_data['policy_type_id'] = $sanitized_post_data['policy_type_id'] ?? null;
|
||||
|
||||
$insert_data['no_of_lives'] = $sanitized_post_data['no_of_lives'];
|
||||
$insert_data['policy_status'] = $sanitized_post_data['policy_status'];
|
||||
$insert_data['no_of_employees'] = $sanitized_post_data['no_of_employees'];
|
||||
$insert_data['earned_premium_date'] = change_date_format($sanitized_post_data['earned_premium_date'], 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$insert_data['claims_incurred_date'] = change_date_format($sanitized_post_data['claims_incurred_date'], 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$insert_data['incurred_claims_ratio'] = $sanitized_post_data['incurred_claims_ratio'];
|
||||
$insert_data['no_lives_at_inception'] = $sanitized_post_data['no_lives_at_inception'];
|
||||
$insert_data['premium_paid_at_inception'] = $sanitized_post_data['premium_paid_at_inception'];
|
||||
$insert_data['claims_experience_for_last_3_years'] = $sanitized_post_data['claims_experience_for_last_3_years'];
|
||||
$insert_data['earned_premium_amount'] = $sanitized_post_data['earned_premium_amount'];
|
||||
$insert_data['claims_incurred_amount'] = $sanitized_post_data['claims_incurred_amount'];
|
||||
$insert_data['base_policy'] = ($sanitized_post_data['base_policy'] === '' || $sanitized_post_data['base_policy'] == 0) ? null : $sanitized_post_data['base_policy'];
|
||||
$insert_data['policy_status'] = 1;
|
||||
$insert_data['inception_type'] = $sanitized_post_data['inception_type'] ? 2 : 1;
|
||||
$insert_data['client_branch_id'] = $sanitized_post_data['client_branch_id'];
|
||||
$insert_data['cd_ac_pk'] = $sanitized_post_data['cd_ac_no'];
|
||||
$insert_data['gst'] = $sanitized_post_data['gst'];
|
||||
$insert_data['disclaimer'] = $sanitized_post_data['disclaimer'];
|
||||
$insert_data['is_member_modify_allowed'] = $sanitized_post_data['is_member_modify_allowed'] ? 1 : 0;
|
||||
$insert_data['enrolment_visibility'] = $sanitized_post_data['enrolment_visibility'] ? 1 : 0;
|
||||
$insert_data['is_lgbtq'] = $sanitized_post_data['is_lgbtq'] ? 1 : 0;
|
||||
$insert_data['wellness_plan_id'] = $sanitized_post_data['wellness_plan_id'];
|
||||
$insert_data['wellness_vendor_id'] = $sanitized_post_data['wellness_vendor_id'];
|
||||
$insert_data['wellness_vendor_id'] = !empty($insert_data['wellness_vendor_id']) ? $insert_data['wellness_vendor_id'] : null;
|
||||
|
||||
$sanitized_post_data['earned_premium_date'] = change_date_format($sanitized_post_data['earned_premium_date'] ?? null, 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$sanitized_post_data['claims_incurred_date'] = change_date_format($sanitized_post_data['claims_incurred_date'] ?? null, 'd-m-Y', 'Y-m-d') ?? null;
|
||||
|
||||
$sanitized_post_dataa['base_policy'] = ($sanitized_post_data['base_policy'] === '' || $sanitized_post_data['base_policy'] == 0) ? null : $sanitized_post_data['base_policy'];
|
||||
$sanitized_post_data['policy_status'] = 1;
|
||||
$sanitized_post_data['inception_type'] = $sanitized_post_data['inception_type'] ? 2 : 1;
|
||||
|
||||
|
||||
|
||||
|
||||
$sanitized_post_data['is_member_modify_allowed'] = $sanitized_post_data['is_member_modify_allowed'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['enrolment_visibility'] = $sanitized_post_data['enrolment_visibility'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['is_lgbtq'] = $sanitized_post_data['is_lgbtq'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['wellness_vendor_id'] = !empty($sanitized_post_data['wellness_vendor_id']) ? $sanitized_post_data['wellness_vendor_id'] : null;
|
||||
|
||||
|
||||
if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) {
|
||||
|
||||
$insert_data['is_addon'] = 1; // Base Policy
|
||||
$sanitized_post_data['is_addon'] = 1; // Base Policy
|
||||
|
||||
} else if ($policy_type_id == 4 || $policy_type_id == 5) {
|
||||
|
||||
$insert_data['is_addon'] = 2; // SI TOPUP
|
||||
$sanitized_post_data['is_addon'] = 2; // SI TOPUP
|
||||
|
||||
} else if ($policy_type_id == 3) {
|
||||
|
||||
if ($base_policy) {
|
||||
$insert_data['is_addon'] = 3; // Dependent Addon
|
||||
$sanitized_post_data['is_addon'] = 3; // Dependent Addon
|
||||
} else {
|
||||
$insert_data['is_addon'] = 1;
|
||||
$sanitized_post_data['is_addon'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$insert_data['policy_start_date'] = change_date_format($sanitized_post_data['policy_start_date'], 'd-m-Y', 'Y-m-d');
|
||||
$insert_data['policy_end_date'] = change_date_format($sanitized_post_data['policy_end_date'], 'd-m-Y', 'Y-m-d');
|
||||
$insert_data['policy_no'] = $sanitized_post_data['policy_no'];
|
||||
if ($insert_data['inception_type'] == 2) {
|
||||
$insert_data['open_date'] = change_date_format($sanitized_post_data['open_date'], 'd-m-Y', 'Y-m-d');
|
||||
$insert_data['close_date'] = change_date_format($sanitized_post_data['close_date'], 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['policy_start_date'] = change_date_format($sanitized_post_data['policy_start_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['policy_end_date'] = change_date_format($sanitized_post_data['policy_end_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['policy_no'] = $sanitized_post_data['policy_no'] ?? null;
|
||||
if ($sanitized_post_data['inception_type'] == 2) {
|
||||
$sanitized_post_data['open_date'] = change_date_format($sanitized_post_data['open_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['close_date'] = change_date_format($sanitized_post_data['close_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
// $data['reminder_date'] = change_date_format($this->request->getPost('reminder_date'), 'd-m-Y', 'Y-m-d');
|
||||
$insert_data['reminder_date'] = $sanitized_post_data['reminder_date'];
|
||||
$sanitized_post_data['reminder_date'] = $sanitized_post_data['reminder_date'] ?? null;
|
||||
} else {
|
||||
$insert_data['open_date'] = null;
|
||||
$insert_data['closedate'] = null;
|
||||
$insert_data['reminder_date'] = null;
|
||||
$sanitized_post_data['open_date'] = null;
|
||||
$sanitized_post_data['closedate'] = null;
|
||||
$sanitized_post_data['reminder_date'] = null;
|
||||
}
|
||||
|
||||
$insert_data['created_by'] = get_session_userid();
|
||||
$sanitized_post_data['created_by'] = get_session_userid();
|
||||
|
||||
$insert = $this->clientPolicyModel->insert($insert_data);
|
||||
$insert = $this->clientPolicyModel->insert($sanitized_post_data);
|
||||
if ($insert) {
|
||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($sanitized_post_data['client_id']);
|
||||
$clientPoliceData['role'] = get_role_id();
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $clientPoliceData, 'method' => 'CERATE', 'post_data' => $insert_data], 200);
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $clientPoliceData, 'client_id' => $client_id, 'method' => 'CERATE', 'post_data' => $insert_data], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
||||
}
|
||||
@ -2088,19 +2134,19 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$policy_type_id = $sanitized_post_data['policy_type_id'];
|
||||
$base_policy = $sanitized_post_data['base_policy'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$policy_type_id = $sanitized_post_data['policy_type_id'] ?? null;
|
||||
$base_policy = $sanitized_post_data['base_policy'] ?? null;
|
||||
|
||||
|
||||
$insurerValue = (string) $sanitized_post_data['insurer'];
|
||||
list($insurerBranchId, $insurerId) = explode('-', $insurerValue);
|
||||
|
||||
$data['insurer_branch_id'] = $insurerBranchId;
|
||||
$data['insurer_id'] = $insurerId;
|
||||
$sanitized_post_data['insurer_branch_id'] = $insurerBranchId ?? null;
|
||||
$sanitized_post_data['insurer_id'] = $insurerId ?? null;
|
||||
|
||||
$tpaValue = (string) $sanitized_post_data['tpa'];
|
||||
$tpaValue = (string) $sanitized_post_data['tpa'] ?? null;
|
||||
if (!empty($tpaValue) || $tpaValue !== '') {
|
||||
list($tpaBranchId, $tpaId) = explode('-', $tpaValue);
|
||||
} else {
|
||||
@ -2108,73 +2154,73 @@ class ClientController extends AdminController
|
||||
$tpaId = null;
|
||||
}
|
||||
|
||||
$update_data['tpa_branch_id'] = $tpaBranchId;
|
||||
$update_data['client_id'] = $client_id;
|
||||
$update_data['tpa_id'] = $tpaId;
|
||||
$update_data['policy_type_id'] = $sanitized_post_data['policy_type_id'];
|
||||
$update_data['policy_no'] = $sanitized_post_data['policy_no'];
|
||||
$sanitized_post_data['tpa_branch_id'] = $tpaBranchId ?? null;
|
||||
$sanitized_post_data['client_id'] = $client_id ?? null;
|
||||
$sanitized_post_data['tpa_id'] = $tpaId ?? null;
|
||||
$sanitized_post_data['policy_type_id'] = $sanitized_post_data['policy_type_id'] ?? null;
|
||||
$sanitized_post_data['policy_no'] = $sanitized_post_data['policy_no'] ?? null;
|
||||
|
||||
$update_data['insured'] = $sanitized_post_data['insured'];
|
||||
$update_data['no_of_lives'] = $sanitized_post_data['no_of_lives'];
|
||||
$update_data['policy_status'] = $sanitized_post_data['policy_status'];
|
||||
$update_data['no_of_employees'] = $sanitized_post_data['no_of_employees'];
|
||||
$update_data['earned_premium_date'] = change_date_format($sanitized_post_data['earned_premium_date'], 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$update_data['claims_incurred_date'] = change_date_format($sanitized_post_data['claims_incurred_date'], 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$update_data['incurred_claims_ratio'] = $sanitized_post_data['incurred_claims_ratio'];
|
||||
$update_data['no_lives_at_inception'] = $sanitized_post_data['no_lives_at_inception'];
|
||||
$update_data['premium_paid_at_inception'] = $sanitized_post_data['premium_paid_at_inception'];
|
||||
$update_data['claims_experience_for_last_3_years'] = $sanitized_post_data['claims_experience_for_last_3_years'];
|
||||
$update_data['earned_premium_amount'] = $sanitized_post_data['earned_premium_amount'];
|
||||
$update_data['claims_incurred_amount'] = $sanitized_post_data['claims_incurred_amount'];
|
||||
$update_data['base_policy'] = ($sanitized_post_data['base_policy'] === '' || $sanitized_post_data['base_policy'] == 0) ? null : $sanitized_post_data['base_policy'];
|
||||
$update_data['policy_status'] = 1;
|
||||
$update_data['inception_type'] = $sanitized_post_data['inception_type'] ? 2 : 1;
|
||||
$update_data['enrolment_visibility'] = $sanitized_post_data['enrolment_visibility'] ? 1 : 0;
|
||||
$update_data['client_branch_id'] = $sanitized_post_data['client_branch_id'];
|
||||
$update_data['cd_ac_pk'] = $sanitized_post_data['cd_ac_no'];
|
||||
$update_data['gst'] = $sanitized_post_data['gst'];
|
||||
$update_data['disclaimer'] = $sanitized_post_data['disclaimer'];
|
||||
$update_data['policy_start_date'] = change_date_format($sanitized_post_data['policy_start_date'], 'd-m-Y', 'Y-m-d');
|
||||
$update_data['policy_end_date'] = change_date_format($sanitized_post_data['policy_end_date'], 'd-m-Y', 'Y-m-d');
|
||||
$update_data['is_member_modify_allowed'] = $sanitized_post_data['is_member_modify_allowed'] ? 1 : 0;
|
||||
$update_data['is_lgbtq'] = $sanitized_post_data['is_lgbtq'] ? 1 : 0;
|
||||
$update_data['wellness_plan_id'] = $sanitized_post_data['wellness_plan_id'];
|
||||
$update_data['wellness_vendor_id'] = $sanitized_post_data['wellness_vendor_id'];
|
||||
$update_data['wellness_vendor_id'] = !empty($update_data['wellness_vendor_id']) ? $update_data['wellness_vendor_id'] : null;
|
||||
// $sanitized_post_data['insured'] = $sanitized_post_data['insured'];
|
||||
$sanitized_post_data['no_of_lives'] = $sanitized_post_data['no_of_lives'] ?? null;
|
||||
$sanitized_post_data['policy_status'] = $sanitized_post_data['policy_status'] ?? null;
|
||||
$sanitized_post_data['no_of_employees'] = $sanitized_post_data['no_of_employees'] ?? null;
|
||||
$sanitized_post_data['earned_premium_date'] = change_date_format($sanitized_post_data['earned_premium_date'] ?? null, 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$sanitized_post_data['claims_incurred_date'] = change_date_format($sanitized_post_data['claims_incurred_date'] ?? null, 'd-m-Y', 'Y-m-d') ?? null;
|
||||
$sanitized_post_data['incurred_claims_ratio'] = $sanitized_post_data['incurred_claims_ratio'] ?? null;
|
||||
$sanitized_post_data['no_lives_at_inception'] = $sanitized_post_data['no_lives_at_inception'] ?? null;
|
||||
$sanitized_post_data['premium_paid_at_inception'] = $sanitized_post_data['premium_paid_at_inception'] ?? null;
|
||||
$sanitized_post_data['claims_experience_for_last_3_years'] = $sanitized_post_data['claims_experience_for_last_3_years'] ?? null;
|
||||
$sanitized_post_data['earned_premium_amount'] = $sanitized_post_data['earned_premium_amount'] ?? null;
|
||||
$sanitized_post_data['claims_incurred_amount'] = $sanitized_post_data['claims_incurred_amount'] ?? null;
|
||||
$sanitized_post_data['base_policy'] = ($sanitized_post_data['base_policy'] === '' || $sanitized_post_data['base_policy'] == 0) ? null : $sanitized_post_data['base_policy'];
|
||||
$sanitized_post_data['policy_status'] = 1;
|
||||
$sanitized_post_data['inception_type'] = $sanitized_post_data['inception_type'] ?? null ? 2 : 1;
|
||||
$sanitized_post_data['enrolment_visibility'] = $sanitized_post_data['enrolment_visibility'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['client_branch_id'] = $sanitized_post_data['client_branch_id'] ?? null;
|
||||
$sanitized_post_data['cd_ac_pk'] = $sanitized_post_data['cd_ac_no'] ?? null;
|
||||
$sanitized_post_data['gst'] = $sanitized_post_data['gst'] ?? null;
|
||||
$sanitized_post_data['disclaimer'] = $sanitized_post_data['disclaimer'] ?? null;
|
||||
$sanitized_post_data['policy_start_date'] = change_date_format($sanitized_post_data['policy_start_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['policy_end_date'] = change_date_format($sanitized_post_data['policy_end_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['is_member_modify_allowed'] = $sanitized_post_data['is_member_modify_allowed'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['is_lgbtq'] = $sanitized_post_data['is_lgbtq'] ?? null ? 1 : 0;
|
||||
$sanitized_post_data['wellness_plan_id'] = $sanitized_post_data['wellness_plan_id'] ?? null;
|
||||
$sanitized_post_data['wellness_vendor_id'] = $sanitized_post_data['wellness_vendor_id'] ?? null;
|
||||
$sanitized_post_data['wellness_vendor_id'] = !empty($sanitized_post_data['wellness_vendor_id']) ? $sanitized_post_data['wellness_vendor_id'] : null;
|
||||
|
||||
if ($update_data['inception_type'] == 2) {
|
||||
$update_data['open_date'] = change_date_format($sanitized_post_data['open_date'], 'd-m-Y', 'Y-m-d');
|
||||
$update_data['close_date'] = change_date_format($sanitized_post_data['close_date'], 'd-m-Y', 'Y-m-d');
|
||||
// $data['reminder_date'] = change_date_format($sanitized_post_data['reminder_date'), 'd-m-Y', 'Y-m-d');
|
||||
$update_data['reminder_date'] = $sanitized_post_data['reminder_date'];
|
||||
if ($sanitized_post_data['inception_type'] == 2) {
|
||||
$sanitized_post_data['open_date'] = change_date_format($sanitized_post_data['open_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['close_date'] = change_date_format($sanitized_post_data['close_date'] ?? null, 'd-m-Y', 'Y-m-d');
|
||||
// $sanitized_post_data['reminder_date'] = change_date_format($sanitized_post_data['reminder_date'), 'd-m-Y', 'Y-m-d');
|
||||
$sanitized_post_data['reminder_date'] = $sanitized_post_data['reminder_date'] ?? null;
|
||||
} else {
|
||||
$update_data['open_date'] = null;
|
||||
$update_data['close_date'] = null;
|
||||
$update_data['reminder_date'] = null;
|
||||
$sanitized_post_data['open_date'] = null;
|
||||
$sanitized_post_data['close_date'] = null;
|
||||
$sanitized_post_data['reminder_date'] = null;
|
||||
}
|
||||
|
||||
if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) {
|
||||
|
||||
$update_data['is_addon'] = 1; // Base Policy
|
||||
$sanitized_post_data['is_addon'] = 1; // Base Policy
|
||||
|
||||
} else if ($policy_type_id == 4 || $policy_type_id == 5) {
|
||||
|
||||
$update_data['is_addon'] = 2; // SI TOPUP
|
||||
$sanitized_post_data['is_addon'] = 2; // SI TOPUP
|
||||
|
||||
} else if ($policy_type_id == 3) {
|
||||
|
||||
if ($base_policy) {
|
||||
$update_data['is_addon'] = 3; // Dependent Addon
|
||||
$sanitized_post_data['is_addon'] = 3; // Dependent Addon
|
||||
} else {
|
||||
$update_data['is_addon'] = 1;
|
||||
$sanitized_post_data['is_addon'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$policy_terms = $this->clientPolicyModel->where('id', $sanitized_post_data['base_policy'])->first();
|
||||
|
||||
$old_client_policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $id)->first();
|
||||
$update_data['updated_by'] = get_session_userid();
|
||||
$update = $this->clientPolicyModel->update($id, $update_data);
|
||||
$sanitized_post_data['updated_by'] = get_session_userid();
|
||||
$update = $this->clientPolicyModel->update($id, $sanitized_post_data);
|
||||
|
||||
if ($update) {
|
||||
|
||||
@ -2190,7 +2236,7 @@ class ClientController extends AdminController
|
||||
]]);
|
||||
}
|
||||
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $clientPoliceData, 'method' => 'EDIT'], 200);
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $clientPoliceData, 'client_id' => $client_id, 'method' => 'EDIT'], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
||||
}
|
||||
@ -2269,20 +2315,20 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$client_policy_id = $sanitized_post_data['client_policy_id'];
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$client_policy_id = $sanitized_post_data['client_policy_id'] ?? null;
|
||||
$record = $this->clientPolicyModel->where('client_policy.id', $client_policy_id)->first();
|
||||
$premium_type = $sanitized_post_data['premium_type'];
|
||||
$premium_type = $sanitized_post_data['premium_type'] ?? null;
|
||||
if (!empty($client_id) && $client_id != null) {
|
||||
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
$client_id = $client_policy_data['client_id'];
|
||||
$client_id = $client_policy_data['client_id'] ?? null;
|
||||
}
|
||||
|
||||
$branch_units = $this->getBranchUnitsByBranchId($record['client_branch_id']);
|
||||
$branch_units = json_decode($branch_units);
|
||||
|
||||
$policy_grid_id = $sanitized_post_data['policy_grid_id'];
|
||||
$rack_rate_name = $sanitized_post_data['rack_rate_name'];
|
||||
$policy_grid_id = $sanitized_post_data['policy_grid_id'] ?? null;
|
||||
$rack_rate_name = $sanitized_post_data['rack_rate_name'] ?? null;
|
||||
|
||||
$relation_data = [
|
||||
'self' => $sanitized_post_data['self'] ?? 'NA',
|
||||
@ -2316,7 +2362,7 @@ class ClientController extends AdminController
|
||||
$jsonDataForRelation = json_encode($relation_data);
|
||||
$json_data_relation_data_for_form_submit_check = json_encode($relation_data_for_form_submit_check);
|
||||
|
||||
$si_or_bp = $sanitized_post_data['si_or_bp'];
|
||||
$si_or_bp = $sanitized_post_data['si_or_bp'] ?? null;
|
||||
$basic_multiplier = str_replace(',', '', $sanitized_post_data['basic_multiplier']);
|
||||
$premium_multiplier = str_replace(',', '', $sanitized_post_data['premium_multiplier']);
|
||||
$multiplier = str_replace(',', '', $sanitized_post_data['multiplier']);
|
||||
@ -2344,14 +2390,14 @@ class ClientController extends AdminController
|
||||
|
||||
$premium = str_replace(',', '', $sanitized_post_data['gpa_sum_premium[]']);
|
||||
$sum_insure = str_replace(',', '', $sanitized_post_data['gpa_sum_si[]']);
|
||||
$multiplier = $sanitized_post_data['gpa_sum_multiplier'];
|
||||
$unit = $sanitized_post_data['gpa_unit_1[]'];
|
||||
$multiplier = $sanitized_post_data['gpa_sum_multiplier'] ?? null;
|
||||
$unit = $sanitized_post_data['gpa_unit_1[]'] ?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['si'] = $sum_insure[$i];
|
||||
$data['premium'] = $premium[$i];
|
||||
$data['multiplier'] = $multiplier;
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'];
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'] ?? null;
|
||||
if (empty($unit) || !isset($unit[$i]) || empty($unit[$i])) {
|
||||
$data['unit'] = $branch_units[0];
|
||||
} else {
|
||||
@ -2364,9 +2410,9 @@ class ClientController extends AdminController
|
||||
|
||||
$premium = str_replace(',', '', $sanitized_post_data['gpa_sum_premium2[]']);
|
||||
$sum_insure = str_replace(',', '', $sanitized_post_data['gpa_sum_si2[]']);
|
||||
$multiplier = $sanitized_post_data['gpa_sum_multiplier2'];
|
||||
$grade = $sanitized_post_data['gpa_band[]'];
|
||||
$unit = $sanitized_post_data['gpa_unit_3[]'];
|
||||
$multiplier = $sanitized_post_data['gpa_sum_multiplier2'] ?? null;
|
||||
$grade = $sanitized_post_data['gpa_band[]'] ?? null;
|
||||
$unit = $sanitized_post_data['gpa_unit_3[]'] ?? null;
|
||||
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
@ -2374,7 +2420,7 @@ class ClientController extends AdminController
|
||||
$data['premium'] = $premium[$i];
|
||||
$data['grade'] = $grade[$i];
|
||||
$data['multiplier'] = $multiplier;
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'];
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'] ?? null;
|
||||
if (empty($unit) || !isset($unit[$i]) || empty($unit[$i])) {
|
||||
$data['unit'] = $branch_units[0];
|
||||
} else {
|
||||
@ -2388,14 +2434,14 @@ class ClientController extends AdminController
|
||||
$premium = str_replace(',', '', $sanitized_post_data['gpa_basic_premium[]']);
|
||||
$sum_insure = str_replace(',', '', $sanitized_post_data['gpa_basic_si[]']);
|
||||
$basic_pay = str_replace(',', '', $sanitized_post_data['basic_pay[]']);
|
||||
$unit = $sanitized_post_data['gpa_unit[]'];
|
||||
$unit = $sanitized_post_data['gpa_unit[]'] ?? null;
|
||||
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'];
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'] ?? null;
|
||||
$data['basic_multiplier'] = str_replace(',', '', $sanitized_post_data['basic_multiplier']);
|
||||
$data['multiplier'] = $sanitized_post_data['premium_multiplier'];
|
||||
$data['multiplier'] = $sanitized_post_data['premium_multiplier'] ?? null;
|
||||
$data['basic_pay'] = $basic_pay[$i];
|
||||
$data['si'] = $sum_insure[$i];
|
||||
$data['premium'] = $premium[$i];
|
||||
@ -2412,9 +2458,9 @@ class ClientController extends AdminController
|
||||
$data['premium'] = str_replace(',', '', $sanitized_post_data['gpa_basic_premium']);
|
||||
$data['si'] = str_replace(',', '', $sanitized_post_data['gpa_basic_si']);
|
||||
$data['basic_multiplier'] = str_replace(',', '', $sanitized_post_data['basic_multiplier']);
|
||||
$data['multiplier'] = $sanitized_post_data['premium_multiplier'];
|
||||
$data['multiplier'] = $sanitized_post_data['premium_multiplier'] ?? null;
|
||||
$data['basic_pay'] = str_replace(',', '', $sanitized_post_data['basic_pay']);
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'];
|
||||
$data['si_or_bp'] = $sanitized_post_data['si_or_bp'] ?? null;
|
||||
|
||||
$policyPremium = $this->policyPremium1Model->insert($data);
|
||||
}
|
||||
@ -2423,9 +2469,9 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '2') {
|
||||
|
||||
$premium = $sanitized_post_data['gpa_premium29[]'];
|
||||
$sum_insure = $sanitized_post_data['gpa_si29[]'];
|
||||
$unit = $sanitized_post_data['gpa_unit29[]'];
|
||||
$premium = $sanitized_post_data['gpa_premium29[]'] ?? null;
|
||||
$sum_insure = $sanitized_post_data['gpa_si29[]'] ?? null;
|
||||
$unit = $sanitized_post_data['gpa_unit29[]'] ?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2442,9 +2488,9 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '3') {
|
||||
|
||||
$premium = $sanitized_post_data['3_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['3_si[]'];
|
||||
$unit = $sanitized_post_data['3_unit[]'];
|
||||
$premium = $sanitized_post_data['3_premium[]'] ?? null;
|
||||
$sum_insure = $sanitized_post_data['3_si[]'] ?? null;
|
||||
$unit = $sanitized_post_data['3_unit[]'] ?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2460,11 +2506,11 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '4') {
|
||||
|
||||
$premium = $sanitized_post_data['4_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['4_si'];
|
||||
$age_from = $sanitized_post_data['4_age_from[]'];
|
||||
$age_to = $sanitized_post_data['4_age_to[]'];
|
||||
$unit = $sanitized_post_data['4_unit[]'];
|
||||
$premium = $sanitized_post_data['4_premium[]'] ?? null;
|
||||
$sum_insure = $sanitized_post_data['4_si'] ?? null;
|
||||
$age_from = $sanitized_post_data['4_age_from[]'] ?? null;
|
||||
$age_to = $sanitized_post_data['4_age_to[]'] ?? null;
|
||||
$unit = $sanitized_post_data['4_unit[]'] ?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2483,11 +2529,11 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '5') {
|
||||
|
||||
$premium = $sanitized_post_data['5_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['5_si[]'];
|
||||
$age_from = $sanitized_post_data['5_age_from[]'];
|
||||
$age_to = $sanitized_post_data['5_age_to[]'];
|
||||
$unit = $sanitized_post_data['5_unit[]'];
|
||||
$premium = $sanitized_post_data['5_premium[]'] ?? null;
|
||||
$sum_insure = $sanitized_post_data['5_si[]']?? null;
|
||||
$age_from = $sanitized_post_data['5_age_from[]']?? null;
|
||||
$age_to = $sanitized_post_data['5_age_to[]']?? null;
|
||||
$unit = $sanitized_post_data['5_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2507,11 +2553,11 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '6') {
|
||||
|
||||
$premium = $sanitized_post_data['6_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['6_si'];
|
||||
$age_from = $sanitized_post_data['6_age_from[]'];
|
||||
$age_to = $sanitized_post_data['6_age_to[]'];
|
||||
$unit = $sanitized_post_data['6_unit[]'];
|
||||
$premium = $sanitized_post_data['6_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['6_si']?? null;
|
||||
$age_from = $sanitized_post_data['6_age_from[]']?? null;
|
||||
$age_to = $sanitized_post_data['6_age_to[]']?? null;
|
||||
$unit = $sanitized_post_data['6_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2529,11 +2575,11 @@ class ClientController extends AdminController
|
||||
$data = $sanitized_post_data;
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '7') {
|
||||
$premium = $sanitized_post_data['7_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['7_si[]'];
|
||||
$age_from = $sanitized_post_data['7_age_from[]'];
|
||||
$age_to = $sanitized_post_data['7_age_to[]'];
|
||||
$unit = $sanitized_post_data['7_unit[]'];
|
||||
$premium = $sanitized_post_data['7_premium[]'] ?? null;
|
||||
$sum_insure = $sanitized_post_data['7_si[]'] ?? null;
|
||||
$age_from = $sanitized_post_data['7_age_from[]'] ?? null;
|
||||
$age_to = $sanitized_post_data['7_age_to[]'] ?? null;
|
||||
$unit = $sanitized_post_data['7_unit[]'] ?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2551,10 +2597,10 @@ class ClientController extends AdminController
|
||||
$data = $sanitized_post_data;
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '8') {
|
||||
$premium = $sanitized_post_data['8_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['8_si[]'];
|
||||
$grade = $sanitized_post_data['8_grade[]'];
|
||||
$unit = $sanitized_post_data['8_unit[]'];
|
||||
$premium = $sanitized_post_data['8_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['8_si[]']?? null;
|
||||
$grade = $sanitized_post_data['8_grade[]']?? null;
|
||||
$unit = $sanitized_post_data['8_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2572,9 +2618,9 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '9') {
|
||||
|
||||
$premium = $sanitized_post_data['gpa_premium29[]'];
|
||||
$sum_insure = $sanitized_post_data['gpa_si29[]'];
|
||||
$unit = $sanitized_post_data['gpa_unit29[]'];
|
||||
$premium = $sanitized_post_data['gpa_premium29[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['gpa_si29[]']?? null;
|
||||
$unit = $sanitized_post_data['gpa_unit29[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2590,11 +2636,11 @@ class ClientController extends AdminController
|
||||
$data = $sanitized_post_data;
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '10') {
|
||||
$premium = $sanitized_post_data['10_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['10_si[]'];
|
||||
$age_from = $sanitized_post_data['10_age_from[]'];
|
||||
$age_to = $sanitized_post_data['10_age_to[]'];
|
||||
$unit = $sanitized_post_data['10_unit[]'];
|
||||
$premium = $sanitized_post_data['10_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['10_si[]']?? null;
|
||||
$age_from = $sanitized_post_data['10_age_from[]']?? null;
|
||||
$age_to = $sanitized_post_data['10_age_to[]']?? null;
|
||||
$unit = $sanitized_post_data['10_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2614,11 +2660,11 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '11') {
|
||||
|
||||
$premium = $sanitized_post_data['11_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['11_si[]'];
|
||||
$grade = $sanitized_post_data['11_grade[]'];
|
||||
$max_sum_insure = $sanitized_post_data['11_max_si[]'];
|
||||
$unit = $sanitized_post_data['11_unit[]'];
|
||||
$premium = $sanitized_post_data['11_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['11_si[]']?? null;
|
||||
$grade = $sanitized_post_data['11_grade[]']?? null;
|
||||
$max_sum_insure = $sanitized_post_data['11_max_si[]']?? null;
|
||||
$unit = $sanitized_post_data['11_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2637,10 +2683,10 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '12') {
|
||||
|
||||
$premium = $sanitized_post_data['12_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['12_si[]'];
|
||||
$relationship = $sanitized_post_data['12_relationship[]'];
|
||||
$unit = $sanitized_post_data['12_unit[]'];
|
||||
$premium = $sanitized_post_data['12_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['12_si[]']?? null;
|
||||
$relationship = $sanitized_post_data['12_relationship[]']?? null;
|
||||
$unit = $sanitized_post_data['12_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -2658,12 +2704,12 @@ class ClientController extends AdminController
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '13') {
|
||||
|
||||
$premium = $sanitized_post_data['13_premium[]'];
|
||||
$sum_insure = $sanitized_post_data['13_si[]'];
|
||||
$age_from = $sanitized_post_data['13_age_from[]'];
|
||||
$age_to = $sanitized_post_data['13_age_to[]'];
|
||||
$relationship = $sanitized_post_data['13_relationship[]'];
|
||||
$unit = $sanitized_post_data['13_unit[]'];
|
||||
$premium = $sanitized_post_data['13_premium[]']?? null;
|
||||
$sum_insure = $sanitized_post_data['13_si[]']?? null;
|
||||
$age_from = $sanitized_post_data['13_age_from[]']?? null;
|
||||
$age_to = $sanitized_post_data['13_age_to[]']?? null;
|
||||
$relationship = $sanitized_post_data['13_relationship[]']?? null;
|
||||
$unit = $sanitized_post_data['13_unit[]']?? null;
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
@ -5605,7 +5651,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['vehicle_primary_key'];
|
||||
$id = $sanitized_post_data['vehicle_primary_key'] ?? null;
|
||||
|
||||
|
||||
if ($id) {
|
||||
@ -5632,9 +5678,9 @@ class ClientController extends AdminController
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'vehicle_id' => $vehicle_insert,
|
||||
'owner_id' => $sanitized_post_data['owner'],
|
||||
'owner_id' => $sanitized_post_data['owner'] ?? null,
|
||||
'owner_branch_id' => $sanitized_post_data['branch_id'] ?? null,
|
||||
'owner_type' => $sanitized_post_data['Owner_type'],
|
||||
'owner_type' => $sanitized_post_data['Owner_type']?? null,
|
||||
'vehicles' => $vehicles,
|
||||
'message' => 'Vehicle created successfully
|
||||
'
|
||||
@ -6597,6 +6643,7 @@ class ClientController extends AdminController
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 51]); //abhi
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 53]); //icici
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 54]); //mediassist
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]);
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]);
|
||||
// dd($response);
|
||||
@ -6641,7 +6688,8 @@ class ClientController extends AdminController
|
||||
$policyTransactionController = new PolicyTransactionController();
|
||||
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '281']);
|
||||
// $res = $policyTransactionController->updateInsurerStatement(['file_id' => '62']);
|
||||
// dd('-----', $res);
|
||||
// $res = $policyTransactionController->bdsDumpExcelFileFormatValidation(['file_id' => '73']);
|
||||
// dd($res);
|
||||
|
||||
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -841,6 +841,7 @@ class EmployeeController extends AdminController
|
||||
{
|
||||
|
||||
$data = [];
|
||||
|
||||
$data['status'] = ['pending' => 'Pending', 'inprogress' => 'In-Progress', 'complete' => 'Complete'];
|
||||
if (count($this->request->getGet())) {
|
||||
$filterData = $this->request->getGet();
|
||||
@ -850,9 +851,9 @@ class EmployeeController extends AdminController
|
||||
status: $filterData['status'],
|
||||
branch_id: $filterData['branch_id']
|
||||
);
|
||||
$data['getData'] = $filterData;
|
||||
$data['getData'] = $filterData;
|
||||
// echo "<pre>";
|
||||
// print_r($data); die;
|
||||
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', 'list called');
|
||||
@ -1108,7 +1109,39 @@ class EmployeeController extends AdminController
|
||||
|
||||
try {
|
||||
|
||||
$filePath = WRITEPATH . '/uploads/excel/' . $file_name['file_name'];
|
||||
if (!$file_name) {
|
||||
return $this->respond([
|
||||
'dataStatus' => false,
|
||||
'code' => 200,
|
||||
'data' => '<div class="text-center">No Data Found</div>',
|
||||
'file_data' => null
|
||||
], 200);
|
||||
}
|
||||
|
||||
$filePath = WRITEPATH . 'uploads/excel/' . $file_name['file_name'];
|
||||
|
||||
// ✅ File not exists on disk
|
||||
if (!file_exists($filePath)) {
|
||||
return $this->respond([
|
||||
'dataStatus' => false,
|
||||
'code' => 200,
|
||||
'data' => '<div class="text-center">No Data Found</div>',
|
||||
'file_data' => $file_name
|
||||
], 200);
|
||||
}
|
||||
|
||||
|
||||
$excel_data = $empDataServiceController->readExcelFileToArray($filePath);
|
||||
|
||||
// ✅ Excel empty or header only
|
||||
if (empty($excel_data) || count($excel_data) <= 1) {
|
||||
return $this->respond([
|
||||
'dataStatus' => false,
|
||||
'code' => 200,
|
||||
'data' => '<div class="text-center">No Data Found</div>',
|
||||
'file_data' => $file_name
|
||||
], 200);
|
||||
}
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
|
||||
@ -1144,8 +1177,7 @@ class EmployeeController extends AdminController
|
||||
$errorMessage = 'Error occurred:' . PHP_EOL . json_encode($errorData, JSON_PRETTY_PRINT);
|
||||
$this->myLogger->logme('error', $errorMessage);
|
||||
|
||||
$html = '<div class="text-center">No Data Found</div>';
|
||||
return $this->respond(['dataStatus' => false, 'code' => 500, 'data' => $html, 'file_data' => $file_name], 500);
|
||||
return $this->respond(['dataStatus' => false, 'code' => 500, 'data' => '<div class="text-center">Something went wrong</div>', 'file_data' => $file_name ?? null], 500);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3035,12 +3067,12 @@ class EmployeeController extends AdminController
|
||||
$request_post_data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
|
||||
$client_id = $sanitized_post_data['client_id'];
|
||||
$branch_id = $sanitized_post_data['branch_id'];
|
||||
$policy_id = $sanitized_post_data['client_policy_id'];
|
||||
$selected_employees = (array)$sanitized_post_data['selected'];
|
||||
$si_amt = $sanitized_post_data['si_amt'];
|
||||
$policy_start_date_unformatted = $sanitized_post_data['policy_start_date'];
|
||||
$client_id = $sanitized_post_data['client_id'] ?? null;
|
||||
$branch_id = $sanitized_post_data['branch_id'] ?? null;
|
||||
$policy_id = $sanitized_post_data['client_policy_id'] ?? null;
|
||||
$selected_employees = (array)$sanitized_post_data['selected'] ?? [];
|
||||
$si_amt = $sanitized_post_data['si_amt'] ?? null;
|
||||
$policy_start_date_unformatted = $sanitized_post_data['policy_start_date'] ?? null;
|
||||
|
||||
$policy_start_date = change_date_format($policy_start_date_unformatted, 'd/M/Y', 'Y-m-d');
|
||||
|
||||
@ -3079,7 +3111,7 @@ class EmployeeController extends AdminController
|
||||
public function unmapEmployees($actionType){
|
||||
$request_post_data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
$selected_employees = (array)$sanitized_post_data['selected'];
|
||||
$selected_employees = (array)$sanitized_post_data['selected'] ?? [];
|
||||
if($actionType == 0){
|
||||
for($i = 0;$i<count($selected_employees);$i++){log_message('error',$selected_employees[$i]);
|
||||
$result1 = $this->employeeModel->set(['client_id' => null, 'client_branch_id' => null])->where('id',$selected_employees[$i])->update();log_message('error',$result1);
|
||||
|
||||
@ -322,13 +322,13 @@ class MasterController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
|
||||
$insert_data['addition_add_day'] = (!empty($sanitized_post_data['addition_add_day'])) ? 1 : 0;
|
||||
$insert_data['deletion_add_day'] = (!empty($sanitized_post_data['deletion_add_day'])) ? 1 : 0;
|
||||
$insert_data['is_multi_event'] = (!empty($sanitized_post_data['is_multi_event'])) ? 1 : 0;
|
||||
$insert_data['created_by'] = get_session_userid();
|
||||
$insert_data['insurer_logo'] = $file_name;
|
||||
$sanitized_post_data['addition_add_day'] = (!empty($sanitized_post_data['addition_add_day'])) ? 1 : 0;
|
||||
$sanitized_post_data['deletion_add_day'] = (!empty($sanitized_post_data['deletion_add_day'])) ? 1 : 0;
|
||||
$sanitized_post_data['is_multi_event'] = (!empty($sanitized_post_data['is_multi_event'])) ? 1 : 0;
|
||||
$sanitized_post_data['created_by'] = get_session_userid();
|
||||
$sanitized_post_data['insurer_logo'] = $file_name;
|
||||
|
||||
$insert = $this->insurerModel->insert($insert_data);
|
||||
$insert = $this->insurerModel->insert($sanitized_post_data);
|
||||
|
||||
if($insert){
|
||||
$insurer_data = $this->insurerModel->where(['id' => $insert, 'is_active' => 1])->first();
|
||||
@ -455,10 +455,10 @@ class MasterController extends AdminController
|
||||
'contact_type' => 'insurer',
|
||||
'ref_id' => $insert,
|
||||
'created_by' => get_session_userid(),
|
||||
'name' => $sanitized_post_data['name'][$i],
|
||||
'email' => $sanitized_post_data['email'][$i],
|
||||
'mobile' => $sanitized_post_data['mobile'][$i],
|
||||
'designation' => $sanitized_post_data['designation'][$i]
|
||||
'name' => $sanitized_post_data['name'][$i] ?? null,
|
||||
'email' => $sanitized_post_data['email'][$i] ?? null,
|
||||
'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
|
||||
'designation' => $sanitized_post_data['designation'][$i] ?? null
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
|
||||
}
|
||||
@ -537,19 +537,19 @@ class MasterController extends AdminController
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
|
||||
$update_data['addition_add_day'] = (!empty($sanitized_post_data['addition_add_day'])) ? 1 : 0;
|
||||
$update_data['deletion_add_day'] = (!empty($sanitized_post_data['deletion_add_day'])) ? 1 : 0;
|
||||
$update_data['is_multi_event'] = (!empty($sanitized_post_data['is_multi_event'])) ? 1 : 0;
|
||||
$update_data['updated_by'] = get_session_userid();
|
||||
$sanitized_post_data['addition_add_day'] = (!empty($sanitized_post_data['addition_add_day'])) ? 1 : 0;
|
||||
$sanitized_post_data['deletion_add_day'] = (!empty($sanitized_post_data['deletion_add_day'])) ? 1 : 0;
|
||||
$sanitized_post_data['is_multi_event'] = (!empty($sanitized_post_data['is_multi_event'])) ? 1 : 0;
|
||||
$sanitized_post_data['updated_by'] = get_session_userid();
|
||||
|
||||
if(!empty($file_name)){
|
||||
$update_data['insurer_logo'] = $file_name;
|
||||
$sanitized_post_data['insurer_logo'] = $file_name;
|
||||
}
|
||||
|
||||
$update = $this->insurerModel->update($id,$update_data);
|
||||
$update = $this->insurerModel->update($id,$sanitized_post_data);
|
||||
|
||||
if($update){
|
||||
echo json_encode(array("status" => true , 'data' => $data));
|
||||
echo json_encode(array("status" => true , 'data' => $sanitized_post_data));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
@ -673,7 +673,7 @@ class MasterController extends AdminController
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$update = $this->insurerBranchModel->update($id, $sanitized_post_data);
|
||||
|
||||
if($update){
|
||||
@ -687,11 +687,11 @@ class MasterController extends AdminController
|
||||
'contact_type' => 'insurer',
|
||||
'ref_id' => $id,
|
||||
'created_by' => get_session_userid(),
|
||||
'name' => $sanitized_post_data['name'][$i],
|
||||
'email' => $sanitized_post_data['email'][$i],
|
||||
'mobile' => $sanitized_post_data['mobile'][$i],
|
||||
'designation' => $sanitized_post_data['designation'][$i]
|
||||
];
|
||||
'name' => $sanitized_post_data['name'][$i] ?? null,
|
||||
'email' => $sanitized_post_data['email'][$i] ?? null,
|
||||
'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
|
||||
'designation' => $sanitized_post_data['designation'][$i] ?? null
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
|
||||
}
|
||||
}
|
||||
@ -922,16 +922,16 @@ class MasterController extends AdminController
|
||||
|
||||
$eCardTemplate = $sanitized_post_data['ecard_content'];
|
||||
|
||||
$insert_data['created_by'] = get_session_userid();
|
||||
$insert_data['tpa_logo'] = $file_name;
|
||||
$insert_data['front_card'] = $front_card_file_name;
|
||||
$insert_data['back_card'] = $back_card_file_name;
|
||||
$insert_data['network_hospitals'] = $sanitized_post_data['network_hospitals'];
|
||||
$sanitized_post_data['created_by'] = get_session_userid();
|
||||
$sanitized_post_data['tpa_logo'] = $file_name;
|
||||
$sanitized_post_data['front_card'] = $front_card_file_name;
|
||||
$sanitized_post_data['back_card'] = $back_card_file_name;
|
||||
$sanitized_post_data['network_hospitals'] = $sanitized_post_data['network_hospitals'];
|
||||
|
||||
$insert = $this->tpaModel->insert($insert_data);
|
||||
$insert = $this->tpaModel->insert($sanitized_post_data);
|
||||
|
||||
$tpa_name = (string) $sanitized_post_data['name'];
|
||||
$short_name = (string) $sanitized_post_data['short_name'];
|
||||
$tpa_name = ((string) $sanitized_post_data['name']) ?? null;
|
||||
$short_name = ((string) $sanitized_post_data['short_name']) ?? null;
|
||||
|
||||
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
|
||||
$file_directory = WRITEPATH . 'e_card_template/';
|
||||
@ -1080,10 +1080,10 @@ class MasterController extends AdminController
|
||||
'contact_type' => 'tpa',
|
||||
'ref_id' => $insert,
|
||||
'created_by' => get_session_userid(),
|
||||
'name' => $sanitized_post_data['name'][$i],
|
||||
'email' => $sanitized_post_data['email'][$i],
|
||||
'mobile' => $sanitized_post_data['mobile'][$i],
|
||||
'designation' => $sanitized_post_data['designation'][$i]
|
||||
'name' => $sanitized_post_data['name'][$i] ?? null,
|
||||
'email' => $sanitized_post_data['email'][$i] ?? null,
|
||||
'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
|
||||
'designation' => $sanitized_post_data['designation'][$i] ?? null
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
|
||||
}
|
||||
@ -1209,29 +1209,29 @@ class MasterController extends AdminController
|
||||
$front_card_file_name = file_Upload($this->request->getFile('fc'), $template_bg_path);
|
||||
$back_card_file_name = file_Upload($this->request->getFile('bc'), $template_bg_path);
|
||||
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
|
||||
$update_data['updated_by'] = get_session_userid();
|
||||
$sanitized_post_data['updated_by'] = get_session_userid();
|
||||
|
||||
if(!empty($file_name)){
|
||||
$update_data['tpa_logo'] = $file_name;
|
||||
$sanitized_post_data['tpa_logo'] = $file_name;
|
||||
}
|
||||
|
||||
if(!empty($front_card_file_name)){
|
||||
$update_data['front_card'] = $front_card_file_name;
|
||||
$sanitized_post_data['front_card'] = $front_card_file_name;
|
||||
}
|
||||
|
||||
if(!empty($back_card_file_name)){
|
||||
$update_data['back_card'] = $back_card_file_name;
|
||||
$sanitized_post_data['back_card'] = $back_card_file_name;
|
||||
}
|
||||
|
||||
$update_data['network_hospitals'] = $sanitized_post_data['network_hospitals'];
|
||||
$update = $this->tpaModel->update($id,$update_data);
|
||||
$sanitized_post_data['network_hospitals'] = $sanitized_post_data['network_hospitals'] ?? null;
|
||||
$update = $this->tpaModel->update($id,$sanitized_post_data);
|
||||
|
||||
|
||||
$tpa_name = (string) $sanitized_post_data['name'];
|
||||
$short_name = (string) $sanitized_post_data['short_name'];
|
||||
$eCardTemplate = $sanitized_post_data['ecard_content'];
|
||||
$tpa_name = ((string) $sanitized_post_data['name']) ?? null;
|
||||
$short_name = ((string) $sanitized_post_data['short_name']) ?? null;
|
||||
$eCardTemplate = $sanitized_post_data['ecard_content'] ?? null;
|
||||
|
||||
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
|
||||
$file_directory = WRITEPATH . 'e_card_template/';
|
||||
@ -1258,7 +1258,7 @@ class MasterController extends AdminController
|
||||
|
||||
|
||||
if($update){
|
||||
echo json_encode(array("status" => true , 'data' => $update_data));
|
||||
echo json_encode(array("status" => true , 'data' => $sanitized_post_data));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
@ -1383,7 +1383,7 @@ class MasterController extends AdminController
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$update = $this->tpaBranchModel->update($id, $sanitized_post_data);
|
||||
|
||||
// print_r($this->request->getPost('name[]'));
|
||||
@ -1402,10 +1402,10 @@ class MasterController extends AdminController
|
||||
'contact_type' => 'tpa',
|
||||
'ref_id' => $id,
|
||||
'created_by' => get_session_userid(),
|
||||
'name' => $sanitized_post_data['name'][$i],
|
||||
'email' => $sanitized_post_data['email'][$i],
|
||||
'mobile' => $sanitized_post_data['mobile'][$i],
|
||||
'designation' => $sanitized_post_data['designation'][$i]
|
||||
'name' => $sanitized_post_data['name'][$i] ?? null,
|
||||
'email' => $sanitized_post_data['email'][$i] ?? null,
|
||||
'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
|
||||
'designation' => $sanitized_post_data['designation'][$i] ?? null
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
|
||||
}
|
||||
@ -1644,7 +1644,7 @@ class MasterController extends AdminController
|
||||
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$sanitized_post_data['updated_by'] = get_session_userid();
|
||||
$update = $this->kycEntityTypeModel->update($id,$sanitized_post_data);
|
||||
if($update){
|
||||
@ -1995,7 +1995,7 @@ class MasterController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$sanitized_post_data['updated_by'] = get_session_userid();
|
||||
$update = $this->policyTypeModel->update($id,$sanitized_post_data);
|
||||
if($update){
|
||||
@ -2048,8 +2048,10 @@ class MasterController extends AdminController
|
||||
public function editPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$data = $this->request->getPost();
|
||||
$request_post_data = $this->request->getPost();
|
||||
$data = sanitizeInputArrayAdvanced($request_post_data);
|
||||
|
||||
$id = $data['PrimaryKey'] ?? null;
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$update = $this->policesModel->update($id,$data);
|
||||
if($update){
|
||||
@ -2196,10 +2198,10 @@ class MasterController extends AdminController
|
||||
// CD Account Details
|
||||
// ======================
|
||||
'opening_date' => [
|
||||
'rules' => 'required|valid_date[Y-m-d]',
|
||||
'rules' => 'required|valid_date[d-m-Y]',
|
||||
'errors' => [
|
||||
'required' => 'Opening date is required',
|
||||
'valid_date' => 'Opening date must be in YYYY-MM-DD format'
|
||||
'valid_date' => 'Opening date must be in DD-MM-YYYY format'
|
||||
]
|
||||
],
|
||||
|
||||
@ -2259,13 +2261,13 @@ class MasterController extends AdminController
|
||||
if ($insert) {
|
||||
|
||||
$cd_tranction_data = [
|
||||
'amount' => $sanitized_post_data['opening_bal'],
|
||||
'amount' => $sanitized_post_data['opening_bal'] ?? null,
|
||||
'sub_type_id' => 7,
|
||||
'client_id' => $sanitized_post_data['client_id'],
|
||||
'client_id' => $sanitized_post_data['client_id'] ?? null,
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $sanitized_post_data['cd_ac_no'],
|
||||
'cd_ac_no' => $sanitized_post_data['cd_ac_no'] ?? null,
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'],
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'] ?? null,
|
||||
'description' => 'Opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'event_name' => null,
|
||||
@ -2377,10 +2379,10 @@ class MasterController extends AdminController
|
||||
// CD Account Details
|
||||
// ======================
|
||||
'opening_date' => [
|
||||
'rules' => 'required|valid_date[Y-m-d]',
|
||||
'rules' => 'required|valid_date[d-m-Y]',
|
||||
'errors' => [
|
||||
'required' => 'Opening date is required',
|
||||
'valid_date' => 'Opening date must be in YYYY-MM-DD format'
|
||||
'valid_date' => 'Opening date must be in DD-MM-YYYY format'
|
||||
]
|
||||
],
|
||||
|
||||
@ -2410,8 +2412,8 @@ class MasterController extends AdminController
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'];
|
||||
$date = (string) $sanitized_post_data['opening_date'];
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$date = ((string) $sanitized_post_data['opening_date']) ?? null;
|
||||
$sanitized_post_data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
|
||||
if ($data) {
|
||||
@ -2713,11 +2715,11 @@ class MasterController extends AdminController
|
||||
|
||||
|
||||
$fetch_data = [
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'],
|
||||
'policy_type_id' => $sanitized_post_data['policy_type'],
|
||||
'event_name' => $sanitized_post_data['event'],
|
||||
'insurer_id' => $sanitized_post_data['insurer_id'] ?? null ,
|
||||
'policy_type_id' => $sanitized_post_data['policy_type'] ?? null,
|
||||
'event_name' => $sanitized_post_data['event'] ?? null,
|
||||
'type_name' => 'export',
|
||||
'jsoncolumns' => $sanitized_post_data['json_data'],
|
||||
'jsoncolumns' => $sanitized_post_data['json_data'] ?? null,
|
||||
'is_active' => 1,
|
||||
'created_by' => get_session_userid(),
|
||||
];
|
||||
|
||||
@ -309,7 +309,7 @@
|
||||
'format' => null,
|
||||
'allowed_values' => null,
|
||||
'custom' => 'check_agent_exist',
|
||||
'params' => ['row', 'agent_data']
|
||||
'params' => ['row', 'pos_data']
|
||||
],
|
||||
|
||||
'base_premium' => [
|
||||
@ -4944,6 +4944,7 @@
|
||||
$pt_data = $this->policyTransactionModel->where('is_active', 1)->findAll();
|
||||
$user_data = $this->userModel->where('is_active', 1)->findAll();
|
||||
$agent_data = db_connect()->table('partner_agent')->where('is_active', 1)->get()->getResultArray();
|
||||
$pos_data = db_connect()->table('partner_pos')->where('is_active', 1)->get()->getResultArray();
|
||||
$rto_master = db_connect()->table('rto_master')->where('is_active', 1)->get()->getResultArray();
|
||||
$vehicle_type = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
|
||||
$nhance_branch_data = db_connect()->table('nhance_branch')->where('is_active', 1)->get()->getResultArray();
|
||||
@ -5109,6 +5110,7 @@
|
||||
$vehicle_data = $this->vehicleModel->where('is_active', 1)->findAll();
|
||||
$user_data = $this->userModel->where('is_active', 1)->findAll();
|
||||
$agent_data = db_connect()->table('partner_agent')->where('is_active', 1)->get()->getResultArray();
|
||||
$pos_data = db_connect()->table('partner_pos')->where('is_active', 1)->get()->getResultArray();
|
||||
$rto_master = db_connect()->table('rto_master')->where('is_active', 1)->get()->getResultArray();
|
||||
$vehicle_type_data = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
|
||||
$nhance_branch_data = db_connect()->table('nhance_branch')->where('is_active', 1)->get()->getResultArray();
|
||||
@ -5191,7 +5193,8 @@
|
||||
$current_insurer_branch_data = check_insurer_branch_exist($row, $insurer_branch_data, $current_insurer_data)['branch'] ?? null;
|
||||
|
||||
$current_nhance_branch = check_nhance_branch($row, $nhance_branch_data)['branch'] ?? null;
|
||||
$current_agent_data = check_agent_exist($row, $agent_data)['agent'] ?? null;
|
||||
// $current_agent_data = check_agent_exist($row, $agent_data)['agent'] ?? null;
|
||||
$current_agent_data = check_agent_exist($row, $pos_data)['agent'] ?? null;
|
||||
|
||||
$salse = check_user_exist($row, 13, $user_data)['user'] ?? null;
|
||||
$service = check_user_exist($row, 14, $user_data)['user'] ?? null;
|
||||
@ -5229,8 +5232,9 @@
|
||||
'salse_person_manager_id' => $salse['rm_id'] ?? null,
|
||||
'service_person_manager_id' => $service['rm_id'] ?? null,
|
||||
'service_person_branch_id' => $service['nhance_branch_id'] ?? null,
|
||||
'agent_id' => $current_agent_data['id'] ?? null,
|
||||
'agent_code' => $current_agent_data['agent_code'] ?? null,
|
||||
// 'agent_id' => $current_agent_data['id'] ?? null,
|
||||
// 'agent_code' => $current_agent_data['agent_code'] ?? null,
|
||||
'pos_id' => $current_agent_data['id'] ?? null,
|
||||
'file_id' => $params['file_id'],
|
||||
'endorsement_no' => null,
|
||||
'client_branch_id' => null,
|
||||
|
||||
@ -424,7 +424,6 @@ class TicketController extends BaseController
|
||||
|
||||
return $this->loadLayout('ticket_search', $data);
|
||||
} else {
|
||||
|
||||
$isFromDashboard = $this->request->getPost("is_dashboard");
|
||||
log_message('error', 'Is From Dashboard: ' . $isFromDashboard);
|
||||
|
||||
@ -446,7 +445,6 @@ class TicketController extends BaseController
|
||||
}
|
||||
$data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll();
|
||||
$data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active', 1)->findAll();
|
||||
// dd($data);
|
||||
return $this->loadLayout('ticket_search', $data);
|
||||
|
||||
}
|
||||
|
||||
@ -23,11 +23,11 @@ class AuthMVC implements FilterInterface
|
||||
// }
|
||||
|
||||
// Fingerprint validation
|
||||
$fp = generateFingerprint();
|
||||
// log_message('error',$fp);
|
||||
if (session()->get('fingerprint') !== $fp) {
|
||||
return AuthLogout::logout();
|
||||
}
|
||||
// $fp = generateFingerprint();
|
||||
// // log_message('error',$fp);
|
||||
// if (session()->get('fingerprint') !== $fp) {
|
||||
// return AuthLogout::logout();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -3149,7 +3149,7 @@ if (!function_exists('check_agent_exist')) {
|
||||
// Loop agent data from DB
|
||||
foreach ($agent_data as $agent) {
|
||||
// Assuming DB keys: agent_code
|
||||
if (isset($agent['agent_code']) && $agent['agent_code'] == $agent_code) {
|
||||
if (isset($agent['pos_code']) && (strtolower($agent['pos_code']) == strtolower($agent_code))) {
|
||||
return [
|
||||
'status' => true,
|
||||
'error' => null,
|
||||
@ -3173,6 +3173,17 @@ if (!function_exists('check_rto_data')) {
|
||||
$vehicle_no = strtoupper(trim($row[2])); // Example: TN10AB1234
|
||||
$new_vehicle = strtolower(trim($row[2]));
|
||||
|
||||
// BH Series: 22BH1234AA
|
||||
$bhPattern = '/^[0-9]{2}BH[0-9]{4}[A-Z]{2}$/';
|
||||
|
||||
if (preg_match($bhPattern, $vehicle_no)) {
|
||||
return [
|
||||
'status' => true,
|
||||
'error' => null,
|
||||
'rto_data' => []
|
||||
];
|
||||
}
|
||||
|
||||
if($new_vehicle == "new"){
|
||||
return [
|
||||
'status' => true,
|
||||
|
||||
@ -640,6 +640,8 @@ if (!function_exists('change_date_format')) {
|
||||
|
||||
'd/m/Y', // 01/01/2025
|
||||
'd-m-Y', // 01-01-2025
|
||||
'm/d/Y h:i:s A', // 01-01-2025
|
||||
'm/d/Y', // 25-05-2025
|
||||
|
||||
];
|
||||
|
||||
|
||||
@ -82,7 +82,6 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
["excel_column" => ["col_name" => "CORPORATE_EMPLOYEE_CODE", "col_index" => 63], "db_column" => "corporate_employee_code"],
|
||||
];
|
||||
|
||||
|
||||
protected $ticketMasterMapping = [
|
||||
|
||||
// Employee / Member details
|
||||
@ -115,19 +114,31 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
// Misc
|
||||
'diagnosis' => 'claim_description',
|
||||
'healthcard_id' => 'tpa_no',
|
||||
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
'ticket_type_id' => 1,
|
||||
];
|
||||
|
||||
|
||||
protected $statusMapping = [
|
||||
'Settled' => 11,
|
||||
'Rejected' => 8,
|
||||
'Cancelled' => 13,
|
||||
];
|
||||
|
||||
protected $dateColumns = [
|
||||
'policy_from',
|
||||
'policy_upto',
|
||||
|
||||
'intimation_date',
|
||||
'date_of_doc_rec',
|
||||
|
||||
'doa',
|
||||
'dod',
|
||||
|
||||
'repudiation_date',
|
||||
'settled_date',
|
||||
|
||||
'expected_doa',
|
||||
'expected_dod',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* ABSTRACT FUNCTIONs
|
||||
@ -215,14 +226,13 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
$dbColumn = $map['db_column'];
|
||||
|
||||
$value = $row[$excelColumn] ?? null;
|
||||
|
||||
if ($this->isDateValue($value)) {
|
||||
$value = $this->normalizeDate($value);
|
||||
}
|
||||
|
||||
$item[$dbColumn] = trim($value);
|
||||
}
|
||||
|
||||
foreach ($this->dateColumns as $key => $value) {
|
||||
$item[$value] = change_date_format($item[$value] ?? null, 'm/d/Y h:i:s A', 'Y-m-d');
|
||||
}
|
||||
|
||||
$params = [
|
||||
'doa' => $item['doa'] ?? null,
|
||||
'member_code' => $item['member_code'] ?? null,
|
||||
@ -346,6 +356,10 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$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;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
|
||||
@ -4,8 +4,6 @@ namespace App\Libraries\TPAClaimsImportServices;
|
||||
|
||||
use App\Models\TicketMasterModel;
|
||||
use App\Models\ClientPolicyModel;
|
||||
use App\Models\ClientRMModel;
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\ClaimDumpFileModel;
|
||||
use App\Models\ClaimsDumpFhplModel;
|
||||
|
||||
@ -140,39 +138,45 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
protected $ticketMasterMapping = [
|
||||
|
||||
// Employee / Member details
|
||||
'member_code' => 'emp_code',
|
||||
'relation' => 'relationship',
|
||||
// Claim / Reference
|
||||
'claim_id' => 'claim_number',
|
||||
|
||||
// Policy / Claim identifiers
|
||||
'policy_number' => 'policy_no',
|
||||
'certificate_no' => 'claim_number',
|
||||
'abhi_claim_no' => 'tpa_claim_id',
|
||||
// Policy
|
||||
'policy_no' => 'policy_no',
|
||||
|
||||
// Dates
|
||||
'doa' => 'doa',
|
||||
'dod' => 'dod',
|
||||
'intimation_date' => 'date_of_intimat',
|
||||
// Employee / Member
|
||||
'employee_id' => 'emp_code',
|
||||
'relationship' => 'relationship',
|
||||
|
||||
// Claim info
|
||||
'claim_type' => 'claim_type',
|
||||
'claim_status' => 'tpa_claim_status',
|
||||
'claimed_amount' => 'claim_amount',
|
||||
'abhi_amount_less_coins_current_month' => 'approved_amount',
|
||||
// Claim Dates
|
||||
'admission_date' => 'doa',
|
||||
'discharge_date' => 'dod',
|
||||
'claim_received_date' => 'date_of_intimat',
|
||||
'claim_passed_date' => 'approved_date',
|
||||
'settled_date' => 'settled_date',
|
||||
|
||||
// Hospital details
|
||||
'hospital_name' => 'hospital_name',
|
||||
'hospital_city' => 'hospital_city',
|
||||
'hospital_state' => 'hospital_state',
|
||||
'current_claim_status' => 'tpa_claim_status',
|
||||
|
||||
// Settlement / decision
|
||||
'repudiation_date' => 'denial_date',
|
||||
'settled_date' => 'settled_date',
|
||||
'rejection_category' => 'denial_reason',
|
||||
// Amounts
|
||||
'claim_amount' => 'claim_amount',
|
||||
'settled_amount' => 'settled_amount',
|
||||
'disallowed_amount' => 'denial_reason',
|
||||
'coverage_amount' => 'si_amt',
|
||||
|
||||
// Misc
|
||||
'diagnosis' => 'claim_description',
|
||||
'healthcard_id' => 'tpa_no',
|
||||
// Hospital
|
||||
'provider_name' => 'hospital_name',
|
||||
'provider_address' => 'hospital_address',
|
||||
'provider_state' => 'hospital_state',
|
||||
'provider_place' => 'hospital_city',
|
||||
'provider_pincode' => 'hospital_pin_code',
|
||||
|
||||
// Remarks / Description
|
||||
'diagnosis' => 'claim_description',
|
||||
'rejection_remarks' => 'return_remark',
|
||||
|
||||
// Payment
|
||||
'cheque_no' => 'utr_details',
|
||||
'uhid_no' => 'tpa_no',
|
||||
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
@ -184,6 +188,33 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
'Rejected' => 8,
|
||||
];
|
||||
|
||||
protected $dateColumns = [
|
||||
'intimation_date',
|
||||
'policy_start_date',
|
||||
'policy_commencing_date',
|
||||
'policy_expiry_date',
|
||||
'claim_received_date',
|
||||
'admission_date',
|
||||
'discharge_date',
|
||||
'cheque_date',
|
||||
'claim_passed_date',
|
||||
'settled_date',
|
||||
'ir_date',
|
||||
'ir_retrieval_date',
|
||||
'first_reminder',
|
||||
'second_reminder',
|
||||
'date_of_joining',
|
||||
'nidb_removed_date',
|
||||
'investigation_date',
|
||||
'investigation_retrieval_date',
|
||||
'reopened_date',
|
||||
'refer_to_insurer_date',
|
||||
'received_date_from_insurer',
|
||||
'claim_created_datetime',
|
||||
'last_modified_date'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* ABSTRACT FUNCTIONs
|
||||
*/
|
||||
@ -260,27 +291,26 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
$dbColumn = $map['db_column'];
|
||||
|
||||
$value = $row[$excelColumn] ?? null;
|
||||
|
||||
if ($this->isDateValue($value)) {
|
||||
$value = $this->normalizeDate($value);
|
||||
}
|
||||
|
||||
$item[$dbColumn] = trim($value);
|
||||
}
|
||||
|
||||
// $params = [
|
||||
// 'admission_date' => change_date_format($item['admission_date'] ?? '') ?? null,
|
||||
// 'employee_number' => $item['employee_number'] ?? null,
|
||||
// 'claim_amount' => $item['claim_amount'] ?? null,
|
||||
// 'primary_policy_holder_card_id' => $item['primary_policy_holder_card_id'] ?? null
|
||||
// ];
|
||||
foreach ($this->dateColumns as $key => $value) {
|
||||
$item[$value] = change_date_format($item[$value] ?? null, 'd-M-y', 'Y-m-d');
|
||||
}
|
||||
|
||||
// $is_duplicate = $this->checkDuplicateTpaClaim('claims_dump_fhpl', $params);
|
||||
$params = [
|
||||
'admission_date' => $item['admission_date'] ?? null,
|
||||
'employee_id' => $item['employee_id'] ?? null,
|
||||
'claim_amount' => $item['claim_amount'] ?? null,
|
||||
'uhid_no' => $item['uhid_no'] ?? null
|
||||
];
|
||||
|
||||
// if ($is_duplicate) {
|
||||
// $item = [];
|
||||
// continue;
|
||||
// }
|
||||
$is_duplicate = $this->checkDuplicateTpaClaim('claims_dump_fhpl', $params);
|
||||
|
||||
if ($is_duplicate) {
|
||||
$item = [];
|
||||
continue;
|
||||
}
|
||||
|
||||
$item['file_id'] = $file_id ?? null;
|
||||
$item['client_id'] = $file_data['client_id'] ?? null;
|
||||
@ -332,10 +362,10 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
foreach ($tpaClaimDumpData as $row) {
|
||||
|
||||
$params = [
|
||||
'doa' => change_date_format($row['date_of_admission'] ?? '') ?? null,
|
||||
'emp_code' => $row['employee_number'] ?? null,
|
||||
'doa' => change_date_format($row['admission_date'] ?? '') ?? null,
|
||||
'emp_code' => $row['employee_id'] ?? null,
|
||||
'claim_amount' => $row['claim_amount'] ?? null,
|
||||
'tpa_no' => $row['primary_policy_holder_card_id'] ?? null
|
||||
'tpa_no' => $row['uhid_no'] ?? null
|
||||
];
|
||||
|
||||
$isduplicate = $this->checkDublicateTicketMasterClaim($params);
|
||||
@ -354,9 +384,9 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
$item['tpa_id'] = $client_policy_data['tpa_id'] ?? null;
|
||||
$item['acm_id'] = $client_policy_data['acm_id'] ?? null;
|
||||
$item['policy_no'] = $client_policy_data['policy_no'] ?? null;
|
||||
$item['relationship'] = $this->convertRelation($row['relation'] ?? null, $row['gender'] ?? null);
|
||||
$item['relationship'] = $this->convertRelation($row['relationship'] ?? null);
|
||||
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_number'], $item['relationship']);
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_id'], $item['relationship']);
|
||||
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
@ -390,7 +420,10 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$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['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
@ -419,83 +452,47 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
* HELPER FUNCTIONs
|
||||
*/
|
||||
|
||||
public function isDateValue($value): bool
|
||||
{
|
||||
if (empty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Excel numeric date (e.g. 44927)
|
||||
if (is_numeric($value) && $value > 30000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Common date formats
|
||||
return preg_match(
|
||||
'/^\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}$|^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/',
|
||||
(string) $value
|
||||
) === 1;
|
||||
}
|
||||
|
||||
|
||||
public function normalizeDate($value): ?string
|
||||
{
|
||||
try {
|
||||
// Excel numeric date
|
||||
if (is_numeric($value)) {
|
||||
return date('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($value));
|
||||
}
|
||||
|
||||
// String date
|
||||
return date('Y-m-d', strtotime(str_replace('/', '-', $value)));
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function convertRelation(string $relation, string $gender): ?string
|
||||
public function convertRelation(?string $relation): ?string
|
||||
{
|
||||
if (empty($relation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$relation = strtolower($relation);
|
||||
$gender = strtolower($gender);
|
||||
|
||||
if ($relation == 'self') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'self')) {
|
||||
return 'self';
|
||||
}
|
||||
|
||||
if ($relation == 'spouse') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'spouse') || str_contains($relation, 'wife') || str_contains($relation, 'husband')) {
|
||||
return 'spouse';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'male') {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'female') {
|
||||
if (str_contains($relation, 'daughter')) {
|
||||
return 'daughter';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'male') {
|
||||
return 'father';
|
||||
if (str_contains($relation, 'son')) {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'female') {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'male') {
|
||||
if (str_contains($relation, 'father in law') || str_contains($relation, 'father-in-law')) {
|
||||
return 'father-in-law';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'female') {
|
||||
if (str_contains($relation, 'mother in law') || str_contains($relation, 'mother-in-law')) {
|
||||
return 'mother-in-law';
|
||||
}
|
||||
|
||||
return null;
|
||||
if (str_contains($relation, 'father')) {
|
||||
return 'father';
|
||||
}
|
||||
|
||||
if (str_contains($relation, 'mother')) {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
return null; // unmatched case
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
'hospital_state' => 'hospital_state',
|
||||
|
||||
'cheque_number' => 'utr_details',
|
||||
'tpa_no' => 'uhid',
|
||||
'uhid' => 'tpa_no',
|
||||
'rejected_query_desc' => 'claim_description',
|
||||
];
|
||||
|
||||
@ -108,6 +108,23 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
'REJECTED' => 8,
|
||||
];
|
||||
|
||||
protected $dateColumns = [
|
||||
'policy_start_date',
|
||||
'policy_end_date',
|
||||
|
||||
'dt_of_deficiencies_sent',
|
||||
'dt_of_deficiencies_received',
|
||||
|
||||
'payment_date',
|
||||
|
||||
'doa',
|
||||
'dod',
|
||||
|
||||
'rejected_query_closed_date',
|
||||
'rejreopen_closure_date',
|
||||
];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ABSTRACT FUNCTIONs
|
||||
@ -203,14 +220,13 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
$dbColumn = $map['db_column'];
|
||||
|
||||
$value = $row[$excelColumn] ?? null;
|
||||
|
||||
if ($this->isDateValue($value)) {
|
||||
$value = $this->normalizeDate($value);
|
||||
}
|
||||
|
||||
$item[$dbColumn] = $value;
|
||||
}
|
||||
|
||||
foreach ($this->dateColumns as $key => $value) {
|
||||
$item[$value] = change_date_format($item[$value] ?? null);
|
||||
}
|
||||
|
||||
$params = [
|
||||
'doa' => change_date_format($item['doa'] ?? '') ?? null,
|
||||
'employee_member_id' => $item['employee_member_id'] ?? null,
|
||||
@ -297,9 +313,9 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
$item['tpa_id'] = $client_policy_data['tpa_id'] ?? null;
|
||||
$item['acm_id'] = $client_policy_data['acm_id'] ?? null;
|
||||
$item['policy_no'] = $client_policy_data['policy_no'] ?? null;
|
||||
$item['relationship'] = strtolower($row['relation_group'] ?? '');
|
||||
$item['relationship'] = $this->convertRelation($row['relation_group'] ?? '');
|
||||
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_number'], $item['relationship']);
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_member_id'], $item['relationship']);
|
||||
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
@ -330,9 +346,13 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Meta fields
|
||||
$item['claim_status_id'] = $statusMapping[$row['updated_status']] ?? 61;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['file_id'] = $file_id;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
@ -361,83 +381,48 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
* HELPER FUNCTIONs
|
||||
*/
|
||||
|
||||
public function isDateValue($value): bool
|
||||
{
|
||||
if (empty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Excel numeric date (e.g. 44927)
|
||||
if (is_numeric($value) && $value > 30000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Common date formats
|
||||
return preg_match(
|
||||
'/^\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}$|^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/',
|
||||
(string) $value
|
||||
) === 1;
|
||||
}
|
||||
|
||||
|
||||
public function normalizeDate($value): ?string
|
||||
{
|
||||
try {
|
||||
// Excel numeric date
|
||||
if (is_numeric($value)) {
|
||||
return date('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($value));
|
||||
}
|
||||
|
||||
// String date
|
||||
return date('Y-m-d', strtotime(str_replace('/', '-', $value)));
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function convertRelation(string $relation, string $gender): ?string
|
||||
public function convertRelation(?string $relation): ?string
|
||||
{
|
||||
if (empty($relation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$relation = strtolower($relation);
|
||||
$gender = strtolower($gender);
|
||||
|
||||
if ($relation == 'self') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'self')) {
|
||||
return 'self';
|
||||
}
|
||||
|
||||
if ($relation == 'spouse') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'spouse') || str_contains($relation, 'wife') || str_contains($relation, 'husband')) {
|
||||
return 'spouse';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'male') {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'female') {
|
||||
if (str_contains($relation, 'daughter')) {
|
||||
return 'daughter';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'male') {
|
||||
return 'father';
|
||||
if (str_contains($relation, 'son')) {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'female') {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'male') {
|
||||
if (str_contains($relation, 'father in law') || str_contains($relation, 'father-in-law')) {
|
||||
return 'father-in-law';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'female') {
|
||||
if (str_contains($relation, 'mother in law') || str_contains($relation, 'mother-in-law')) {
|
||||
return 'mother-in-law';
|
||||
}
|
||||
|
||||
return null;
|
||||
if (str_contains($relation, 'father')) {
|
||||
return 'father';
|
||||
}
|
||||
|
||||
if (str_contains($relation, 'mother')) {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
return null; // unmatched case
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -112,7 +112,6 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
["excel_column" => ["col_name" => "balance_sum_insured_exhausted", "col_index" => 93], "db_column" => "balance_sum_insured_exhausted"],
|
||||
];
|
||||
|
||||
|
||||
protected $ticketMasterMapping = [
|
||||
|
||||
// Employee / Beneficiary details
|
||||
@ -121,12 +120,11 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Policy / Claim identifiers
|
||||
'policy_no' => 'policy_no',
|
||||
'claim_id' => 'tpa_claim_id',
|
||||
'insurer_claim_ref_no' => 'tpa_no',
|
||||
'claim_id' => 'claim_number',
|
||||
'event_id' => 'tpa_no',
|
||||
'claim_pre_auths' => 'tpa_claim_push_reference_no',
|
||||
|
||||
// Claim type & status
|
||||
'claim_type' => 'claim_type',
|
||||
'claim_status' => 'tpa_claim_status',
|
||||
|
||||
// Dates
|
||||
@ -155,12 +153,8 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Payment
|
||||
'utr_no' => 'utr_details',
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
'ticket_type_id' => 1,
|
||||
];
|
||||
|
||||
|
||||
protected $statusMapping = [
|
||||
'Settled' => 11,
|
||||
'Rejected' => 8,
|
||||
@ -248,19 +242,14 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
$dbColumn = $map['db_column'];
|
||||
|
||||
$value = $row[$excelColumn] ?? null;
|
||||
|
||||
if ($this->isDateValue($value)) {
|
||||
$value = $this->normalizeDate($value);
|
||||
}
|
||||
|
||||
$item[$dbColumn] = $value;
|
||||
}
|
||||
|
||||
$params = [
|
||||
'date_of_admission' => change_date_format($item['date_of_admission'] ?? '') ?? null,
|
||||
'employee_number' => $item['employee_number'] ?? null,
|
||||
'pribenef_employee_code' => $item['pribenef_employee_code'] ?? null,
|
||||
'claim_amount' => $item['claim_amount'] ?? null,
|
||||
'primary_policy_holder_card_id' => $item['primary_policy_holder_card_id'] ?? null
|
||||
'event_id' => $item['event_id'] ?? null
|
||||
];
|
||||
|
||||
$is_duplicate = $this->checkDuplicateTpaClaim('claims_dump_medi_assist', $params);
|
||||
@ -321,9 +310,9 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
$params = [
|
||||
'doa' => change_date_format($row['date_of_admission'] ?? '') ?? null,
|
||||
'emp_code' => $row['employee_number'] ?? null,
|
||||
'emp_code' => $row['pribenef_employee_code'] ?? null,
|
||||
'claim_amount' => $row['claim_amount'] ?? null,
|
||||
'tpa_no' => $row['primary_policy_holder_card_id'] ?? null
|
||||
'tpa_no' => $row['event_id'] ?? null
|
||||
];
|
||||
|
||||
$isduplicate = $this->checkDublicateTicketMasterClaim($params);
|
||||
@ -342,9 +331,9 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
$item['tpa_id'] = $client_policy_data['tpa_id'] ?? null;
|
||||
$item['acm_id'] = $client_policy_data['acm_id'] ?? null;
|
||||
$item['policy_no'] = $client_policy_data['policy_no'] ?? null;
|
||||
$item['relationship'] = $this->convertRelation($row['relation'] ?? null, $row['gender'] ?? null);
|
||||
$item['relationship'] = $this->convertRelation($row['benef_relation'] ?? null);
|
||||
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_number'], $item['relationship']);
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['pribenef_employee_code'], $item['relationship']);
|
||||
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
@ -378,7 +367,10 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_status_id'] = $statusMapping[$row['claim_status']] ?? 61;
|
||||
$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['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
@ -407,85 +399,48 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
* HELPER FUNCTIONs
|
||||
*/
|
||||
|
||||
public function isDateValue($value): bool
|
||||
{
|
||||
if (empty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Excel numeric date (e.g. 44927)
|
||||
if (is_numeric($value) && $value > 30000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Common date formats
|
||||
return preg_match(
|
||||
'/^\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}$|^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/',
|
||||
(string) $value
|
||||
) === 1;
|
||||
}
|
||||
|
||||
|
||||
public function normalizeDate($value): ?string
|
||||
{
|
||||
try {
|
||||
// Excel numeric date
|
||||
if (is_numeric($value)) {
|
||||
return date('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($value));
|
||||
}
|
||||
|
||||
// String date
|
||||
return date('Y-m-d', strtotime(str_replace('/', '-', $value)));
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function convertRelation(string $relation, string $gender): ?string
|
||||
public function convertRelation(?string $relation): ?string
|
||||
{
|
||||
if (empty($relation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$relation = strtolower($relation);
|
||||
$gender = strtolower($gender);
|
||||
|
||||
if ($relation == 'self') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'self')) {
|
||||
return 'self';
|
||||
}
|
||||
|
||||
if ($relation == 'spouse') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'spouse') || str_contains($relation, 'wife') || str_contains($relation, 'husband')) {
|
||||
return 'spouse';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'male') {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'female') {
|
||||
if (str_contains($relation, 'daughter')) {
|
||||
return 'daughter';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'male') {
|
||||
return 'father';
|
||||
if (str_contains($relation, 'son')) {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'female') {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'male') {
|
||||
if (str_contains($relation, 'father in law') || str_contains($relation, 'father-in-law')) {
|
||||
return 'father-in-law';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'female') {
|
||||
if (str_contains($relation, 'mother in law') || str_contains($relation, 'mother-in-law')) {
|
||||
return 'mother-in-law';
|
||||
}
|
||||
|
||||
return null;
|
||||
if (str_contains($relation, 'father')) {
|
||||
return 'father';
|
||||
}
|
||||
|
||||
if (str_contains($relation, 'mother')) {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
return null; // unmatched case
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -60,8 +60,6 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Employee / Member
|
||||
'employee_member_id' => 'emp_code',
|
||||
'insured_name' => 'insured_name',
|
||||
'patient_name' => 'emp_name',
|
||||
'relation' => 'relationship',
|
||||
|
||||
// Policy
|
||||
@ -95,10 +93,6 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// References
|
||||
'cl_inward_no' => 'claim_number',
|
||||
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
'ticket_type_id' => 1,
|
||||
];
|
||||
|
||||
protected $statusMapping = [
|
||||
@ -112,6 +106,17 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
'Cashless Document Awaited' => 3,
|
||||
];
|
||||
|
||||
protected $dateColumns = [
|
||||
'inward_date',
|
||||
'policy_start_date',
|
||||
'policy_end_date',
|
||||
'doa_opd_treatment_from',
|
||||
'dod_opd_treatment_to',
|
||||
'approved_date',
|
||||
'cheque_neft_date'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* ABSTRACT FUNCTIONs
|
||||
*/
|
||||
@ -205,14 +210,13 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
$dbColumn = $map['db_column'];
|
||||
|
||||
$value = $row[$excelColumn] ?? null;
|
||||
|
||||
if ($this->isDateValue($value)) {
|
||||
$value = $this->normalizeDate($value);
|
||||
}
|
||||
|
||||
$item[$dbColumn] = $value;
|
||||
}
|
||||
|
||||
foreach ($this->dateColumns as $key => $value) {
|
||||
$item[$value] = change_date_format($item[$value] ?? null, 'd-M-y', 'Y-m-d');
|
||||
}
|
||||
|
||||
$params = [
|
||||
'doa_opd_treatment_from' => $item['doa_opd_treatment_from'] ?? null,
|
||||
'employee_member_id' => $item['employee_member_id'] ?? null,
|
||||
@ -299,7 +303,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
$item['tpa_id'] = $client_policy_data['tpa_id'] ?? null;
|
||||
$item['acm_id'] = $client_policy_data['acm_id'] ?? null;
|
||||
$item['policy_no'] = $client_policy_data['policy_no'] ?? null;
|
||||
$item['relationship'] = $this->convertRelation($row['relation'] ?? null, $row['gender'] ?? null);
|
||||
$item['relationship'] = $this->convertRelation($row['relation'] ?? null);
|
||||
|
||||
$employee_data = $this->getEmployeeDetails($file_data['client_id'], $file_data['client_policy_id'], $row['employee_member_id'], $item['relationship']);
|
||||
|
||||
@ -334,7 +338,12 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_status_id'] = $statusMapping[$row['final_status']] ?? 61;
|
||||
$item['file_id'] = $file_id;
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['claim_type'] = 1;
|
||||
$item['priority'] = 1;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
@ -363,83 +372,47 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
* HELPER FUNCTIONs
|
||||
*/
|
||||
|
||||
public function isDateValue($value): bool
|
||||
{
|
||||
if (empty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Excel numeric date (e.g. 44927)
|
||||
if (is_numeric($value) && $value > 30000) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Common date formats
|
||||
return preg_match(
|
||||
'/^\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}$|^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/',
|
||||
(string) $value
|
||||
) === 1;
|
||||
}
|
||||
|
||||
|
||||
public function normalizeDate($value): ?string
|
||||
{
|
||||
try {
|
||||
// Excel numeric date
|
||||
if (is_numeric($value)) {
|
||||
return date('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($value));
|
||||
}
|
||||
|
||||
// String date
|
||||
return date('Y-m-d', strtotime(str_replace('/', '-', $value)));
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function convertRelation(string $relation, string $gender): ?string
|
||||
public function convertRelation(?string $relation): ?string
|
||||
{
|
||||
if (empty($relation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$relation = strtolower($relation);
|
||||
$gender = strtolower($gender);
|
||||
|
||||
if ($relation == 'self') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'self')) {
|
||||
return 'self';
|
||||
}
|
||||
|
||||
if ($relation == 'spouse') {
|
||||
return $relation;
|
||||
if (str_contains($relation, 'spouse') || str_contains($relation, 'wife') || str_contains($relation, 'husband')) {
|
||||
return 'spouse';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'male') {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'child' && $gender == 'female') {
|
||||
if (str_contains($relation, 'daughter')) {
|
||||
return 'daughter';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'male') {
|
||||
return 'father';
|
||||
if (str_contains($relation, 'son')) {
|
||||
return 'son';
|
||||
}
|
||||
|
||||
if ($relation == 'parents' && $gender == 'female') {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'male') {
|
||||
if (str_contains($relation, 'father in law') || str_contains($relation, 'father-in-law')) {
|
||||
return 'father-in-law';
|
||||
}
|
||||
|
||||
if ($relation == 'parents-in-law' && $gender == 'female') {
|
||||
if (str_contains($relation, 'mother in law') || str_contains($relation, 'mother-in-law')) {
|
||||
return 'mother-in-law';
|
||||
}
|
||||
|
||||
return null;
|
||||
if (str_contains($relation, 'father')) {
|
||||
return 'father';
|
||||
}
|
||||
|
||||
if (str_contains($relation, 'mother')) {
|
||||
return 'mother';
|
||||
}
|
||||
|
||||
return null; // unmatched case
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -346,9 +346,6 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Meta
|
||||
'file_id' => 'file_id',
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
'ticket_type_id' => 1,
|
||||
];
|
||||
|
||||
|
||||
@ -566,6 +563,9 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$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;
|
||||
$item['mode_of_intimation'] = 5;
|
||||
$item['ticket_type_id'] = 1;
|
||||
|
||||
$mapped[] = $item;
|
||||
}
|
||||
|
||||
@ -118,7 +118,16 @@ class ClientPolicyModel extends Model
|
||||
|
||||
|
||||
return $this->db->table('client_policy')
|
||||
->select('client_policy.*')
|
||||
->select('
|
||||
|
||||
client_policy.*,
|
||||
CASE
|
||||
WHEN client_policy.policy_entry_from = 3
|
||||
AND client_policy.cd_ac_pk IS NULL
|
||||
THEN leads.cd_amount
|
||||
ELSE NULL
|
||||
END AS lead_cd_amount
|
||||
', false)
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
|
||||
->select('policy_type.policy_type as policy_type_name')
|
||||
@ -132,6 +141,7 @@ class ClientPolicyModel extends Model
|
||||
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
|
||||
->join('leads', 'client_policy.is_from_lead = leads.id', 'left')
|
||||
->where('client_policy.client_id', $client_id)
|
||||
// ->where('client_policy.policy_status', 1)
|
||||
->where('client_policy.is_active', 1)
|
||||
|
||||
@ -289,7 +289,6 @@
|
||||
|
||||
$('#opening_date').val('');
|
||||
$('#cd_ac_no_for_cd_master').val('');
|
||||
$('#opening_bal').val('');
|
||||
// $('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
|
||||
$('#title').html('Add Opening Amount');
|
||||
$('#cd_master_btn_Submit').html('Submit');
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
<td>Get Branch Wise Employee Data</td>
|
||||
<td><?= base_url("getClientBranchEmpData") ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>-->
|
||||
|
||||
|
||||
<!-- Enter Token Section -->
|
||||
|
||||
@ -102,7 +102,7 @@ table.dataTable thead th {
|
||||
<tr >
|
||||
<td class="text-center"><?=$index+1?></td>
|
||||
<td class="client_info" data-id="<?php echo $row->id; ?>"><?php echo $row->client_name; ?> ( <?php echo $row->short_name; ?> ) </td>
|
||||
<td>
|
||||
<!-- <td>
|
||||
<?php $account_managers = ''; ?>
|
||||
<?php foreach ($client_rm as $client): ?>
|
||||
<?php if ($client->client_id == $row->id): ?>
|
||||
@ -112,6 +112,9 @@ table.dataTable thead th {
|
||||
<?php
|
||||
$account_managers = rtrim($account_managers, ', ');
|
||||
echo $account_managers !== '' ? $account_managers : 'N/A'; ?>
|
||||
</td> -->
|
||||
<td>
|
||||
<?= $row->account_managers ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
@ -389,8 +392,10 @@ $(document).ready(function()
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
if (response.status === "success" && Array.isArray(response.data)) {
|
||||
console.error("#CL 1 : ", response.data);
|
||||
renderRows(response.data);
|
||||
} else {
|
||||
console.error("#CL 2 : ", response.data);
|
||||
renderRows([]);
|
||||
}
|
||||
},
|
||||
@ -407,21 +412,21 @@ $(document).ready(function()
|
||||
table.clear();
|
||||
if (Array.isArray(data) && data.length) {
|
||||
data.forEach((row, index) => {
|
||||
let clientrm = <?= json_encode($client_rm) ?>;
|
||||
let account_managers = "";
|
||||
|
||||
clientrm.forEach(client => {
|
||||
if (client.client_id == row.id) {
|
||||
account_managers += client.account_manager + ", ";
|
||||
}
|
||||
});
|
||||
account_managers = account_managers.replace(/,\s*$/, "");
|
||||
if (account_managers === "") account_managers = "N/A";
|
||||
// let clientrm = json_encode($client_rm)
|
||||
// let account_managers = "";
|
||||
//
|
||||
// clientrm.forEach(client => {
|
||||
// if (client.client_id == row.id) {
|
||||
// account_managers += client.account_manager + ", ";
|
||||
// }
|
||||
// });
|
||||
// account_managers = account_managers.replace(/,\s*$/, "");
|
||||
// if (account_managers === "") account_managers = "N/A";
|
||||
|
||||
let rowData = [
|
||||
index + 1,
|
||||
`<span class="client_info" data-id="${row.id}">${row.client_name} (${row.short_name})</span>`,
|
||||
account_managers,
|
||||
row.account_managers,
|
||||
`<div class="btn-group dropdown">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown">
|
||||
<i class="mdi mdi-dots-horizontal"></i>
|
||||
@ -645,7 +650,11 @@ function featchClient(){
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res.status == true){
|
||||
let client_url = '<?= base_url('client/list/') ?>' + res.client_id + '?client_policy_id=' + res.client_policy_id+'#police-tab';
|
||||
let client_url = '<?= base_url('client/list/') ?>'
|
||||
+ res.client_id
|
||||
+ '?cd_amt=' + (res.cd_amount ?? 0)
|
||||
+ '&client_policy_id=' + res.client_policy_id
|
||||
+ '#police-tab';
|
||||
toastr.success(res.message, 'SUCCESS')
|
||||
window.location.href = client_url
|
||||
}else{
|
||||
|
||||
@ -527,7 +527,7 @@ input:checked + .slider_blue::before {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" data-cdamt="${item.lead_cd_amount}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
@ -794,7 +794,7 @@ input:checked + .slider_blue::before {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" data-cdamt="${item.lead_cd_amount}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
@ -825,6 +825,13 @@ input:checked + .slider_blue::before {
|
||||
$('#open_date').val('');
|
||||
$('#close_date').val('');
|
||||
$('#policy').html('<option value="" selected>Select Policy</option>');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const clientPolicyId = urlParams.get('client_policy_id');
|
||||
if (clientPolicyId) {
|
||||
let client_url = '<?= base_url('client/list/') ?>' + res.client_id ;
|
||||
window.location.href = client_url
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -851,6 +858,7 @@ input:checked + .slider_blue::before {
|
||||
}, 1000);
|
||||
},
|
||||
complete :function(){
|
||||
$('#opening_bal').val("")
|
||||
console.log('AJAX request completed');
|
||||
}
|
||||
});
|
||||
@ -935,6 +943,14 @@ input:checked + .slider_blue::before {
|
||||
|
||||
var policy_form_action = '';
|
||||
var policy_id = $(this).attr('data-id');
|
||||
var opening_bal = $(this).attr('data-cdamt') ?? "";
|
||||
console.log('opening_bal', opening_bal)
|
||||
console.log('opening_bal', $('#opening_bal'))
|
||||
|
||||
if(opening_bal != "null"){
|
||||
$('#opening_bal').val(opening_bal);
|
||||
}
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
@ -2031,6 +2047,7 @@ input:checked + .slider_blue::before {
|
||||
// Get the `client_policy_id` from the URL
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const clientPolicyId = urlParams.get('client_policy_id');
|
||||
const cd_amt = urlParams.get('cd_amt');
|
||||
|
||||
if (clientPolicyId) {
|
||||
// Call your function with the `client_policy_id`
|
||||
@ -2038,6 +2055,10 @@ input:checked + .slider_blue::before {
|
||||
getClientPolicyDataForEdit(clientPolicyId);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
if(cd_amt){
|
||||
$('#opening_bal').val(cd_amt);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -2498,7 +2519,7 @@ $(document).ready(function () {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" data-cdamt="${item.lead_cd_amount}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
@ -2534,7 +2555,7 @@ $(document).ready(function () {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" data-cdamt="${item.lead_cd_amount}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
|
||||
@ -270,6 +270,7 @@ th:first-child, td:first-child {
|
||||
<th><?php echo format_indian_number($gst_total); ?></th> -->
|
||||
<th></th>
|
||||
</tr> */ ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="ticket_type"> Policy Type <span class="text-danger"></span></label>
|
||||
<label> Policy Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="openTicketTypeAskModal">
|
||||
<option value="1">Claim-GMC</option>
|
||||
<option value="2">Claim-GPA</option>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user