CHANGE_BDS_CHANGE_2
This commit is contained in:
parent
991147773c
commit
b0441597b1
@ -2398,13 +2398,27 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function uploadVehicleFile()
|
public function uploadVehicleFile($params = null)
|
||||||
{
|
{
|
||||||
$this->myLogger->logme('error', 'uploadVehicleFile function called');
|
$this->myLogger->logme('error', 'uploadVehicleFile function called');
|
||||||
|
|
||||||
|
$client_id = null;
|
||||||
|
$vehicle_id = null;
|
||||||
|
$files = null;
|
||||||
|
$docs_name = null;
|
||||||
|
|
||||||
|
if(empty($params) && $this->request){
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
$files = $this->request->getFiles();
|
$files = $this->request->getFiles();
|
||||||
// $data['client_id'] = 12;
|
$client_id = $data['client_id'] ?? null;
|
||||||
// $data['vehicle_id'] = 1;
|
$vehicle_id = $data['vehicle_id'] ?? null;
|
||||||
|
$docs_name = $data['other_docs_name'] ?? null;
|
||||||
|
}else {
|
||||||
|
$client_id = $params['client_id'] ?? null;
|
||||||
|
$vehicle_id = $params['vehicle_id'] ?? null;
|
||||||
|
$docs_name = $params['other_docs_name'] ?? null;
|
||||||
|
$files = $params['file_data'] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
// upload path
|
// upload path
|
||||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||||
@ -2412,20 +2426,21 @@ class ClientController extends AdminController
|
|||||||
$insertedDocs = [];
|
$insertedDocs = [];
|
||||||
|
|
||||||
// Check document names and files
|
// Check document names and files
|
||||||
if (isset($data['other_docs_name']) && isset($files['file_name'])) {
|
if (!empty($docs_name) && !empty($files) && !empty($client_id) && !empty($vehicle_id)) {
|
||||||
foreach ($data['other_docs_name'] as $key => $docName) {
|
|
||||||
|
foreach ($docs_name as $key => $docName) {
|
||||||
// Get the corresponding file for this document name
|
// Get the corresponding file for this document name
|
||||||
$file = $files['file_name'][$key];
|
$file = $files['file_name'][$key];
|
||||||
|
|
||||||
if (!empty($docName) && $file->isValid() && !$file->hasMoved()) {
|
if (!empty($docName) && $file->isValid() && !$file->hasMoved()) {
|
||||||
// Upload the file
|
// Upload the file
|
||||||
$uploadedFileName = file_Upload($file, $uploadFilePath);
|
$uploadedFileName = file_Upload_for_lead($file, $uploadFilePath);
|
||||||
|
|
||||||
if ($uploadedFileName) {
|
if ($uploadedFileName) {
|
||||||
// Prepare data for each document upload
|
// Prepare data for each document upload
|
||||||
$docData = [
|
$docData = [
|
||||||
'client_id' => $data['client_id'],
|
'client_id' => $client_id,
|
||||||
'vehicle_id' => $data['vehicle_id'],
|
'vehicle_id' => $vehicle_id,
|
||||||
'other_docs_name' => $docName,
|
'other_docs_name' => $docName,
|
||||||
'file_name' => $uploadedFileName,
|
'file_name' => $uploadedFileName,
|
||||||
'created_by' => get_session_userid(),
|
'created_by' => get_session_userid(),
|
||||||
@ -2441,16 +2456,21 @@ class ClientController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($params) && !$this->request){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($insertedDocs)) {
|
if (!empty($insertedDocs)) {
|
||||||
// Fetch all documents for the client
|
// Fetch all documents for the client
|
||||||
$vehicleDocs = $this->clientKYCDocsModel
|
$vehicleDocs = $this->clientKYCDocsModel
|
||||||
->where('client_id', $data['client_id'])
|
->where('client_id', $data['client_id'])
|
||||||
->where('vehicle_id', $data['vehicle_id'])
|
->where('vehicle_id', $data['vehicle_id'])
|
||||||
->findAll();
|
->findAll();
|
||||||
return $this->respond(['status' => true, 'code' => 200, 'vehicle_docs' => $vehicleDocs, 'inserted_docs' => $insertedDocs], 200);
|
return $this->respond(['status' => true, 'code' => 200, 'vehicle_docs' => $vehicleDocs, 'inserted_docs' => $insertedDocs, 'message' => 'File uploaded successfully'], 200);
|
||||||
} else {
|
} else {
|
||||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No documents uploaded or inserted'], 200);
|
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No documents uploaded or inserted'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'Invalid data submission'], 200);
|
return $this->respond(['status' => false, 'code' => 400, 'message' => 'Invalid data submission'], 200);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -934,6 +934,12 @@
|
|||||||
{
|
{
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
|
|
||||||
|
$file_data = $this->request->getFiles() ?? null;
|
||||||
|
$data['file_data'] = $file_data ?? null;
|
||||||
|
|
||||||
|
$vehicle_file_data = $this->request->getFiles() ?? null;
|
||||||
|
$data['vehicle_file_data'] = $vehicle_file_data ?? null;
|
||||||
|
|
||||||
// print_r($data); die;
|
// print_r($data); die;
|
||||||
|
|
||||||
if (empty($data['policy_issue_date'])) {
|
if (empty($data['policy_issue_date'])) {
|
||||||
@ -1043,6 +1049,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// policy file upload
|
||||||
|
if(isset($data['doc_name']) && isset($data['file_data']) && !empty($data['doc_name']) && !empty($data['file_data'])){
|
||||||
|
$this->uploadFile($data['doc_name'], $data['file_data'], $insert);
|
||||||
|
}
|
||||||
|
|
||||||
|
// policy file upload
|
||||||
|
if(
|
||||||
|
isset($data['other_docs_name']) && isset($data['vehicle_file_data']) && isset($data['client_id']) && isset($data['vehicle_id']) &&
|
||||||
|
!empty($data['other_docs_name']) && !empty($data['vehicle_file_data']) && !empty($data['client_id']) && !empty($data['vehicle_id'])
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$vdd = [
|
||||||
|
'other_docs_name' => $data['other_docs_name'],
|
||||||
|
'file_data' => $data['vehicle_file_data'],
|
||||||
|
'client_id' => $data['client_id'],
|
||||||
|
'vehicle_id' => $data['vehicle_id'],
|
||||||
|
];
|
||||||
|
$clientController = new ClientController();
|
||||||
|
$clientController->uploadVehicleFile($vdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||||
|
|
||||||
@ -2871,20 +2899,23 @@
|
|||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//file upload function
|
//file upload function
|
||||||
public function uploadFile()
|
public function uploadFile($docs_name = null, $files = null, $pt_id = null)
|
||||||
{
|
{
|
||||||
$GoogleDriveController = new GoogleDriveController();
|
$GoogleDriveController = new GoogleDriveController();
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($docs_name) && empty($files) && empty($pt_id) && $this->request){
|
||||||
$files = $this->request->getFiles();
|
$files = $this->request->getFiles();
|
||||||
$doc_name = $this->request->getPost('doc_name[]');
|
$docs_name = $this->request->getPost('doc_name');
|
||||||
$pt_id = $this->request->getPost('pt_id');
|
$pt_id = $this->request->getPost('pt_id');
|
||||||
$client_policy_id = $this->request->getPost('client_policy_id');
|
$client_policy_id = $this->request->getPost('client_policy_id');
|
||||||
$data = $this->request->getPost();
|
}
|
||||||
|
|
||||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||||
|
|
||||||
$uploadData = [];
|
$uploadData = [];
|
||||||
|
|
||||||
foreach ($data['doc_name'] as $key => $docName) {
|
foreach ($docs_name as $key => $docName) {
|
||||||
|
|
||||||
// Get the corresponding file for this document name
|
// Get the corresponding file for this document name
|
||||||
$file = $files['file'][$key];
|
$file = $files['file'][$key];
|
||||||
@ -2892,7 +2923,7 @@
|
|||||||
if (!empty($docName) && $file->isValid() && !$file->hasMoved()) {
|
if (!empty($docName) && $file->isValid() && !$file->hasMoved()) {
|
||||||
|
|
||||||
// Upload the file
|
// Upload the file
|
||||||
$uploadedFileName = file_Upload($file, $uploadFilePath);
|
$uploadedFileName = file_Upload_for_lead($file, $uploadFilePath);
|
||||||
|
|
||||||
if ($uploadedFileName) {
|
if ($uploadedFileName) {
|
||||||
// Prepare data for each document upload
|
// Prepare data for each document upload
|
||||||
@ -2917,6 +2948,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($docs_name) && !empty($files) && !empty($pt_id) && !$this->request){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// print_r($uploadData); die;
|
// print_r($uploadData); die;
|
||||||
|
|
||||||
// $uploadData = uploadFilesToGoogleDrive($files['file'], $doc_name, $pt_id);
|
// $uploadData = uploadFilesToGoogleDrive($files['file'], $doc_name, $pt_id);
|
||||||
|
|||||||
@ -99,12 +99,14 @@ $("#drive_file_upload_form").submit(function(event) {
|
|||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
if(res.status == true){
|
if(res.status == true){
|
||||||
toastr.success(res.message, 'Success');
|
toastr.success(res.message, 'SUCCESS');
|
||||||
appendFileTableBody(res.data.pt_files);
|
appendFileTableBody(res.data.pt_files);
|
||||||
}else{
|
}else{
|
||||||
toastr.error(res.message, 'Error');
|
toastr.warning(res.message, 'WARNING');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#drive_file_upload_form')[0].reset();
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
|
|||||||
@ -2446,26 +2446,71 @@
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// if(allocg == "EB"){
|
||||||
|
// $('.hideter').hide();
|
||||||
|
// $('.hidetp').hide();
|
||||||
|
// $('.hidecoter').hide()
|
||||||
|
// $('.hidecotp').hide()
|
||||||
|
// }else{
|
||||||
|
|
||||||
|
// $('.hidetp').show();
|
||||||
|
// if(is_co_pay_yes == 1){
|
||||||
|
// $('.hidecotp').show();
|
||||||
|
// $('#table_tr_7').show();
|
||||||
|
// $('#table_tr_35').show();
|
||||||
|
// $('#table_tr_3').show();
|
||||||
|
// }else{
|
||||||
|
// $('.hidecotp').hide();
|
||||||
|
// $('#table_tr_7').hide();
|
||||||
|
// $('#table_tr_35').hide();
|
||||||
|
// $('#table_tr_3').hide();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
|
// $('.hideter').show();
|
||||||
|
// if(is_co_pay_yes == 1){
|
||||||
|
// $('.hidecoter').show();
|
||||||
|
// }else{
|
||||||
|
// $('.hidecoter').hide();
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// $('.hideter').hide();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if(allocg == "EB"){
|
if(allocg == "EB"){
|
||||||
|
|
||||||
$('.hideter').hide();
|
$('.hideter').hide();
|
||||||
$('.hidetp').hide();
|
$('.hidetp').hide();
|
||||||
$('.hidecoter').hide()
|
$('.hidecoter').hide()
|
||||||
$('.hidecotp').hide()
|
$('.hidecotp').hide()
|
||||||
|
|
||||||
|
} else if(allocg == "Non-EB"){
|
||||||
|
|
||||||
|
$('.hidetp').hide();
|
||||||
|
$('.hidecotp').hide();
|
||||||
|
|
||||||
|
$('.hideter').show();
|
||||||
|
if(is_co_pay_yes == 1){
|
||||||
|
$('.hidecoter').show();
|
||||||
}else{
|
}else{
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(allocg == "Motor"){
|
||||||
|
|
||||||
|
$('.hideter').hide();
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
|
||||||
$('.hidetp').show();
|
$('.hidetp').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
$('.hidecotp').show();
|
$('.hidecotp').show();
|
||||||
$('#table_tr_7').show();
|
|
||||||
$('#table_tr_35').show();
|
|
||||||
$('#table_tr_3').show();
|
|
||||||
}else{
|
}else{
|
||||||
$('.hidecotp').hide();
|
$('.hidecotp').hide();
|
||||||
$('#table_tr_7').hide();
|
|
||||||
$('#table_tr_35').hide();
|
|
||||||
$('#table_tr_3').hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else{
|
||||||
|
|
||||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
$('.hideter').show();
|
$('.hideter').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
|
|||||||
@ -349,7 +349,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="card mb-1">
|
<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="card-body" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
<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>
|
||||||
@ -465,7 +465,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="card mb-1">
|
<div class="card mb-1">
|
||||||
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
|
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
|
||||||
<div class="card-body">
|
<div class="card-body" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
<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>
|
||||||
@ -490,7 +490,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -660,6 +659,48 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Policy Docs Row -->
|
||||||
|
<div class="row" id="policy_docs" style="display: none;">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div id="accordion_23" class="mb-0">
|
||||||
|
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||||
|
<span class="font-color-black">Policy Docs</span>
|
||||||
|
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwentyTwo"
|
||||||
|
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="collapseTwentyTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_23">
|
||||||
|
<div class="card-body" id="policy_docs_div" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Vehicle Docs Row -->
|
||||||
|
<div class="row" id="vehicle_docs" style="display: none;">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div id="accordion_22" class="mb-0">
|
||||||
|
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||||
|
<span class="font-color-black">Vehicle Docs</span>
|
||||||
|
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwentyThree"
|
||||||
|
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="collapseTwentyThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_22">
|
||||||
|
<div class="card-body" id="vehicle_docs_div" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
|
</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">
|
||||||
@ -673,7 +714,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="card mb-1">
|
<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="card-body" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
<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;">
|
||||||
@ -890,7 +931,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="card mb-0">
|
<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="card-body" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
|
||||||
<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> -->
|
||||||
@ -941,7 +982,7 @@
|
|||||||
<tr id="table_tr_4">
|
<tr id="table_tr_4">
|
||||||
<td>Base Premium</td>
|
<td>Base Premium</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="hidetp" id="table_tr_5">
|
<tr class="hidetp" id="table_tr_5" style="display: none;">
|
||||||
<td id="tp_premium_td">TP Premium</td>
|
<td id="tp_premium_td">TP Premium</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="hideter" id="table_tr_6" style="display: none;">
|
<tr class="hideter" id="table_tr_6" style="display: none;">
|
||||||
@ -1809,11 +1850,28 @@
|
|||||||
var is_co_pay_yes = $('#cop_yes').prop('checked') ? 1 : 0;
|
var is_co_pay_yes = $('#cop_yes').prop('checked') ? 1 : 0;
|
||||||
|
|
||||||
if(allocg == "EB"){
|
if(allocg == "EB"){
|
||||||
|
|
||||||
$('.hideter').hide();
|
$('.hideter').hide();
|
||||||
$('.hidetp').hide();
|
$('.hidetp').hide();
|
||||||
$('.hidecoter').hide()
|
$('.hidecoter').hide()
|
||||||
$('.hidecotp').hide()
|
$('.hidecotp').hide()
|
||||||
|
|
||||||
|
} else if(allocg == "Non-EB"){
|
||||||
|
|
||||||
|
$('.hidetp').hide();
|
||||||
|
$('.hidecotp').hide();
|
||||||
|
|
||||||
|
$('.hideter').show();
|
||||||
|
if(is_co_pay_yes == 1){
|
||||||
|
$('.hidecoter').show();
|
||||||
}else{
|
}else{
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(value == 8){
|
||||||
|
|
||||||
|
$('.hideter').hide();
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
|
||||||
$('.hidetp').show();
|
$('.hidetp').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
@ -1822,6 +1880,8 @@
|
|||||||
$('.hidecotp').hide();
|
$('.hidecotp').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else{
|
||||||
|
|
||||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
$('.hideter').show();
|
$('.hideter').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
@ -1834,6 +1894,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// do not remove this commented item
|
// do not remove this commented item
|
||||||
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
// $('.hideter').show();
|
// $('.hideter').show();
|
||||||
@ -1891,7 +1952,7 @@
|
|||||||
$('#vhnodiv').show();
|
$('#vhnodiv').show();
|
||||||
$('#client_type_div').hide();
|
$('#client_type_div').hide();
|
||||||
$('#policyholdernamediv').hide();
|
$('#policyholdernamediv').hide();
|
||||||
$('#hide_vehicle_tab').show();
|
// $('#hide_vehicle_tab').show();
|
||||||
$('#client_type').addClass('readonly-select ');
|
$('#client_type').addClass('readonly-select ');
|
||||||
$('#client_id').addClass('readonly-select ').select2('destroy');
|
$('#client_id').addClass('readonly-select ').select2('destroy');
|
||||||
$('#client_branch_id').addClass('readonly-select ').select2('destroy');
|
$('#client_branch_id').addClass('readonly-select ').select2('destroy');
|
||||||
@ -1899,7 +1960,7 @@
|
|||||||
$('#vehicle_no').val("").select2();
|
$('#vehicle_no').val("").select2();
|
||||||
$('#vhnodiv').hide();
|
$('#vhnodiv').hide();
|
||||||
$('#client_type_div').show();
|
$('#client_type_div').show();
|
||||||
$('#hide_vehicle_tab').hide();
|
// $('#hide_vehicle_tab').hide();
|
||||||
$('#client_type').removeClass('readonly-select ');
|
$('#client_type').removeClass('readonly-select ');
|
||||||
$('#client_id').removeClass('readonly-select ').select2();
|
$('#client_id').removeClass('readonly-select ').select2();
|
||||||
$('#client_branch_id').removeClass('readonly-select ').select2();
|
$('#client_branch_id').removeClass('readonly-select ').select2();
|
||||||
@ -1960,6 +2021,14 @@
|
|||||||
$("select[name='cd_ac_no_for_child[]']").attr('required', 'required');
|
$("select[name='cd_ac_no_for_child[]']").attr('required', 'required');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(value == 8){
|
||||||
|
addHTMLInputForVehicleFileUpload(null, 'vehicle_docs_div')
|
||||||
|
$('#vehicle_docs').show();
|
||||||
|
}else{
|
||||||
|
$('#vehicle_docs').hide();
|
||||||
|
$('#vehicle_docs_div').empty();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -2009,6 +2078,20 @@
|
|||||||
$('#calc_policy_issue_date_1').val(policy_issue_date).addClass('readonly-select');
|
$('#calc_policy_issue_date_1').val(policy_issue_date).addClass('readonly-select');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
// Hide all
|
||||||
|
$('[name="cd_ac_no_for_child[]"]').hide();
|
||||||
|
$('[id^="cd_current_balance_"]').hide();
|
||||||
|
|
||||||
|
// Show only current one
|
||||||
|
$('#cd_ac_no_' + uniqueid).show();
|
||||||
|
$('#cd_current_balance_' + uniqueid).show();
|
||||||
|
} else {
|
||||||
|
// Show all back
|
||||||
|
$('[name="cd_ac_no_for_child[]"]').show();
|
||||||
|
$('[id^="cd_current_balance_"]').show();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', 'select[name="relationship[]"]', function() {
|
$(document).on('change', 'select[name="relationship[]"]', function() {
|
||||||
@ -2397,6 +2480,10 @@
|
|||||||
$('#is_cd_reduce_from_bds').prop('checked', false);
|
$('#is_cd_reduce_from_bds').prop('checked', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#vehicle_docs').hide();
|
||||||
|
$('#vehicle_docs_div').empty();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('No data found');
|
console.log('No data found');
|
||||||
}
|
}
|
||||||
@ -2532,7 +2619,7 @@
|
|||||||
$('#sgst_' + input).val(isFinite($('#sgst_' + input).val()) ? $('#sgst_' + input).val() : 0);
|
$('#sgst_' + input).val(isFinite($('#sgst_' + input).val()) ? $('#sgst_' + input).val() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function amountCalculation(input) {
|
function amountCalculation(input, name = null) {
|
||||||
|
|
||||||
console.log('############################## AMOUNT CALCULATION ############################################')
|
console.log('############################## AMOUNT CALCULATION ############################################')
|
||||||
console.log('amountCalculation : ' + input);
|
console.log('amountCalculation : ' + input);
|
||||||
@ -2717,7 +2804,7 @@
|
|||||||
// $('#variance_' + input).val(!isNaN(variance) && isFinite(variance) ? variance.toFixed(2) : '0.00');
|
// $('#variance_' + input).val(!isNaN(variance) && isFinite(variance) ? variance.toFixed(2) : '0.00');
|
||||||
let policy_type_id = $('#policy_type_id').val();
|
let policy_type_id = $('#policy_type_id').val();
|
||||||
|
|
||||||
if(policy_type_id > 7){
|
if(policy_type_id > 7 && name == "base_premium[]"){
|
||||||
checkCDAmountForBasePremium(input);
|
checkCDAmountForBasePremium(input);
|
||||||
}else{
|
}else{
|
||||||
console.log("First Skip the Ajax Call these are group policies");
|
console.log("First Skip the Ajax Call these are group policies");
|
||||||
@ -4077,7 +4164,58 @@
|
|||||||
|
|
||||||
$('#cop_yes').change(function() {
|
$('#cop_yes').change(function() {
|
||||||
|
|
||||||
|
var selectedOption = $('#policy_type_id').find('option:selected');
|
||||||
|
var bap = selectedOption.data('bap');
|
||||||
|
var allocg = selectedOption.data('allocg');
|
||||||
|
var policy_type_id = $('#policy_type_id').val();
|
||||||
|
|
||||||
|
if(allocg == "EB"){
|
||||||
|
|
||||||
|
$('.hideter').hide();
|
||||||
|
$('.hidetp').hide();
|
||||||
|
$('.hidecoter').hide()
|
||||||
|
$('.hidecotp').hide()
|
||||||
|
|
||||||
|
} else if(allocg == "Non-EB"){
|
||||||
|
|
||||||
|
$('.hidetp').hide();
|
||||||
|
$('.hidecotp').hide();
|
||||||
|
|
||||||
|
$('.hideter').show();
|
||||||
|
if($(this).is(':checked')){
|
||||||
|
$('.hidecoter').show();
|
||||||
|
}else{
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(policy_type_id == 8){
|
||||||
|
|
||||||
|
$('.hideter').hide();
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
|
||||||
|
$('.hidetp').show();
|
||||||
|
if($(this).is(':checked')){
|
||||||
|
$('.hidecotp').show();
|
||||||
|
}else{
|
||||||
|
$('.hidecotp').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else{
|
||||||
|
|
||||||
|
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
|
$('.hideter').show();
|
||||||
|
if($(this).is(':checked')){
|
||||||
|
$('.hidecoter').show();
|
||||||
|
}else{
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$('.hideter').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($(this).is(':checked')) {
|
if ($(this).is(':checked')) {
|
||||||
|
|
||||||
$('#add_more_row').removeClass('d-none');
|
$('#add_more_row').removeClass('d-none');
|
||||||
$('.payby').removeClass('d-none');
|
$('.payby').removeClass('d-none');
|
||||||
$('#table_tr_2').show()
|
$('#table_tr_2').show()
|
||||||
@ -4085,12 +4223,6 @@
|
|||||||
$('#table_tr_7').show()
|
$('#table_tr_7').show()
|
||||||
$('#table_tr_35').show()
|
$('#table_tr_35').show()
|
||||||
|
|
||||||
var selectedOption = $('#policy_type_id').find('option:selected');
|
|
||||||
var bap = selectedOption.data('bap');
|
|
||||||
var allocg = selectedOption.data('allocg');
|
|
||||||
// console.log('allocg:', allocg);
|
|
||||||
|
|
||||||
|
|
||||||
// do not remove this commented items
|
// do not remove this commented items
|
||||||
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
// $('.hidecoter').show()
|
// $('.hidecoter').show()
|
||||||
@ -4106,31 +4238,31 @@
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(allocg == "EB"){
|
// if(allocg == "EB"){
|
||||||
$('.hideter').hide();
|
// $('.hideter').hide();
|
||||||
$('.hidetp').hide();
|
// $('.hidetp').hide();
|
||||||
$('.hidecoter').hide()
|
// $('.hidecoter').hide()
|
||||||
$('.hidecotp').hide()
|
// $('.hidecotp').hide()
|
||||||
}else{
|
// }else{
|
||||||
|
|
||||||
$('.hidetp').show();
|
// $('.hidetp').show();
|
||||||
if($(this).is(':checked')){
|
// if($(this).is(':checked')){
|
||||||
$('.hidecotp').show();
|
// $('.hidecotp').show();
|
||||||
}else{
|
// }else{
|
||||||
$('.hidecotp').hide();
|
// $('.hidecotp').hide();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
$('.hideter').show();
|
// $('.hideter').show();
|
||||||
if($(this).is(':checked')){
|
// if($(this).is(':checked')){
|
||||||
$('.hidecoter').show();
|
// $('.hidecoter').show();
|
||||||
}else{
|
// }else{
|
||||||
$('.hidecoter').hide();
|
// $('.hidecoter').hide();
|
||||||
}
|
// }
|
||||||
}else{
|
// }else{
|
||||||
$('.hideter').hide();
|
// $('.hideter').hide();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// $('input[name="co_share_per[]"], input[name="co_premium[]"]').each(function () {
|
// $('input[name="co_share_per[]"], input[name="co_premium[]"]').each(function () {
|
||||||
// $(this).val(''); // Clear value
|
// $(this).val(''); // Clear value
|
||||||
@ -4889,11 +5021,28 @@
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if(allocg == "EB"){
|
if(allocg == "EB"){
|
||||||
|
|
||||||
$('.hideter').hide();
|
$('.hideter').hide();
|
||||||
$('.hidetp').hide();
|
$('.hidetp').hide();
|
||||||
$('.hidecoter').hide()
|
$('.hidecoter').hide()
|
||||||
$('.hidecotp').hide()
|
$('.hidecotp').hide()
|
||||||
|
|
||||||
|
} else if(allocg == "Non-EB"){
|
||||||
|
|
||||||
|
$('.hidetp').hide();
|
||||||
|
$('.hidecotp').hide();
|
||||||
|
|
||||||
|
$('.hideter').show();
|
||||||
|
if(is_co_pay_yes == 1){
|
||||||
|
$('.hidecoter').show();
|
||||||
}else{
|
}else{
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(policy_type_id == 8){
|
||||||
|
|
||||||
|
$('.hideter').hide();
|
||||||
|
$('.hidecoter').hide();
|
||||||
|
|
||||||
$('.hidetp').show();
|
$('.hidetp').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
@ -4902,6 +5051,8 @@
|
|||||||
$('.hidecotp').hide();
|
$('.hidecotp').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else{
|
||||||
|
|
||||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
$('.hideter').show();
|
$('.hideter').show();
|
||||||
if(is_co_pay_yes == 1){
|
if(is_co_pay_yes == 1){
|
||||||
@ -4914,6 +5065,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(allocg == "EB"){
|
||||||
|
// $('.hideter').hide();
|
||||||
|
// $('.hidetp').hide();
|
||||||
|
// $('.hidecoter').hide()
|
||||||
|
// $('.hidecotp').hide()
|
||||||
|
// }else{
|
||||||
|
|
||||||
|
// $('.hidetp').show();
|
||||||
|
// if(is_co_pay_yes == 1){
|
||||||
|
// $('.hidecotp').show();
|
||||||
|
// }else{
|
||||||
|
// $('.hidecotp').hide();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||||
|
// $('.hideter').show();
|
||||||
|
// if(is_co_pay_yes == 1){
|
||||||
|
// $('.hidecoter').show();
|
||||||
|
// }else{
|
||||||
|
// $('.hidecoter').hide();
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// $('.hideter').hide();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
var std_bp = 0;
|
var std_bp = 0;
|
||||||
var std_tp = 0;
|
var std_tp = 0;
|
||||||
var std_tep = 0;
|
var std_tep = 0;
|
||||||
@ -5557,16 +5734,18 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#insurerTable input, #insurerTable select, #insurerTable textarea', function() {
|
$(document).on('change', '#insurerTable input, #insurerTable select, #insurerTable textarea', function() {
|
||||||
// console.log('Changed in table:', $(this).attr('name'), 'Value:', $(this).val());
|
console.log('Changed in table:', $(this).attr('name'), 'Value:', $(this).val());
|
||||||
getColumnIndexes()
|
getColumnIndexes(0, $(this).attr('name'))
|
||||||
});
|
});
|
||||||
|
|
||||||
function getColumnIndexes(count = 0) {
|
function getColumnIndexes(count = 0, name = null) {
|
||||||
$('#insurerTable thead th').each(function(index) {
|
$('#insurerTable thead th').each(function(index) {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
console.log("Premium Table columnIndexes is", index);
|
console.log("Premium Table columnIndexes is", index);
|
||||||
} else {
|
} else {
|
||||||
amountCalculation(index);
|
|
||||||
|
amountCalculation(index, name);
|
||||||
|
|
||||||
if(count == 1){
|
if(count == 1){
|
||||||
amountCalculation(index);
|
amountCalculation(index);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -579,7 +579,9 @@ $(document).ready(function() {
|
|||||||
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) {
|
||||||
hide_list_show_add();
|
hide_list_show_add();
|
||||||
addInsurerColumn() ;
|
addInsurerColumn();
|
||||||
|
addHTMLInput(null, 'policy_docs_div');
|
||||||
|
$('#policy_docs').show()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -720,6 +722,7 @@ function hide_list_show_add()
|
|||||||
$('#inception_filter').hide()
|
$('#inception_filter').hide()
|
||||||
$('#policyholdernamediv').hide();
|
$('#policyholdernamediv').hide();
|
||||||
$('.branchdiv').show();
|
$('.branchdiv').show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_list_hide_add()
|
function show_list_hide_add()
|
||||||
@ -1000,23 +1003,33 @@ function getPolicyDetailsByPolicyId(input)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHTMLInput(data = null)
|
function addHTMLInput(data = null, container_id = 'dynamic-form-container')
|
||||||
{
|
{
|
||||||
const container = document.getElementById('dynamic-form-container');
|
console.log('container_id', container_id);
|
||||||
|
const container = document.getElementById(container_id);
|
||||||
|
|
||||||
|
let required = ''
|
||||||
|
let required_star = ''
|
||||||
|
if(container_id == 'dynamic-form-container'){
|
||||||
|
required = 'required';
|
||||||
|
required_star = '*';
|
||||||
|
}
|
||||||
|
console.log('container', 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';
|
||||||
newRow.innerHTML = `
|
newRow.innerHTML = `
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
<label for="file_name">Document Name<span class="text-danger">*</span></label>
|
<label for="file_name">Document Name<span class="text-danger">${required_star}</span></label>
|
||||||
<input type="text" class="form-control" id="docs_name" name="doc_name[]" placeholder="Enter file name" required>
|
<input type="text" class="form-control" id="docs_name" name="doc_name[]" placeholder="Enter file name" ${required}>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
<label for="file">Upload File<span class="text-danger">*</span></label>
|
<label for="file">Upload File<span class="text-danger">${required_star}</span></label>
|
||||||
<input type="file" class="form-control" id="file_name" name="file[]" required>
|
<input type="file" class="form-control" id="file_name" name="file[]" ${required}>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a>
|
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this, '${container_id}')">x</a>
|
||||||
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInput(this)">+</a>
|
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInput(null, '${container_id}')">+</a>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
container.appendChild(newRow);
|
container.appendChild(newRow);
|
||||||
@ -1027,9 +1040,9 @@ function addHTMLInput(data = null)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeHTMLInput(element)
|
function removeHTMLInput(element, container_id)
|
||||||
{
|
{
|
||||||
const container = document.getElementById('dynamic-form-container');
|
const container = document.getElementById(container_id);
|
||||||
const rows = container.querySelectorAll('.dynamic-form-row');
|
const rows = container.querySelectorAll('.dynamic-form-row');
|
||||||
|
|
||||||
if (rows.length > 1) {
|
if (rows.length > 1) {
|
||||||
@ -1179,23 +1192,30 @@ function validateForm()
|
|||||||
return checkInputs(); // Call checkInputs before form submission
|
return checkInputs(); // Call checkInputs before form submission
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHTMLInputForVehicleFileUpload(data = null)
|
function addHTMLInputForVehicleFileUpload(data = null, container_id = 'dynamic-form-container-for-vehicle-file-upload')
|
||||||
{
|
{
|
||||||
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
|
let required = ''
|
||||||
|
let required_star = ''
|
||||||
|
if(container_id == 'dynamic-form-container-for-vehicle-file-upload'){
|
||||||
|
required = 'required';
|
||||||
|
required_star = '*';
|
||||||
|
}
|
||||||
|
|
||||||
|
const container = document.getElementById(container_id);
|
||||||
const newRow = document.createElement('div');
|
const newRow = document.createElement('div');
|
||||||
newRow.className = 'form-row dynamic-form-row';
|
newRow.className = 'form-row dynamic-form-row';
|
||||||
newRow.innerHTML = `
|
newRow.innerHTML = `
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
<label for="file_name">Document Name<span class="text-danger">*</span></label>
|
<label for="file_name">Document Name<span class="text-danger">${required_star}</span></label>
|
||||||
<input type="text" class="form-control" id="docs_name" name="other_docs_name[]" placeholder="Enter file name" required>
|
<input type="text" class="form-control" id="docs_name" name="other_docs_name[]" placeholder="Enter file name" ${required}>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
<label for="file">Upload File<span class="text-danger">*</span></label>
|
<label for="file">Upload File<span class="text-danger">${required_star}</span></label>
|
||||||
<input type="file" class="form-control" id="file_name" name="file_name[]" required>
|
<input type="file" class="form-control" id="file_name" name="file_name[]" ${required}>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInputForVehicleFileUpload(this)">x</a>
|
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInputForVehicleFileUpload(this, '${container_id}')">x</a>
|
||||||
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInputForVehicleFileUpload(this)">+</a>
|
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInputForVehicleFileUpload(null, '${container_id}')">+</a>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
container.appendChild(newRow);
|
container.appendChild(newRow);
|
||||||
@ -1244,9 +1264,9 @@ function appendVehicleFileTableBody(data)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeHTMLInputForVehicleFileUpload(element)
|
function removeHTMLInputForVehicleFileUpload(element, container_id)
|
||||||
{
|
{
|
||||||
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
|
const container = document.getElementById(container_id);
|
||||||
const rows = container.querySelectorAll('.dynamic-form-row');
|
const rows = container.querySelectorAll('.dynamic-form-row');
|
||||||
|
|
||||||
if (rows.length > 1) {
|
if (rows.length > 1) {
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<li class="nav-item" id="hide_file_upload" style="display: none;">
|
<li class="nav-item" id="hide_file_upload" style="display: none;">
|
||||||
<a href="#fileupload" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
|
<a href="#fileupload" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
|
||||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||||
<span class="d-none d-sm-inline-block">File Upload</span>
|
<span class="d-none d-sm-inline-block">Policy Docs</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" id="hide_vehicle_tab" style="display: none;">
|
<li class="nav-item" id="hide_vehicle_tab" style="display: none;">
|
||||||
|
|||||||
@ -163,10 +163,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>S.No </th>
|
<th>S.No </th>
|
||||||
<th>Client </th>
|
<th>Client </th>
|
||||||
<th>Client Branch </th>
|
<!-- <th>Client Branch </th> -->
|
||||||
<th>Insurer </th>
|
<!-- <th>Insurer </th> -->
|
||||||
<th>Insurer Branch </th>
|
<th>Insurer Branch </th>
|
||||||
<th>Policy </th>
|
<th>Policy Type </th>
|
||||||
|
<th>Policy No </th>
|
||||||
<th>Endorsement No </th>
|
<th>Endorsement No </th>
|
||||||
<th>Premium </th>
|
<th>Premium </th>
|
||||||
<th>Statement Premium </th>
|
<th>Statement Premium </th>
|
||||||
@ -182,10 +183,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="text-center"><?= $index + 1 ?></td>
|
<td class="text-center"><?= $index + 1 ?></td>
|
||||||
<td><?php echo $row['client_name']; ?></td>
|
<td><?php echo $row['client_name']; ?></td>
|
||||||
<td><?php echo $row['client_branch_name']; ?></td>
|
<!-- <td><?php //echo $row['client_branch_name']; ?></td>
|
||||||
<td><?php echo $row['insurer_name']; ?></td>
|
<td><?php //echo $row['insurer_name']; ?></td> -->
|
||||||
<td><?php echo $row['insurer_branch_name']; ?></td>
|
<td><?php echo $row['insurer_branch_name']; ?></td>
|
||||||
<td><?php echo $row['policy_type'] .' - '. $row['policy_no']; ?></td>
|
<td><?php echo $row['policy_type']; ?></td>
|
||||||
|
<td><?php echo $row['policy_no']; ?></td>
|
||||||
<td><?php echo $row['endorsement_no']; ?></td>
|
<td><?php echo $row['endorsement_no']; ?></td>
|
||||||
<td class="right-align-input"><?php echo $row['original_premium']; ?></td>
|
<td class="right-align-input"><?php echo $row['original_premium']; ?></td>
|
||||||
<td class="right-align-input"><?php echo isset($row['statement_premium']) ? $row['statement_premium'] : '0.00'; ?></td>
|
<td class="right-align-input"><?php echo isset($row['statement_premium']) ? $row['statement_premium'] : '0.00'; ?></td>
|
||||||
@ -198,7 +200,6 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
@ -206,8 +207,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let client_list = [];
|
let client_list = [];
|
||||||
let branch_list = [];
|
let branch_list = [];
|
||||||
let policy_list = [];
|
let policy_list = [];
|
||||||
@ -216,9 +217,7 @@
|
|||||||
|
|
||||||
// Datatable document ready
|
// Datatable document ready
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||||
|
|
||||||
if (ticketsTable.length) {
|
if (ticketsTable.length) {
|
||||||
ticketsTable.DataTable({
|
ticketsTable.DataTable({
|
||||||
scrollX: true,
|
scrollX: true,
|
||||||
@ -291,9 +290,9 @@
|
|||||||
} else {
|
} else {
|
||||||
console.error("Table not found.");
|
console.error("Table not found.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
getClientAndBranchAndPolicy()
|
getClientAndBranchAndPolicy()
|
||||||
getURLParams()
|
getURLParams()
|
||||||
$('#client_id').select2();
|
$('#client_id').select2();
|
||||||
@ -302,10 +301,9 @@ $(document).ready(function() {
|
|||||||
$('#insurer_branch_id').select2();
|
$('#insurer_branch_id').select2();
|
||||||
$('#client_policy_id').select2();
|
$('#client_policy_id').select2();
|
||||||
$('#policy_type_id').select2();
|
$('#policy_type_id').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();
|
||||||
@ -338,14 +336,13 @@ function fetchEmpolyeeList(event)
|
|||||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||||
console.log(apiURL);
|
console.log(apiURL);
|
||||||
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('&');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getURLParams()
|
function getURLParams() {
|
||||||
{
|
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const params = new URLSearchParams(url.search);
|
const params = new URLSearchParams(url.search);
|
||||||
|
|
||||||
@ -397,9 +394,9 @@ function getURLParams()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const params = new URLSearchParams(url.search);
|
const params = new URLSearchParams(url.search);
|
||||||
@ -454,9 +451,9 @@ $(function() {
|
|||||||
cb(start, end); // Update the displayed date range
|
cb(start, end); // Update the displayed date range
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function hideDateField(input = null) {
|
function hideDateField(input = null) {
|
||||||
let val = $('#date_type').val();
|
let val = $('#date_type').val();
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
@ -468,9 +465,9 @@ function hideDateField(input = null) {
|
|||||||
} else {
|
} else {
|
||||||
$('#date_div').hide()
|
$('#date_div').hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendPolicyTransactionID(event, pt_id) {
|
function sendPolicyTransactionID(event, pt_id) {
|
||||||
event.preventDefault(); // Prevent default action
|
event.preventDefault(); // Prevent default action
|
||||||
|
|
||||||
console.log(pt_id);
|
console.log(pt_id);
|
||||||
@ -483,13 +480,12 @@ function sendPolicyTransactionID(event, pt_id) {
|
|||||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||||
console.log(apiURL);
|
console.log(apiURL);
|
||||||
window.location.href = apiURL;
|
window.location.href = apiURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//featch client, client branch, insurer, insurer branch and client policy list data
|
//featch client, client branch, insurer, insurer branch and client policy list data
|
||||||
function getClientAndBranchAndPolicy()
|
function getClientAndBranchAndPolicy(){
|
||||||
{
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -515,7 +511,7 @@ function getClientAndBranchAndPolicy()
|
|||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
getClientAndBranchAndPolicy()
|
getClientAndBranchAndPolicy()
|
||||||
|
|||||||
@ -102,12 +102,14 @@ $("#vehicle_file_upload_form").submit(function(event) {
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
||||||
if(res.status == true){
|
if(res.status == true){
|
||||||
toastr.success(res.message, 'Success');
|
toastr.success(res.message, 'SUCCESS');
|
||||||
appendVehicleFileTableBody(res.vehicle_docs);
|
appendVehicleFileTableBody(res.vehicle_docs);
|
||||||
}else{
|
}else{
|
||||||
toastr.error(res.message, 'Error');
|
toastr.warning(res.message, 'WARNING');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#vehicle_file_upload_form')[0].reset();
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user