diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 7b42c29a..0670bca5 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -323,8 +323,8 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get("test_mail", "MasterController::testGmailAPI"); $routes->post("test_mail", "MasterController::testGmailAPI"); $routes->get("check_policy_no/(:any)", "ClientController::check_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", "ClientController::get_client_policy_data_using_policy_no"); + $routes->get("get_client_policy_data_using_policy_no_and_endo_no", "ClientController::get_client_policy_data_using_policy_no_and_endo_no"); $routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1"); $routes->get("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1"); $routes->get("sentTestMail/(:any)", "NotificationController::sentTestMail/$1"); @@ -362,7 +362,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { $routes->group("inception", ["filter" => "authMVC"], function ($routes) { - $routes->get("list", "PolicyTransactionController::viewInception"); + $routes->match(['get', 'post'], 'list', 'PolicyTransactionController::viewInception'); $routes->post("create", "PolicyTransactionController::createInceptionPolicy"); $routes->get("list/(:any)", "PolicyTransactionController::getInceptionDataForEdit/$1"); $routes->get("remove/(:any)", "PolicyTransactionController::removeCDMaster/$1"); @@ -536,7 +536,8 @@ $routes->group("/bdsReport", ["filter" => "authMVC"], function ($routes) { $routes->get('insurer_wise_data/(:any)','BDSReportController::Insurer_wise_Data/$1'); $routes->get('bap_wise_data/(:any)','BDSReportController::Bap_Wise_Data/$1'); $routes->match( ['get', 'post'], 'renewal_report','BDSReportController::renewalReport'); - + $routes->get('getTATReport','BDSReportController::bdsTATReport'); + $routes->get("getMultiReport/(:any)", "BDSReportController::getMultiReport/$1"); }); //New Tickets @@ -554,6 +555,7 @@ $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) { $routes->match( ['get', 'post'], 'ticket_reports','TicketController::ticketReports'); $routes->post('getPolicyStartDate','TicketController::getPolicyStartDate'); $routes->post("getPoliciesbyEmpID","TicketController::getPoliciesbyEmpID"); + $routes->post("getMoreInfo","TicketController::getMoreInfo"); // $routes->post('ticket_messages','TicketController::getTicketMessage'); }); diff --git a/app/Controllers/BDSReportController.php b/app/Controllers/BDSReportController.php index 54abf46f..c3005aac 100644 --- a/app/Controllers/BDSReportController.php +++ b/app/Controllers/BDSReportController.php @@ -33,6 +33,7 @@ class BDSReportController extends AdminController protected $PTCOShareDetailsModel; protected $coShareStmtDetailsModel; protected $policyTypeModel; + protected $policyTatReportType; public function __construct() { @@ -46,6 +47,13 @@ class BDSReportController extends AdminController $this->PTCOShareDetailsModel = new PTCOShareDetailsModel(); $this->coShareStmtDetailsModel = new COShareStmtDetailsModel(); $this->policyTypeModel = new PolicyTypeModel(); + + + $this->policyTatReportType = [ + '1' => "TAT Band Wise report", + '2' => "Account Manger Status Wise Report", + '3' => "Account Manger TAT Wise Report" + ]; } // public function Insurer_wise_Data($insurerCategory, $fromDate, $toDate) @@ -209,7 +217,7 @@ class BDSReportController extends AdminController $html = view('bds_report_bap_wise_data', $viewData); return $this->respond(['status' => true, 'html' => $html], 200); - } else if($report_type == 'bapInsurer'){ + } else if ($report_type == 'bapInsurer') { //Condition for BAP Insurer wise date $category = $category == 'life' ? 1 : 0; @@ -217,8 +225,7 @@ class BDSReportController extends AdminController $html = view('irda_bap_insurer_report_list', $viewData); return $this->respond(['status' => true, 'html' => $html], 200); - - }else if($report_type == 'bapClient'){ + } else if ($report_type == 'bapClient') { //Condition for BAP Client wise date $category = $category == 'life' ? 1 : 0; @@ -226,8 +233,7 @@ class BDSReportController extends AdminController $html = view('irda_bap_client_report_list', $viewData); return $this->respond(['status' => true, 'html' => $html], 200); - - }else if($report_type == 'client'){ + } else if ($report_type == 'client') { //Condition for Client wise date $category = $category == 'life' ? 1 : 0; @@ -517,7 +523,7 @@ class BDSReportController extends AdminController if (!empty($start_date) && !empty($end_date)) { $fromDate = change_date_format($start_date); - $toDate = change_date_format($end_date); + $toDate = change_date_format($end_date); } $this->myLogger->logme('error', 'From date : {fromDate} - To date {toDate} ', ['fromDate' => $fromDate, 'toDate' => $toDate]); @@ -597,7 +603,7 @@ class BDSReportController extends AdminController // $db = db_connect(); // $builder = $db->query(" - + // select ins.id, ins.name as insurer_name, // -- Health Policies @@ -706,7 +712,7 @@ class BDSReportController extends AdminController // life_premium DESC, // marine_cargo_premium DESC, // marine_hull_premium DESC; - + // "); // // Get the query @@ -745,7 +751,7 @@ class BDSReportController extends AdminController // $db = db_connect(); // $builder = $db->query(" - + // SELECT // c.id AS client_id, // c.client_name, @@ -808,7 +814,7 @@ class BDSReportController extends AdminController // life_premium DESC, // marine_cargo_premium DESC, // marine_hull_premium DESC - + // "); // // Get the query @@ -847,11 +853,11 @@ class BDSReportController extends AdminController // $db = db_connect(); // $builder = $db->query(" - + // select // c.id as client_id, // c.client_name, - + // ( // select // count(policy_transaction.id) @@ -862,7 +868,7 @@ class BDSReportController extends AdminController // and policy_transaction.is_active = 1 // ) as policy_count, - + // COALESCE(( // select // sum(stmt.actual_bp_amt + stmt.actual_tp_amt + stmt.actual_tep_amt) as premium @@ -873,9 +879,9 @@ class BDSReportController extends AdminController // and stmt.is_active = 1 // and ptco.is_active = 1 // and pt.is_active = 1 - + // ), 0) as premium - + // from clients c // join policy_transaction on c.id = policy_transaction.client_id AND policy_transaction.policy_issue_date >= '$fromDate' AND policy_transaction.policy_issue_date <= '$toDate' // join policy_type on policy_transaction.policy_type_id = policy_type.id and policy_type.policy_category = $category @@ -910,7 +916,6 @@ class BDSReportController extends AdminController $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['page_name'] = "Renewal Report"; return $this->loadLayout('renewal_search', $data); - } else { $fromDate = $this->request->getPost('fromDate'); @@ -927,4 +932,224 @@ class BDSReportController extends AdminController return $this->respond(['status' => true, 'html' => $html], 200); } } + + public function bdsTATReport() + { + $sql = " + SELECT + tc.TAT_Category, + COALESCE(SUM(CASE WHEN subquery.status = 'under_process' THEN 1 ELSE 0 END), 0) AS `Under Process`, + COALESCE(SUM(CASE WHEN subquery.status = 'client_pending' THEN 1 ELSE 0 END), 0) AS `Client Pending`, + COALESCE(SUM(CASE WHEN subquery.status = 'insurer_pending' THEN 1 ELSE 0 END), 0) AS `Insurer Pending`, + COALESCE(SUM(CASE WHEN subquery.status = 'instalment_pending' THEN 1 ELSE 0 END), 0) AS `Instalment Pending`, + COALESCE(SUM(CASE WHEN subquery.status = 'co_insurer_pending' THEN 1 ELSE 0 END), 0) AS `Co-Insurer Pending`, + COALESCE(SUM(CASE WHEN subquery.status = 'tpa_pending' THEN 1 ELSE 0 END), 0) AS `TPA Pending`, + COALESCE(SUM(CASE WHEN subquery.status = 'validated' THEN 1 ELSE 0 END), 0) AS `Validated`, + COALESCE(SUM(CASE WHEN subquery.status = 'cancelled' THEN 1 ELSE 0 END), 0) AS `Cancelled`, + COALESCE(SUM(CASE WHEN subquery.status = 'completed' THEN 1 ELSE 0 END), 0) AS `Completed`, + COALESCE(SUM(CASE WHEN subquery.status = 'lost' THEN 1 ELSE 0 END), 0) AS `Lost` FROM + ( + SELECT 'Above 12 Days' AS TAT_Category + UNION ALL + SELECT '9-12 Days' + UNION ALL + SELECT '5-8 Days' + UNION ALL + SELECT '0-4 Days' + ) AS tc + LEFT JOIN ( + SELECT + pt.id AS policy_id, + ls.status, + CASE + WHEN DATEDIFF(CURRENT_DATE, pt.created_at) BETWEEN 0 AND 4 THEN '0-4 Days' + WHEN DATEDIFF(CURRENT_DATE, pt.created_at) BETWEEN 5 AND 8 THEN '5-8 Days' + WHEN DATEDIFF(CURRENT_DATE, pt.created_at) BETWEEN 9 AND 12 THEN '9-12 Days' + ELSE 'Above 12 Days' + END AS TAT_Category + FROM + policy_transaction pt + LEFT JOIN ( + SELECT + pts1.* + FROM + policy_transaction_status pts1 + INNER JOIN ( + SELECT + policy_tran_id, + MAX(created_at) AS max_created_at + FROM + policy_transaction_status + WHERE is_active = 1 + GROUP BY policy_tran_id + ) pts2 + ON pts1.policy_tran_id = pts2.policy_tran_id + AND pts1.created_at = pts2.max_created_at + WHERE pts1.is_active = 1 + ) ls + ON pt.id = ls.policy_tran_id + WHERE pt.is_active = 1 + ) AS subquery + ON tc.TAT_Category = subquery.TAT_Category + GROUP BY + tc.TAT_Category + ORDER BY + FIELD(tc.TAT_Category, '0-4 Days', '5-8 Days' , '9-12 Days' , 'Above 12 Days' ) + "; + + // Run the query + $db = \Config\Database::connect(); + $query = $db->query($sql); + + // Get the result + $result = $query->getResultArray(); + // dd(db_connect()->getLastQuery(),$result); + $data['data'] = $result; + // dd($data, get_role_id(), ENROLLMENT_TEAM_ID, user_team()); + // return $this->loadLayout('bds_tat_wise_report', $data); + + return $result; + } + + public function accountMangerStatusBDSReport() + { + $data['page_name'] = "Account Manager BDS Report"; + + $sql = " + SELECT + COALESCE(ACM_Name, 'Total') AS ACM_Name, + COALESCE(SUM(CASE WHEN status = 'instalment_pending' THEN 1 ELSE 0 END), 0) AS `Instalment Pending`, + COALESCE(SUM(CASE WHEN status = 'under_process' THEN 1 ELSE 0 END), 0) AS `Under Process`, + COALESCE(SUM(CASE WHEN status = 'client_pending' THEN 1 ELSE 0 END), 0) AS `Client Pending`, + COALESCE(SUM(CASE WHEN status = 'co_insurer_pending' THEN 1 ELSE 0 END), 0) AS `Co Insurer Pending`, + COALESCE(SUM(CASE WHEN status = 'tpa_pending' THEN 1 ELSE 0 END), 0) AS `TPA Pending`, + COALESCE(SUM(CASE WHEN status = 'validated' THEN 1 ELSE 0 END), 0) AS `Validated`, + COALESCE(SUM(CASE WHEN status = 'cancelled' THEN 1 ELSE 0 END), 0) AS `Cancelled`, + COALESCE(SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END), 0) AS `Completed`, + COALESCE(SUM(CASE WHEN status = 'lost' THEN 1 ELSE 0 END), 0) AS `Lost`, + COALESCE(SUM(CASE WHEN status = 'insurer_pending' THEN 1 ELSE 0 END), 0) AS `Insurer Pending` + + FROM ( + SELECT + up.first_name AS ACM_Name, + ls.status + FROM policy_transaction pt + JOIN clients c ON pt.client_id = c.id AND c.is_active = 1 + JOIN client_rm crm ON crm.client_id = c.id AND crm.is_active = 1 AND crm.level = 3 + JOIN user_profiles up ON up.id = crm.user_id AND up.is_active = 1 + LEFT JOIN ( + SELECT + pts1.policy_tran_id, + pts1.status, + pts1.created_at + FROM policy_transaction_status pts1 + INNER JOIN ( + SELECT + policy_tran_id, + MAX(created_at) AS max_created_at + FROM policy_transaction_status + WHERE is_active = 1 + GROUP BY policy_tran_id + ) pts2 + ON pts1.policy_tran_id = pts2.policy_tran_id + AND pts1.created_at = pts2.max_created_at + WHERE pts1.is_active = 1 + ) ls ON pt.id = ls.policy_tran_id + WHERE pt.is_active = 1 + AND DATEDIFF(CURDATE(), ls.created_at) >= 4 + ) AS sub + GROUP BY ACM_Name; + "; + + $db = \Config\Database::connect(); + $query = $db->query($sql); + + // Get the result + $result = $query->getResultArray(); + + return $result; + } + + public function accountManagerTatBDSReport(){ + + $sql = " + SELECT + COALESCE(ACM_Name, 'Total') AS ACM_Name, + COALESCE(SUM(CASE WHEN tat_bucket = '0-4 Days' THEN 1 ELSE 0 END), 0) AS `0-4 Days`, + COALESCE(SUM(CASE WHEN tat_bucket = '5-8 Days' THEN 1 ELSE 0 END), 0) AS `5-8 Days`, + COALESCE(SUM(CASE WHEN tat_bucket = '9-12 Days' THEN 1 ELSE 0 END), 0) AS `9-12 Days`, + COALESCE(SUM(CASE WHEN tat_bucket = 'Above 12 Days' THEN 1 ELSE 0 END), 0) AS `Above 12 Days` + FROM ( + SELECT + up.first_name AS ACM_Name, + CASE + WHEN DATEDIFF(CURDATE(), ls.created_at) BETWEEN 0 AND 4 THEN '0-4 Days' + WHEN DATEDIFF(CURDATE(), ls.created_at) BETWEEN 5 AND 8 THEN '5-8 Days' + WHEN DATEDIFF(CURDATE(), ls.created_at) BETWEEN 9 AND 12 THEN '9-12 Days' + WHEN DATEDIFF(CURDATE(), ls.created_at) > 12 THEN 'Above 12 Days' + ELSE 'Unknown' + END AS tat_bucket + FROM policy_transaction pt + JOIN clients c ON pt.client_id = c.id AND c.is_active = 1 + JOIN client_rm crm ON crm.client_id = c.id AND crm.is_active = 1 AND crm.level = 3 + JOIN user_profiles up ON up.id = crm.user_id AND up.is_active = 1 + LEFT JOIN ( + SELECT + pts1.policy_tran_id, + pts1.status, + pts1.created_at + FROM policy_transaction_status pts1 + INNER JOIN ( + SELECT + policy_tran_id, + MAX(created_at) AS max_created_at + FROM policy_transaction_status + WHERE is_active = 1 + GROUP BY policy_tran_id + ) pts2 + ON pts1.policy_tran_id = pts2.policy_tran_id + AND pts1.created_at = pts2.max_created_at + WHERE pts1.is_active = 1 + ) ls ON pt.id = ls.policy_tran_id + WHERE pt.is_active = 1 + AND ls.created_at IS NOT NULL + ) AS sub + GROUP BY ACM_Name; + + "; + + $db = \Config\Database::connect(); + $query = $db->query($sql); + + // Get the result + $result = $query->getResultArray(); + + return $result; + + } + + public function getMultiReport($report_type){ + + $data['page_name'] = "BDS Report"; + + if ($report_type == 1){ + + $data['page_title'] = "BDS TAT Report"; + $data['data'] = $this->bdsTATReport(); + }else if ($report_type == 2){ + + $data['page_title'] = "Account Manager Status Report"; + $data['data'] = $this->accountMangerStatusBDSReport(); + + }else{ + + $data['page_title'] = "Account Manager TAT Report"; + $data['data'] = $this->accountManagerTatBDSReport(); + + } + + return $this->loadLayout('bds_multi_report', $data); + + } } + diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index ff19c48c..5fa86502 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -3999,8 +3999,9 @@ class ClientController extends AdminController } } - public function get_client_policy_data_using_policy_no($policy_no) - { + public function get_client_policy_data_using_policy_no() + { + $policy_no = $this->request->getGet('policy_no'); $data = $this->clientPolicyModel ->select(" client_policy.*, @@ -4020,8 +4021,11 @@ class ClientController extends AdminController } } - public function get_client_policy_data_using_policy_no_and_endo_no($policy_no, $endorsement_no) - { + public function get_client_policy_data_using_policy_no_and_endo_no() + { + $policy_no = $this->request->getGet('policy_no'); + $endorsement_no = $this->request->getGet('endorsement_no'); + $data = $this->clientPolicyModel ->select('client_policy.*, endorsement.endorsement_type') ->join('endorsement', 'client_policy.id = endorsement.client_policy_id') @@ -4602,7 +4606,7 @@ class ClientController extends AdminController $empServiceController = new EmployeeServiceController(); // $res = $empServiceController->excelFileFormatValidation(['file_id' => '873']); // $res = $empServiceController->excelFileDataValidation(['file_id' => '874']); - // $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '874']); + // $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '829']); // dd('-----', $res); @@ -4627,8 +4631,10 @@ class ClientController extends AdminController // $ids = array_column($emp_data, 'id'); // $EmpDataServiceController->sendMailForDownloadingECard($ids); - // $EmpDataServiceController = new EmpDataServiceController(); + $EmpDataServiceController = new EmpDataServiceController(); // $EmpDataServiceController->importDeletionValidation(['file_id' => 304]); //for live + // $EmpDataServiceController->importSIEnhancementUpdateEndorsementID(['file_id' => 1199]); //for live + // $EmpDataServiceController->importSIEnhancementValidation(['file_id' => 1205]); //for live // $result = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($batch_data); // print_rr($result); die; diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index 2adf141a..b9ed11a4 100755 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -238,6 +238,7 @@ class DashboardController extends AdminController // echo "
";
             $data['pendingActionsData'] = $pendingActionsData;
             $data['businessTeamCount'] = count($businessTeamData) ?? 0;
