From be69492e80503a35bb1b76066d6dd17ae798d700 Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Thu, 6 Jun 2024 17:19:51 +0530 Subject: [PATCH 1/8] CHANGE_OAUTH_ISSUE : AADHAVAN --- app/Controllers/UserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index 184cbefa..f654dc40 100644 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -71,7 +71,8 @@ class UserController extends AdminController $admin = 0; } foreach ($temp_team as $key => $value) { - if($value == 2){ + $team = $this->teamModel->where('id' , $value)->first(); + if($team['name'] == 'Claims'){ $hdz_staff = [ 'emp_code' => $userData['emp_code'], 'fullname' => $userData['first_name'], From 88b0a8c5ad2010b032748469bc093b3dac42709e Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 27 Jun 2024 14:35:46 +0530 Subject: [PATCH 2/8] FIX_CLIENT_CHANGES_RACT_RATE_CD_TRANCTION_POLICY_NO_AND_OTHERS : RV --- app/Controllers/ClientController.php | 7 +- app/Controllers/EmployeeController.php | 15 ++- app/Models/ClientModel.php | 21 ++- app/Models/ClientPolicyModel.php | 3 +- app/Models/EmployeePolicyModel.php | 17 ++- app/Views/UserList.php | 15 +-- app/Views/batch_list.php | 22 ++-- app/Views/client_policy.php | 49 ++++--- app/Views/employee_data_list.php | 2 +- app/Views/employee_list.php | 2 +- app/Views/employee_upload.php | 3 +- app/Views/endorsement_list.php | 6 +- app/Views/file_list.php | 6 +- app/Views/insurer_or_tpa_data.php | 2 +- app/Views/policy_grid.php | 172 ++++++++++++++----------- app/Views/policy_grid_excel.php | 10 +- app/Views/view_deposit.php | 141 +++++++++++--------- 17 files changed, 297 insertions(+), 196 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 01f35d7c..185ff9ce 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -217,11 +217,13 @@ class ClientController extends AdminController // 3 => 'Refund', // 4 => 'Debit', // ]; + $subTypeOptions = [ 1 => 'Replenishment', 2 => 'Adjustment', 3 => 'Refund From Deletion', 4 => 'Debit', + 5 => 'Asset Policy', ]; $data['subTypeOptions'] = $subTypeOptions; @@ -660,6 +662,7 @@ class ClientController extends AdminController $data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1; $data['client_branch_id'] = $this->request->getPost('client_branch_id'); $data['cd_ac_no'] = $this->request->getPost('cd_ac_no'); + $data['gst'] = $this->request->getPost('gst'); @@ -756,9 +759,9 @@ class ClientController extends AdminController $data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1; $data['client_branch_id'] = $this->request->getPost('client_branch_id'); $data['cd_ac_no'] = $this->request->getPost('cd_ac_no'); + $data['gst'] = $this->request->getPost('gst'); - - + $policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first(); if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) { diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index ae32b9a4..ec8467e6 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -268,22 +268,33 @@ class EmployeeController extends AdminController '(SELECT SUM(ep.rata_premimum) + SUM(ep.gst) FROM employees e JOIN employee_polices ep ON e.id = ep.employee_id - WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as total' + WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as total', + 'policy_type.policy_type' , + 'cp.policy_no' , ]) ->join('user_profiles up', 'files.created_by = up.id') ->join('client_policy cp', 'files.policy_id = cp.id', 'left') ->join('client_branch cb', 'files.client_branch_id = cb.id', 'left') ->join('policies pm', 'cp.policy_id = pm.id', 'left') + ->join('policy_type', 'policy_type.id = pm.policy_type_id') ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left') ->where('files.created_by', get_session_userid()) ->orderBy('files.created_at', 'desc') ->findAll(); // dd($data['fileList']); - $data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name, client_branch.branch_name') + $data['batch_list'] = $this->batchFileModel->select( + 'batch_files.*, + policies.name as policy_name, + clients.short_name as client_short_name, + client_branch.branch_name, + client_policy.policy_no, + policy_type.policy_type + ') ->join('client_policy', 'client_policy.id = batch_files.client_policy_id') ->join('client_branch', 'client_branch.id = batch_files.client_branch_id') ->join('policies', 'policies.id = client_policy.policy_id') + ->join('policy_type', 'policy_type.id = policies.policy_type_id') ->join('clients', 'clients.id = client_policy.client_id') ->orderBy('batch_files.id', 'desc') ->findAll(); diff --git a/app/Models/ClientModel.php b/app/Models/ClientModel.php index fd1e8510..b6c81833 100644 --- a/app/Models/ClientModel.php +++ b/app/Models/ClientModel.php @@ -36,9 +36,25 @@ class ClientModel extends Model //get client and its associated policies in same array public function clientsWithPolicies() { + + $role_id = get_role_id(); + $user_id = get_session_userid(); + + $columns = ['clients.id ', 'client_name','short_name']; + $clients = $this->select($columns) + ->where('is_active',1) + ->findAll(); + + if($role_id == 2 || $role_id == 3){ + + $clients = $this->select($columns) + ->join('client_rm', 'client_rm.client_id = clients.id') + ->where('client_rm.user_id', $user_id) + ->where('clients.is_active',1) + ->findAll(); + } - $columns = ['id', 'client_name','short_name']; - $clients = $this->select($columns)->where('is_active',1)->findAll(); + foreach ($clients as &$client) { $clientPolicyModel = new ClientPolicyModel(); @@ -51,6 +67,7 @@ class ClientModel extends Model 'client_branch.client_id', 'client_policy.id as client_policy_id', 'client_policy.policy_terms', + 'client_policy.policy_no', 'p.name', 'pt.policy_type', ]) diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index a69cf852..8d2af103 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -43,7 +43,8 @@ class ClientPolicyModel extends Model "reason_for_exit", "policy_no", "client_branch_id", - "cd_ac_no" + "cd_ac_no", + "gst", ]; public function getClientPolicyById($id){ diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 15bf295d..160eb71e 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -100,11 +100,14 @@ class EmployeePolicyModel extends Model 'emp.gender', 'emp.emp_status', 'emp.is_active as emp_is_active', - 'emp.mobile as mobile' + 'emp.mobile as mobile', + 'policy_type.policy_type', + 'cp.policy_no', ]) ->join('employees emp', 'employee_polices.employee_id = emp.id') ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy ->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master + ->join('policy_type', 'policy_type.id = pm.policy_type_id') ->join('insurers im', 'cp.insurer_id = im.id') //im - insurer master ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurer branch ->join('tpa tpam', 'cp.tpa_id = tpam.id', 'left') //tpam - tpa master @@ -702,7 +705,9 @@ class EmployeePolicyModel extends Model e.endorsement_id, ep.client_policy_id, policies.name as policy_name, - insurers.short_name as insurer_short_name + insurers.short_name as insurer_short_name, + client_policy.policy_no, + policy_type.policy_type '); $query1->distinct(); $query1->join('employee_polices ep', 'ep.id = e.pk'); @@ -710,6 +715,7 @@ class EmployeePolicyModel extends Model $query1->join('client_policy', 'client_policy.id = ep.client_policy_id'); $query1->join('client_branch', 'client_branch.id = employees.client_branch_id'); $query1->join('policies', 'policies.id = client_policy.policy_id'); + $query1->join('policy_type', 'policy_type.id = policies.policy_type_id'); $query1->join('insurers', 'insurers.id = policies.insurer_id'); $query1->whereIn('e.actions', ['c']); $query1->where('ep.client_policy_id', $policy_id); @@ -736,18 +742,21 @@ class EmployeePolicyModel extends Model e.remarks, ep.client_policy_id, policies.name as policy_name, - insurers.short_name as insurer_short_name + insurers.short_name as insurer_short_name, + client_policy.policy_no, + policy_type.policy_type '); $query2->join('employee_polices ep', 'ep.id = e.pk'); $query2->join('employees', 'employees.id = ep.employee_id'); $query2->join('client_policy', 'client_policy.id = ep.client_policy_id'); $query2->join('client_branch', 'client_branch.id = employees.client_branch_id'); $query2->join('policies', 'policies.id = client_policy.policy_id'); + $query2->join('policy_type', 'policy_type.id = policies.policy_type_id'); $query2->join('insurers', 'insurers.id = policies.insurer_id'); $query2->whereIn('e.actions', ['si', 'd']); $query2->where('ep.client_policy_id', $policy_id); $query2->where('employees.client_id', $client_id); - $query1->where('employees.client_branch_id', $branch_id); + $query2->where('employees.client_branch_id', $branch_id); if($status != 0 && !empty($status)){ $query2->where('e.status', $status); diff --git a/app/Views/UserList.php b/app/Views/UserList.php index c1794990..e53e341d 100644 --- a/app/Views/UserList.php +++ b/app/Views/UserList.php @@ -269,20 +269,19 @@ $(document).ready(function () { $('body').on('click', '.btnDelete', function () { Swal.fire({ - title: "Are you sure?", - text: "You won't be able to revert this!", - icon: "warning", - showCancelButton: true, - confirmButtonColor: "#3085d6", - cancelButtonColor: "#d33", - confirmButtonText: "Yes, delete it!" + title: "Are you sure?", + text: "You need to remove this user", + icon: "info", + showCancelButton: true, + confirmButtonColor: "#3085d6", + confirmButtonText: "Yes", }).then((result) => { if (result.isConfirmed) { var student_id = $(this).attr('data-id'); $.get(''+student_id, function (data) { console.log(data); - // $('#tickets-table tbody #'+ student_id).remove(); + toastr.success('User removed successfully', 'success'); window.location.reload() }) } diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 0b28f477..a909008c 100644 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -6,6 +6,13 @@ .reload:hover { cursor: pointer; } + +.truncate { + max-width: 80px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +}
@@ -22,13 +29,13 @@ SNO - Batch
Code + Batch Code File Name Client - Client
Branch + Client Branch Client Policy - Event
Type - Insurer/
TPA + Event Type + Insurer/ TPA Action Count (₹)Amount @@ -46,13 +53,12 @@ - - + + - + - - diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 611fadd3..7ef31b9e 100644 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -130,6 +130,12 @@
+ +
+ + +
+
- +
@@ -110,7 +110,7 @@ - + @@ -326,7 +326,7 @@ $.each(data, function(index, item) { var option = $(' - + - + diff --git a/app/Views/insurer_or_tpa_data.php b/app/Views/insurer_or_tpa_data.php index c068ec39..15b70b51 100644 --- a/app/Views/insurer_or_tpa_data.php +++ b/app/Views/insurer_or_tpa_data.php @@ -415,7 +415,7 @@ $.each(data, function(index, item) { var option = $('
SNO
( ) - -
+ + - - ' . $file['first_name'] . '' ?>