FIX_CD_INFFFUC_HR_MAIL_SEND
This commit is contained in:
parent
35ca1169b9
commit
2435112b79
@ -1032,8 +1032,9 @@ class EmpDataServiceController extends BaseController
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//for cd tranction and cd master data is empty check
|
||||
if(!empty($inceptionData) && $inceptionData != null){
|
||||
if(!empty($inceptionData) && $inceptionData != null || !empty($additionData) && $additionData != null || !empty($dependentAdditionData) && $dependentAdditionData != null){
|
||||
|
||||
$policy_details = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first();
|
||||
|
||||
@ -1065,6 +1066,14 @@ class EmpDataServiceController extends BaseController
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
|
||||
foreach ($additionData as $item) {
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
|
||||
foreach ($dependentAdditionData as $item) {
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
|
||||
$totals = round($totals, 2);
|
||||
|
||||
|
||||
@ -1127,8 +1136,7 @@ class EmpDataServiceController extends BaseController
|
||||
AND `insurer_excel_export_template`.`type_name` = :type_name:
|
||||
LIMIT 1";
|
||||
|
||||
$binds = ['client_policy_id' => (int)$export_data['client_policy_id'],
|
||||
'type_name' => $export_data['actions']];
|
||||
$binds = ['client_policy_id' => (int)$export_data['client_policy_id'],'type_name' => $export_data['actions']];
|
||||
$query = db_connect()->query($sql,$binds);
|
||||
$template_json = $query->getRowArray();
|
||||
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.select2-hidden-accessible + .select2-container .select2-dropdown {
|
||||
/* Hide dropdown list only for the insurer copy select (search-only UX) */
|
||||
#insurer.select2-hidden-accessible + .select2-container .select2-dropdown {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@ -53,6 +54,14 @@
|
||||
z-index: 1060;
|
||||
}
|
||||
|
||||
#template_modal .select2-container {
|
||||
z-index: 1061;
|
||||
}
|
||||
|
||||
#template_modal .select2-dropdown {
|
||||
z-index: 1062;
|
||||
}
|
||||
|
||||
#template_modal.show {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
@ -276,6 +285,44 @@
|
||||
<script>
|
||||
var insurerTemplateDataTable = null;
|
||||
var templateDebugPrefix = '[InsurerTemplate]';
|
||||
var insurerDbColumnOptions = <?= json_encode($db_column_name ?? [], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP) ?>;
|
||||
|
||||
function buildDbColumnSelectOptions() {
|
||||
var html = '<option value="" selected>Select</option>';
|
||||
if (!insurerDbColumnOptions || typeof insurerDbColumnOptions !== 'object') {
|
||||
return html;
|
||||
}
|
||||
Object.keys(insurerDbColumnOptions).forEach(function (label) {
|
||||
var value = insurerDbColumnOptions[label];
|
||||
html += '<option value="' + String(value).replace(/"/g, '"') + '">' + String(label).replace(/</g, '<') + '</option>';
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
function initDbColumnSelect2($select) {
|
||||
if (!$select || !$select.length || typeof $.fn.select2 !== 'function') {
|
||||
return;
|
||||
}
|
||||
if ($select.hasClass('select2-hidden-accessible')) {
|
||||
$select.select2('destroy');
|
||||
}
|
||||
$select.select2({
|
||||
placeholder: 'Select',
|
||||
allowClear: true,
|
||||
width: '100%',
|
||||
dropdownParent: $('#template_modal')
|
||||
});
|
||||
}
|
||||
|
||||
function destroyDbColumnSelect2InContainer(container) {
|
||||
var $container = container ? $(container) : $('#dynamic-form-container');
|
||||
$container.find('.db-column-name-select').each(function () {
|
||||
var $el = $(this);
|
||||
if ($el.hasClass('select2-hidden-accessible')) {
|
||||
$el.select2('destroy');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showTemplateModal() {
|
||||
var $modal = $('#template_modal');
|
||||
@ -662,6 +709,7 @@
|
||||
input.preventDefault();
|
||||
}
|
||||
$('#myCenterModalLabel').text('Create Template');
|
||||
destroyDbColumnSelect2InContainer();
|
||||
$('#dynamic-form-container').empty();
|
||||
addHTMLInput();
|
||||
showTemplateModal();
|
||||
@ -672,6 +720,10 @@
|
||||
const container = document.getElementById('dynamic-form-container');
|
||||
const newRow = document.createElement('div');
|
||||
newRow.className = 'form-row dynamic-form-row';
|
||||
const disableDbSelect = data !== null && data !== undefined && data !== '' && data.default_value != "" && data.default_value != null;
|
||||
const headerValue = data !== null && data !== undefined && data !== '' ? (data.column_name || '') : '';
|
||||
const defaultValue = data != null && data != undefined && data != '' && data.default_value != "" && data.default_value != null ? data.default_value : '';
|
||||
|
||||
newRow.innerHTML = `
|
||||
<div class="mt-3 p-3" style="width: 100%; background: #F7F7F7;
|
||||
border-radius: 30px !important;
|
||||
@ -681,24 +733,19 @@
|
||||
">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="db_column_name">DataBase Column Name<span class="text-danger"></span></label>
|
||||
<select class="form-control db-column-name-select dbColumn" name="db_column_name[]" onchange="checkForDuplicates(this); handleDbColumnChange(this)" ${data !== null && data !== undefined && data !== '' && data.default_value != "" && data.default_value != null ? 'disabled' : ''}>
|
||||
<option value="" selected >Select</option>
|
||||
<?php if (!empty($db_column_name)){ ?>
|
||||
<?php foreach ($db_column_name as $key => $value) { ?>
|
||||
<option value="<?= $value ?>"><?= $key ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<select class="form-control db-column-name-select" name="db_column_name[]" onchange="checkForDuplicates(this); handleDbColumnChange(this)"${disableDbSelect ? ' disabled' : ''}>
|
||||
${buildDbColumnSelectOptions()}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="excel_column_name">Header Name<span class="text-danger">*</span></label>
|
||||
<input id="excel_column_name" value="${data !== null && data !== undefined && data !== '' ? data.column_name : ''}" class="form-control" type="text" name="excel_column_name[]" placeholder="Excel Header Column Name">
|
||||
<input id="excel_column_name" value="${headerValue}" class="form-control" type="text" name="excel_column_name[]" placeholder="Excel Header Column Name">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="default_value">Default Value<span class="text-danger"></span></label>
|
||||
<input id="default_value" value="${data != null && data != undefined && data != '' && data.default_value != "" && data.default_value != null ? data.default_value : ''}" class="form-control" type="text" name="default_value[]" placeholder="Excel Default value">
|
||||
<input id="default_value" value="${defaultValue}" class="form-control" type="text" name="default_value[]" placeholder="Excel Default value">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;left: 28px;">
|
||||
@ -708,13 +755,14 @@
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(newRow);
|
||||
var $dbSelect = $(newRow).find('.db-column-name-select');
|
||||
if (data != null && data.db_column_name != undefined) {
|
||||
const selectElement = newRow.querySelector('.db-column-name-select');
|
||||
selectElement.value = data.db_column_name;
|
||||
$('.dbColumn').select2();
|
||||
$dbSelect.val(data.db_column_name);
|
||||
}
|
||||
initDbColumnSelect2($dbSelect);
|
||||
if (data != null && data.db_column_name != undefined) {
|
||||
$dbSelect.trigger('change');
|
||||
}
|
||||
|
||||
$('.dbColumn').select2();
|
||||
}
|
||||
|
||||
// function removeHTMLInput(element)
|
||||
@ -731,6 +779,12 @@
|
||||
|
||||
if (rows.length > 1) {
|
||||
const row = element.closest('.dynamic-form-row');
|
||||
$(row).find('.db-column-name-select').each(function () {
|
||||
var $el = $(this);
|
||||
if ($el.hasClass('select2-hidden-accessible')) {
|
||||
$el.select2('destroy');
|
||||
}
|
||||
});
|
||||
row.remove();
|
||||
}
|
||||
}
|
||||
@ -813,6 +867,7 @@
|
||||
var data = JSON.parse(res.data.jsoncolumns)
|
||||
// console.log(JSON.parse(res.data.jsoncolumns));
|
||||
|
||||
destroyDbColumnSelect2InContainer();
|
||||
$('#dynamic-form-container').empty();
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
@ -855,6 +910,7 @@
|
||||
|
||||
$('.close').click(function()
|
||||
{
|
||||
destroyDbColumnSelect2InContainer();
|
||||
$('#dynamic-form-container').empty();
|
||||
$('#policy_type').val('');
|
||||
$('#event').val('').change();
|
||||
@ -926,9 +982,9 @@
|
||||
let $dbSelect = $row.find('select[name="db_column_name[]"]');
|
||||
|
||||
if ($defaultInput.val().trim() !== '') {
|
||||
$dbSelect.val('').trigger('change').prop('disabled', true);
|
||||
$dbSelect.val(null).trigger('change').prop('disabled', true);
|
||||
} else {
|
||||
$dbSelect.prop('disabled', false);
|
||||
$dbSelect.prop('disabled', false).trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1256,11 +1256,20 @@
|
||||
// Start the interval
|
||||
function startInterval() {
|
||||
if (!submitInterval) {
|
||||
messageShown = false; // Reset message flag
|
||||
messageShown = false;
|
||||
|
||||
submitInterval = setInterval(function() {
|
||||
checkCDBalance();
|
||||
}, 2000);
|
||||
|
||||
console.log("Checking CD balance started...");
|
||||
|
||||
// Stop after 15 seconds
|
||||
setTimeout(function() {
|
||||
clearInterval(submitInterval);
|
||||
submitInterval = null;
|
||||
console.log("Checking CD balance stopped after 15 seconds.");
|
||||
}, 15000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user