From ecec25490b72c5c9a541f89bd89a05140f39bbda Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 10 Jan 2025 17:24:57 +0530 Subject: [PATCH 1/2] CHANGE_BATCH_FILE_LIST_QUERY_CHANGES : RV --- app/Controllers/EmployeeController.php | 46 ++++++++++++++++++++------ 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index bbdabd87..b031e487 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -335,20 +335,46 @@ class EmployeeController extends AdminController ->find(); // dd($data['fileList']); - $data['batch_list'] = $this->batchFileModel->select( - 'batch_files.*, + $data['batch_list'] = $this->batchFileModel->select(" + + batch_files.id, + batch_files.client_id, + batch_files.client_policy_id, + batch_files.batch_code, + batch_files.file_name, + batch_files.insurer_or_tpa, + batch_files.event_type, + batch_files.actions, + batch_files.count, + batch_files.created_by, + batch_files.created_at, + batch_files.updated_by, + batch_files.updated_at, + batch_files.is_active, + batch_files.amount, + batch_files.status, + batch_files.client_branch_id, + + CASE + WHEN batch_files.status = 'partially success' THEN + batch_files.error_data + ELSE + error_data = null + END AS error_data, + 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('policy_type', 'policy_type.id = client_policy.policy_type_id') - ->join('clients', 'clients.id = client_policy.client_id') - ->orderBy('batch_files.id', 'desc') - ->limit(100) - ->find(); + + ") + ->join('client_policy', 'client_policy.id = batch_files.client_policy_id') + ->join('client_branch', 'client_branch.id = batch_files.client_branch_id') + ->join('policy_type', 'policy_type.id = client_policy.policy_type_id') + ->join('clients', 'clients.id = client_policy.client_id') + ->orderBy('batch_files.id', 'desc') + ->limit(100) + ->find(); // dd($data['fileList']);die(); From e5dedf86c6bb9d7acc149394e627a37eebc3991f Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 11 Jan 2025 15:50:16 +0530 Subject: [PATCH 2/2] CHANGE_EXPORT_CD_TRANS_CHECK_CD_AC_PK :RV --- app/Controllers/EmpDataServiceController.php | 23 +++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index ae04f357..fa3d4378 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -157,7 +157,14 @@ class EmpDataServiceController extends BaseController return 5; } - $cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->orderBy('id', 'DESC')->first(); + $cash_balance = $this->clientDepositModel + ->where('cd_ac_pk', $policy_details['cd_ac_pk']) + // ->where('cd_ac_no', $policy_details['cd_ac_no']) + ->where('is_active', 1) + ->orderBy('id', 'DESC') + ->first(); + + // dd(db_connect()->getLastQuery(), $cash_balance); if ($cash_balance == null) { $balance = $this->CDMasterModel @@ -647,7 +654,12 @@ class EmpDataServiceController extends BaseController return 1; } - $cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->orderBy('id', 'DESC')->first(); + $cash_balance = $this->clientDepositModel + ->where('cd_ac_pk', $policy_details['cd_ac_pk']) + // ->where('cd_ac_no', $policy_details['cd_ac_no']) + ->where('is_active', 1) + ->orderBy('id', 'DESC') + ->first(); if ($cash_balance == null) { @@ -952,7 +964,12 @@ class EmpDataServiceController extends BaseController return 5; } - $cash_balance = $this->clientDepositModel->where('cd_ac_no', $policy_details['cd_ac_no'])->orderBy('id', 'DESC')->first(); + $cash_balance = $this->clientDepositModel + ->where('cd_ac_pk', $policy_details['cd_ac_pk']) + // ->where('cd_ac_no', $policy_details['cd_ac_no']) + ->where('is_active', 1) + ->orderBy('id', 'DESC') + ->first(); if ($cash_balance == null) { $balance = $this->CDMasterModel