MERGE_UAT_TPI_API_DATA

This commit is contained in:
Ubuntu 2026-05-05 09:19:41 +05:30
commit 953ea5bb97
18 changed files with 170 additions and 52 deletions

View File

@ -4367,10 +4367,55 @@ class EmployeeController extends AdminController
$not_in_tpa = $this->employeePolicyModel->getTPADataVariationReport($client_id, $client_policy_id, $file_id, $tpa_emp_codes);
if (!empty($not_in_tpa) || !empty($not_in_nhance) || !empty($emp_data_wo_tpa_id)) {
$not_in_nhance_button_enable_status = false;
if(count($not_in_tpa))
{
foreach($not_in_nhance as $nih)
{
if($nih['ref'] === '' || empty($nih['ref']))
{
$not_in_nhance_button_enable_status = true;
break;
}
}
}
$not_in_nhance_inception_count = 0;
$not_in_nhance_deletion_count = 0;
foreach ($not_in_nhance as $nih) {
$hasRefKey = array_key_exists('ref', $nih);
$ref = $hasRefKey ? $nih['ref'] : null;
// Empty/null ref: no key, NULL, '', or whitespace-only string.
$refIsEmpty = !$hasRefKey
|| $ref === null
|| $ref === ''
|| (is_string($ref) && trim($ref) === '');
$actionIsDeletion = strtoupper(trim((string) ($nih['action_flag_status'] ?? ''))) === 'D';
// Every empty/null ref row counts as inception; those that also have flag D additionally count as deletion.
if ($refIsEmpty) {
$not_in_nhance_inception_count++;
if ($actionIsDeletion) {
$not_in_nhance_deletion_count++;
}
}
}
$not_in_nhance_proceed_button_text = sprintf(
'Proceed - Inception(%d) + Deletion(%d)',
$not_in_nhance_inception_count,
$not_in_nhance_deletion_count
);
$response = [
'not_in_tpa' => $not_in_tpa,
'not_in_nhance' => $not_in_nhance,
'mismatch_data' => $emp_data_wo_tpa_id,
'not_in_nhance_button_enable_status' => $not_in_nhance_button_enable_status,
'not_in_nhance_inception_count' => $not_in_nhance_inception_count,
'not_in_nhance_deletion_count' => $not_in_nhance_deletion_count,
'not_in_nhance_proceed_button_text' => $not_in_nhance_proceed_button_text,
];
if ($type === 'view') {
@ -4447,10 +4492,10 @@ class EmployeeController extends AdminController
{
if($generationResult['data']['file_id'])
{
sleep(1);
// sleep(1);
//initiate update references b/w tpa_api_data and employess (pk update)
// $this->reconTpaApiDataWithEmployeepolicies(['file_id' => $file_id]);
sleep(1);
// sleep(1);
//initiate deleteion if any
// $this->initializeDeletionProcessForTpaApiData(['file_id' => $file_id]);

View File

@ -223,8 +223,8 @@ class EmployeeMultiEventServiceController extends BaseController
'col_cell_name' => 'M',
'col_name' => 'Phone',
'is_mandatory' => false,
'data_type' => 'str',
'format' => null,
'data_type' => 'mobile',
'format' => 'mobile',
'allowed_values' => null,
'custom' => 'check_dup_mobileno',
'params' => ['row', 'existing_mobilenos']
@ -1506,6 +1506,7 @@ class EmployeeMultiEventServiceController extends BaseController
foreach ($row as $col_key => $col) {
$is_mandatory = $columns_to_check[$keys[$col_key]]['is_mandatory'];
$format = $columns_to_check[$keys[$col_key]]['format'];
$data_type = $columns_to_check[$keys[$col_key]]['data_type'];
$allowed_values = $columns_to_check[$keys[$col_key]]['allowed_values'];
$custom_function = isset($columns_to_check[$keys[$col_key]]['custom']) ? $columns_to_check[$keys[$col_key]]['custom'] : null;
$binding_params = isset($columns_to_check[$keys[$col_key]]['params']) ? $columns_to_check[$keys[$col_key]]['params'] : null;
@ -1545,14 +1546,26 @@ class EmployeeMultiEventServiceController extends BaseController
}
//format check
if (isset($format)) {
$format_error = check_excel_date_format($col, $format);
if (!$format_error['status']) {
if(isset($format))
{
$validation = validate_excel_value($col, $data_type, $format, $allowed_values);
if (!$validation['status']) {
array_push($result['error_summary'], 2);
$result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; //push column name
$result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index; //push column index
$result['error_data'][$row_key][$keys[$col_key]]['error'][] = $format_error['error'];
$result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name;
$result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index;
$result['error_data'][$row_key][$keys[$col_key]]['error'][] = $validation['error'];
}
// $format_error = check_excel_date_format($col,$format);
// if(!$format_error['status'])
// {
// array_push($result['error_summary'],2);
// $result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; //push column name
// $result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index; //push column index
// $result['error_data'][$row_key][$keys[$col_key]]['error'][] = $format_error['error'];
// }
}
// Kint::dump($is_mandatory);
//allowed values check

View File

@ -530,12 +530,19 @@ class FhplApiController extends BaseController
$employeePolicyModel = new EmployeePolicyModel();
$employeePolicyData = $employeePolicyModel
->select('
employees.*,
employee_polices.id as emp_policy_id,
employee_polices.client_policy_id,
')
->join('employees', 'employees.id = employee_polices.employee_id')
->where('employee_polices.client_policy_id', $client_policy_id)
->where('employee_polices.tpa_id IS NULL')
->findAll();
$updated = 0;
$employee_policy_ids = [];
$batch_file_success = 'success';
foreach ($employeePolicyData as $policy) {
$hasMatchForThisPolicy = false;
@ -566,24 +573,22 @@ class FhplApiController extends BaseController
}
}
}
}
// Handle NO MATCH for this policy
if (!$hasMatchForThisPolicy) {
if (!$hasMatchForThisPolicy) {
$nhanceSideData = [
'name' => $policy['name'] ?? null,
'emp_code' => $policy['emp_code'] ?? null,
'relationship' => $policy['relationship'] ?? null,
'gender' => $policy['gender'] ?? null,
'dob' => $policy['dob'] ?? null,
];
$batch_file_success = 'partially success';
$nhanceSideData = [
'name' => $policy_data['name'] ?? null,
'emp_code' => $policy_data['emp_code'] ?? null,
'relationship' => $policy_data['relationship'] ?? null,
'gender' => $policy_data['gender'] ?? null,
'dob' => $policy_data['dob'] ?? null,
];
$batch_file_success = 'partially success';
log_message(
'error',
"FHPL - TPA ID Pull No match for Nhance = " . json_encode($nhanceSideData)
);
log_message(
'error',
"FHPL - TPA ID Pull No match for Nhance = " . json_encode($nhanceSideData)
);
}
}
// send e-card
@ -1064,6 +1069,11 @@ class FhplApiController extends BaseController
'is_active' => 1,
'created_by' => $file_info[0]['created_by'] ?? null,
'action_flag_status' => $row['IsActive'] == 1 ? 'A' : 'D'
'si' => $row['BASE_SUMINSURED'],
'doj' => change_date_format($row['DATE_OF_JOINING'],'Y-m-d\TH:i:s'),
'endorsement_no' => $row['ENDORSEMENT_NO']
// 'date_of_exit' => $row['DATE_OF_RESIGN_FROM_POLICY']
];
}

View File

@ -1092,7 +1092,10 @@ class HealthIndiaApiController extends BaseController
'is_active' => 1,
'created_by' => $file_info[0]['created_by'] ?? null,
'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D'
'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D',
'doj' => change_date_format($row['doj'],),
'si' => $row['baseSumInsured'],
'endorsement_no' => $row['endorsementNumber']
];
}
// log_message('error','HEALTH_INDIA - COUNT' . count($mappedRows));

