CHANAGE_CLAIMS_MODULE_SRI
This commit is contained in:
parent
3bdf3f6bb5
commit
bfe5c2be2d
@ -114,8 +114,7 @@ class TicketController extends BaseController
|
|||||||
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
|
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
|
||||||
];
|
];
|
||||||
$this->extraFields = [
|
$this->extraFields = [
|
||||||
1 => ['non_id_reason'],
|
|
||||||
10 => ['pay_initiate_date'],
|
|
||||||
3 => ['raised_date'],
|
3 => ['raised_date'],
|
||||||
4 => ['raised_date'],
|
4 => ['raised_date'],
|
||||||
5 => ['claim_number', 'registration_date'],
|
5 => ['claim_number', 'registration_date'],
|
||||||
|
|||||||
@ -235,9 +235,44 @@ function showConfirmationModal(event) {
|
|||||||
console.log($('#ticket_form_data')[0])
|
console.log($('#ticket_form_data')[0])
|
||||||
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
||||||
} else if (result.isDenied) {
|
} else if (result.isDenied) {
|
||||||
|
// Show second Swal for rejection reason
|
||||||
|
Swal.fire({
|
||||||
|
title: "Rejection Reason",
|
||||||
|
text: "Please provide a reason for rejection",
|
||||||
|
input: "textarea",
|
||||||
|
inputPlaceholder: "Enter your reason here...",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#6c757d",
|
||||||
|
confirmButtonText: "Submit",
|
||||||
|
cancelButtonText: "Back"
|
||||||
|
}).then((reasonResult) => {
|
||||||
|
if (reasonResult.isConfirmed) {
|
||||||
|
// Check if reason is not empty
|
||||||
|
if (reasonResult.value && reasonResult.value.trim() !== "") {
|
||||||
$('#is_head_approved').val(2);
|
$('#is_head_approved').val(2);
|
||||||
console.log($('#ticket_form_data')[0])
|
$('#rejection_reason').val(reasonResult.value.trim());
|
||||||
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
console.log($('#ticket_form_data')[0]);
|
||||||
|
$('#head_rejection_reason').val(reasonResult.value.trim());
|
||||||
|
submitClaimForm(event, $('#ticket_form_data')[0]);
|
||||||
|
} else {
|
||||||
|
// Alert if reason is empty
|
||||||
|
Swal.fire({
|
||||||
|
title: "Error",
|
||||||
|
text: "Rejection reason cannot be empty",
|
||||||
|
icon: "error",
|
||||||
|
confirmButtonColor: "#3085d6"
|
||||||
|
}).then(() => {
|
||||||
|
// Go back to the rejection reason dialog
|
||||||
|
showConfirmationModal(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If canceled, go back to first Swal
|
||||||
|
showConfirmationModal(event);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('#is_head_approved').val(0);
|
$('#is_head_approved').val(0);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
||||||
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
||||||
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
||||||
|
<input type="hidden" id="head_rejection_reason" name="head_rejection_reason">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -215,7 +216,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="pod_no">POD No<span class="text-danger"></span></label>
|
<label id="pod_no_label_1" for="pod_no">POD No<span id="pod_no_label_1_span" class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
||||||
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
||||||
name="pod_no">
|
name="pod_no">
|
||||||
@ -347,12 +348,9 @@
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let GlobelExtraFields = [];
|
let GlobelExtraFields = [];
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@ -367,13 +365,34 @@ $(document).ready(function() {
|
|||||||
allowInput: false
|
allowInput: false
|
||||||
});
|
});
|
||||||
|
|
||||||
flatpickr("#raised_date", { dateFormat: "d/m/Y", allowInput: false });
|
flatpickr("#raised_date", {
|
||||||
flatpickr("#registration_date", { dateFormat: "d/m/Y", allowInput: false });
|
dateFormat: "d/m/Y",
|
||||||
flatpickr("#query_received_date", { dateFormat: "d/m/Y", allowInput: false });
|
allowInput: false
|
||||||
flatpickr("#denial_date", { dateFormat: "d/m/Y", allowInput: false });
|
});
|
||||||
flatpickr("#approved_date", { dateFormat: "d/m/Y", allowInput: false });
|
flatpickr("#registration_date", {
|
||||||
flatpickr("#settled_date", { dateFormat: "d/m/Y", allowInput: false });
|
dateFormat: "d/m/Y",
|
||||||
flatpickr("#pay_initiate_date", { dateFormat: "d/m/Y", allowInput: false });
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#query_received_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#denial_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#approved_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#settled_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#pay_initiate_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
||||||
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
||||||
@ -531,8 +550,10 @@ $(document).on("input", function (event) {
|
|||||||
if ($parentDiv.length) {
|
if ($parentDiv.length) {
|
||||||
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
||||||
console.log('thirdClass', thirdClass);
|
console.log('thirdClass', thirdClass);
|
||||||
|
addRequiredFieldSymbolByClass(thirdClass);
|
||||||
|
// addRequiredFieldSymbol(targetId);
|
||||||
if (thirdClass) {
|
if (thirdClass) {
|
||||||
|
// console.log("fields",fields);
|
||||||
claimStatusFieldRemoveREquired(fields, false, thirdClass);
|
claimStatusFieldRemoveREquired(fields, false, thirdClass);
|
||||||
$(thirdClass).each(function() {
|
$(thirdClass).each(function() {
|
||||||
let $label = $(this).find("label");
|
let $label = $(this).find("label");
|
||||||
@ -544,9 +565,82 @@ $(document).on("input", function (event) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
claimStatusFieldRemoveREquired($field, false, '');
|
claimStatusFieldRemoveREquired($field, false, '');
|
||||||
|
console.log("In Else Condition");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function addRequiredFieldSymbol(field_name) {
|
||||||
|
// Find the field with the given name
|
||||||
|
var $field = $(`[name="${field_name}"]`);
|
||||||
|
|
||||||
|
if ($field.length) {
|
||||||
|
// Find the parent div of this field
|
||||||
|
var $parentDiv = $field.closest('div');
|
||||||
|
|
||||||
|
if ($parentDiv.length) {
|
||||||
|
// Get the classes as an array
|
||||||
|
var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
|
||||||
|
|
||||||
|
if (classes.length > 0) {
|
||||||
|
// Get the last class in the array
|
||||||
|
var lastClass = classes[classes.length - 1];
|
||||||
|
|
||||||
|
// Find all divs with this last class
|
||||||
|
var $allDivsWithClass = $(`.${lastClass}`);
|
||||||
|
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$allDivsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`Parent div for field "${field_name}" has no classes`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`No parent div found for field name="${field_name}"`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`No field found with name="${field_name}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addRequiredFieldSymbolByClass(className) {
|
||||||
|
// Find all divs with the specified class
|
||||||
|
var $divsWithClass = $(`.${className}`);
|
||||||
|
|
||||||
|
if ($divsWithClass.length) {
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$divsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`No divs found with class="${className}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#mode_of_intimation').change(function(){
|
||||||
|
console.log("function called");
|
||||||
|
var mode_of_intimation = $('#mode_of_intimation').val();
|
||||||
|
console.log('mode of ',mode_of_intimation);
|
||||||
|
|
||||||
|
if (mode_of_intimation == 2){
|
||||||
|
$('#pod_no').attr('required', 'required');
|
||||||
|
$('#pod_no_label_1_span').text("*");
|
||||||
|
}else{
|
||||||
|
$('#pod_no').removeAttr('required', false);
|
||||||
|
$('#pod_no_label_1_span').text("");
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@ -399,9 +399,10 @@ console.log('fields', fields);
|
|||||||
console.log('$field id', $field);
|
console.log('$field id', $field);
|
||||||
let $parentDiv = $field.closest("div");
|
let $parentDiv = $field.closest("div");
|
||||||
console.log('$parentDiv', $parentDiv);
|
console.log('$parentDiv', $parentDiv);
|
||||||
|
// addRequiredFieldSymbol(targetId);
|
||||||
if ($parentDiv.length) {
|
if ($parentDiv.length) {
|
||||||
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
||||||
|
addRequiredFieldSymbolByClass(thirdClass);
|
||||||
console.log('thirdClass', thirdClass);
|
console.log('thirdClass', thirdClass);
|
||||||
|
|
||||||
if (thirdClass) {
|
if (thirdClass) {
|
||||||
@ -416,5 +417,61 @@ console.log('fields', fields);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// function addRequiredFieldSymbol(field_name) {
|
||||||
|
// // Find the field with the given name
|
||||||
|
// var $field = $(`[name="${field_name}"]`);
|
||||||
|
|
||||||
|
// if ($field.length) {
|
||||||
|
// // Find the parent div of this field
|
||||||
|
// var $parentDiv = $field.closest('div');
|
||||||
|
|
||||||
|
// if ($parentDiv.length) {
|
||||||
|
// // Get the classes as an array
|
||||||
|
// var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
|
||||||
|
|
||||||
|
// if (classes.length > 0) {
|
||||||
|
// // Get the last class in the array
|
||||||
|
// var lastClass = classes[classes.length - 1];
|
||||||
|
|
||||||
|
// // Find all divs with this last class
|
||||||
|
// var $allDivsWithClass = $(`.${lastClass}`);
|
||||||
|
|
||||||
|
// // Add asterisk to all labels within these divs
|
||||||
|
// $allDivsWithClass.each(function() {
|
||||||
|
// var $label = $(this).find('label');
|
||||||
|
// if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
// $label.append(' <span class="text-danger">*</span>');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
|
||||||
|
// } else {
|
||||||
|
// console.warn(`Parent div for field "${field_name}" has no classes`);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// console.warn(`No parent div found for field name="${field_name}"`);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// console.warn(`No field found with name="${field_name}"`);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
function addRequiredFieldSymbolByClass(className) {
|
||||||
|
// Find all divs with the specified class
|
||||||
|
var $divsWithClass = $(`.${className}`);
|
||||||
|
|
||||||
|
if ($divsWithClass.length) {
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$divsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`No divs found with class="${className}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user