+            // dd($businessTeamData);
             $data['financeTeamCount'] = count($financeTeamData) ?? 0;
             $data['businessTeamStatusData'] = $businessTeamStatusData;
             $data['financeTeamStatusData'] = $financeTeamStatusData;
@@ -257,6 +258,7 @@ class DashboardController extends AdminController
         }
 
         // dd(get_role_id(),user_team());
+        // dd($data);
         
         $data['page_name'] = 'Dashboard';
 
@@ -725,7 +727,6 @@ class DashboardController extends AdminController
             'validated' => [],
             'cancelled' => [],
             'instalment_pending' => [],
-            'completed' => [],
         ];
 
         // Loop through results and group them by their status
@@ -755,12 +756,13 @@ class DashboardController extends AdminController
                 case 'instalment_pending':
                     $groupedData['instalment_pending'][] = $row;
                     break;
-                default:
+                case 'under_process':
                     $groupedData['under_process'][] = $row;
                     break;
+                default:
+                    break;
             }
         }
-
         return $groupedData;
     }
 
diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php
index cb259f6c..d13676aa 100755
--- a/app/Controllers/EmpDataServiceController.php
+++ b/app/Controllers/EmpDataServiceController.php
@@ -2420,8 +2420,17 @@ class EmpDataServiceController extends BaseController
         $client_policy_id = $file['client_policy_id'];
         $client_branch_id = $file['client_branch_id'];
         $batch_code = $file['batch_code'];
