FIX_LIVE_ISSUE : RV
This commit is contained in:
parent
0c2c99c34d
commit
094e1fbb1a
@ -311,6 +311,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->get("get_client_policy_data_using_policy_no/(:any)", "ClientController::get_client_policy_data_using_policy_no/$1");
|
$routes->get("get_client_policy_data_using_policy_no/(:any)", "ClientController::get_client_policy_data_using_policy_no/$1");
|
||||||
$routes->get("get_client_policy_data_using_policy_no_and_endo_no/(:any)", "ClientController::get_client_policy_data_using_policy_no_and_endo_no/$1");
|
$routes->get("get_client_policy_data_using_policy_no_and_endo_no/(:any)", "ClientController::get_client_policy_data_using_policy_no_and_endo_no/$1");
|
||||||
$routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1");
|
$routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1");
|
||||||
|
$routes->get("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1811,6 +1811,11 @@ class EmpDataServiceController extends BaseController
|
|||||||
$file_data = $this->getDataByFileId($file_id, 'success');
|
$file_data = $this->getDataByFileId($file_id, 'success');
|
||||||
$this->setPullNotification($file_data);
|
$this->setPullNotification($file_data);
|
||||||
|
|
||||||
|
// if(excelFileGDriveUpload($file_id, 'batch_file')){
|
||||||
|
// $this->myLogger->logme('error', 'Inception Update Google Drive File Upload -- File Uploaded Successfully');
|
||||||
|
// }else{
|
||||||
|
// $this->myLogger->logme('error', 'Inception Update Google Drive File Upload -- File Uploaded Field');
|
||||||
|
// }
|
||||||
|
|
||||||
return 'Import Inception Updated ' . $status_val . '- Updated Count : ' . $emp_count;
|
return 'Import Inception Updated ' . $status_val . '- Updated Count : ' . $emp_count;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,6 +148,10 @@ class EmployeeController extends AdminController
|
|||||||
public function employeesUplodWithEvents()
|
public function employeesUplodWithEvents()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// $empDataServiceController = new EmpDataServiceController();
|
||||||
|
// !dd($empDataServiceController->importInceptionUpdateTPAandUHID(['file_id' => 79]));
|
||||||
|
|
||||||
|
|
||||||
// $job_details = new Jobs();
|
// $job_details = new Jobs();
|
||||||
// $r = Jobs::addJob(['job_name' => 'add','payload' => ['a' => 10, 'b' => 35]]);
|
// $r = Jobs::addJob(['job_name' => 'add','payload' => ['a' => 10, 'b' => 35]]);
|
||||||
// print_r($r);//die();
|
// print_r($r);//die();
|
||||||
|
|||||||
@ -216,25 +216,46 @@ class PolicyTransactionController extends BaseController
|
|||||||
// $data['renewal_date'] = change_date_format($this->request->getPost('renewal_date'), 'd/m/Y', 'Y-m-d') ?? null;
|
// $data['renewal_date'] = change_date_format($this->request->getPost('renewal_date'), 'd/m/Y', 'Y-m-d') ?? null;
|
||||||
// $data['rollover_date'] = change_date_format($this->request->getPost('rollover_date'), 'd/m/Y', 'Y-m-d') ?? null;
|
// $data['rollover_date'] = change_date_format($this->request->getPost('rollover_date'), 'd/m/Y', 'Y-m-d') ?? null;
|
||||||
|
|
||||||
$data['policy_issue_date'] = (isset($data['policy_issue_date']) && $data['policy_issue_date'] !== null && $data['policy_issue_date'] !== '')
|
// $data['policy_issue_date'] = (isset($data['policy_issue_date']) && $data['policy_issue_date'] !== null && $data['policy_issue_date'] !== '')
|
||||||
? date('d/m/Y', strtotime($data['policy_issue_date']))
|
// ? date('d/m/Y', strtotime($data['policy_issue_date']))
|
||||||
: null;
|
// : null;
|
||||||
|
|
||||||
$data['policy_start_date'] = (isset($data['policy_start_date']) && $data['policy_start_date'] !== null && $data['policy_start_date'] !== '')
|
// $data['policy_start_date'] = (isset($data['policy_start_date']) && $data['policy_start_date'] !== null && $data['policy_start_date'] !== '')
|
||||||
? date('d/m/Y', strtotime($data['policy_start_date']))
|
// ? date('d/m/Y', strtotime($data['policy_start_date']))
|
||||||
: null;
|
// : null;
|
||||||
|
|
||||||
$data['policy_end_date'] = (isset($data['policy_end_date']) && $data['policy_end_date'] !== null && $data['policy_end_date'] !== '')
|
// $data['policy_end_date'] = (isset($data['policy_end_date']) && $data['policy_end_date'] !== null && $data['policy_end_date'] !== '')
|
||||||
? date('d/m/Y', strtotime($data['policy_end_date']))
|
// ? date('d/m/Y', strtotime($data['policy_end_date']))
|
||||||
: null;
|
// : null;
|
||||||
|
|
||||||
$data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '')
|
// $data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '')
|
||||||
? date('d/m/Y', strtotime($data['renewal_date']))
|
// ? date('d/m/Y', strtotime($data['renewal_date']))
|
||||||
: null;
|
// : null;
|
||||||
|
|
||||||
$data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '')
|
// $data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '')
|
||||||
? date('d/m/Y', strtotime($data['rollover_date']))
|
// ? date('d/m/Y', strtotime($data['rollover_date']))
|
||||||
: null;
|
// : null;
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($data['policy_issue_date'])){
|
||||||
|
$data['policy_issue_date'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($data['policy_start_date'])){
|
||||||
|
$data['policy_start_date'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($data['policy_end_date'])){
|
||||||
|
$data['policy_end_date'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($data['renewal_date'])){
|
||||||
|
$data['renewal_date'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($data['rollover_date'])){
|
||||||
|
$data['rollover_date'] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Separate Insurer and TPA Branch IDs and IDs
|
// Separate Insurer and TPA Branch IDs and IDs
|
||||||
@ -275,7 +296,7 @@ class PolicyTransactionController extends BaseController
|
|||||||
|
|
||||||
// Determine $is_addon value
|
// Determine $is_addon value
|
||||||
$data['is_addon'] = in_array($data['policy_type_id'], [1, 2, 6, 7]) ? 1 :
|
$data['is_addon'] = in_array($data['policy_type_id'], [1, 2, 6, 7]) ? 1 :
|
||||||
(in_array($data['policy_type_id'], [4, 5]) ? 2 : ($data['policy_type_id'] == 3 && $data['base_policy'] ? 3 : 1));
|
(in_array($data['policy_type_id'], [4, 5]) ? 2 : ($data['policy_type_id'] == 3 && isset($data['base_policy']) ? 3 : 1));
|
||||||
|
|
||||||
// print_r($data); die;
|
// print_r($data); die;
|
||||||
|
|
||||||
@ -717,16 +738,14 @@ class PolicyTransactionController extends BaseController
|
|||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
// $data['base_policy_data'] = $this->clientPolicyModel
|
$data['base_policy_data'] = $this->clientPolicyModel
|
||||||
// ->select('client_policy.*, policy_type.policy_type')
|
->select('client_policy.*, policy_type.policy_type')
|
||||||
// ->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||||
// ->where('client_policy.client_id', $data['client_id'])
|
->where('client_policy.client_id', $data['client_id'])
|
||||||
// ->where('client_policy.client_branch_id', $data['client_branch_id'])
|
->where('client_policy.client_branch_id', $data['client_branch_id'])
|
||||||
// ->where('client_policy.policy_type_id', 2)
|
->whereIn('client_policy.policy_type_id', [2, 3])
|
||||||
// ->where('client_policy.is_active', 1)
|
->where('client_policy.is_active', 1)
|
||||||
// ->findAll();
|
->findAll();
|
||||||
|
|
||||||
$data['base_policy_data'] = $this->clientPolicyModel->getPolicyDetailsForRemainder($data['client_id']);
|
|
||||||
|
|
||||||
$data['pt_files'] = $this->PTFileModel
|
$data['pt_files'] = $this->PTFileModel
|
||||||
->join('policy_transaction', 'pt_files.pt_id = policy_transaction.id')
|
->join('policy_transaction', 'pt_files.pt_id = policy_transaction.id')
|
||||||
@ -1234,6 +1253,24 @@ class PolicyTransactionController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getBasePolicy($client_id, $client_branch_id)
|
||||||
|
{
|
||||||
|
$data = $this->clientPolicyModel
|
||||||
|
->select('client_policy.*, policy_type.policy_type')
|
||||||
|
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||||
|
->where('client_policy.client_id', $client_id)
|
||||||
|
->where('client_policy.client_branch_id', $client_branch_id)
|
||||||
|
->whereIn('client_policy.policy_type_id', [2, 3])
|
||||||
|
->where('client_policy.is_active', 1)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
if($data){
|
||||||
|
return $this->respond(['status' => true, 'data'=> $data, 'code' => 200], 200);
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => false, 'count'=> 0, 'message' => 'No Data Found', 'code' => 404], 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//get BDS Reports data
|
//get BDS Reports data
|
||||||
@ -1938,7 +1975,7 @@ class PolicyTransactionController extends BaseController
|
|||||||
//get policy docs from policy transation related tables
|
//get policy docs from policy transation related tables
|
||||||
$pt_files = $this->PTFileModel->getPolicyDriveFilesIndex($policy_id,$policy_doc_name);
|
$pt_files = $this->PTFileModel->getPolicyDriveFilesIndex($policy_id,$policy_doc_name);
|
||||||
// ~dd($this->PTFileModel->getLastQuery());
|
// ~dd($this->PTFileModel->getLastQuery());
|
||||||
// ~dd($d);
|
// ~dd($pt_files);
|
||||||
}
|
}
|
||||||
if($customer_id != "")
|
if($customer_id != "")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -105,9 +105,9 @@ class sendMailNotification
|
|||||||
$wholeData = [];
|
$wholeData = [];
|
||||||
}
|
}
|
||||||
return $wholeData;
|
return $wholeData;
|
||||||
// }else{
|
// }else{
|
||||||
// return "false";
|
// return "false";
|
||||||
// }
|
// }
|
||||||
} else if($action == 'member_ecard_mail'){
|
} else if($action == 'member_ecard_mail'){
|
||||||
|
|
||||||
$notification = $params['notification'];
|
$notification = $params['notification'];
|
||||||
@ -160,7 +160,7 @@ class sendMailNotification
|
|||||||
$client_data =$clientModel->where('id', $client_id)->first();
|
$client_data =$clientModel->where('id', $client_id)->first();
|
||||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||||
|
|
||||||
if ($notification_data['enabled'] == 1) {
|
if (isset($notification_data) && $notification_data['enabled'] == 1) {
|
||||||
$mail_content = $notification_data['mail_content'];
|
$mail_content = $notification_data['mail_content'];
|
||||||
$subject = $notification_data['subject'];
|
$subject = $notification_data['subject'];
|
||||||
$app_link = $_ENV['App_Url'];
|
$app_link = $_ENV['App_Url'];
|
||||||
@ -259,7 +259,7 @@ class sendMailNotification
|
|||||||
$client_data =$clientModel->where('id', $client_id)->first();
|
$client_data =$clientModel->where('id', $client_id)->first();
|
||||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||||
|
|
||||||
if ($notification_data['enabled'] == 1) {
|
if (isset($notification_data) && $notification_data['enabled'] == 1) {
|
||||||
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
||||||
$user_list= [];
|
$user_list= [];
|
||||||
foreach ($client_rm_data as $key => $value) {
|
foreach ($client_rm_data as $key => $value) {
|
||||||
@ -376,7 +376,7 @@ class sendMailNotification
|
|||||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||||
$clientRMModel =new ClientRMModel();
|
$clientRMModel =new ClientRMModel();
|
||||||
|
|
||||||
if ($notification_data['enabled'] == 1) {
|
if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) {
|
||||||
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
||||||
$user_list= [];
|
$user_list= [];
|
||||||
foreach ($client_rm_data as $key => $value) {
|
foreach ($client_rm_data as $key => $value) {
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
use App\Models\ClientModel;
|
use App\Models\ClientModel;
|
||||||
use App\Models\UserTeamsModel;
|
use App\Models\UserTeamsModel;
|
||||||
|
use App\Models\FileModel;
|
||||||
|
use App\Models\BatchFileModelFileModel;
|
||||||
|
use App\Controllers\GoogleDriveController;
|
||||||
|
use App\Models\BatchFileModel;
|
||||||
|
|
||||||
// File: app/Helpers/Uuid_helper.php
|
// File: app/Helpers/Uuid_helper.php
|
||||||
|
|
||||||
@ -318,6 +321,61 @@ if (!function_exists('generateRandomCode')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('excelFileGDriveUpload')) {
|
||||||
|
|
||||||
|
function excelFileGDriveUpload($file_id, $table_name) {
|
||||||
|
$doc_type = "UPLOADS";
|
||||||
|
$uploadFilePath = WRITEPATH . 'uploads/' . ($table_name == 'batch_file' ? 'import_excel' : 'excel');
|
||||||
|
|
||||||
|
$models = [
|
||||||
|
'batch_file' => [
|
||||||
|
'model' => new BatchFileModel(),
|
||||||
|
'select' => "client_id, client_policy_id, file_name"
|
||||||
|
],
|
||||||
|
'files' => [
|
||||||
|
'model' => new FileModel(),
|
||||||
|
'select' => "client_id, policy_id as client_policy_id, file_name"
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!array_key_exists($table_name, $models)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve data
|
||||||
|
$data = $models[$table_name]['model']
|
||||||
|
->select($models[$table_name]['select'])
|
||||||
|
->where('id', $file_id)
|
||||||
|
->where('is_active', 1)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($data) {
|
||||||
|
$uploadFilePath .= '/' . $data['file_name'];
|
||||||
|
// dd($data, $uploadFilePath);
|
||||||
|
|
||||||
|
$GoogleDriveController = new GoogleDriveController();
|
||||||
|
$result = $GoogleDriveController->uploadFiletoGdrive(
|
||||||
|
// client_id : $data['client_id'],
|
||||||
|
client_policy_id: $data['client_policy_id'],
|
||||||
|
doc_type : $doc_type,
|
||||||
|
file_path : $uploadFilePath,
|
||||||
|
file_name : $data['file_name']
|
||||||
|
);
|
||||||
|
|
||||||
|
// dd($result);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function numberToWords($number)
|
function numberToWords($number)
|
||||||
|
|||||||
@ -180,6 +180,8 @@
|
|||||||
"&file_name=" + item.file_name +
|
"&file_name=" + item.file_name +
|
||||||
"&client_policy_id=client_policy_id";
|
"&client_policy_id=client_policy_id";
|
||||||
|
|
||||||
|
// var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||||
|
|
||||||
// console.log('step 1')
|
// console.log('step 1')
|
||||||
|
|
||||||
if(item.file_name != null && item.file_name != ""){
|
if(item.file_name != null && item.file_name != ""){
|
||||||
@ -298,6 +300,7 @@
|
|||||||
"&client_policy_id=client_policy_id";
|
"&client_policy_id=client_policy_id";
|
||||||
|
|
||||||
|
|
||||||
|
// var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||||
|
|
||||||
// console.log("Current item:", item);
|
// console.log("Current item:", item);
|
||||||
if (item.kyc_doc_type_id == '0') {
|
if (item.kyc_doc_type_id == '0') {
|
||||||
@ -468,6 +471,9 @@
|
|||||||
"&file_name=" + item.file_name +
|
"&file_name=" + item.file_name +
|
||||||
"&client_policy_id=client_policy_id";
|
"&client_policy_id=client_policy_id";
|
||||||
|
|
||||||
|
// var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||||
|
|
||||||
|
|
||||||
if(item.kyc_doc_type_id == '0'){
|
if(item.kyc_doc_type_id == '0'){
|
||||||
table += `
|
table += `
|
||||||
<tr id="kyc-${item.id}">
|
<tr id="kyc-${item.id}">
|
||||||
@ -508,6 +514,9 @@
|
|||||||
"&file_name=" + item.file_name +
|
"&file_name=" + item.file_name +
|
||||||
"&client_policy_id=client_policy_id";
|
"&client_policy_id=client_policy_id";
|
||||||
|
|
||||||
|
// var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||||
|
|
||||||
|
|
||||||
if(item.file_name != null && item.file_name != ""){
|
if(item.file_name != null && item.file_name != ""){
|
||||||
// console.log('step 2')
|
// console.log('step 2')
|
||||||
|
|
||||||
|
|||||||
@ -2864,9 +2864,9 @@ $('#policy_status').change(function(){
|
|||||||
|
|
||||||
if(client_id && client_branch_id){
|
if(client_id && client_branch_id){
|
||||||
|
|
||||||
var url_for_get_policy_type_list = '<?php echo base_url('util/get_policy_type_for_base_policy/') ?>' + client_id + '/' + client_branch_id;
|
var url_for_get_policy_type_list = '<?php echo base_url('util/base_policy_for_policy_inception/') ?>' + client_id + '/' + client_branch_id;
|
||||||
$.get(url_for_get_policy_type_list, function(response){
|
$.get(url_for_get_policy_type_list, function(response){
|
||||||
console.log('get_policy_type_for_base_policy response', response)
|
console.log('base_policy_for_policy_inception response', response)
|
||||||
appendBasePolicyList(response.data);
|
appendBasePolicyList(response.data);
|
||||||
}).fail(function(xhr, status, error) {
|
}).fail(function(xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user