View File

@ -661,6 +661,13 @@ if (! function_exists('change_date_format')) {
$date_str = trim($date_str);
// Allowed date formats
$allowed_formats = [
// ISO 8601 datetime (must come before plain Y-m-d to avoid partial match issues)
'Y-m-d\TH:i:sP', // 2025-07-26T00:00:00+05:30
'Y-m-d\TH:i:s\Z', // 2025-07-26T00:00:00Z
'Y-m-d\TH:i:s', // 2025-07-26T00:00:00
// Day Month Year (clear unambiguous formats)
'd M Y', // 01 Dec 2024
'd-M-Y', // 01-Dec-2024

View File

@ -522,6 +522,10 @@ for ($i = 0; $i < $batch_col_count; $i++) {
<script>
let currentTPAVariationFileId = null;
/** From API `not_in_nhance_button_enable_status` — when false, Proceed is disabled on "Not in Nhance" tab. */
let tpaNotInNhanceProceedEnabled = true;
/** From API `not_in_nhance_proceed_button_text` — label for Proceed on "Not in Nhance" tab. */
let tpaNotInNhanceProceedButtonText = 'Proceed - Not in Nhance';
const tpaVariationColumns = {
not_in_nhance: [
@ -661,7 +665,13 @@ for ($i = 0; $i < $batch_col_count; $i++) {
renderVariationTable('#not_in_tpa_table', notInTpa, tpaVariationColumns.not_in_tpa);
renderVariationTable('#need_to_review_table', reviewData, tpaVariationColumns.need_to_review);
// Default tab: Not in Nhance — select tab and init DataTable for #not_in_nhance_table as soon as data is rendered.
tpaNotInNhanceProceedEnabled = data.not_in_nhance_button_enable_status !== false;
if (typeof data.not_in_nhance_proceed_button_text === 'string' && data.not_in_nhance_proceed_button_text.trim() !== '') {
tpaNotInNhanceProceedButtonText = data.not_in_nhance_proceed_button_text.trim();
} else {
tpaNotInNhanceProceedButtonText = 'Proceed - Not in Nhance';
}
showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
@ -773,15 +783,17 @@ for ($i = 0; $i < $batch_col_count; $i++) {
return;
}
// Default: visible
$button.removeClass('d-none');
$button.prop('disabled', false);
if (activeId === 'not-in-nhance-tab') {
$button.text('Proceed - Not in Nhance');
$button.text(tpaNotInNhanceProceedButtonText);
if (!tpaNotInNhanceProceedEnabled) {
$button.prop('disabled', true);
}
} else if (activeId === 'need-to-review-tab') {
$button.text('Proceed - Need to Review');
} else if (activeId === 'not-in-tpa-tab') {
// Hide button for "Not in TPA" section
$button.addClass('d-none');
} else {
$button.text('Proceed');
@ -798,7 +810,6 @@ for ($i = 0; $i < $batch_col_count; $i++) {
});
$('#tpa_variation_modal').on('shown.bs.modal', function () {
// Always show "Not in Nhance" first; re-measure DataTable now that the modal is visible.
showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
@ -808,6 +819,9 @@ for ($i = 0; $i < $batch_col_count; $i++) {
destroyVariationDataTable('#not_in_nhance_table');
destroyVariationDataTable('#not_in_tpa_table');
destroyVariationDataTable('#need_to_review_table');
tpaNotInNhanceProceedEnabled = true;
tpaNotInNhanceProceedButtonText = 'Proceed - Not in Nhance';
$('#tpaProceedButton').prop('disabled', false);
});
/* footer.php sets scrollX/scrollY on $.fn.dataTable.defaults — force off for this init so DT does not split thead into .dataTables_scrollHead / tbody into .dataTables_scrollBody (only the body strip would scroll horizontally). */
@ -1111,6 +1125,10 @@ for ($i = 0; $i < $batch_col_count; $i++) {
}
if (activeId === 'not-in-nhance-tab') {
if (!tpaNotInNhanceProceedEnabled) {
toastr.warning('Proceed is not available for this tab.', 'WARNING');
return;
}
proceedNotInNhance();
} else if (activeId === 'not-in-tpa-tab') {
proceedNotInTPA();

View File

@ -49,7 +49,7 @@
<div class="form-group col-md-4">
<label>File<span class="text-danger">*</span></label>
<input class="form-control other-doc-file-field" type="file" name="file_name[]" required accept=".pdf, .jpeg, .jpg, .png">
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF</small>
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG.</small>
<div class="other-doc-file-error text-danger small mt-1"></div>
</div>
<div class="form-group col-md-4" style="<?= isset($client['id']) ? 'margin-top: 41px;' : 'margin-top: 30px;' ?>">
@ -170,7 +170,7 @@
<div class="form-group col-md-4">
<label>File<span class="text-danger">*</span></label>
<input class="form-control other-doc-file-field" type="file" name="file_name[]" required accept=".pdf, .jpeg, .jpg, .png">
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF</small>
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG.</small>
<div class="other-doc-file-error text-danger small mt-1"></div>
</div>
<div class="form-group col-md-4" style="<?= isset($client['id']) ? 'margin-top: 41px;' : 'margin-top: 30px;' ?>">
@ -505,7 +505,7 @@
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
<input type="hidden" name="client_id" value="${client_id}">
<button class="btn btn-sm btn-primary submit" style="position: relative; right:0px;">Submit</button>
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF</small>
<small class="mt-1 text-muted d-block">Allowed: PDF, JPG, JPEG, PNG.</small>
<div class="kyc-primary-file-error text-danger small mt-1"></div>
</form>
</td>

View File

@ -976,7 +976,7 @@ $gst_total = 0;
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while fetching e-card.', 'Error');
});

View File

@ -41,11 +41,20 @@
text-align: center;
}
.error-illustration-frame {
display: inline-block;
max-width: 100%;
line-height: 0;
margin: 0 auto 24px auto;
}
.error-image {
width: min(100%, 560px);
height: auto;
display: block;
margin: 0 auto 10px auto;
width: 446px;
height: auto;
max-width: 100%;
max-height: 52vh;
object-fit: contain;
}
.error-title {
@ -98,7 +107,7 @@
background-image: radial-gradient(circle at 0 0, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 120px, transparent 120px), radial-gradient(circle at 100% 100%, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 140px, transparent 140px);
}
.error-image {
.error-illustration-frame {
margin-bottom: 20px;
}
@ -113,7 +122,15 @@
<body>
<main class="error-wrapper">
<img class="error-image" src="<?= base_url()."public"; ?>/assets/images/errors/403_illustration.png" alt="403 access denied">
<div class="error-illustration-frame">
<img class="error-image"
src="<?= base_url()."public"; ?>/assets/images/errors/403_illustration.png"
width="446"
height="415"
decoding="async"
fetchpriority="high"
alt="403 access forbidden">
</div>
<h1 class="error-title">ACCESS DENIED</h1>
<p class="error-subtitle">
<?= isset($message) && !empty($message) ? $message : "You don't have permission to access this page." ?>

View File

@ -1361,7 +1361,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while fetching TPA ID.', 'Error');
});

View File

@ -451,8 +451,11 @@
<div class="form-row">
<div class="form-group col-md-12">
<label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
<textarea class="form-control" id="notes" name="notes" rows="4"maxlength="100"
oninput="this.value = this.value.slice(0, 100);">
</textarea>
</div>
</div>
</div>
</div>

View File

@ -733,7 +733,7 @@ if (isset($selected_lead_type)) {
$('.loader-mask').delay(350).fadeOut('slow');
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while removing the file.', 'Error');
});
}else{

View File

@ -469,8 +469,10 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
<label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4" maxlength="100"
oninput="this.value = this.value.slice(0, 100);">
</textarea>
</div>
</div>
</div>

View File

@ -6185,7 +6185,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while creating the vehicle.', 'Error');
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
});
@ -6251,7 +6251,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while creating the client.', 'Error');
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');

View File

@ -5842,7 +5842,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while creating the vehicle.', 'Error');
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
});
@ -5908,7 +5908,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while createing the client.', 'Error');
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');

View File

@ -7433,7 +7433,7 @@ function appendMultiFileData(data) {
$('.loader-mask').delay(350).fadeOut('slow');
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while removing the file.', 'Error');
});
}else{

View File

@ -3271,7 +3271,7 @@
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while checking the CD amount.', 'Error');
toastr.error('An error occurred while saving the data.', 'Error');
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 30 KiB