+        $insurer_or_tpa = $file['insurer_or_tpa'];
         $user_id = $file['created_by'];
 
+        $ref_data = [
+            'client_id' => $client_id,
+            'client_policy_id' => $client_policy_id,
+            'client_branch_id' => $client_branch_id,
+            'insurer_or_tpa' => $insurer_or_tpa,
+            'event_type' => $file['event_type'],
+        ];
+
 
         $file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name'];
 
@@ -2453,92 +2462,92 @@ class EmpDataServiceController extends BaseController
             }
         }
 
+        $endorsement_data = $this->employeePolicyModel->getSIEnhancementEmployeesDataForExportExcel($ref_data, 1);
+            // $db = \Config\Database::connect();
 
-            $db = \Config\Database::connect();
+            // // Raw SQL query
+            // $sql = "
+            //     SELECT 
+            //         a.id as endorsement_primarykey,
+            //         a.group_key,
+            //         employee_polices.id AS primaryKey,
+            //         employees.id AS emp_primary,
+            //         employees.name AS emp_name,
+            //         employees.emp_code AS emp_code,
+            //         employees.dob AS emp_dob,
+            //         employees.gender AS emp_gender,
+            //         employees.relationship_code AS emp_relationship_code,
+            //         'Has Define' AS emp_type,
+            //         employee_polices.uhid AS risk_id,
+            //         employee_polices.pre_existing_alignments,
+            //         employee_polices.policy_end_date,
+            //         employee_polices.basic_cover_si as old_basic_cover_si,
+            //         employee_polices.rata_premimum as old_si_premium,
+            //         sidata.new_basic_cover_si,
+            //         sidata.new_si_premium,
+            //         sidata.date_of_coverage,
+            //         DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1 AS no_of_days,
+            //         sidata.new_si_premium - employee_polices.rata_premimum AS difference_premium,
+            //         ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premimum,
+            //         ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
+            //         ((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) + ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS total
+            //     FROM 
+            //         emp_endorsement a
+            //     LEFT JOIN 
+            //         employees ON employees.emp_code = a.emp_code
+            //     LEFT JOIN 
+            //         employee_polices ON employees.id = employee_polices.employee_id 
+            //     LEFT JOIN (
+            //         SELECT 
+            //             aa.emp_code, 
+            //             aa.new_value as new_basic_cover_si, 
+            //             bb.new_value as new_si_premium, 
+            //             cc.new_value as date_of_coverage 
+            //         FROM (
+            //             SELECT  
+            //                 a1.emp_code, 
+            //                 a1.field_name, 
+            //                 a1.new_value 
+            //             FROM 
+            //                 emp_endorsement as a1 
+            //             WHERE 
+            //                 a1.field_name = 'basic_cover_si'
+            //         ) aa 
+            //         LEFT JOIN (
+            //             SELECT  
+            //                 b1.emp_code, 
+            //                 b1.field_name, 
+            //                 b1.new_value 
+            //             FROM 
+            //                 emp_endorsement as b1 
+            //             WHERE 
+            //                 b1.field_name = 'premium'
+            //         ) bb ON aa.emp_code = bb.emp_code 
+            //         LEFT JOIN (
+            //             SELECT  
+            //                 c1.emp_code, 
+            //                 c1.field_name, 
+            //                 c1.new_value 
+            //             FROM 
+            //                 emp_endorsement as c1  
+            //             WHERE 
+            //                 c1.field_name = 'si_enhancement_date'
+            //         ) cc ON aa.emp_code = cc.emp_code
+            //     ) as sidata ON a.emp_code = sidata.emp_code 
+            //     WHERE 
+            //         employee_polices.client_policy_id = '$client_policy_id'
+            //         AND employees.client_branch_id = '$client_branch_id'
+            //         AND employee_polices.is_active = '1'
+            //         AND (a.endorsement_id IS NULL OR a.endorsement_id = '')   
+            //         AND a.actions = 'si'
+            //     GROUP BY group_key
+            // ";
 
-            // Raw SQL query
-            $sql = "
-                SELECT 
-                    a.id as endorsement_primarykey,
-                    a.group_key,
-                    employee_polices.id AS primaryKey,
-                    employees.id AS emp_primary,
-                    employees.name AS emp_name,
-                    employees.emp_code AS emp_code,
-                    employees.dob AS emp_dob,
-                    employees.gender AS emp_gender,
-                    employees.relationship_code AS emp_relationship_code,
-                    'Has Define' AS emp_type,
-                    employee_polices.uhid AS risk_id,
-                    employee_polices.pre_existing_alignments,
-                    employee_polices.policy_end_date,
-                    employee_polices.basic_cover_si as old_basic_cover_si,
-                    employee_polices.rata_premimum as old_si_premium,
-                    sidata.new_basic_cover_si,
-                    sidata.new_si_premium,
-                    sidata.date_of_coverage,
-                    DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1 AS no_of_days,
-                    sidata.new_si_premium - employee_polices.rata_premimum AS difference_premium,
-                    ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premimum,
-                    ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
-                    ((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) + ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS total
-                FROM 
-                    emp_endorsement a
-                LEFT JOIN 
-                    employees ON employees.emp_code = a.emp_code
-                LEFT JOIN 
-                    employee_polices ON employees.id = employee_polices.employee_id 
-                LEFT JOIN (
-                    SELECT 
-                        aa.emp_code, 
-                        aa.new_value as new_basic_cover_si, 
-                        bb.new_value as new_si_premium, 
-                        cc.new_value as date_of_coverage 
-                    FROM (
-                        SELECT  
-                            a1.emp_code, 
-                            a1.field_name, 
-                            a1.new_value 
-                        FROM 
-                            emp_endorsement as a1 
-                        WHERE 
-                            a1.field_name = 'basic_cover_si'
-                    ) aa 
-                    LEFT JOIN (
-                        SELECT  
-                            b1.emp_code, 
-                            b1.field_name, 
-                            b1.new_value 
-                        FROM 
-                            emp_endorsement as b1 
-                        WHERE 
-                            b1.field_name = 'premium'
-                    ) bb ON aa.emp_code = bb.emp_code 
-                    LEFT JOIN (
-                        SELECT  
-                            c1.emp_code, 
-                            c1.field_name, 
-                            c1.new_value 
-                        FROM 
-                            emp_endorsement as c1  
-                        WHERE 
-                            c1.field_name = 'si_enhancement_date'
-                    ) cc ON aa.emp_code = cc.emp_code
-                ) as sidata ON a.emp_code = sidata.emp_code 
-                WHERE 
-                    employee_polices.client_policy_id = '$client_policy_id'
-                    AND employees.client_branch_id = '$client_branch_id'
-                    AND employee_polices.is_active = '1'
-                    AND (a.endorsement_id IS NULL OR a.endorsement_id = '')   
-                    AND a.actions = 'si'
-                GROUP BY group_key
-            ";
+            // // Execute the query
+            // $query = $db->query($sql);
 
-            // Execute the query
-            $query = $db->query($sql);
-
-            // Fetch the results
-            $endorsement_data = $query->getResultArray();
+            // // Fetch the results
+            // $endorsement_data = $query->getResultArray();
 
 
 
@@ -2745,11 +2754,11 @@ class EmpDataServiceController extends BaseController
                 ];
             }
 
