MERGE_CONFLICT : RV
This commit is contained in:
commit
bce0ef1440
@ -26,8 +26,11 @@ table.dataTable thead th {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Client List</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<a href="<?= base_url("client/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
|
||||
<div class="col-2" style="text-align: right; position: relative;top: 56px; left: 303px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="showModal()">Add From Lead</a>
|
||||
</div>
|
||||
<div class="col-1" style="text-align: right; position: relative;top: 56px; left: 294px;">
|
||||
<a href="<?= base_url("client/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
@ -81,13 +84,47 @@ table.dataTable thead th {
|
||||
<div id="append_client_info"></div>
|
||||
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="lead_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Lead List</h4>
|
||||
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="lead_id"> Lead List <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_id" name="lead_id" required>
|
||||
<option value="">Select Lead</option>
|
||||
<?php if(isset($lead_data)) { ?>
|
||||
<?php foreach ($lead_data as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button type="submit" class="btn btn-primary" onclick="featchClient()">Featch Client</button>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#lead_id').select2();
|
||||
})
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-7 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
@ -214,8 +251,47 @@ $(document).on('click', '.client_info_close', function() {
|
||||
$('#client_list').show();
|
||||
});
|
||||
|
||||
function showModal(){
|
||||
var myModal = new bootstrap.Modal(document.getElementById('lead_modal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
function featchClient(){
|
||||
|
||||
let lead_id = $('#lead_id').val();
|
||||
console.log('lead_id : ', lead_id)
|
||||
let url = '<?= base_url('leads/featchLeadDataAndInsertClient/') ?>' + lead_id
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res.status == true){
|
||||
let client_url = '<?= base_url('client/list/') ?>'+res.client_id;
|
||||
toastr.success(res.message, 'SUCCESS')
|
||||
window.location.href = client_url
|
||||
}else{
|
||||
toastr.success(res.message, 'WARNING')
|
||||
}
|
||||
|
||||
$('.close').click()
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('.close').click()
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -604,53 +604,53 @@ $(document).on('change', 'input[type="checkbox"][name="co_share_type[]"]', funct
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('input', '[name="cgst[]"]', function() {
|
||||
// $(document).on('input', '[name="cgst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="igst[]"]').val(0);
|
||||
$('[name="cgst[]"]').val(val);
|
||||
$('[name="sgst[]"]').val(val);
|
||||
// if(val){
|
||||
// $('[name="igst[]"]').val(0);
|
||||
// $('[name="cgst[]"]').val(val);
|
||||
// $('[name="sgst[]"]').val(val);
|
||||
|
||||
}else{
|
||||
$('[name="igst[]"]').val('');
|
||||
$('[name="sgst[]"]').val('');
|
||||
}
|
||||
console.log('cgst value', val);
|
||||
});
|
||||
// }else{
|
||||
// $('[name="igst[]"]').val('');
|
||||
// $('[name="sgst[]"]').val('');
|
||||
// }
|
||||
// console.log('cgst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('input', '[name="sgst[]"]', function() {
|
||||
// $(document).on('input', '[name="sgst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="igst[]"]').val(0);
|
||||
$('[name="sgst[]"]').val(val)
|
||||
$('[name="cgst[]"]').val(val)
|
||||
}else{
|
||||
$('[name="igst[]"]').val('');
|
||||
$('[name="sgst[]"]').val('')
|
||||
$('[name="cgst[]"]').val('')
|
||||
}
|
||||
console.log('cgst value', val);
|
||||
});
|
||||
// if(val){
|
||||
// $('[name="igst[]"]').val(0);
|
||||
// $('[name="sgst[]"]').val(val)
|
||||
// $('[name="cgst[]"]').val(val)
|
||||
// }else{
|
||||
// $('[name="igst[]"]').val('');
|
||||
// $('[name="sgst[]"]').val('')
|
||||
// $('[name="cgst[]"]').val('')
|
||||
// }
|
||||
// console.log('cgst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('input', '[name="igst[]"]', function() {
|
||||
// $(document).on('input', '[name="igst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="cgst[]"], [name="sgst[]"]').val(0);
|
||||
$('[name="igst[]"]').val(val)
|
||||
}else{
|
||||
$('[name="cgst[]"], [name="sgst[]"]').val('');
|
||||
$('[name="igst[]"]').val('')
|
||||
// if(val){
|
||||
// $('[name="cgst[]"], [name="sgst[]"]').val(0);
|
||||
// $('[name="igst[]"]').val(val)
|
||||
// }else{
|
||||
// $('[name="cgst[]"], [name="sgst[]"]').val('');
|
||||
// $('[name="igst[]"]').val('')
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
console.log('igst value', val);
|
||||
});
|
||||
// console.log('igst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('click', '[name="co_share_type[]"]', function() {
|
||||
|
||||
@ -924,6 +924,30 @@ function getPolicyTransactionDataForEndorsementEdit(input){
|
||||
}
|
||||
//end edit function
|
||||
|
||||
function checkAndDistributeTax(input)
|
||||
{
|
||||
const event = window.event;
|
||||
// console.log("Event type:", event.type);
|
||||
// console.log("Event target:", event.target);
|
||||
console.log("Event id:", event.target.id);
|
||||
|
||||
let cgst = parseFloat($('#cgst_' + input).val());
|
||||
let sgst = parseFloat($('#sgst_' + input).val());
|
||||
let igst = parseFloat($('#igst_' + input).val());
|
||||
if(((event.target.id).startsWith('cgst') || (event.target.id).startsWith('sgst') ))
|
||||
{
|
||||
if(cgst !== 0) { $('#sgst_' + input).val(cgst.toFixed(2)); }
|
||||
else if(sgst !== 0) { $('#cgst_' + input).val(sgst.toFixed(2)); }
|
||||
|
||||
$('#igst_' + input).val(0.00);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cgst_' + input).val(0.00);
|
||||
$('#sgst_' + input).val(0.00);
|
||||
}
|
||||
}
|
||||
|
||||
function amountCalculation(input) {
|
||||
|
||||
// console.log(input);
|
||||
@ -945,6 +969,7 @@ function amountCalculation(input) {
|
||||
}
|
||||
|
||||
let cop = parseFloat($('#co_premium_' + input).val()) || 0;
|
||||
checkAndDistributeTax(input);
|
||||
let cgst = parseFloat($('#cgst_' + input).val()) || 0;
|
||||
let sgst = parseFloat($('#sgst_' + input).val()) || 0;
|
||||
let igst = parseFloat($('#igst_' + input).val()) || 0;
|
||||
|
||||
@ -748,14 +748,14 @@
|
||||
<!-- end form row -->
|
||||
|
||||
<!-- Client form content modal-->
|
||||
<div class="modal fade" id="upload_enrollment_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
<div class="modal fade" id="upload_enrollment_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Add New Client</h4>
|
||||
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" style="overflow-y: auto;height: 90vh;">
|
||||
<form class="parsley-examples" method="post" id="client_form" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
|
||||
@ -998,11 +998,31 @@
|
||||
<script>
|
||||
|
||||
var team_id = [];
|
||||
let isClientFormSubmitting = false;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// hidePermiumDetailsBasedOnTheTeam()
|
||||
|
||||
// $('#upload_enrollment_model').modal({
|
||||
// backdrop: 'static',
|
||||
// keyboard: false
|
||||
// })
|
||||
|
||||
$('#upload_enrollment_model').on('hide.bs.modal', function (e) {
|
||||
if (!isClientFormSubmitting) {
|
||||
// Ask for confirmation
|
||||
if (confirm("Are you sure you want to close? Unsaved changes will be lost.")) {
|
||||
// If confirmed, reset the form
|
||||
$('#client_form')[0].reset();
|
||||
} else {
|
||||
// If not confirmed, prevent the modal from closing
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
team_id = <?php echo json_encode(user_team()); ?>;
|
||||
console.log('team_id', team_id);
|
||||
|
||||
@ -1203,53 +1223,53 @@ $(document).on('change', 'input[type="checkbox"][name="co_share_type[]"]', funct
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('input', '[name="cgst[]"]', function() {
|
||||
// $(document).on('input', '[name="cgst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="igst[]"]').val(0);
|
||||
$('[name="cgst[]"]').val(val);
|
||||
$('[name="sgst[]"]').val(val);
|
||||
// if(val){
|
||||
// $('[name="igst[]"]').val(0);
|
||||
// $('[name="cgst[]"]').val(val);
|
||||
// $('[name="sgst[]"]').val(val);
|
||||
|
||||
}else{
|
||||
$('[name="igst[]"]').val('');
|
||||
$('[name="sgst[]"]').val('');
|
||||
}
|
||||
// console.log('cgst value', val);
|
||||
});
|
||||
// }else{
|
||||
// $('[name="igst[]"]').val('');
|
||||
// $('[name="sgst[]"]').val('');
|
||||
// }
|
||||
// // console.log('cgst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('input', '[name="sgst[]"]', function() {
|
||||
// $(document).on('input', '[name="sgst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="igst[]"]').val(0);
|
||||
$('[name="sgst[]"]').val(val)
|
||||
$('[name="cgst[]"]').val(val)
|
||||
}else{
|
||||
$('[name="igst[]"]').val('');
|
||||
$('[name="sgst[]"]').val('')
|
||||
$('[name="cgst[]"]').val('')
|
||||
}
|
||||
// console.log('cgst value', val);
|
||||
});
|
||||
// if(val){
|
||||
// $('[name="igst[]"]').val(0);
|
||||
// $('[name="sgst[]"]').val(val)
|
||||
// $('[name="cgst[]"]').val(val)
|
||||
// }else{
|
||||
// $('[name="igst[]"]').val('');
|
||||
// $('[name="sgst[]"]').val('')
|
||||
// $('[name="cgst[]"]').val('')
|
||||
// }
|
||||
// // console.log('cgst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('input', '[name="igst[]"]', function() {
|
||||
// $(document).on('input', '[name="igst[]"]', function() {
|
||||
|
||||
let val = $(this).val();
|
||||
// let val = $(this).val();
|
||||
|
||||
if(val){
|
||||
$('[name="cgst[]"], [name="sgst[]"]').val(0);
|
||||
$('[name="igst[]"]').val(val)
|
||||
}else{
|
||||
$('[name="cgst[]"], [name="sgst[]"]').val('');
|
||||
$('[name="igst[]"]').val('')
|
||||
// if(val){
|
||||
// $('[name="cgst[]"], [name="sgst[]"]').val(0);
|
||||
// $('[name="igst[]"]').val(val)
|
||||
// }else{
|
||||
// $('[name="cgst[]"], [name="sgst[]"]').val('');
|
||||
// $('[name="igst[]"]').val('')
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
// console.log('igst value', val);
|
||||
});
|
||||
// // console.log('igst value', val);
|
||||
// });
|
||||
|
||||
$(document).on('click', '[name="co_share_type[]"]', function() {
|
||||
|
||||
@ -1650,9 +1670,33 @@ function getPolicyTransactionDataForEdit(input) {
|
||||
checkInvoiceStatusToHideSubmitBtn(id)
|
||||
}
|
||||
|
||||
function checkAndDistributeTax(input)
|
||||
{
|
||||
const event = window.event;
|
||||
// console.log("Event type:", event.type);
|
||||
// console.log("Event target:", event.target);
|
||||
console.log("Event id:", event.target.id);
|
||||
|
||||
let cgst = parseFloat($('#cgst_' + input).val());
|
||||
let sgst = parseFloat($('#sgst_' + input).val());
|
||||
let igst = parseFloat($('#igst_' + input).val());
|
||||
if(((event.target.id).startsWith('cgst') || (event.target.id).startsWith('sgst') ))
|
||||
{
|
||||
if(cgst !== 0) { $('#sgst_' + input).val(cgst.toFixed(2)); }
|
||||
else if(sgst !== 0) { $('#cgst_' + input).val(sgst.toFixed(2)); }
|
||||
|
||||
$('#igst_' + input).val(0.00);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cgst_' + input).val(0.00);
|
||||
$('#sgst_' + input).val(0.00);
|
||||
}
|
||||
}
|
||||
|
||||
function amountCalculation(input) {
|
||||
|
||||
// console.log(input);
|
||||
console.log('amountCalculation - ' + input);
|
||||
let selectedOption = $('#policy_type_id').find('option:selected');
|
||||
let bap = selectedOption.data('bap');
|
||||
|
||||
@ -1671,9 +1715,12 @@ function amountCalculation(input) {
|
||||
}
|
||||
|
||||
let cop = parseFloat($('#co_premium_' + input).val()) || 0;
|
||||
checkAndDistributeTax(input);
|
||||
let cgst = parseFloat($('#cgst_' + input).val()) || 0;
|
||||
let sgst = parseFloat($('#sgst_' + input).val()) || 0;
|
||||
let igst = parseFloat($('#igst_' + input).val()) || 0;
|
||||
|
||||
|
||||
let stamp_duty_amt = parseFloat($('#stamp_duty_' + input).val()) || 0;
|
||||
let agreed_amount = parseFloat($('#agreed_amount_' + input).val()) || 0;
|
||||
|
||||
@ -1697,7 +1744,10 @@ function amountCalculation(input) {
|
||||
// Calculate GST percentage
|
||||
let gst_per = igst;
|
||||
if (igst === 0) {
|
||||
gst_per = cgst + sgst;
|
||||
console.log('called' + cgst + sgst);
|
||||
gst_per = parseFloat(cgst) + parseFloat(sgst);
|
||||
// gst_per = (cgst) + (sgst);
|
||||
console.log(gst_per);
|
||||
}
|
||||
|
||||
// Calculate the total premium (Base + TP + Co-Premium)
|
||||
@ -2658,7 +2708,7 @@ $("#inception_form_id").submit(function(event) {
|
||||
$("#client_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
isClientFormSubmitting = true;
|
||||
var isValid = $('#client_form').parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
@ -2705,6 +2755,7 @@ $("#client_form").submit(function(event) {
|
||||
|
||||
$('#client_form')[0].reset();
|
||||
$('.close').click();
|
||||
isClientFormSubmitting = false;
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
|
||||
@ -201,7 +201,7 @@ body {
|
||||
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;"> <?= isset($page_name) ? $page_name : 'RFQ' ?> Process</h4>
|
||||
<h4 style="position: relative;"> <?= isset($page_name) ? $page_name : 'RFQ' ?> </h4>
|
||||
</div>
|
||||
|
||||
<div class="col-2" id="status_change" style="text-align: right; position: relative;top: 56px; left: 386px;">
|
||||
@ -210,8 +210,8 @@ body {
|
||||
</div>
|
||||
|
||||
<button id="addQuote" class="btn btn-custom">Add New Proposal</button>
|
||||
<button id="submitData" class="btn btn-primary">Save</button>
|
||||
<button id="submitQCRData"class="btn btn-primary">Save QCR</button>
|
||||
<button id="submitData" class="btn btn-primary">Save RFQ</button>
|
||||
<button id="submitQCRData"class="btn btn-primary">Procced to QCR</button>
|
||||
<a id="submitExcel"class="btn btn-primary" id>Export Excel</a>
|
||||
<button id="submitMail"class="btn btn-primary" onclick="showModal()">Send Mail</button>
|
||||
|
||||
@ -375,7 +375,7 @@ $(document).ready(function() {
|
||||
$('#submitQCRData').text('Save');
|
||||
} else {
|
||||
$('#submitData').show();
|
||||
$('#submitQCRData').text('Save QCR');
|
||||
$('#submitQCRData').text('Proceed to QCR');
|
||||
}
|
||||
|
||||
let excel_url = '<?= base_url('leads/exportQCRandRFQ/') ?>'+lead_id + '/' + type_for_url + '/' + 'excel'
|
||||
@ -717,6 +717,14 @@ function addSuggestionsToTable() {
|
||||
editableCell.classList.add('editablecolumns');
|
||||
const inputBox = document.createElement('input');
|
||||
inputBox.type = 'hidden';
|
||||
|
||||
//add default values for default proposal for both hidden valuse as well as cell textContent
|
||||
if(details.answers.length != 0)
|
||||
{
|
||||
inputBox.value = JSON.stringify(details.answers[0]);
|
||||
editableCell.textContent = (details.answers[0].display_value);
|
||||
}
|
||||
|
||||
editableCell.appendChild(inputBox);
|
||||
// Additional handling can be added here for 'answers' or 'type'
|
||||
}
|
||||
@ -1054,7 +1062,7 @@ function addRow(e) {
|
||||
const actionCell = newRow.insertCell();
|
||||
actionCell.classList.add('action');
|
||||
actionCell.innerHTML =
|
||||
'<input type="checkbox" name="qcr"> QCR <input type="checkbox" name="client"> Client <button class="btn btn-danger btn-sm removeRow">−</button> <button class="btn btn-primary btn-sm" onclick="addRow(event)">+</button>';
|
||||
'<input type="checkbox" name="qcr" checked> QCR <input type="checkbox" name="client" checked> Client <button class="btn btn-danger btn-sm removeRow">−</button> <button class="btn btn-primary btn-sm" onclick="addRow(event)">+</button>';
|
||||
|
||||
|
||||
e.target.remove();
|
||||
@ -2153,10 +2161,10 @@ function showModal(){
|
||||
var lead_id = $('#lead_id').val();
|
||||
|
||||
if(RFQ_or_QCR == 2){
|
||||
$('#myCenterModalLabel').text('Client Data')
|
||||
$('#myCenterModalLabel').text('Client contact to send mail')
|
||||
url = '<?= base_url('leads/list/') ?>' + lead_id;
|
||||
}else{
|
||||
$('#myCenterModalLabel').text('Insurer Data')
|
||||
$('#myCenterModalLabel').text('Choose insurer to send mail')
|
||||
url = '<?= base_url('util/getLevelContects') ?>'
|
||||
}
|
||||
|
||||
@ -2746,11 +2754,12 @@ function jsonToTable(json) {
|
||||
|
||||
try {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
const jsonData = await tableToJsonForFormSubmit(); // Construct the JSON data
|
||||
|
||||
console.log(jsonData);
|
||||
// return false;
|
||||
// Create a FormData object
|
||||
const formData = new FormData();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user