CHANGE_Issues

This commit is contained in:
venba-Inspriron-3558 2025-09-29 09:35:27 +05:30
parent ef13c94d0a
commit 4c25d7e0aa
10 changed files with 1789 additions and 2068 deletions

View File

@ -36,6 +36,7 @@
</div> </div>
</div> </div>
<div id="collapseOne">
<div id="file_table" class="card"> <div id="file_table" class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
@ -45,7 +46,7 @@
</div> </div>
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table data-custom-table-css="second-table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No&nbsp;</th> <th>S.No&nbsp;</th>
@ -63,6 +64,7 @@
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div> </div>
</div>
<script> <script>

View File

@ -356,11 +356,7 @@
// for datatable // for datatable
$(document).ready(function() { $(document).ready(function() {
$('#hr_tickets_table').DataTable({ $('#hr_tickets_table').DataTable({
<<<<<<< HEAD
dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
=======
dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" +
>>>>>>> 3e7d3426 (FIX_XL button and Search)
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{ buttons: [{

View File

@ -217,21 +217,6 @@
<i class="mdi mdi-magnify datatable-search-icon"></i> <i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`, </div>`,
searchPlaceholder: "Search" searchPlaceholder: "Search"
>>>>>>> 3e7d3426 (FIX_XL button and Search)
},
{
text: 'ADD',
className: 'btn btn-color',
action: function() {
window.location.href = "<?= base_url("master/insurer/create"); ?>";
}
}
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
}, },
paging: true, paging: true,
}); });

View File

@ -765,7 +765,7 @@
background: #FFFFFF !important; background: #FFFFFF !important;
padding: 12px; padding: 12px;
border-top: 0px solid #fff !important; border-top: 0px solid #fff !important;
border-bottom: 2px solid #F5FFFF !important; border-bottom: 2px solid #F0F0F0 !important;
font-weight: 400 !important; font-weight: 400 !important;
} }
</style> </style>
@ -1295,7 +1295,8 @@
<style> <style>
.card #collapseOne .card-body, .card #collapseOne .card-body,
.card #collapseTwo .card-body, .card #collapseTwo .card-body,
.card #collapseThree .card-body { .card #collapseThree .card-body,
.card #collapseFour .card-body {
background-color: #F5FFFF !important; background-color: #F5FFFF !important;
border: 2px solid #F5FFFF; border: 2px solid #F5FFFF;
border-radius: 10px; border-radius: 10px;
@ -1313,7 +1314,11 @@
.card #collapseThree .card-body input, .card #collapseThree .card-body input,
.card #collapseThree .card-body select, .card #collapseThree .card-body select,
.card #collapseThree .card-body textarea { .card #collapseThree .card-body textarea,
.card #collapseFour .card-body input,
.card #collapseFour .card-body select,
.card #collapseFour .card-body textarea {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
@ -1322,7 +1327,8 @@
.card #collapseOne .card-body input[type='file'], .card #collapseOne .card-body input[type='file'],
.card #collapseTwo .card-body input[type='file'], .card #collapseTwo .card-body input[type='file'],
.card #collapseThree .card-body input[type='file'] { .card #collapseThree .card-body input[type='file'],
.card #collapseFour .card-body input[type='file'] {
padding: 10px !important; padding: 10px !important;
background-color: white !important; background-color: white !important;
color: black !important; color: black !important;
@ -1331,7 +1337,8 @@
/* Apply to Select2 (single select) */ /* Apply to Select2 (single select) */
.card #collapseOne .card-body .select2-container .select2-selection--single, .card #collapseOne .card-body .select2-container .select2-selection--single,
.card #collapseTwo .card-body .select2-container .select2-selection--single, .card #collapseTwo .card-body .select2-container .select2-selection--single,
.card #collapseThree .card-body .select2-container .select2-selection--single { .card #collapseThree .card-body .select2-container .select2-selection--single,
.card #collapseFour .card-body .select2-container .select2-selection--single {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
@ -1345,7 +1352,8 @@
/* Apply to Select2 (multiple select) */ /* Apply to Select2 (multiple select) */
.card #collapseOne .card-body .select2-container .select2-selection--multiple, .card #collapseOne .card-body .select2-container .select2-selection--multiple,
.card #collapseTwo .card-body .select2-container .select2-selection--multiple, .card #collapseTwo .card-body .select2-container .select2-selection--multiple,
.card #collapseThree .card-body .select2-container .select2-selection--multiple { .card #collapseThree .card-body .select2-container .select2-selection--multiple,
.card #collapseFour .card-body .select2-container .select2-selection--multiple {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;

View File

@ -225,114 +225,6 @@
<script> <script>
<<<<<<< HEAD
$(document).ready(function() {
$('#collapseOne').on('show.bs.collapse', function() {
// When open
$('#icon').removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
$('#filterAccordion').removeAttr("style"); // remove custom bg/border when open
=======
$(document).ready(function () {
$('#collapseOne').on('show.bs.collapse', function () {
// When open
$('#icon').removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
$('#filterAccordion').removeAttr("style"); // remove custom bg/border when open
});
$('#collapseOne').on('hide.bs.collapse', function () {
// When closed
$('#icon').removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
// $('#filterAccordion').css({
// "background-color": "#F5FFFF",
// "border": "2px solid #F5FFFF",
// "border-radius": "10px",
// "box-shadow": "0px 4px 4px 0px #00000040"
// });
});
});
// Datatable document ready
$(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) {
ticketsTable.DataTable({
scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{
extend: 'csv',
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-BDS-List',
},
{
extend: 'excel',
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Policy-Tranction-BDS-List',
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0;
// Find cells in column AB (28th column in Excel)
$('row c[r^="AB"]', sheet).each(function() {
var value = parseFloat($('v', this)
.text()); // Get the value inside the cell
if (!isNaN(value)) {
total += value;
}
});
// Get the last row index and append the total row
var lastRow = $('row:last', sheet);
var rowIndex = parseInt(lastRow.attr('r')) +
2; // Find the next row index
var totalRow = '<row r="' + rowIndex + '">' +
'<c t="inlineStr" r="AA' + rowIndex +
'"><is><t>Total</t></is></c>' + // Insert "Total" in AA
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) +
'</v></c>' + // Insert sum in AB
'</row>';
// Append the new total row to the sheet
$(sheet).find('sheetData').append(totalRow);
}
}
]
}
],
language: {
search: `
<div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
},
paging: true, // Enable pagination
pageLength: 25 // Set default number of rows per page (optional)
>>>>>>> 3e7d3426 (FIX_XL button and Search)
});
$('#collapseOne').on('hide.bs.collapse', function() {
// When closed
$('#icon').removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
// $('#filterAccordion').css({
// "background-color": "#F5FFFF",
// "border": "2px solid #F5FFFF",
// "border-radius": "10px",
// "box-shadow": "0px 4px 4px 0px #00000040"
// });
});
});
// Datatable document ready
$(document).ready(function() { $(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable'); var ticketsTable = $('#scroll-horizontal-datatable');

View File

@ -202,7 +202,6 @@
<!-- sales Row --> <!-- sales Row -->
<div class="row" id="sales_row"> <div class="row" id="sales_row">
<div class="col-md-12"> <div class="col-md-12">
<!-- <div class="form-section"> -->
<div id="accordion_2" class="mb-0"> <div id="accordion_2" class="mb-0">
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Endorsement</span> <span class="font-color-black">Endorsement</span>
@ -349,12 +348,8 @@
</div> </div>
</div> </div>
</div> </div>
<!-- </div> -->
</div> </div>
</div>
<!-- Premium Details --> <!-- Premium Details -->
<div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- <div class="form-section"> --> <!-- <div class="form-section"> -->
<div id="accordion_3" class="mb-0"> <div id="accordion_3" class="mb-0">
@ -531,8 +526,8 @@
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
</div>
</div>
<div class="form-group text-right mt-3 m-b-0" id="submitButton"> <div class="form-group text-right mt-3 m-b-0" id="submitButton">
@ -1742,8 +1737,10 @@ function addInsurerColumn() {
// Update header // Update header
$('#insurerTable thead tr').append(` $('#insurerTable thead tr').append(`
<th> <th>
<span style="display:flex; justify-content:space-between; align-items:center;">
Insurer ${insurerCount} Insurer ${insurerCount}
${insurerCount > 1 ? `<a class="text-danger mdi mdi-delete delete-insurer" data-count="${insurerCount}" style="margin-left: 135px;"></a>` : ''} ${insurerCount > 1 ? `<a class="text-danger mdi mdi-delete delete-insurer" data-count="${insurerCount}" style="margin-left: 135px;"></a>` : ''}
</span>
</th> </th>
`); `);

View File

@ -296,14 +296,14 @@ table.dataTable thead th {
<div class="col-12" id="endorsement_list"> <div class="col-12" id="endorsement_list">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<!-- <h4 style="position: relative;">Endorsement List</h4> --> <h4 style="position: relative;">Endorsement List</h4>
</div><!-- col-6 --> </div>
<!-- <div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;"> <div class="col-3">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add()">Add</button> <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add()">Add</button>
</div> col-3 --> </div>
</div><!-- row --> </div> -->
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
@ -326,19 +326,19 @@ table.dataTable thead th {
<tbody> <tbody>
<?php foreach ($endorsement_data_list as $index => $row) { ?> <?php foreach ($endorsement_data_list as $index => $row) { ?>
<tr> <tr>
<td><?php echo $index + 1; ?></td> <td class="text-center"><?php echo $index + 1; ?></td>
<td><?php echo $issuer[$row['issuer']] ?? ''; ?></td><!-- Issuer --> <td><?php echo $issuer[$row['issuer']] ?: 'N/A'; ?></td><!-- Issuer -->
<td><?php echo $row['client_short_name']; ?></td><!-- Client --> <td><?php echo $row['client_short_name'] ?: 'N/A'; ?></td><!-- Client -->
<td><?php echo $row['client_branch_name']; ?></td><!-- Branch --> <td><?php echo $row['client_branch_name'] ?: 'N/A'; ?></td><!-- Branch -->
<td><?php echo $row['insurer_short_name']; ?></td><!-- Insurer --> <td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td><!-- Insurer -->
<td><?php echo $row['policy_type']; ?></td><!-- Policy --> <td><?php echo $row['policy_type'] ?: 'N/A'; ?></td><!-- Policy -->
<td><?php echo $action_type[$row['action_type']]; ?></td> <td><?php echo $action_type[$row['action_type']] ?: 'N/A';?></td>
<td><?php echo $row['endorsement_no']; ?></td> <td><?php echo $row['endorsement_no'] ?: 'N/A'; ?></td>
<td><?php echo empty($row['data_received_date']) ? '' : date('d/m/Y', strtotime($row['data_received_date'])); ?></td> <td><?php echo empty($row['data_received_date']) ? 'N/A' : date('d/m/Y', strtotime($row['data_received_date'])); ?></td>
<td class="right-align-input"><?php echo $row['emp_count']; ?></td> <td class="right-align-input"><?php echo $row['emp_count'] ?: '0'; ?></td>
<td class="right-align-input"><?php echo $row['dependent_count']; ?></td> <td class="right-align-input"><?php echo $row['dependent_count'] ?: '0'; ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td>
<td><?php echo $policy_status[$row['status']]; ?></td> <td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td>
<td> <td>
<div class="btn-group dropdown"> <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> <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>
@ -487,22 +487,34 @@ table.dataTable thead th {
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function (e, dt, node, config) {
hide_list_show_add();
},
attr: { id: 'btnAdd' }
},
{
extend: 'collection', extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>', text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ', className: 'btn app-btn-secondary ',
buttons: [{ buttons: [
{
extend: 'csv', extend: 'csv',
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-Endorsement-List', title: 'Policy-Tranction-Endorsement-List',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}] }
}], ]
}
],
language: { language: {
search: ` search: `
<div class="datatable-search-wrapper"> <div class="datatable-search-wrapper">
@ -518,6 +530,7 @@ table.dataTable thead th {
} else { } else {
console.error("Table not found."); console.error("Table not found.");
} }
$('#btnAdd').wrap('<div id="status_change"></div>');
}); });
// Date document ready // Date document ready

View File

@ -141,6 +141,22 @@
font-size: 24px; font-size: 24px;
} }
/** newly implemented */
#insurerTable thead th:first-child {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable tbody td {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable th{
color: black !important;
background-color: transparent !important;
}
</style> </style>
<div class="tab-pane fade active show" id="form"> <div class="tab-pane fade active show" id="form">
@ -184,15 +200,18 @@
<div class="row"> <div class="row">
<!-- Section 1 --> <!-- Section 1 -->
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_0" class="mb-0"> <div id="accordion_0" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Client Details <span class="font-color-black">Client Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-1">
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
<div class="card-body">
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="email"> Policy Type <span class="text-danger">*</span></label> <label for="email"> Policy Type <span class="text-danger">*</span></label>
@ -284,6 +303,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -297,16 +317,18 @@
<!-- Pre sales Row --> <!-- Pre sales Row -->
<div class="row" id="pre_sales_row"> <div class="row" id="pre_sales_row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_1" class="mb-0">
<div class="card mb-0">
<h4 class="m-1">Pre Sales
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</h4>
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
<div id="accordion_1" class="mb-0">
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Pre Sales</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label>
<div class="card mb-1">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
<div class="card-body">
<div class="row" id="policyholdernamediv" style="display: none;"> <div class="row" id="policyholdernamediv" style="display: none;">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="bp_igst">Policyholder Name</label> <label for="bp_igst">Policyholder Name</label>
@ -498,21 +520,25 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- sales Row --> <!-- sales Row -->
<div class="row" id="sales_row" style="display: none;"> <div class="row" id="sales_row" style="display: none;">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_2" class="mb-0"> <div id="accordion_2" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Sales <span class="font-color-black">Sales</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-1">
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2"> <div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2">
<div class="card-body">
<div class="row"> <div class="row">
<div class="form-group col-md-3" id="base_policy_id" style="display: none;"> <div class="form-group col-md-3" id="base_policy_id" style="display: none;">
@ -652,20 +678,27 @@
</div> </div>
</div> </div>
<hr> </div>
</div>
</div>
</div> <!-- accordion_2 div closed here -->
</div><!-- 1st col-md-12 div closed here -->
<!-- Premium Details --> <!-- Premium Details -->
<div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_3" class="mb-0"> <div id="accordion_3" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Premium Details <span class="font-color-black">Premium Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-0">
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3"> <div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
<div class="card-body">
<div class="row d-none" id="add_more_row"> <div class="row d-none" id="add_more_row">
<div class="col-md-2"> <div class="col-md-2">
<!-- <label for="setInsurerCount">Insurer Count : </label> --> <!-- <label for="setInsurerCount">Insurer Count : </label> -->
@ -681,7 +714,7 @@
</div> </div>
<div id="insurerTableContainer" style="overflow: auto;"> <div id="insurerTableContainer" style="overflow: auto;">
<table data-custom-table-css="table" class="table table-bordered co_share_table" id="insurerTable"> <table data-custom-table-css="table" class="table co_share_table" id="insurerTable">
<thead> <thead>
<tr> <tr>
<th>Premium Details</th> <th>Premium Details</th>
@ -821,22 +854,18 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div> <!-- insurerTableContainer div closed here-->
</div> </div>
</div> <!-- collapseFour div closed here -->
</div> </div>
</div> </div> <!-- accordion_3 div closed here -->
</div> </div> <!-- 2nd col-md-12 closed here -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group text-right m-b-0" id="submitButton"> </div> <!-- sales_row div closed here -->
<div class="form-group text-right mt-1 m-b-0" id="submitButton">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" <button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button> id="btnSubmit">Submit</button>
</div> </div>
@ -4086,8 +4115,10 @@
// Update header // Update header
$('#insurerTable thead tr').append(` $('#insurerTable thead tr').append(`
<th> <th>
<span style="display:flex; justify-content:space-between; align-items:center;">
Insurer ${insurerCount} Insurer ${insurerCount}
${insurerCount > 1 ? `<a data-count="${insurerCount}" class="text-danger mdi mdi-delete delete-insurer" style="margin-left: 135px;"></a>` : ''} ${insurerCount > 1 ? `<a data-count="${insurerCount}" class="text-danger mdi mdi-delete delete-insurer" style="margin-left: 135px;"></a>` : ''}
</span>
</th> </th>
`); `);

View File

@ -27,8 +27,7 @@
} }
.column-header { .column-header {
margin-right: 10px; margin-right: 10px; /* Adjust this value as needed */
/* Adjust this value as needed */
} }
.form-section { .form-section {
@ -46,7 +45,6 @@
.addbtnStyle{ .addbtnStyle{
margin-left: 20px !important; margin-left: 20px !important;
} }
.custom-dropdown-menu { .custom-dropdown-menu {
display: none; display: none;
position: absolute; position: absolute;
@ -135,10 +133,20 @@
.slider.round:before { .slider.round:before {
border-radius: 50%; border-radius: 50%;
} }
#inception_filter{
margin-bottom:-20px !important;
margin-left:30px !important;
}
#inception_list{
margin-left:20px !important;
}
</style> </style>
<div class="col-12" id="inception_filter"> <div class="row" id="inception_filter">
<div class="card-body"> <div class="col-12">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h4 class="m-1"> <h4 class="m-1">
@ -153,7 +161,7 @@
<div class="form-group"> <div class="form-group">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="client_branch">Client<span class="text-danger"></span></label> <label for="client_branch">Client<span class="text-danger"></span></label>
<select class="form-control" id="client_id_for_search" name="client_id" > <select class="form-control" id="client_id_for_search" name="client_id" >
<option value="0">Select Client</option> <option value="0">Select Client</option>
@ -167,7 +175,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="addon_policy"> Insurer <span id="base_danger" class="text-danger"></span></label> <label for="addon_policy"> Insurer <span id="base_danger" class="text-danger"></span></label>
<select class="form-control" id="insurer_id_for_search" name="insurer_id" > <select class="form-control" id="insurer_id_for_search" name="insurer_id" >
<option value="0" selected>Select Insurer</option> <option value="0" selected>Select Insurer</option>
@ -177,7 +185,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="email"> Policy Type <span class="text-danger"></span></label> <label for="email"> Policy Type <span class="text-danger"></span></label>
<select class="form-control" id="policy_type_for_search" name="policy_type_id" > <select class="form-control" id="policy_type_for_search" name="policy_type_id" >
<option value="0">Select Policy Type</option> <option value="0">Select Policy Type</option>
@ -205,7 +213,7 @@
</select> </select>
</div> --> </div> -->
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="email"> Status <span class="text-danger"></span></label> <label for="email"> Status <span class="text-danger"></span></label>
<select class="form-control" id="policy_status_for_search" name="policy_type_id" > <select class="form-control" id="policy_status_for_search" name="policy_type_id" >
<option value="0">Select Status</option> <option value="0">Select Status</option>
@ -219,7 +227,13 @@
</select> </select>
</div> </div>
<div class="form-group col-md-4"> </div>
<div class="form-row">
<div class="form-group col-md-3">
<label>Date Type<span class="text-danger"></span></label> <label>Date Type<span class="text-danger"></span></label>
<select class="form-control" id="date_type" name="date_type" onchange="hideDateField()"> <select class="form-control" id="date_type" name="date_type" onchange="hideDateField()">
<option value="0">Select Date Type</option> <option value="0">Select Date Type</option>
@ -233,20 +247,27 @@
</select> </select>
</div> </div>
<div class="form-group col-md-4" style="display: none;" id="date_div"> <div class="form-group col-md-3" style="display: none;" id="date_div">
<label>Date<span class="text-danger"></span></label> <label>Date<span class="text-danger"></span></label>
<div class="input-icon"> <div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;"> <i class="mdi mdi-calendar-blank"></i>&nbsp;
<i class="mdi mdi-calendar-blank-outline additional-icon"></i> <span></span> <i class="mdi mdi-menu-down"></i>
</div> </div>
<input type="hidden" id="startDate"> <input type="hidden" id="startDate">
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
</div> </div>
<div class="form-group text-right m-b-0"> <div class="form-row">
<div class="form-group col-md-12 text-right m-b-0">
<a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a> <a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a>
<a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a> <a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -254,69 +275,39 @@
</div> </div>
</div> </div>
</div> <div class="row" id="inception_list">
<div class="col-12">
<div class="col-12" id="inception_list">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Policy List</h4> <h4 style="position: relative;">Policy List</h4>
</div> </div>
<div class="table-responsive">
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
<!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add();">Add</button> -->
</div>
</div>
<div>
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th> <th><div class="column-header">S.No.</div></th>
<div class="column-header">S.No&nbsp;</div> <th><div class="column-header">Issuer</div></th>
</th> <th><div class="column-header">Business Type</div></th>
<th> <th><div class="column-header">Client Type</div></th>
<div class="column-header">Issuer&nbsp;</div> <th><div class="column-header">Client / Branch</div></th>
</th> <th><div class="column-header">Insurer</div></th>
<th> <th><div class="column-header">Policy</div></th>
<div class="column-header">Business Type&nbsp;</div> <th><div class="column-header">Policy No</div></th>
</th> <th><div class="column-header">Policy Issue Date</div></th>
<th> <th><div class="column-header">D.O.C</div></th>
<div class="column-header">Client Type&nbsp;</div> <th><div class="column-header">D.O.E</div></th>
</th> <th><div class="column-header">No of Insured</div></th>
<th> <th><div class="column-header">No of Dependents</div></th>
<div class="column-header">Client / Branch&nbsp;</div> <th><div class="column-header">Status</div></th>
</th> <th><div class="column-header">User</div></th>
<th> <th><div class="column-header">Action</div></th>
<div class="column-header">Insurer&nbsp;</div>
</th>
<th>
<div class="column-header">Policy&nbsp;</div>
</th>
<th>
<div class="column-header">Policy No&nbsp;</div>
</th>
<th>
<div class="column-header">Policy Issue Date&nbsp;</div>
</th>
<th>
<div class="column-header">D.O.C&nbsp;</div>
</th>
<th>
<div class="column-header">D.O.E&nbsp;</div>
</th>
<th>
<div class="column-header">No of Insured&nbsp;</div>
</th>
<th>
<div class="column-header">No of Dependents&nbsp;</div>
</th>
<th>
<div class="column-header">Status&nbsp;</div>
</th>
<th>
<div class="column-header">User&nbsp;</div>
</th>
<th>
<div class="column-header">Action</div>
</th>
</tr> </tr>
</thead> </thead>
@ -324,24 +315,18 @@
<?php foreach($inception_data_list as $index => $row){ ?> <?php foreach($inception_data_list as $index => $row){ ?>
<tr> <tr>
<td class="text-center"><?php echo $index+1; ?></td> <td class="text-center"><?php echo $index+1; ?></td>
<td><?php echo $issuer[$row['issuer']] ?: 'N/A'; ?></td> <td><?php echo $issuer[$row['issuer']]; ?></td>
<td><?php echo $issuing_type[$row['issue_type']] ?: 'N/A'; ?></td> <td><?php echo $issuing_type[$row['issue_type']] ?: 'N/A'; ?></td>
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td> <td><?php echo $client_type[$row['client_type']] ?? 'N/A'; ?></td>
<td><?php echo $row['client_type'] == 2 ? $row['client_name'] . " - " . (!empty($row['pan']) ? $row['pan'] : 'N/A') : $row['client_short_name'] . ' - ' . $row['client_branch_name']; ?></td> <td><?php echo $row['client_type'] == 2 ? $row['client_name'] . " - " . (!empty($row['pan']) ? $row['pan'] : 'N/A') : $row['client_short_name'] . ' - ' . $row['client_branch_name']; ?></td>
<td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td> <td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td>
<td><?php echo $row['policy_type'] ?: 'N/A'; ?></td> <td><?php echo $row['policy_type'] ?: 'N/A'; ?></td>
<td><?php echo $row['policy_no'] ?: 'N/A'; ?></td> <td><?php echo $row['policy_no'] ?: 'N/A'; ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td>
<!-- <td class="right-align-input"><?php echo $row['emp_count'] ?: 'N/A'; ?></td> <td class="right-align-input"><?php echo $row['emp_count'] ?: '0'; ?></td>
<td class="right-align-input"><?php echo $row['dependent_count'] ?: 'N/A'; ?></td> --> <td class="right-align-input"><?php echo $row['dependent_count'] ?: '0'; ?></td>
<td class="<?= ($row['emp_count'] !== '' && $row['emp_count'] !== null) ? 'right-align-input' : 'text-center'; ?>">
<?= ($row['emp_count'] !== '' && $row['emp_count'] !== null) ? $row['emp_count'] : 'N/A'; ?>
</td>
<td class="<?= ($row['dependent_count'] !== '' && $row['dependent_count'] !== null) ? 'right-align-input' : 'text-center'; ?>">
<?= ($row['dependent_count'] !== '' && $row['dependent_count'] !== null) ? $row['dependent_count'] : 'N/A'; ?>
</td>
<td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td> <td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td>
<td><?php echo $row['user_name'] ?: 'N/A'; ?></td> <td><?php echo $row['user_name'] ?: 'N/A'; ?></td>
<td> <td>
@ -365,8 +350,7 @@
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div>
<!-- end table row --> <!-- end table row -->
@ -399,6 +383,7 @@
</div> </div>
</div> </div>
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const table = document.getElementById("tickets-table"); const table = document.getElementById("tickets-table");
@ -478,9 +463,7 @@
activeDropdown.style.display = 'none'; activeDropdown.style.display = 'none';
activeDropdown = null; activeDropdown = null;
} }
}, { }, { once: true });
once: true
});
}); });
}); });
@ -495,6 +478,7 @@
</script> </script>
<script> <script>
var client_list = ''; // local variable for storing the client branch list var client_list = ''; // local variable for storing the client branch list
var branch_list = ''; // local variable for storing the client branch list var branch_list = ''; // local variable for storing the client branch list
var policy_list = ''; // local variable for storing the client policy list var policy_list = ''; // local variable for storing the client policy list
@ -577,32 +561,11 @@
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
// buttons: [ buttons: [
// { {
// extend: 'collection',
// text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
// className: 'btn app-btn-secondary ',
// buttons: [
// {
// extend: 'csv',
// text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
// title: 'Policy-Tranction-Inception-List',
// exportOptions: {
// columns: ':not(:last-child)'
// },
// } ]},
// {
// text: 'Add',
// className: 'buttons-html5 addbtnStyle',
// action: function (e, dt, node, config) {
// hide_list_show_add();
// }
// }
// ],
buttons: [{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>', text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2', className: 'btn app-btn-primary mr-2',
action: function (e, dt, node, config) { action: function (e, dt, node, config) {
@ -613,12 +576,17 @@
extend: 'collection', extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>', text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ', className: 'btn app-btn-secondary ',
buttons: [{ buttons: [
{
extend: 'csv', extend: 'csv',
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ', className: 'app-btn-primary ',
title: 'Policy-Tranction-Inception-List', title: 'Policy-Tranction-Inception-List',
}] exportOptions: {
columns: ':not(:last-child)'
},
}
]
} }
], ],
language: { language: {
@ -709,237 +677,8 @@
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
function hide_list_show_add() { function hide_list_show_add()
$('#page_title').text('Add Policy')
$('#inception_form_id')[0].reset();
$('#client_id').val('').change().prop('disabled', false);
$('#tpa').val('').change().prop('disabled', false);
$('#client_id_for_edit').val('');
$('#policy_tranction_primarykey').val('');
$('#client_policy_id').val('');
$('#client_branch_id').val('').change().prop('disabled', false);
$('#insurer_id').val('');
$('#cd_ac_no').empty().prop('disabled', false);
$('#policy_no').val('').change().prop('disabled', false);
$('#source_client_policy_id').val('').prop('disabled', false);
$('#policy_end_date').prop('disabled', false);
$('#policy_start_date').prop('disabled', false);
$('#client_type').prop('disabled', false);
$('#policy_type_id').prop('disabled', false);
$('#invoice_no_div').hide()
$('.current_date').hide()
$('#invoice_no').attr('required', false)
$('#pt_onboarding').show()
$('#inception_list').hide()
$('#inception_filter').hide()
$('#policyholdernamediv').hide();
$('.branchdiv').show();
}
function show_list_hide_add() {
$('#pt_onboarding').hide()
$('#inception_list').show()
$('#inception_filter').show();
$('#nav_pills').empty()
$('#tab_content').empty()
count = 0
}
function getClientAndBranchAndPolicy() {
$.ajax({
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
type: "GET",
dataType: 'json',
success: function(res) {
console.log('getClientAndBranchAndPolicy', res);
if (res.status == true) {
client_list = res.client_data;
branch_list = res.branch_data;
policy_list = res.policy_data;
vehicle_list = res.vehicle_data;
unit_list = res.unit_data;
appendClients(res.client_data);
appendVehicles(res.vehicle_data);
appendOwner(client_list)
} else {
console.log('No data found');
}
}
});
}
// Check on page load
// checkAndDisableFields();
// // Check whenever these fields are updated
// $('#client_id, #client_branch_id').on('change keyup', function() {
// checkAndDisableFields();
// });
// Attach event handler to show toastr if user clicks on any disabled field
$('#inception_form_id').on('click', '.disabled-field', function(e) {
e.preventDefault();
toastr.warning('Please select Client and Client Branch before filling out the form.');
});
// select2 document ready
$(document).ready(function() {
getClientAndBranchAndPolicy()
addHTMLInput();
addHTMLInputForVehicleFileUpload()
<?php if (session()->has('create_failed')) : ?>
toastr.error('<?= session()->getFlashdata('create_failed') ?>', 'Failed');
<?php endif; ?>
<?php if (session()->has('update_failed')) : ?>
toastr.error('<?= session()->getFlashdata('update_failed') ?>', 'Failed');
<?php endif; ?>
<?php if (session()->has('create_success')) : ?>
toastr.success('<?= session()->getFlashdata('create_success') ?>', 'success');
<?php endif; ?>
<?php if (session()->has('update_success')) : ?>
toastr.success('<?= session()->getFlashdata('update_success') ?>', 'success');
<?php endif; ?>
$('#client_id').select2();
$('#client_branch_id').select2();
$('#insurer_branch').select2();
$('#tpa').select2();
$('#base_policy').select2();
$('#source_client_policy_id').select2();
$('#sales_generated_by').select2();
$('#serviced_by').select2();
$('#policy_type_id').select2();
$('#ppteam').select2();
})
// Datatable document ready
$(document).ready(function() {
var ticketsTable = $('#tickets-table');
if (ticketsTable.length) {
ticketsTable.DataTable({
scrollX: true,
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{
extend: 'csv',
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-Inception-List',
exportOptions: {
columns: ':not(:last-child)'
},
}]
},
{ {
text: 'Add',
className: 'buttons-html5 addbtnStyle',
action: function(e, dt, node, config) {
hide_list_show_add();
}
}
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true, // Enable pagination
pageLength: 25, // Set default number of rows per page (optional)
// ordering: false,
});
} else {
console.error("Table not found.");
}
});
// Date document ready
$(document).ready(function() {
var today = new Date();
var opening_date = flatpickr("#opening_date", {
dateFormat: "d/m/Y",
allowInput: false
});
var policy_start_date = flatpickr("#policy_start_date", {
dateFormat: "d/m/Y",
defaultDate: today,
allowInput: false,
onChange: function(selectedDates, dateStr, instance) {
var policy_end_date = new Date(selectedDates[0]);
policy_end_date.setFullYear(policy_end_date.getFullYear() + 1);
policy_end_date.setDate(policy_end_date.getDate() - 1); // Set end date to last day of selected year
policy_end_datePicker.setDate(policy_end_date);
// Calculate renewal date (one month before the end date)
var renewal_date = new Date(policy_end_date);
// renewal_date.setMonth(renewal_date.getMonth() - 1);
renewal_datePicker.setDate(renewal_date); // Set renewal date
}
});
// Calculate the end date (today + 1 year)
var closeDate = new Date(today);
closeDate.setFullYear(closeDate.getFullYear() + 1);
closeDate.setDate(closeDate.getDate() - 1); // Set end date to last day of next year
var policy_end_datePicker = flatpickr("#policy_end_date", {
dateFormat: "d/m/Y",
defaultDate: closeDate,
allowInput: false
});
var renewal_datePicker = flatpickr("#renewal_date", {
dateFormat: "d/m/Y",
allowInput: false
});
var month = flatpickr("#month", {
dateFormat: "M/Y", // Format as month and year
allowInput: false, // Disable manual input
});
var policy_issue_date = flatpickr("#policy_issue_date", {
dateFormat: "d/m/Y", // Format as day-month-year
allowInput: false, // Disable manual input
onChange: function(selectedDates, dateStr, instance) {
// Get the selected date
var selectedDate = new Date(selectedDates[0]);
// Format the selected date to "M-Y"
var formattedMonth = flatpickr.formatDate(selectedDate, "M/Y");
// Set the value of the #month input
month.setDate(formattedMonth);
}
});
})
//--------------------------------------------------------------------------------------------------------
function hide_list_show_add() {
$('#page_title').text('Add Policy') $('#page_title').text('Add Policy')
$('#inception_form_id')[0].reset(); $('#inception_form_id')[0].reset();
$('#client_id').val('').change().prop('disabled', false); $('#client_id').val('').change().prop('disabled', false);
@ -968,7 +707,8 @@
$('.branchdiv').show(); $('.branchdiv').show();
} }
function show_list_hide_add() { function show_list_hide_add()
{
$('#pt_onboarding').hide() $('#pt_onboarding').hide()
$('#inception_list').show() $('#inception_list').show()
$('#inception_filter').show(); $('#inception_filter').show();
@ -977,7 +717,8 @@
count = 0 count = 0
} }
function getClientAndBranchAndPolicy() { function getClientAndBranchAndPolicy(appendStatus = true)
{
$.ajax({ $.ajax({
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>', url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
type: "GET", type: "GET",
@ -985,15 +726,21 @@
success: function(res) { success: function(res) {
console.log('getClientAndBranchAndPolicy', res); console.log('getClientAndBranchAndPolicy', res);
if(res.status == true){ if(res.status == true){
client_list = res.client_data; client_list = res.client_data;
branch_list = res.branch_data; branch_list = res.branch_data;
policy_list = res.policy_data; policy_list = res.policy_data;
vehicle_list = res.vehicle_data; vehicle_list = res.vehicle_data;
unit_list = res.unit_data; unit_list = res.unit_data;
if(appendStatus == true){
appendClients(res.client_data); appendClients(res.client_data);
appendVehicles(res.vehicle_data); appendVehicles(res.vehicle_data);
appendOwner(client_list) // appendOwner(client_list)
}
}else{ }else{
console.log('No data found'); console.log('No data found');
} }
@ -1006,7 +753,8 @@
}); });
} }
function appendClients(data) { function appendClients(data, client_id = null)
{
$('#client_id').empty(); $('#client_id').empty();
$('#client_id').append($('<option>', { $('#client_id').append($('<option>', {
@ -1035,11 +783,16 @@
class: item.client_type == 1 ? 'group' : item.client_type == 2 ? 'individual' : '' class: item.client_type == 1 ? 'group' : item.client_type == 2 ? 'individual' : ''
}); });
if (client_id == item.id) {
option.attr('selected', true);
}
$('#client_id').append(option); $('#client_id').append(option);
}); });
} }
function appendVehicles(data, vehicle_id) { function appendVehicles(data, vehicle_id = null)
{
$('#vehicle_no').empty(); $('#vehicle_no').empty();
$('#vehicle_no').append($('<option>', { $('#vehicle_no').append($('<option>', {
@ -1067,7 +820,8 @@
}); });
} }
function appendBranch(data) { function appendBranch(data, branch_id = null)
{
$('#client_branch_id').empty(); $('#client_branch_id').empty();
@ -1082,11 +836,17 @@
value: item.id, value: item.id,
text: item.branch_name text: item.branch_name
}); });
if (branch_id == item.id) {
option.attr('selected', true);
}
$('#client_branch_id').append(option); $('#client_branch_id').append(option);
}); });
} }
function appendRenewalPolicies(data) { function appendRenewalPolicies(data)
{
console.log('appendRenewalPolicies', data); console.log('appendRenewalPolicies', data);
console.log('appendRenewalPolicies', $('#source_client_policy_id')); console.log('appendRenewalPolicies', $('#source_client_policy_id'));
@ -1199,7 +959,8 @@
// } // }
// } // }
function getPolicyDetailsByPolicyId(input) { function getPolicyDetailsByPolicyId(input)
{
var policy_id = $(input).val() var policy_id = $(input).val()
if(policy_id){ if(policy_id){
@ -1222,7 +983,8 @@
} }
} }
function addHTMLInput(data = null) { function addHTMLInput(data = null)
{
const container = document.getElementById('dynamic-form-container'); const container = document.getElementById('dynamic-form-container');
const newRow = document.createElement('div'); const newRow = document.createElement('div');
newRow.className = 'form-row dynamic-form-row'; newRow.className = 'form-row dynamic-form-row';
@ -1248,7 +1010,8 @@
} }
} }
function removeHTMLInput(element) { function removeHTMLInput(element)
{
const container = document.getElementById('dynamic-form-container'); const container = document.getElementById('dynamic-form-container');
const rows = container.querySelectorAll('.dynamic-form-row'); const rows = container.querySelectorAll('.dynamic-form-row');
@ -1258,7 +1021,8 @@
} }
} }
function appendBasePolicyList(data, select = null) { function appendBasePolicyList(data, select = null)
{
console.log('---------------------------------------------------------------') console.log('---------------------------------------------------------------')
console.log('first') console.log('first')
console.log('---------------------------------------------------------------') console.log('---------------------------------------------------------------')
@ -1281,7 +1045,8 @@
}); });
} }
function appendUnits(data) { function appendUnits(data)
{
$('#units').empty() $('#units').empty()
$('#units').append($('<option>', { $('#units').append($('<option>', {
value: '', value: '',
@ -1305,12 +1070,14 @@
}); });
} }
function fileupload(input) { function fileupload(input)
{
var myModal = new bootstrap.Modal(document.getElementById('file_upload')); var myModal = new bootstrap.Modal(document.getElementById('file_upload'));
myModal.show(); myModal.show();
} }
function logSelectedIds() { function logSelectedIds()
{
var selectedIds = []; var selectedIds = [];
$('.row-select:checked').each(function() { $('.row-select:checked').each(function() {
selectedIds.push($(this).data('id')); selectedIds.push($(this).data('id'));
@ -1320,7 +1087,8 @@
} }
function appendFileTableBody(data) { function appendFileTableBody(data)
{
console.log(data); console.log(data);
$('#table_bd').empty(); $('#table_bd').empty();
@ -1355,7 +1123,8 @@
}); });
} }
function checkInputs() { function checkInputs()
{
let isValid = true; let isValid = true;
// Iterate through each dynamic row // Iterate through each dynamic row
@ -1388,11 +1157,13 @@
return isValid; return isValid;
} }
function validateForm() { function validateForm()
{
return checkInputs(); // Call checkInputs before form submission return checkInputs(); // Call checkInputs before form submission
} }
function addHTMLInputForVehicleFileUpload(data = null) { function addHTMLInputForVehicleFileUpload(data = null)
{
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload'); const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
const newRow = document.createElement('div'); const newRow = document.createElement('div');
newRow.className = 'form-row dynamic-form-row'; newRow.className = 'form-row dynamic-form-row';
@ -1418,7 +1189,8 @@
} }
} }
function appendVehicleFileTableBody(data) { function appendVehicleFileTableBody(data)
{
console.log(data); console.log(data);
// Clear the table body // Clear the table body
@ -1455,7 +1227,8 @@
}); });
} }
function removeHTMLInputForVehicleFileUpload(element) { function removeHTMLInputForVehicleFileUpload(element)
{
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload'); const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
const rows = container.querySelectorAll('.dynamic-form-row'); const rows = container.querySelectorAll('.dynamic-form-row');
@ -1483,24 +1256,39 @@
$('#policy_holder_name').val(client_name); $('#policy_holder_name').val(client_name);
let status = $('#policy_status').val();
if(client_id == 'add_client') { if(client_id == 'add_client') {
if ($('#client_type').val()) { // if($('#client_type').val()){
$('#client_id').val('').change(); // $('#client_id').val('').change();
if ($('#client_type').val() == 2) { // if($('#client_type').val() == 2){
$('#short_name').closest('.form-group').hide(); // $('#short_name').closest('.form-group').hide();
$('#short_name').removeAttr('required'); // $('#short_name').removeAttr('required');
} else { // } else {
$('#short_name').closest('.form-group').show(); // $('#short_name').closest('.form-group').show();
$('#short_name').attr('required', 'required'); // $('#short_name').attr('required', 'required');
} // }
// var myModal = new bootstrap.Modal(document.getElementById('upload_enrollment_model'));
// myModal.show();
// }else{
// $('#client_id').val('').change();
// toastr.warning('Please select the client type', 'WARNING')
// }
appendClientForm();
$(this).val('').select2();
$('#pre_sales_row').hide();
$('#sales_row').hide();
$('#submitButton').hide();
var myModal = new bootstrap.Modal(document.getElementById('upload_enrollment_model'));
myModal.show();
}else{ }else{
$('#client_id').val('').change(); $('#pre_sales_row').show();
toastr.warning('Please select the client type', 'WARNING') $('#submitButton').show();
if(status == "completed"){
$('#sales_row').show();
} }
} }
@ -1739,7 +1527,8 @@
if(policy_list != '' && branch_id != '') { if(policy_list != '' && branch_id != '') {
console.log(policy_list[branch_id]); console.log(policy_list[branch_id]);
let data = policy_list[branch_id]; let data = policy_list[branch_id];
if (issue_type == 2) { if(issue_type == 2)
{
appendRenewalPolicies(data); appendRenewalPolicies(data);
} }
} }
@ -1747,7 +1536,8 @@
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
function formatDateforpolicy(dateStr) { function formatDateforpolicy(dateStr)
{
let dateParts = dateStr.split('-'); let dateParts = dateStr.split('-');
let year = dateParts[0]; let year = dateParts[0];
@ -1760,16 +1550,19 @@
return date; return date;
} }
function onlyNumbers(event) { function onlyNumbers(event)
{
var charcode; var charcode;
charcode = event.which || event.keyCode; charcode = event.which || event.keyCode;
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true; if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
return false; return false;
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// getURLParams() // getURLParams()
$('#client_id_for_search').select2(); $('#client_id_for_search').select2();
@ -1777,7 +1570,8 @@
$('#policy_type_for_search').select2(); $('#policy_type_for_search').select2();
}) })
function fetchEmpolyeeList(event) { function fetchEmpolyeeList(event)
{
event.preventDefault(); // Prevent default action event.preventDefault(); // Prevent default action
var start_date = $('#startDate').val(); var start_date = $('#startDate').val();
@ -1810,7 +1604,8 @@
window.location.href = apiURL; window.location.href = apiURL;
} }
function objectToQueryString(obj) { function objectToQueryString(obj)
{
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&'); return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
} }
@ -1876,7 +1671,7 @@
// var end = moment(); // var end = moment();
function cb(start, end) { function cb(start, end) {
$('#reportrange').html(start.format('D/MM/YYYY') + ' - ' + end.format('D/MM/YYYY')); $('#reportrange span').html(start.format('D/MM/YYYY') + ' - ' + end.format('D/MM/YYYY'));
$('#startDate').val(start.format('DD/MM/YYYY')); $('#startDate').val(start.format('DD/MM/YYYY'));
$('#endDate').val(end.format('DD/MM/YYYY')); $('#endDate').val(end.format('DD/MM/YYYY'));
} }
@ -1914,7 +1709,8 @@
}); });
function hideDateField(input = null) { function hideDateField(input = null)
{
let val = $('#date_type').val(); let val = $('#date_type').val();
if(input){ if(input){
@ -1940,9 +1736,7 @@
let url = '<?= base_url('policy_tranction/inception/removePolicyTransaction/') ?>' + pt_id; let url = '<?= base_url('policy_tranction/inception/removePolicyTransaction/') ?>' + pt_id;
// Include `pt_id` in the AJAX request if necessary // Include `pt_id` in the AJAX request if necessary
let requestData = { let requestData = { pt_id: pt_id };
pt_id: pt_id
};
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) { sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
console.log('Data fetched successfully:', response); console.log('Data fetched successfully:', response);
@ -1960,4 +1754,5 @@
} }
}); });
} }
</script> </script>

View File

@ -36,6 +36,7 @@
</div> </div>
</div> </div>
<div id="collapseOne">
<div id="vehicle_file_table" class="card"> <div id="vehicle_file_table" class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
@ -45,7 +46,7 @@
</div> </div>
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table data-custom-table-css="second-table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No&nbsp;</th> <th>S.No&nbsp;</th>
@ -62,6 +63,7 @@
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div>
</div> </div>