-            if ($endorsement_value['pro_rata_premimum'] != $excel_data[$key][16]) {
+            if ($endorsement_value['pro_rata_premium'] != $excel_data[$key][16]) {
                 $errors[$key][] = [
                     'row' => $key,
                     'column' => 16,
-                    'db_data' => $endorsement_value['pro_rata_premimum'],
+                    'db_data' => $endorsement_value['pro_rata_premium'],
                     'excel_data' => $excel_data[$key][16]
                 ];
             }
@@ -2950,7 +2959,7 @@ class EmpDataServiceController extends BaseController
                 
                 $empData['basic_cover_si'] = $value[8];
                 $empData['premium'] = $value[14];
-                $empData['si_enhancement_date'] = $value[10];
+                $empData['si_enhancement_date'] = date('Y-m-d', strtotime($value[10])) ?? null;
                 $empData['rata_premimum'] = $value[16];
                 $empData['gst'] = $value[17];
                 $empData['created_by'] =  $user_id;
@@ -2964,26 +2973,20 @@ class EmpDataServiceController extends BaseController
 
         $this->employeePolicyModel->updateBatch($emp_policy_ids, 'id');
 
-        $db = \Config\Database::connect();
-        $db->transStart();
-        
-        $this->employeePolicyModel->insertBatch($emp_details);
+        // $this->employeePolicyModel->insertBatch($emp_details);
+        // $insertedIds = [];
+        // $startId = $db->insertID(); // Get the first inserted ID
         
+        // for ($i = 0; $i < count($emp_details); $i++) {
+        //     $insertedIds[] = $startId + $i;
+        // }
+
         $insertedIds = [];
-        $startId = $db->insertID(); // Get the first inserted ID
-        
-        for ($i = 0; $i < count($emp_details); $i++) {
-            $insertedIds[] = $startId + $i;
+        foreach ($emp_details as $emp) {
+            $insertedIds[] = $this->employeePolicyModel->insert($emp);
         }
         
-        $db->transComplete();
-        
-        // if ($db->transStatus() === FALSE) {
-        //     // Handle the error, rollback, etc.
-        // } else {
-        //     // Transaction successful
-        //     print_r($insertedIds); // This will print the array of inserted IDs
-        // }
+        // dd($insertedIds);
         
         $this->employeePolicyModel->bulkUpdateForEndorsement($endorsement_details);
         $this->storeEndorsementNumber($file_id, $endorsement_id, $enrollment_file_id);
diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php
index 30f012b7..de473c0a 100755
--- a/app/Controllers/EmployeeController.php
+++ b/app/Controllers/EmployeeController.php
@@ -434,7 +434,7 @@ class EmployeeController extends AdminController
             $filePath = ROOTPATH . 'public/sample_excel/sample_correction .xls';
         } else if ($actionType == 'si_enhancement') {
             $filePath = ROOTPATH . 'public/sample_excel/sample_si_enhancement.xls';
-        } else if ($actionType == 'dependent_addtion') {
+        } else if ($actionType == 'dependent_addition') {
             $filePath = ROOTPATH . 'public/sample_excel/sample_dependent_addition.xls';
         } else if ($actionType == 'addition') {
             $filePath = ROOTPATH . 'public/sample_excel/sample_addition.xls';
diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php
index 9b137fda..3feb5558 100755
--- a/app/Controllers/EmployeeRestController.php
+++ b/app/Controllers/EmployeeRestController.php
@@ -3226,18 +3226,12 @@ class EmployeeRestController extends AdminController
                     $message = 'Claim Iniated Successfully';
                     return $this->respond(['status' => true, 'code' => 200, 'message' => $message], 200);
                 } else {
-                    $mail_sent_status = json_decode($mail_sent_status);
+                    $mail_sent_status_object = json_decode($mail_sent_status);
                 }
-                // dd(gettype($mail_sent_status));
 
-                if ($mail_sent_status->status == 'success') {
-                    $sent_message_data['ticket_id'] = $ticket_id;
-                    $sent_message_data['sender'] = 'staff';
-                    $sent_message_data['emp_mail'] = $mail_sent_status->data->params->mail;
-                    $sent_message_data['mail_subject'] = $mail_sent_status->data->params->subject;
-                    $sent_message_data['mail_content'] = $mail_sent_status->data->params->message;
+                if ($mail_sent_status_object->status == 'success') {
 
-                    $message_insert_status = $this->ticketMessage->insert($sent_message_data);
+                    $message_insert_status = $this->ticketController->autoMessageInsertBasedOnMailResponse($mail_sent_status, $ticket_id);
 
                     if ($message_insert_status) {
                         $message = 'Claim Initiated Successfully';
@@ -3248,11 +3242,11 @@ class EmployeeRestController extends AdminController
                         return $this->respond(['status' => false, 'code' => 400, 'message' => $message], 200);
                     }
                 } else {
-
                     $message = 'Claim Initiated, Failed to send Mail ';
                     $this->myLogger->logme('error', "Claim initiated, Failed to send Mail :$ticket_id ");
                     return $this->respond(['status' => false, 'code' => 400, 'message' => $message], 200);
                 }
+
             } else {
                 $message = 'Something Went Wrong';
                 return $this->respond(['status' => false, 'code' => 400, 'message' => $message], 200);
diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php
index 4caa5c4f..035fbd37 100755
--- a/app/Controllers/EmployeeServiceController.php
+++ b/app/Controllers/EmployeeServiceController.php
@@ -1530,8 +1530,21 @@ class EmployeeServiceController extends AdminController
               break;
             }
             // echo '
START- ' . $row[2]; - $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->where('client_branch_id',$file['client_branch_id'])->first(); - $employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first(); + $employee = $this->employeeModel + ->where('emp_code', $row[1]) + ->where('name',$row[2]) + ->where('client_id',$file['client_id']) + ->where('client_branch_id',$file['client_branch_id']) + ->where('emp_status', 'active') + ->where('is_active', 1) + ->first(); + $employee_policy = $this->employeePolicyModel + ->where('employee_id',$employee['id']) + ->where('client_policy_id',$file['policy_id']) + ->where('status', 'active') + ->where('is_active', 1) + ->first(); + // dd($employee, $employee_policy); $existing_endorsements = $this->empEndorsementModel->where('actions','si') ->where('table_name','employee_polices') @@ -1573,6 +1586,8 @@ class EmployeeServiceController extends AdminController $data = transform_si_excel_row_to_calculatable_format(employee: $employee,employee_policy: $employee_policy,maxage_and_maxcount: $max_age_and_max_count_of_current_member,slab_details: $slab_details,applicable_slab_name: $applicable_rack_rate_name,augmented_si: $row[3],grid_master: $applicable_rack_rate_master); $policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); + $policy_terms = (array) $policy_terms[0]; + // dd($policy_terms); //grouping slab details by rack rate name $temp_slab_rates = group_slab_rates_basedon_name($slab_details); diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 99180333..310cc939 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -169,17 +169,38 @@ class PolicyTransactionController extends BaseController $issuer = empty($issuer) ? 0 : $issuer; $status = empty($status) ? 0 : $status; // Corrected from `$issuer` - // Fetch inception data list - $data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData( - $start_date, - $end_date, - $client_id, - $insurer_id, - $policy_type_id, - $date_type, - $issuer, - $status - ); + if ($this->request->is('get')) { + + // Fetch inception data list + $data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData( + $start_date, + $end_date, + $client_id, + $insurer_id, + $policy_type_id, + $date_type, + $issuer, + $status + ); + + }else{ + + $ids = $this->request->getPost('ids'); + $ids = array_filter(explode(',', $ids)); + $data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData( + $start_date = 0, + $end_date = 0, + $client_id = 0, + $insurer_id = 0, + $policy_type_id = 0, + $date_type = 0, + $issuer = 0, + $status = 0, + $ids + ); + } + + // Fetch additional data $data['client'] = $this->clientModel->where('is_active', 1)->findAll(); diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index c58a6fef..37685b55 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -54,6 +54,8 @@ class TicketController extends BaseController public function __construct() { $this->myLogger = \Config\Services::mylogger(); + set_session_context('Ticket Master Controller'); + $this->ticketMasterModel = new TicketMasterModel(); @@ -123,6 +125,7 @@ class TicketController extends BaseController '((CLAIM_FEEDBACK_FORM))' => 'claim_feedback_form', '((SETTLED_LETTER))' => 'settle_letter', '((APPROVED_LETTER))' => 'approved_letter', + '((APPROVED_DESCRIBTION))' => 'approved_description', ]; $this->extraFields = [ 1 => ['non_id_reason'], @@ -132,13 +135,13 @@ class TicketController extends BaseController 5 => ['claim_number', 'registration_date'], 7 => ['query_received_date'], 8 => ['denial_reason','denial_date'], - 9 => ['approved_amount','approved_date', 'approved_letter'], + 9 => ['approved_amount','approved_date', 'approved_letter', "approved_description"], 11 => ['utr_details', 'settled_date', 'settle_letter'], - 40 => ['approved_amount','approved_date', 'approved_letter'], + 40 => ['approved_amount','approved_date', 'approved_letter', "approved_description"], 44 => ['utr_details', 'settled_date', 'settle_letter'], - 30 => ['approved_amount','approved_date', 'approved_letter'], + 30 => ['approved_amount','approved_date', 'approved_letter', "approved_description"], 34 => ['utr_details', 'settled_date', 'settle_letter'], - 20 => ['approved_amount','approved_date', 'approved_letter'], + 20 => ['approved_amount','approved_date', 'approved_letter', "approved_description"], 24 => ['utr_details', 'settled_date', 'settle_letter'], 14 => ['return_remark', 'awb_no_courier_name'], 48 => ['return_remark', 'awb_no_courier_name'], @@ -173,6 +176,9 @@ class TicketController extends BaseController public function ticketList() { $data['ticket_type'] = $this->ticketType; + $data['modeOFIntimate'] = $this->modeOFIntimate; + $data['priorityType'] = $this->priorityType; + $data['claimType'] = $this->claimType; if ($this->request->is('get')) { $data['page_name'] = "Claims"; $data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll(); @@ -183,13 +189,23 @@ class TicketController extends BaseController $isFromDashboard = $this->request->getPost("is_dashboard"); - if (isset($isFromDashboard) && !empty($isFromDashboard) && $isFromDashboard == 1) { + if (isset($isFromDashboard) && !empty($isFromDashboard)){ $data['page_name'] = "Claims"; - $data['ticket_data'] = $this->ticketSearch(3); + if ($isFromDashboard == 1) { + + $data['ticket_data'] = $this->ticketSearch(3); + + }else if ($isFromDashboard == 2){ + $data['ticket_data'] = $this->ticketSearch(4); + + } $data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll(); $data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active', 1)->findAll(); + // dd($data); return $this->loadLayout('ticket_search', $data); - }else{ + + } + else{ $data['ticket_data'] = $this->ticketSearch(); $html = view('ticket_list', $data); return $this->respond(['status' => true, 'html' => $html], 200); @@ -199,13 +215,13 @@ class TicketController extends BaseController } public function ticketSearch($action = null) - { + { $db = db_connect(); $subquery = $db->table('ticket_master tm') - ->select([ - 'tm.id AS ticket_id', - "CASE + ->select([ + 'tm.id AS ticket_id', + "CASE WHEN DATEDIFF( CURDATE(), COALESCE(latest_history.created_at, tm.created_at) @@ -220,20 +236,20 @@ class TicketController extends BaseController ) BETWEEN 13 AND 20 THEN '13-20 Days' ELSE 'Above 20 Days' END AS tat" - ]) - ->join( - '(SELECT th.ticket_id, MAX(th.created_at) AS created_at + ]) + ->join( + '(SELECT th.ticket_id, MAX(th.created_at) AS created_at FROM ticket_history th WHERE th.field_name = "claim_status_id" GROUP BY th.ticket_id) AS latest_history', - 'latest_history.ticket_id = tm.id', - 'left' - ) - ->where('tm.is_active', 1) - ->groupBy('tm.id, tm.created_at, latest_history.created_at'); + 'latest_history.ticket_id = tm.id', + 'left' + ) + ->where('tm.is_active', 1) + ->groupBy('tm.id, tm.created_at, latest_history.created_at'); - //action 1 get last 100 rows, action 2 filter and get all rows related to that and action 3 gets according to dashboard + //action 1 get last 100 rows, action 2 filter and get all rows related to that, action 3 gets according to dashboard, action 4 gets according to ACM if ($action == 1) { $query = $db->table('ticket_master tm') @@ -248,12 +264,63 @@ class TicketController extends BaseController 'tm.tpa_no', 'tm.emp_name', 'tm.emp_code', + 'tm.relationship', 'i.name AS insurer_name', 'c.client_name', 'tm.insured_name', 'c.short_name', 'DATE_FORMAT(tm.created_at, "%d-%m-%Y") AS ticket_created_date', - 'COALESCE(tat_category.tat, "0-6 Days") AS tat' + 'COALESCE(tat_category.tat, "0-6 Days") AS tat', + + 'tm.claim_status_id', + + '(SELECT first_name FROM user_profiles WHERE user_profiles.id = tm.acm_id) AS acm_name', + '(SELECT name FROM insurers WHERE insurers.id = tm.insurer_id) AS insurer_name', + '(SELECT name FROM tpa WHERE tpa.id = tm.tpa_id) AS tpa_name', + + 'tm.acm_id', + 'tm.insurer_id', + 'tm.tpa_id', + 'tm.client_policy_id', + + 'tm.policy_no', + 'tm.priority', + 'tm.relationship', + 'tm.emp_mobile', + 'tm.emp_mail', + 'tm.emp_personal_mail', + 'tm.mode_of_intimation', + 'tm.claim_type', + 'tm.hospital_name', + 'tm.doa', + 'tm.dod', + 'tm.claim_amount', + 'tm.pod_no', + 'tm.date_of_join', + 'tm.date_of_incep', + 'tm.dob', + 'tm.date_of_accident', + 'tm.date_of_death', + 'tm.date_of_intimat', + 'tm.si_amt', + 'tm.raised_date', + 'tm.registration_date', + 'tm.query_received_date', + 'tm.denial_date', + 'tm.approved_date', + 'tm.settled_date', + 'tm.denial_reason', + 'tm.approved_letter', + 'tm.approved_amount', + 'tm.utr_details', + 'tm.settle_letter', + 'tm.return_remark', + 'tm.cancel_remark', + 'tm.awb_no_courier_name', + 'tm.non_id_reason', + 'tm.pay_initiate_date', + 'tm.approved_description' + ]) ->join('insurers i', 'i.id = tm.insurer_id AND i.is_active = 1', 'left') ->join('clients c', 'c.id = tm.client_id AND c.is_active = 1', 'left') @@ -262,13 +329,12 @@ class TicketController extends BaseController ->where('tm.is_active', 1) ->orderBy('tm.id', 'DESC'); - $data = $query->get()->getResultArray(); + $data = $query->get()->getResultArray(); // dd(db_connect()->getLastQuery()); return $data; - - }else if ($action == 3) { + } else if ($action == 3) { $ids = $this->request->getPost('ids'); $ids = array_filter(explode(',', $ids)); @@ -280,6 +346,16 @@ class TicketController extends BaseController } // dd($where); + } else if ($action == 4){ + $acm_id = $this->request->getPost('ids'); + + // dd($acm_id); + if (!empty($acm_id)) { + $where = "tm.acm_id = $acm_id"; + } else { + $where = '1 = 0'; // No valid IDs, return empty result + } + } else { $search_data = $this->request->getPost(); // print_r($search_data); die() @@ -290,41 +366,90 @@ class TicketController extends BaseController } } // print_rr($where); - + } $query = $db->table('ticket_master tm') - ->select([ - 'tm.id', - 'tm.ticket_type_id', - 'tcs.claim_status AS status', - 'tm.claim_number AS claim_no', - 'tm.claim_status_id', - 'tm.is_head_approved', - 'tm.tpa_id', - 'tm.tpa_no', - 'tm.emp_name', - 'tm.emp_code', - 'i.name AS insurer_name', - 'c.client_name', - 'tm.insured_name', - 'c.short_name', - 'DATE_FORMAT(tm.created_at, "%d-%m-%Y") AS ticket_created_date', - 'COALESCE(tat_category.tat, "0-6 Days") AS tat' - ]) - ->join('insurers i', 'i.id = tm.insurer_id AND i.is_active = 1', 'left') - ->join('clients c', 'c.id = tm.client_id AND c.is_active = 1', 'left') - ->join('ticket_claim_status tcs', 'tcs.id = tm.claim_status_id AND tcs.is_active = 1', 'left') - ->join("({$subquery->getCompiledSelect()}) tat_category", 'tm.id = tat_category.ticket_id', 'left') - ->where('tm.is_active', 1) - ->where($where) - ->orderBy('tm.id', 'DESC'); + ->select([ + 'tm.id', + 'tm.ticket_type_id', + 'tcs.claim_status AS status', + 'tm.claim_number AS claim_no', + 'tm.claim_status_id', + 'tm.is_head_approved', + 'tm.tpa_id', + 'tm.tpa_no', + 'tm.emp_name', + 'tm.emp_code', + 'tm.relationship', + 'i.name AS insurer_name', + 'c.client_name', + 'tm.insured_name', + 'c.short_name', + 'DATE_FORMAT(tm.created_at, "%d-%m-%Y") AS ticket_created_date', + 'COALESCE(tat_category.tat, "0-6 Days") AS tat', - $data = $query->get()->getResultArray(); - // print_rr($data); - // log_message('error',' Claims Master Data '.json_encode($data));die(); - // print_rr($data);die(); + '(SELECT first_name FROM user_profiles WHERE user_profiles.id = tm.acm_id) AS acm_name', + '(SELECT name FROM insurers WHERE insurers.id = tm.insurer_id) AS insurer_name', + '(SELECT name FROM tpa WHERE tpa.id = tm.tpa_id) AS tpa_name', - return $data; + 'tm.claim_status_id', + 'tm.acm_id', + 'tm.insurer_id', + 'tm.tpa_id', + 'tm.client_policy_id', + 'tm.policy_no', + 'tm.priority', + 'tm.relationship', + 'tm.emp_mobile', + 'tm.emp_mail', + 'tm.emp_personal_mail', + 'tm.mode_of_intimation', + 'tm.claim_type', + 'tm.hospital_name', + 'tm.doa', + 'tm.dod', + 'tm.claim_amount', + 'tm.pod_no', + 'tm.date_of_join', + 'tm.date_of_incep', + 'tm.dob', + 'tm.date_of_accident', + 'tm.date_of_death', + 'tm.date_of_intimat', + 'tm.si_amt', + 'tm.raised_date', + 'tm.registration_date', + 'tm.query_received_date', + 'tm.denial_date', + 'tm.approved_date', + 'tm.settled_date', + 'tm.denial_reason', + 'tm.approved_letter', + 'tm.approved_amount', + 'tm.utr_details', + 'tm.settle_letter', + 'tm.return_remark', + 'tm.cancel_remark', + 'tm.awb_no_courier_name', + 'tm.non_id_reason', + 'tm.pay_initiate_date', + 'tm.approved_description' + + ]) + ->join('insurers i', 'i.id = tm.insurer_id AND i.is_active = 1', 'left') + ->join('clients c', 'c.id = tm.client_id AND c.is_active = 1', 'left') + ->join('ticket_claim_status tcs', 'tcs.id = tm.claim_status_id AND tcs.is_active = 1', 'left') + ->join("({$subquery->getCompiledSelect()}) tat_category", 'tm.id = tat_category.ticket_id', 'left') + ->where('tm.is_active', 1) + ->where($where) + ->orderBy('tm.id', 'DESC'); + + $data = $query->get()->getResultArray(); + // print_rr($data); + // log_message('error',' Claims Master Data '.json_encode($data));die(); + // print_rr($data);die(); + + return $data; } public function ticket_form($ticket_type) @@ -1259,7 +1384,8 @@ class TicketController extends BaseController if ($received_data['report_type'] == "acc_manager_wise_status"){ $viewData['policy_type'] = $received_data['policy_type']; $viewData['account_manager_wise_data'] = $this->ticketMasterModel->accountManagerWiseReport($policy_type,$fromDate,$toDate); - // print_rr($viewData); + + // print_rr($viewData);die(); if ($policy_type == 1){ $viewData['column_order'] = [ 'ACM_NAME', 'ID NOT GENERATED', 'NON ID', 'CDA', 'INFORMATION REQUIRED', @@ -1277,6 +1403,7 @@ class TicketController extends BaseController $ordered_data[] = $temp; } $viewData['tpa_wise_data'] = $ordered_data; + // print_rr($viewData);die(); $html = view('claims_report_acc_manager_wise', $viewData); return $this->respond(['status' => true, 'html' => $html], 200); }else{ @@ -1295,6 +1422,7 @@ class TicketController extends BaseController $ordered_data[] = $temp; } $viewData['tpa_wise_data'] = $ordered_data; + // print_rr($viewData);die(); $html = view('claims_report_acc_manager_wise', $viewData); return $this->respond(['status' => true, 'html' => $html], 200); } @@ -1573,7 +1701,7 @@ class TicketController extends BaseController } else { $this->myLogger->logme('error', "Failed to send Mail :$ticket_id "); - return true; + return false; } } @@ -1658,4 +1786,84 @@ class TicketController extends BaseController $this->loadLayout("ticket_feedback_list",$data); } + public function getMoreInfo() { + $ticket_id = $this->request->getPost('ticket_id'); + $this->myLogger->logme("error", "Ticket ID : " . $ticket_id); + + $fields = $this->extraFields; + $data_to_send = []; + + // Get ticket data + $ticket_data = $this->ticketMasterModel->where("id", $ticket_id)->where("is_active", 1)->first(); + + // Query previous status + $ticket_previous_status = $this->ticketMasterModel + ->select("th.old_value, tcs.claim_status") + ->join("ticket_history th", "th.ticket_id = ticket_master.id AND th.field_name = 'claim_status_id' AND th.is_active = 1") + ->join("ticket_claim_status tcs", "tcs.id = th.old_value AND tcs.is_active = 1") + ->where("ticket_master.is_active", 1) + ->where("ticket_master.id", $ticket_id) + ->groupBy("th.old_value, tcs.claim_status") + ->get() + ->getResultArray(); + + // Loop through previous status and gather the required data + foreach ($ticket_previous_status as $status) { + $this->myLogger->logme("error", "Status : " . json_encode($status)); + + if (isset($fields[$status['old_value']])) { + $field = $fields[$status['old_value']]; + + // Ensure claim_status is a scalar value (string or int) + $claim_status = (string)$status['claim_status']; // Cast to string to avoid issues + + // Initialize claim_status if it doesn't exist in the array + if (!isset($data_to_send[$claim_status])) { + $data_to_send[$claim_status] = []; + } + + // Handle case where $field is an array + if (is_array($field)) { + foreach ($field as $f) { + // Check if the field exists in the ticket data + $data_to_send[$claim_status][$f] = isset($ticket_data[$f]) ? $ticket_data[$f] : null; + + // Check if the field contains a date and format it + if ($this->isDate($data_to_send[$claim_status][$f])) { + $data_to_send[$claim_status][$f] = date('d-m-Y', strtotime($data_to_send[$claim_status][$f])); + } + + $this->myLogger->logme("error", "Data for field {$f}: " . json_encode($data_to_send[$claim_status][$f])); + } + } else { + // If field is not an array, handle it as a single field + $data_to_send[$claim_status][$field] = isset($ticket_data[$field]) ? $ticket_data[$field] : null; + + // Check if the field contains a date and format it + if ($this->isDate($data_to_send[$claim_status][$field])) { + $data_to_send[$claim_status][$field] = date('d-m-Y', strtotime($data_to_send[$claim_status][$field])); + } + + $this->myLogger->logme("error", "Data for field {$field}: " . json_encode($data_to_send[$claim_status][$field])); + } + } + } + + $this->myLogger->logme('error', "Total data: " . json_encode($data_to_send)); + + // Send response based on data availability + if (!empty($data_to_send)) { + return $this->respond(['status' => true, 'data' => $data_to_send], 200); + } else { + return $this->respond(['status' => false], 200); + } + } + + private function isDate($value) { + // Check if the value is a valid date string (basic validation) + return strtotime($value) !== false; + } + + + } diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 175be311..7f6310af 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -594,7 +594,7 @@ class EmployeePolicyModel extends Model } - public function getSIEnhancementEmployeesDataForExportExcel($ref_data) + public function getSIEnhancementEmployeesDataForExportExcel($ref_data, $return_type = 0) { $client_id = $ref_data['client_id']; @@ -732,7 +732,14 @@ class EmployeePolicyModel extends Model // Get the result set $results = $query->getResult(); - // dd($this->db->getLastQuery(), $results); + + if($return_type == 1){ + $results = $query->getResultArray(); + }else{ + $results = $query->getResult(); + } + + // dd($this->db->getLastQuery()); return $results; } @@ -1528,73 +1535,120 @@ class EmployeePolicyModel extends Model } - public function bulkUpdateForEndorsement($endorsement_details) + // public function bulkUpdateForEndorsement($endorsement_details) + // { + // // dd($endorsement_details, '---'); + // // Extract IDs, endorsement_ids, and statuses + // $ids = array_column($endorsement_details, 'group_key'); + // $endorsement_ids = array_column($endorsement_details, 'endorsement_id'); + // $statuses = array_column($endorsement_details, 'status'); + + // // Escape values for SQL + // $escapedIds = array_map([$this->db, 'escape'], $ids); + // $escapedEndorsementIds = array_map([$this->db, 'escape'], $endorsement_ids); + // $escapedStatuses = array_map([$this->db, 'escape'], $statuses); + + // // Construct the CASE statements + // $caseEndorsementId = array_map(function ($id, $endorsement_id) { + // return "WHEN group_key = $id THEN $endorsement_id"; + // }, $escapedIds, $escapedEndorsementIds); + + // // $caseStatus = array_map(function ($id, $status) { + // // return "WHEN status = $id THEN $status"; + // // }, $escapedIds, $escapedStatuses); + + // // Convert cases to a string + // $caseEndorsementIdString = implode(' ', $caseEndorsementId); + // // $caseStatusString = implode(' ', $caseStatus); + + // // Convert ids to a string + // $idsString = implode(', ', $escapedIds); + + // // Construct the SQL query + // $sql = " + // UPDATE emp_endorsement + // SET + // endorsement_id = CASE {$caseEndorsementIdString} END, + // status = 'complete' + // WHERE group_key IN ({$idsString}) + // "; + + + // // dd($sql); + // // Begin a transaction + // $this->db->transBegin(); + + // try { + // // Start the transaction + // $this->db->transBegin(); + + // // Execute the query + // $this->db->query($sql); + + // // Check transaction status + // if ($this->db->transStatus() === false) { + // $error = $this->db->error(); // Get the last database error + // $this->db->transRollback(); + + // // Optionally log the error + // log_message('error', 'Bulk update failed. Error: ' . json_encode($error)); + + // throw new \Exception('Bulk update failed. Error: ' . $error['message']); + // } + + // // Commit if everything is fine + // $this->db->transCommit(); + + // return $this->db->getLastQuery(); // Optional: return last executed query for debugging + // } catch (\Exception $e) { + // $this->db->transRollback(); + + // // Optionally log the exception + // log_message('error', 'Exception during bulk update: ' . $e->getMessage()); + + // // Re-throw with detailed context + // throw new \RuntimeException('Exception during bulk update: ' . $e->getMessage(), $e->getCode(), $e); + // } + + // } + + public function bulkUpdateForEndorsement(array $endorsement_details) { - - // Extract IDs, endorsement_ids, and statuses - $ids = array_column($endorsement_details, 'group_key'); - $endorsement_ids = array_column($endorsement_details, 'endorsement_id'); - $statuses = array_column($endorsement_details, 'status'); - - // Escape values for SQL - $escapedIds = array_map([$this->db, 'escape'], $ids); - $escapedEndorsementIds = array_map([$this->db, 'escape'], $endorsement_ids); - $escapedStatuses = array_map([$this->db, 'escape'], $statuses); - - // Construct the CASE statements - $caseEndorsementId = array_map(function ($id, $endorsement_id) { - return "WHEN group_key = $id THEN $endorsement_id"; - }, $escapedIds, $escapedEndorsementIds); - - // $caseStatus = array_map(function ($id, $status) { - // return "WHEN status = $id THEN $status"; - // }, $escapedIds, $escapedStatuses); - - // Convert cases to a string - $caseEndorsementIdString = implode(' ', $caseEndorsementId); - // $caseStatusString = implode(' ', $caseStatus); - - // Convert ids to a string - $idsString = implode(', ', $escapedIds); - - // Construct the SQL query + if (empty($endorsement_details)) { + throw new \InvalidArgumentException("No endorsement details provided."); + } + + $caseParts = []; + $groupKeys = []; + + foreach ($endorsement_details as $row) { + $groupKey = $this->db->escape($row['group_key']); + $endorsementId = $this->db->escape($row['endorsement_id']); + $caseParts[] = "WHEN group_key = {$groupKey} THEN {$endorsementId}"; + $groupKeys[] = $groupKey; + } + $sql = " UPDATE emp_endorsement SET - endorsement_id = CASE {$caseEndorsementIdString} END, + endorsement_id = CASE " . implode(' ', $caseParts) . " END, status = 'complete' - WHERE group_key IN ({$idsString}) + WHERE group_key IN (" . implode(', ', $groupKeys) . ") "; - - - // dd($sql); - // Begin a transaction - $this->db->transBegin(); - - try { - // Execute the query - $this->db->query($sql); - - // Commit the transaction - if ($this->db->transStatus() === FALSE) { - // If something went wrong, rollback - $this->db->transRollback(); - throw new \Exception('Bulk update failed.'); - } else { - // Otherwise, commit - $this->db->transCommit(); - } - // $this->storeEndorsementNumber($file_id, $endorsement_id, $enrollment_file_id); - - return $this->db->getLastQuery(); - } catch (\Exception $e) { - // Rollback the transaction on error - $this->db->transRollback(); - throw $e; + + $this->db->query($sql); + + // Check if query was successful + if ($this->db->affectedRows() === 0) { + throw new \RuntimeException('No rows were updated.'); } + + return true; } + + public function bulkUpdateForCorrection($emp_details){ foreach ($emp_details as $employee) { diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index cb7a1ce4..ec355e34 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -863,7 +863,7 @@ class PolicyTransactionModel extends Model if ($client_id == 0 && $insurer_id == 0 && $policy_type_id == 0 && $date_type == 0 && $issuer == 0) { - $fromDate = date('Y-m-d', strtotime('-30 days')); + $fromDate = date('Y-m-d', strtotime('-60 days')); $toDate = date('Y-m-d 23:59:59'); if (empty($where)) { @@ -962,7 +962,7 @@ class PolicyTransactionModel extends Model // return $result; // } - public function getInceptionTranctionListData($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0) + public function getInceptionTranctionListData($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0, $where = null) { $builder = $this->db->table('policy_transaction') ->select(' @@ -1026,14 +1026,18 @@ class PolicyTransactionModel extends Model } // Default to Last 30 Days if No Filters Are Applied - if (empty($client_id) && empty($insurer_id) && empty($policy_type_id) && empty($date_type) && empty($issuer)) { - $fromDate = date('Y-m-d', strtotime('-30 days')); + if (empty($client_id) && empty($insurer_id) && empty($policy_type_id) && empty($date_type) && empty($issuer) && empty($where)) { + $fromDate = date('Y-m-d', strtotime('-60 days')); $toDate = date('Y-m-d 23:59:59'); $builder->where('policy_transaction.created_at >=', $fromDate) ->where('policy_transaction.created_at <=', $toDate); } + if (!empty($where)) { + $builder->whereIn('policy_transaction.id', $where); + } + // Optimize Query Execution $builder->orderBy('policy_transaction.id', 'desc'); @@ -1331,6 +1335,8 @@ class PolicyTransactionModel extends Model ) ->where("th.last_policy_status_change <= '{$dateThreshold}'", null, false) ->where('policy_transaction.is_active', 1) + ->where("policy_transaction.status is not null", null, false) + ->whereNotIn("policy_transaction.status", ['completed']) // ->where('policy_transaction.status', 'completed') ->where('(pt_co_share_details.bp_amt IS NULL OR pt_co_share_details.bp_amt = 0)', null, false); @@ -1422,8 +1428,9 @@ class PolicyTransactionModel extends Model // ->where('policy_transaction.status', 'completed') ->where('COALESCE(pt_co_share_details.agreed_bp_per, 0) + COALESCE(pt_co_share_details.agreed_tp_per, 0) + COALESCE(pt_co_share_details.agreed_tep_per, 0) = 0') ->where('COALESCE(pt_co_share_details.actual_bp_amt, 0) + COALESCE(pt_co_share_details.actual_tp_amt, 0) + COALESCE(pt_co_share_details.actual_tep_amt, 0) = 0') - ->where('COALESCE(pt_co_share_details.actual_bp_brokerage_amt, 0) + COALESCE(pt_co_share_details.actual_tp_brokerage_amt, 0) + COALESCE(pt_co_share_details.actual_tep_brokerage_amt, 0) = 0'); - + ->where('COALESCE(pt_co_share_details.actual_bp_brokerage_amt, 0) + COALESCE(pt_co_share_details.actual_tp_brokerage_amt, 0) + COALESCE(pt_co_share_details.actual_tep_brokerage_amt, 0) = 0') + ->where("policy_transaction.status is not null", null, false) + ->whereNotIn("policy_transaction.status", ['completed']); if ($start_date != 0 && $end_date != 0 && $date_type != 0) { diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index 7e011952..1404190e 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -74,7 +74,9 @@ class TicketMasterModel extends Model 'head_rejection_reason', 'pay_initiate_date', 'emp_personal_mail', - 'client_policy_id' + 'client_policy_id', + + 'approved_description' ]; @@ -605,6 +607,7 @@ class TicketMasterModel extends Model // Construct the final SQL query $sql = " SELECT + user_profiles.id as ACM_ID, user_profiles.first_name AS ACM_NAME, $dynamicSelect, ($dynamicTotal) AS TOTAL @@ -621,7 +624,6 @@ class TicketMasterModel extends Model "; $result = $this->db->query($sql)->getResultArray(); - // dd($result); return $result; } else { @@ -675,6 +677,7 @@ class TicketMasterModel extends Model // Construct the final SQL query $sql = " SELECT + user_profiles.id as ACM_ID, user_profiles.first_name AS ACM_NAME, $dynamicSelect, ($dynamicTotal) AS TOTAL, @@ -694,8 +697,9 @@ class TicketMasterModel extends Model // Execute the query $result = $this->db->query($sql)->getResultArray(); - // print_rr($result);die(); return $result; + + } } diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php index 40d25654..08e08855 100755 --- a/app/Views/DashBoard.php +++ b/app/Views/DashBoard.php @@ -259,10 +259,10 @@ - - - - + diff --git a/app/Views/bds_multi_report.php b/app/Views/bds_multi_report.php new file mode 100644 index 00000000..05b38e6c --- /dev/null +++ b/app/Views/bds_multi_report.php @@ -0,0 +1,122 @@ + + + +
+
+
+
+
+
+

