From db7697d13f83c7256c2fd34c7d79c356edf3cd67 Mon Sep 17 00:00:00 2001 From: Smart Date: Mon, 7 Oct 2024 08:56:18 +0530 Subject: [PATCH 1/5] CHANGE_added is_active condition for mobile no verification api : GWM --- app/Controllers/RestAuthenticationController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index b313789e..d4256270 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -71,7 +71,9 @@ class RestAuthenticationController extends AdminController $mobile_number = $this->request->getJSON()->mobile_number; - $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + $employeeData = $this->employeeModel->where('mobile', $mobile_number) + ->where('relationship', 'self') + ->where('is_active', 1)->first(); if ($employeeData) { @@ -126,7 +128,9 @@ class RestAuthenticationController extends AdminController try { $mobile_number = $this->request->getJSON()->mobile_number; - $HrData = $this->hrModel->where('mobile', $mobile_number)->where('contact_type', 'client')->first(); + $HrData = $this->hrModel->where('mobile', $mobile_number) + ->where('contact_type', 'client') + ->where('is_active', 1)->first(); if ($HrData) { From a9ea4e2031e920a8fff2adac5e32dea74ede34a6 Mon Sep 17 00:00:00 2001 From: Smart Date: Mon, 7 Oct 2024 12:24:37 +0530 Subject: [PATCH 2/5] =?UTF-8?q?CHANGE=5Fin=20=1B[200~=20=20=20=20public=20?= =?UTF-8?q?function=20FloterNotesConvertion(){?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/EmployeeRestController.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index e6aca562..79a02293 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1463,15 +1463,13 @@ class EmployeeRestController extends AdminController $result = 'Can Add Self '; }else if($value != 0 && $key ==='childrens') { if($value > 1){ $result .= ' + '.$value.' Children'; }else{ $result .= ' + '.$value.' Child'; } + }else if($value != 0 && $key ==='parents'){ + if($value > 1){ $result .= ' + '.$value.' Parents'; }else{ $result .= ' + '.$value.' Parent'; } + }else if($value != 0 && $key ==='parents-in-law'){ + if($value > 1){ $result .= ' + '.$value.' Parent in law'; }else{ $result .= ' + '.$value.' Parents in law'; } }else if($value != 0 && $key ==='elders_count') { - }else{ - $string = str_replace('-', ' ', $key); - $string = ucwords($string); - $result .= ' + '.$value.' '.$string; } - - } } From 40fd8ba4ae302b17576e6bcd0dc8b5f0ea121291 Mon Sep 17 00:00:00 2001 From: Smart Date: Mon, 7 Oct 2024 12:29:14 +0530 Subject: [PATCH 3/5] CHANGE_in FloterNotesConvertion --- app/Controllers/EmployeeRestController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 79a02293..aba83570 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1453,7 +1453,7 @@ class EmployeeRestController extends AdminController if ($value > 0) { if($value == 1 && $key ==='either-parents-pil') { $result .= ' + Either 2 Parents or 2 Parents in law'; - }if($value == 2 && $key ==='either-parents-pil') { + }else if($value == 2 && $key ==='either-parents-pil') { $result .= ' + Any 2 of Parents and Parents in law'; }else if($value != 0 && $key ==='spouse') { $string = str_replace('-', ' ', $key); @@ -1463,13 +1463,15 @@ class EmployeeRestController extends AdminController $result = 'Can Add Self '; }else if($value != 0 && $key ==='childrens') { if($value > 1){ $result .= ' + '.$value.' Children'; }else{ $result .= ' + '.$value.' Child'; } - }else if($value != 0 && $key ==='parents'){ - if($value > 1){ $result .= ' + '.$value.' Parents'; }else{ $result .= ' + '.$value.' Parent'; } - }else if($value != 0 && $key ==='parents-in-law'){ - if($value > 1){ $result .= ' + '.$value.' Parent in law'; }else{ $result .= ' + '.$value.' Parents in law'; } }else if($value != 0 && $key ==='elders_count') { + }else{ + $string = str_replace('-', ' ', $key); + $string = ucwords($string); + $result .= ' + '.$value.' '.$string; } + + } } From 6cfbf363bce83754a1ee307e31f72e261d555719 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 7 Oct 2024 17:42:14 +0530 Subject: [PATCH 4/5] FEAT_VEHICAL_MASTER_PAGES_AND_OTHERS : RV --- app/Config/Routes.php | 6 + app/Controllers/ClientController.php | 79 +- app/Controllers/MasterController.php | 62 ++ app/Models/VehicleModel.php | 22 + app/Views/layout/header.php | 6 + .../policy_transaction_endorsement_list.php | 3 +- .../policy_transaction_inception_list.php | 3 +- app/Views/report_bds.php | 3 +- app/Views/vehicle_master_list.php | 812 ++++++++++++++++++ 9 files changed, 971 insertions(+), 25 deletions(-) create mode 100644 app/Views/vehicle_master_list.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e2c4773c..eb09ded0 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -241,6 +241,12 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { $routes->get("list/(:any)", "MasterController::getCDMasterDataByID/$1"); $routes->get("remove/(:any)", "MasterController::removeCDMaster/$1"); }); + + $routes->group("vehicle", ["filter" => "authMVC"], function ($routes) { + $routes->get("list", "MasterController::VehicleMasterList"); + $routes->get("list/(:any)", "MasterController::getVehicleMasterDataByID/$1"); + $routes->get("remove/(:any)", "MasterController::deactiveVehicleData/$1"); + }); }); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 07512fc2..586665eb 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -866,18 +866,19 @@ class ClientController extends AdminController $data['cd_ac_no'] = $this->request->getPost('cd_ac_no'); $data['gst'] = $this->request->getPost('gst'); + if($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7){ - $data['is_addon'] = 1; + $data['is_addon'] = 1; // Base Policy }else if($policy_type_id == 4 || $policy_type_id == 5){ - $data['is_addon'] = 2; + $data['is_addon'] = 2; // SI TOPUP }else if($policy_type_id == 3){ if($base_policy){ - $data['is_addon'] = 3; + $data['is_addon'] = 3; // Dependent Addon }else{ $data['is_addon'] = 1; } @@ -952,6 +953,8 @@ class ClientController extends AdminController $id = $this->request->getPost('PrimaryKey'); $client_id = $this->request->getPost('client_id'); $policy_type_id = $this->request->getPost('policy_type_id'); + $base_policy = $this->request->getPost('base_policy'); + $insurerValue = (string) $this->request->getPost('insurer'); list($insurerBranchId, $insurerId) = explode('-', $insurerValue); @@ -1002,17 +1005,34 @@ class ClientController extends AdminController $data['reminder_date'] = null; } - if($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 3 || $policy_type_id == 6 || $policy_type_id == 7){ + // if($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 3 || $policy_type_id == 6 || $policy_type_id == 7){ - $data['is_addon'] = 1; + // $data['is_addon'] = 1; - }else if($policy_type_id == 4){ + // }else if($policy_type_id == 4){ - $data['is_addon'] = 2; + // $data['is_addon'] = 2; - }else if($policy_type_id == 5){ + // }else if($policy_type_id == 5){ - $data['is_addon'] = 3; + // $data['is_addon'] = 3; + // } + + if($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7){ + + $data['is_addon'] = 1; // Base Policy + + }else if($policy_type_id == 4 || $policy_type_id == 5){ + + $data['is_addon'] = 2; // SI TOPUP + + }else if($policy_type_id == 3){ + + if($base_policy){ + $data['is_addon'] = 3; // Dependent Addon + }else{ + $data['is_addon'] = 1; + } } @@ -3261,6 +3281,7 @@ class ClientController extends AdminController return $this->respond([ 'status' => true, + 'data' => $postData, 'client_id' => $client_insert, 'branch_id' => $branch_insert ?? null, 'message' => 'Client created successfully' @@ -3270,22 +3291,36 @@ class ClientController extends AdminController public function createVehicleWithMinimalData() { $data = $this->request->getPost(); + $id = $this->request->getPost('vehicle_primary_key'); - $vehicle_insert = $this->vehicleModel->insert($data); + if($id){ + + $vehicle_update = $this->vehicleModel->where('id', $id)->set($data)->update(); + + if($vehicle_update){ + return $this->respond(['status' => true, 'message' => 'Vehicle details updated successfully'], 200); + }else{ + return $this->respond(['status' => false, 'message' => 'Failed to update vehicle details'], 200); + } - if($vehicle_insert){ - $vehicles = $this->vehicleModel->where('is_active', 1)->findAll(); - return $this->respond([ - 'status' => true, - 'vehicle_id' => $vehicle_insert, - 'owner_id' => $data['owner'], - 'owner_branch_id' => $data['branch_id'], - 'owner_type' => $data['Owner_type'], - 'vehicles' => $vehicles, - 'message' => 'Vehicle created successfully - '], 200); }else{ - return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200); + + $vehicle_insert = $this->vehicleModel->insert($data); + + if($vehicle_insert){ + $vehicles = $this->vehicleModel->where('is_active', 1)->findAll(); + return $this->respond([ + 'status' => true, + 'vehicle_id' => $vehicle_insert, + 'owner_id' => $data['owner'], + 'owner_branch_id' => $data['branch_id'] ?? null, + 'owner_type' => $data['Owner_type'], + 'vehicles' => $vehicles, + 'message' => 'Vehicle created successfully + '], 200); + }else{ + return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200); + } } } diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index aa1fcd06..2779a509 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -32,6 +32,7 @@ use App\Models\CDMasterModel; use App\Models\ClientDepositModel; use App\Models\InsurerExcelExportTemplateModel; use App\Models\SettingsModel; +use App\Models\VehicleModel; class MasterController extends AdminController { @@ -57,6 +58,7 @@ class MasterController extends AdminController protected $clientDepositModel; protected $insurerTemplateModel; protected $cli_colors; + protected $vehicleModel; @@ -85,6 +87,7 @@ class MasterController extends AdminController $this->clientModel = new ClientModel(); $this->clientDepositModel = new ClientDepositModel(); $this->insurerTemplateModel = new InsurerExcelExportTemplateModel(); + $this->vehicleModel = new VehicleModel(); $this->cli_colors = [ 'red' => "\033[31m", 'green' => "\033[32m", @@ -1395,6 +1398,65 @@ class MasterController extends AdminController } + //Vehicle Master data Function + + public function VehicleMasterList() + { + $data['page_name'] = 'Vehicle Master List'; + $data['vehicle_type'] = [ + 'two_wheeler' => 'Two Wheeler', + 'four_wheeler' => 'Four Wheeler', + 'truck' => 'Truck', + 'bus' => 'Bus', + 'van' => 'Van', + 'suv' => 'SUV', + 'motorcycle' => 'Motorcycle', + 'bicycle' => 'Bicycle' + ]; + $data['vehicle_des'] = [ + 'commercial' => 'Commercial', + 'private' => 'Private', + ]; + $data['entity'] = $this->kycEntityTypeModel->where('is_active', 1)->findAll(); + $data['clients'] = $this->clientModel->where('is_active', 1)->findAll(); + $data['vehicle_Master_Data'] = $this->vehicleModel->getVehicleMasterList(); + $this->loadLayout('vehicle_master_list', $data); + } + + public function getVehicleMasterDataByID($id = null) + { + $vehicle_data = $this->vehicleModel + ->select('vehicle.*, clients.client_type') + ->join('clients', 'vehicle.owner = clients.id') + ->where('vehicle.id', $id) + ->where('vehicle.is_active', 1) + ->first(); + + if ($vehicle_data) { + return $this->respond(['status' => true, 'code' => 200, 'data' => $vehicle_data], 200); + } else { + return $this->respond(['status' => false, 'code' => 404], 200); + } + } + + public function deactiveVehicleData($id) + { + + $this->myLogger->logme('error','deactiveVehicleData function called'); + + $data['updated_by'] = get_session_userid(); + $data['is_active'] = 0; + + $update = $this->vehicleModel->where('id', $id)->set($data)->update(); + + if($update){ + return $this->respond(['status' => true,'code' => 200], 200); + }else{ + return $this->respond(['status' => false,'code' => 404], 200); + } + } + + //excel export template public function createExcelTemplate() { diff --git a/app/Models/VehicleModel.php b/app/Models/VehicleModel.php index d1f9cb4c..dda3af1c 100644 --- a/app/Models/VehicleModel.php +++ b/app/Models/VehicleModel.php @@ -61,4 +61,26 @@ class VehicleModel extends Model return $data; } + public function getVehicleMasterList(){ + + return $this->db->table('vehicle') + ->select(" + vehicle.*, + CASE + WHEN clients.client_type = 1 THEN 'Group' + WHEN clients.client_type = 2 THEN 'Individual' + ELSE '-' + END AS owner_type, + clients.client_name as owner_name, + client_branch.branch_name as owner_branch + ") + ->join('clients', 'vehicle.owner = clients.id') + ->join('client_branch', 'vehicle.branch_id = client_branch.id', 'left') + ->where('vehicle.is_active', 1) + ->orderBy('vehicle.id', 'desc') + ->get() + ->getResultArray(); + + } + } diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 6f7dcf21..88f3ad4b 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -610,6 +610,9 @@
  • CD Master
  • +
  • + Vehicle Master +
  • Users
  • @@ -697,6 +700,9 @@
  • CD Master
  • +
  • + Vehicle Master +
  • Documents
  • diff --git a/app/Views/policy_transaction_endorsement_list.php b/app/Views/policy_transaction_endorsement_list.php index 6d133613..4c5ddef6 100644 --- a/app/Views/policy_transaction_endorsement_list.php +++ b/app/Views/policy_transaction_endorsement_list.php @@ -175,7 +175,7 @@ table.dataTable thead th { -
    +
    @@ -276,6 +276,7 @@ table.dataTable thead th { if (ticketsTable.length) { ticketsTable.DataTable({ + scrollX: true, dom: "<'row'<'col-sm-6'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 diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index 2f8a4885..37cd6cec 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -243,7 +243,7 @@ table.dataTable tbody td { -
    +
    @@ -415,6 +415,7 @@ $(document).ready(function() { if (ticketsTable.length) { ticketsTable.DataTable({ + scrollX: true, dom: "<'row'<'col-sm-6'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 diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index a0f075c9..0caa9383 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -31,7 +31,7 @@ table.dataTable tbody td { -
    +
    @@ -148,6 +148,7 @@ $(document).ready(function() { 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 diff --git a/app/Views/vehicle_master_list.php b/app/Views/vehicle_master_list.php new file mode 100644 index 00000000..84f27a83 --- /dev/null +++ b/app/Views/vehicle_master_list.php @@ -0,0 +1,812 @@ + + +
    +
    +
    +
    +
    +
    +

    Vehicle Master List

    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + $row){ ?> + + + + + + + + + + + + +
    S.No.Owner TypeOwner NameRC Book NoVehicle NoVehicle typeDescriptionAction
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 094e1fbb1a39f6170397b4b8800981c2b89d0009 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 8 Oct 2024 10:37:29 +0530 Subject: [PATCH 5/5] FIX_LIVE_ISSUE : RV --- app/Config/Routes.php | 1 + app/Controllers/EmpDataServiceController.php | 5 + app/Controllers/EmployeeController.php | 4 + .../PolicyTransactionController.php | 91 +++++++++++++------ app/Helpers/sendMailNotification.php | 12 +-- app/Helpers/utility_helper.php | 60 +++++++++++- app/Views/client_kyc.php | 9 ++ .../policy_transaction_inception_form.php | 4 +- 8 files changed, 150 insertions(+), 36 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index eb09ded0..dd81efc5 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -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_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("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1"); }); diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 3fef51e0..4ea1ce46 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -1811,6 +1811,11 @@ class EmpDataServiceController extends BaseController $file_data = $this->getDataByFileId($file_id, 'success'); $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; } diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 38ead2cf..1df4dc16 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -148,6 +148,10 @@ class EmployeeController extends AdminController public function employeesUplodWithEvents() { + // $empDataServiceController = new EmpDataServiceController(); + // !dd($empDataServiceController->importInceptionUpdateTPAandUHID(['file_id' => 79])); + + // $job_details = new Jobs(); // $r = Jobs::addJob(['job_name' => 'add','payload' => ['a' => 10, 'b' => 35]]); // print_r($r);//die(); diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 62e7e626..c927ac44 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -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['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'] !== '') - ? date('d/m/Y', strtotime($data['policy_issue_date'])) - : null; + // $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'])) + // : null; - $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'])) - : null; + // $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'])) + // : null; - $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'])) - : null; + // $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'])) + // : null; - $data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '') - ? date('d/m/Y', strtotime($data['renewal_date'])) - : null; + // $data['renewal_date'] = (isset($data['renewal_date']) && $data['renewal_date'] !== null && $data['renewal_date'] !== '') + // ? date('d/m/Y', strtotime($data['renewal_date'])) + // : null; - $data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '') - ? date('d/m/Y', strtotime($data['rollover_date'])) - : null; + // $data['rollover_date'] = (isset($data['rollover_date']) && $data['rollover_date'] !== null && $data['rollover_date'] !== '') + // ? date('d/m/Y', strtotime($data['rollover_date'])) + // : 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 @@ -275,7 +296,7 @@ class PolicyTransactionController extends BaseController // Determine $is_addon value $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; @@ -717,16 +738,14 @@ class PolicyTransactionController extends BaseController ->findAll(); - // $data['base_policy_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', $data['client_id']) - // ->where('client_policy.client_branch_id', $data['client_branch_id']) - // ->where('client_policy.policy_type_id', 2) - // ->where('client_policy.is_active', 1) - // ->findAll(); - - $data['base_policy_data'] = $this->clientPolicyModel->getPolicyDetailsForRemainder($data['client_id']); + $data['base_policy_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', $data['client_id']) + ->where('client_policy.client_branch_id', $data['client_branch_id']) + ->whereIn('client_policy.policy_type_id', [2, 3]) + ->where('client_policy.is_active', 1) + ->findAll(); $data['pt_files'] = $this->PTFileModel ->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 @@ -1938,7 +1975,7 @@ class PolicyTransactionController extends BaseController //get policy docs from policy transation related tables $pt_files = $this->PTFileModel->getPolicyDriveFilesIndex($policy_id,$policy_doc_name); // ~dd($this->PTFileModel->getLastQuery()); - // ~dd($d); + // ~dd($pt_files); } if($customer_id != "") { diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 7b8fc5c8..311ccd47 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -105,9 +105,9 @@ class sendMailNotification $wholeData = []; } return $wholeData; - // }else{ - // return "false"; - // } + // }else{ + // return "false"; + // } } else if($action == 'member_ecard_mail'){ $notification = $params['notification']; @@ -160,7 +160,7 @@ class sendMailNotification $client_data =$clientModel->where('id', $client_id)->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']; $subject = $notification_data['subject']; $app_link = $_ENV['App_Url']; @@ -259,7 +259,7 @@ class sendMailNotification $client_data =$clientModel->where('id', $client_id)->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(); $user_list= []; 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(); $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(); $user_list= []; foreach ($client_rm_data as $key => $value) { diff --git a/app/Helpers/utility_helper.php b/app/Helpers/utility_helper.php index ab40178e..e0e8ef06 100755 --- a/app/Helpers/utility_helper.php +++ b/app/Helpers/utility_helper.php @@ -1,7 +1,10 @@ [ + '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) diff --git a/app/Views/client_kyc.php b/app/Views/client_kyc.php index 44c2badd..995dd16f 100755 --- a/app/Views/client_kyc.php +++ b/app/Views/client_kyc.php @@ -180,6 +180,8 @@ "&file_name=" + item.file_name + "&client_policy_id=client_policy_id"; + // var url = '' + item.file_name; + // console.log('step 1') if(item.file_name != null && item.file_name != ""){ @@ -298,6 +300,7 @@ "&client_policy_id=client_policy_id"; + // var url = '' + item.file_name; // console.log("Current item:", item); if (item.kyc_doc_type_id == '0') { @@ -468,6 +471,9 @@ "&file_name=" + item.file_name + "&client_policy_id=client_policy_id"; + // var url = '' + item.file_name; + + if(item.kyc_doc_type_id == '0'){ table += ` @@ -508,6 +514,9 @@ "&file_name=" + item.file_name + "&client_policy_id=client_policy_id"; + // var url = '' + item.file_name; + + if(item.file_name != null && item.file_name != ""){ // console.log('step 2') diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 76d12b85..536580c3 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -2864,9 +2864,9 @@ $('#policy_status').change(function(){ if(client_id && client_branch_id){ - var url_for_get_policy_type_list = '' + client_id + '/' + client_branch_id; + var url_for_get_policy_type_list = '' + client_id + '/' + client_branch_id; $.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); }).fail(function(xhr, status, error) { console.error(xhr.responseText);