+
+
+ +
+ + + + + + + + + + + + + + $value): + $numValue = is_numeric($value) ? (int) $value : 0; + if ($key != 'TAT_Category') { + $columnTotals[$key] += $numValue; + $rowTotal += $numValue; + } + ?> + + + + + + + + + + $total): ?> + + + + + +
TOTAL
+
+ +
+
+
+
+ + diff --git a/app/Views/bds_tat_wise_report.php b/app/Views/bds_tat_wise_report.php new file mode 100644 index 00000000..e3c428f4 --- /dev/null +++ b/app/Views/bds_tat_wise_report.php @@ -0,0 +1,122 @@ + + + +
+
+
+
+
+
+

BDS TAT Band Wise Report

+
+
+ +
+ + + + + + + + + + + + + + $value): + $numValue = is_numeric($value) ? (int) $value : 0; + if ($key != 'TAT_Category') { + $columnTotals[$key] += $numValue; + $rowTotal += $numValue; + } + ?> + + + + + + + + + + $total): ?> + + + + + +
TOTAL
+
+ +
+
+
+
+ + diff --git a/app/Views/claims_report_acc_manager_wise.php b/app/Views/claims_report_acc_manager_wise.php index a629a01c..3816a419 100644 --- a/app/Views/claims_report_acc_manager_wise.php +++ b/app/Views/claims_report_acc_manager_wise.php @@ -18,6 +18,10 @@ .right-align-input { text-align: right; } + + #scroll-horizontal-datatable tbody tr:hover { + background-color: #e0e0e0; + }
@@ -47,7 +51,7 @@ - + @@ -101,3 +105,37 @@ } }); + + + \ No newline at end of file diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 3491cacb..a30e0d10 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -758,11 +758,34 @@
  • Renewal Reports
  • +
  • + TAT Band Reports +
  • +
  • + + + Policy TAT Reports + +
    + +
    +
  • diff --git a/app/Views/leads_dash.php b/app/Views/leads_dash.php index 4eb29dd7..dd0f06a6 100644 --- a/app/Views/leads_dash.php +++ b/app/Views/leads_dash.php @@ -268,13 +268,13 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t } function linkRedirectForPolicy(ids){ - var url = ""; + var url = ""; var data = { ids : ids, is_dashboard : 1 } - redirectWithPost(url,data); + redirectWithPost(url,data, "POST"); } function linkRedirectForLeads(status,ids){ @@ -285,14 +285,14 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t is_dashboard : 1 } - redirectWithPost(url,data); + redirectWithPost(url,data, "POST"); } - function redirectWithPost(url, data = {}) { + function redirectWithPost(url, data = {}, method = "GET") { $('.loader').fadeIn(); $('.loader-mask').fadeIn(); const form = document.createElement('form'); - form.method = 'POST'; + form.method = method; form.action = url; for (const key in data) { diff --git a/app/Views/notification.php b/app/Views/notification.php index 6e1e0cbd..316ebae9 100755 --- a/app/Views/notification.php +++ b/app/Views/notification.php @@ -31,6 +31,7 @@ margin: 1.75rem auto; } +
    diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index eaa5543a..565f55de 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -848,8 +848,9 @@ $('#endorsement_no').on('change', function(){ if(policy_no && endorsement_no){ $.ajax({ - url: ''+ policy_no + '/' + endorsement_no, + url: '', type: "GET", + data : {policy_no : policy_no, endorsement_no : endorsement_no}, dataType: 'json', success: function (res) { diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 0469a9d4..a8d31703 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -3721,8 +3721,9 @@ $('#policy_no').change(function(){ if($pt_id == "" && policy_no != ""){ $.ajax({ - url: ''+policy_no, + url: '', type: "GET", + data : { policy_no : policy_no }, dataType: 'json', success: function (res) { diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index 6ab344ba..8eb8c494 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -11,6 +11,18 @@ background-color: #f0f0f0; color: #666; } + + .info-icon { + color: #007bff; + font-size: 15px; + transition: 0.3s ease; + cursor: pointer; + } + + .info-icon:hover { + color: #0056b3; + font-size: 24px; + }
    @@ -168,7 +180,7 @@

    -
    Claim Details
    +
    Claim Details

    @@ -336,6 +348,12 @@ value="" name="approved_letter">
    + + + + + + + \ No newline at end of file diff --git a/app/Views/ticket_form_gpa.php b/app/Views/ticket_form_gpa.php index f701312b..3618d1f1 100644 --- a/app/Views/ticket_form_gpa.php +++ b/app/Views/ticket_form_gpa.php @@ -4,6 +4,18 @@ background-color: #e0e0e0; color: #666; } + + .info-icon { + color: #007bff; + font-size: 15px; + transition: 0.3s ease; + cursor: pointer; + } + + .info-icon:hover { + color: #0056b3; + font-size: 24px; + }
    @@ -130,7 +142,7 @@

    -
    Claim Details
    +
    Claim Details

    @@ -262,6 +274,12 @@ value="" name="approved_letter">
    + + + + + + \ No newline at end of file diff --git a/app/Views/ticket_list.php b/app/Views/ticket_list.php index f0410316..6f49c545 100644 --- a/app/Views/ticket_list.php +++ b/app/Views/ticket_list.php @@ -65,6 +65,49 @@ table.dataTable tbody td { Emp name Insured Name Corporate name + + ACM + Insurer + TPA + Policy No + Priority + Relationship + Emp Mobile + Emp Email + Emp Personal Email + Mode of Intimation + Claim Type + Hospital Name + DOA + DOD + Claim Amount + POD No. + Date of Join + Date of Inception + DOB + Date of Accident + Date of Death + Date of Intimate + Sum Insured + Raised Date + Registration Date + Query Received Date + Denial Date + Approved Date + Settled Date + Denial Reason + Approved Letter + Approved Amount + UTR Details + Settle Letter + Return Remark + Cancel Remark + AWB No. and Courier Name + Non ID Reason + Payment Initiate Date + Approved Description + + TAT @@ -119,6 +162,59 @@ table.dataTable tbody td { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +