diff --git a/app/Config/Constants.php b/app/Config/Constants.php index d86cf312..fb86b921 100755 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -102,6 +102,7 @@ define('CLAIMS_TEAM_ID', '2'); define('BUSINESS_TEAM_ID', '3'); define('FINANCE_TEAM_ID', '4'); define('SALES_TEAM_ID', '5'); +define('MANAGEMENT_TEAM_ID', '6'); /** * @User Teams Constant diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 123b329a..933ef8aa 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -12,7 +12,8 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']); // Reminder Mail Notification $routes->get("reminder_mail", "NotificationController::reminder_mail"); -$routes->get("testing", "ClientController::Testing"); +$routes->get("getClientData", "ClientController::getClientData"); +$routes->get("testing_for_review_mail/(:any)", "ClientController::testingForReviewMail/$1"); $routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections"); $routes->get("update_rack_rate_json", "ClientController::updateRackRateJson"); $routes->get("updatajson", "EmpDataServiceController::updatajson"); @@ -47,7 +48,6 @@ $routes->group("/user", ["filter" => "authMVC"], function ($routes) { $routes->get("rolesandteams", "UserController::getRolesAndTeams"); }); - $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) { $routes->get("view", "DashboardController::dashboard"); $routes->get('get-notification', 'DashboardController::getDashboardNotifications'); @@ -55,33 +55,21 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) { $routes->get('get-pending-action', 'PendingActionsController::getPendingActions'); }); - $routes->group("/client", ["filter" => "authMVC"], function ($routes) { $routes->get("list", "ClientController::index"); $routes->get("create", "ClientController::clientOnboarding"); $routes->get('deposit/(:num)', 'ClientController::deposit/$1'); $routes->get('remove/(:num)', 'ClientController::removeClient/$1'); + $routes->get("list/(:any)", "ClientController::editClientOnboarding/$1"); // application/config/routes.php // Add a route for the view_Deposit method $routes->get('view_deposit/(:num)', 'ClientController::view_Deposit/$1'); $routes->get('createtransaction', 'ClientController::createtransaction'); - $routes->post('save_deposit', 'ClientController::saveDeposit'); - - - - - - // $routes->get('view_Deposit/(:num)/(:num)','ClientController/view_Deposit/$1/$2'); - - - $routes->get("list/(:any)", "ClientController::editClientOnboarding/$1"); - - $routes->group("notification", ["filter" => "authMVC"], function ($routes) { $routes->post("create", "NotificationController::createNotification"); $routes->post("update_enable", "NotificationController::update_enable"); @@ -140,7 +128,6 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) { }); }); - $routes->group("/employee", ["filter" => "authMVC"], function ($routes) { $routes->get("list", "EmployeeController::list"); $routes->get("search", "EmployeeController::search"); @@ -155,13 +142,10 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) { $routes->post("test-rack-rate", "EmployeeController::testRackRate"); }); - $routes->group("/master", ["filter" => "authMVC"], function ($routes) { - $routes->group("insurer", ["filter" => "authMVC"], function ($routes) { - $routes->get("list", "MasterController::insurerList"); $routes->get("remove/(:any)", "MasterController::insurerRemove/$1"); $routes->get("create", "MasterController::insurerOnboarding"); @@ -196,6 +180,7 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { }); $routes->group("kyc", ["filter" => "authMVC"], function ($routes) { + $routes->get("list", "MasterController::kycList"); $routes->get("create", "MasterController::kycOnboarding"); $routes->post("createpost", "MasterController::createKYCInfo"); @@ -204,7 +189,6 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { $routes->get("remove/(:any)", "MasterController::kycRemove/$1"); $routes->get("delete/(:any)", "MasterController::deleteClientKycDocs/$1"); - $routes->group("kycdocs", ["filter" => "authMVC"], function ($routes) { $routes->post("createpost", "MasterController::createKycDocs"); $routes->get("editget/(:any)", "MasterController::editKYCGet/$1"); @@ -216,6 +200,7 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { }); $routes->group("policy", ["filter" => "authMVC"], function ($routes) { + $routes->get("list", "MasterController::policyTypeList"); $routes->get("create", "MasterController::policyTypeOnboarding"); $routes->post("createpost", "MasterController::createPolicyType"); @@ -223,7 +208,6 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { $routes->get("list/(:any)", "MasterController::editPolicyTypeOnboarding/$1"); $routes->get("remove/(:any)", "MasterController::policyTypeRemove/$1"); - $routes->group("policies", ["filter" => "authMVC"], function ($routes) { $routes->post("createpost", "MasterController::createPolicies"); $routes->get("editget/(:any)", "MasterController::editPoliciesGet/$1"); @@ -249,7 +233,6 @@ $routes->group("/master", ["filter" => "authMVC"], function ($routes) { }); }); - $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get("clients-with-policies", "EmployeeController::getClientWithPolicies"); $routes->get("police-by-insurer/(:any)", "ClientController::getPolicesByInsurerId/$1"); @@ -313,8 +296,11 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $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"); -}); + $routes->get("send_manual_reminder/(:any)", "DashboardController::sendManualReminder/$1"); + $routes->get("get_client_policy_list_for_remainder/(:any)", "EmployeeController::get_client_policy_list_for_remainder/$1"); + $routes->get("get_client_branch_data/(:any)", "ClientController::get_client_branch_data/$1"); +}); $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { @@ -337,6 +323,7 @@ $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { $routes->get("report-varience-list", "PolicyTransactionController::reportVarience"); $routes->get("report-business-list", "PolicyTransactionController::reportBusinessList"); $routes->get("report-finance-list", "PolicyTransactionController::reportFinanceList"); + $routes->get("report-outstanding-list", "PolicyTransactionController::reportOutstanding"); }); $routes->group("statement", ["filter" => "authMVC"], function ($routes) { @@ -351,6 +338,13 @@ $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { }); +$routes->group("leads", ["filter" => "authMVC"], function ($routes) { + + $routes->get("list", "LeadsController::viewLeadsList"); + $routes->post("create", "LeadsController::createLead"); + $routes->get("list/(:any)", "LeadsController::getLeadDataForEdit/$1"); +}); + $routes->get("driveListFiles", "GoogleDriveController::listFiles"); $routes->post('dmsSearch', 'PolicyTransactionController::dmsSearch', ['filter' => 'authMVC']); $routes->get('dmsSearch', 'PolicyTransactionController::dmsSearch', ['filter' => 'authMVC']); @@ -366,7 +360,6 @@ $routes->cli('cli/app_check_list', 'MasterController::appCheckList'); $routes->cli('cli/new_gdrive_token', 'GoogleDriveController::generateNewGoogleDriveAccessToken'); - //Employee login api's $routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber"); $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 79dc65c4..020ff116 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -115,72 +115,121 @@ class ClientController extends AdminController $this->vehicleModel = new VehicleModel(); } - public function Testing() //this function for only tsesting some logics not use for business logic + public function testingForReviewMail($client_id = 77, $emp_code = 'MGL-004', $mail_active = 0) //this function for only tsesting some logics not use for business logic { - $emp_code = 'MGL-004'; - $client_id = 77; - $client_policy_id = 205; - $array_list = []; - $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $client_policy_id, emp_code: $emp_code, client_id: $client_id, emp_status: ['draft', 'enrolled'], policy_status: ['draft', 'enrolled']); - if (count($find) > 0) { - $array_list[] = $find; - } + $client_policy_ids = $this->employeeModel + ->select('employee_polices.client_policy_id') + ->join('employee_polices', 'employees.id = employee_polices.employee_id') + ->where('employees.client_id', $client_id ) + ->where('employees.emp_code', $emp_code ) + ->where('employee_polices.is_active', 1 ) + ->where('employees.is_active', 1 ) + ->findAll(); - // dd($array_list); + $client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id'); - $notification = $this->notificationModel->where('client_id', $client_id)->where('template_name', 'member_review_and_summary_mail')->first(); + $client_policy_id = array_unique($client_policy_ids2); - // dd($notification); + // echo '
';
+        // dd($client_policy_id);
+        // print_r($unique_policy_ids); die;
+        // sort($client_policy_id);
 
-        if (isset($notification) && $notification['enabled'] == 1) {
+        $wholeData = '';
+        $mail_send_return = '';
+        $mail_send_return1 = '';
+        $mail_send_return2 = '';
 
-            $params['array_list'] = $array_list;
-            $params['client_policy_id'] = $client_policy_id;
-            $params['emp_code'] = $emp_code;
-            $params['client_id'] = $client_id;
-            $params['notification'] = $notification;
-
-            // print_r($params);die;
-
-            $wholeData = sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
-
-            // print_r($wholeData); die;
-
-            $mail_send_return =  MailHelper::send_email($wholeData[0]);
-            $this->myLogger->logme("info", $mail_send_return);
-
-            if (isset($wholeData[0])) {
-
-                $account_manager_wholeData = sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
-
-                // print_r($account_manager_wholeData); die;
-
-                if ($account_manager_wholeData) {
-
-                    foreach ($account_manager_wholeData as $key => $value) {
-                        $mail_send_return1 =  MailHelper::send_email($value);
-                        $this->myLogger->logme("info", $mail_send_return1);
-                        $this->myLogger->logme("info", $mail_send_return1);
-                    }
-                }
-
-                $client_hr_wholeData = sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
-
-                // print_r($client_hr_wholeData); die;
-
-                if ($client_hr_wholeData) {
-
-                    foreach ($client_hr_wholeData as $key => $value) {
-                        $mail_send_return2 = MailHelper::send_email($value);
-                        $this->myLogger->logme("info", $mail_send_return2);
-                    }
+        if (!is_null($client_policy_id) && is_array($client_policy_id))
+        {
+            $array_list = [];
+            foreach ($client_policy_id as $key => $value) 
+            {   
+                $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
+                if(count($find) > 0){
+                    $array_list[] = $find;
                 }
             }
+
+            // dd($array_list);
+
+            $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
+
+
+            if (isset($notification) && $notification['enabled'] == 1) {
+
+                $params ['array_list'] = $array_list;
+                $params ['client_policy_id'] = $client_policy_id;
+                $params ['emp_code'] = $emp_code;
+                $params ['client_id'] = $client_id;
+                $params ['notification'] = $notification;
+
+                // dd($params);
+
+                $wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
+                // print_r($wholeData); die;
+
+                if($mail_active > 0){
+                    $mail_send_return =  MailHelper::send_email($wholeData[0]);
+                    $this->myLogger->logme("info", $mail_send_return);
+                }
+
+                if (isset($wholeData[0])) {
+                    
+                    $account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
+                    // print_r($account_manager_wholeData); die;
+
+                    if($account_manager_wholeData != null && $account_manager_wholeData != '' && count($account_manager_wholeData))
+                    {   
+                        if($mail_active > 0){
+
+                            foreach ($account_manager_wholeData as $key => $value) {
+                                $mail_send_return1 =  MailHelper::send_email($value);
+                                $this->myLogger->logme("info", $mail_send_return1);
+                            }
+
+                        }
+
+                    }else{
+                        $this->myLogger->logme("error", 'Account Manager Mail Configuration not Enable for this client');
+                    }
+
+                    $client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
+                    // print_r($client_hr_wholeData); die;
+
+                    if($client_hr_wholeData != null && $client_hr_wholeData != '' &&count($client_hr_wholeData))
+                    {  
+                        if($mail_active > 0){
+
+                            foreach ($client_hr_wholeData as $key => $value) {
+                                $mail_send_return2 = MailHelper::send_email($value);
+                                $this->myLogger->logme("info", $mail_send_return2);
+                            }
+                        }
+
+                    }else{
+                        $this->myLogger->logme("error", 'Client HR Mail Configuration not Enable for this client');
+                    }
+                }
+
+            }else{
+                $this->myLogger->logme("error", 'Member Review Mail Configuration not Enable for this client');
+            }
+
         }
+    
+        print_r($wholeData);
 
+        echo '
';
+        echo '

member_review_and_summary_mail



'; + print_r($mail_send_return); + echo '

account_maneger_summary_mail



'; + print_r($mail_send_return1); + echo '

client_hr_summary_mail



'; + print_r($mail_send_return2); - return $this->respond(['status' => 'success', 'code' => 200, 'data' => []], 200); + // return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200); } public function index() @@ -3409,7 +3458,12 @@ class ClientController extends AdminController public function get_client_policy_data_using_policy_no($policy_no) { $data = $this->clientPolicyModel - ->select('client_policy.*, clients.client_type') + ->select(" + client_policy.*, + clients.client_type, + DATE_FORMAT(client_policy.policy_start_date, '%d/%m/%Y') as policy_start_date, + DATE_FORMAT(client_policy.policy_end_date, '%d/%m/%Y') as policy_end_date + ") ->join('clients', 'client_policy.client_id = clients.id') ->where('client_policy.policy_no', $policy_no) ->where('client_policy.is_active', 1) @@ -3438,4 +3492,27 @@ class ClientController extends AdminController return $this->respond(['status' => false, 'message' => 'No Data Found', 'code' => 404], 200); } } + + public function get_client_branch_data($id = null) + { + if ($id) { + $branch_data = $this->clientBranchModel + ->select('client_branch.*, clients.pan') + ->join('clients', 'client_branch.client_id = clients.id') + ->where(['client_branch.id' => $id, 'client_branch.is_active' => 1]) + ->first(); + $branch_contact_data = $this->levelContactModel->where(['ref_id' => $id, 'contact_type' => 'client', 'is_active' => 1])->orderBy('id','asc')->first(); + return $this->respond(['status' => true, 'code' => 200, 'data' => $branch_data, 'contact' => $branch_contact_data], 200); + } else { + return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200); + } + } + + public function getClientData() + { + $client_id = $this->request->getGet('client_id') ?? null; + $result = $this->clientModel->getClientData($client_id); + dd($result); + } + } diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index 079e4d35..bd126144 100755 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -32,6 +32,8 @@ class DashboardController extends AdminController protected $notificationModel; protected $employeePolicyModel; protected $policyTransactionModel; + protected $policyStatus; + protected $colorShades; protected $myLogger; @@ -48,6 +50,48 @@ class DashboardController extends AdminController $this->myLogger = \Config\Services::mylogger(); + $this->policyStatus = [ + 'under_process' => 'Under Process', + 'client_pending' => 'Client Pending', + 'insurer_pending' => 'Insurer Pending', + 'co_insurer_pending' => 'Co-Insurer Pending', + 'tpa_pending' => 'TPA Pending', + 'validated' => 'Validated', + 'cancelled' => 'Cancelled', + 'instalment_pending' => 'Instalment Pending', + 'completed' => 'Completed', + ]; + + $this->colorShades = [ + + [ + 'linear-gradient(45deg, #66e9eb, #5cc7d2)', // Lighter shade 1 + 'linear-gradient(45deg, #4ce2e5, #45bcc9)', // Lighter shade 2 + 'linear-gradient(45deg, #33dbe0, #2baebd)', // Original shade (slightly lighter) + 'linear-gradient(45deg, #00d6db, #00a8b5)', // Original + 'linear-gradient(45deg, #00bfc4, #00929f)', // Darker shade 1 + 'linear-gradient(45deg, #009ea1, #00767a)' // Darker shade 2 + ], + // Shades for Grenadier + [ + 'linear-gradient(45deg, #ff9d37, #ff7a10)', // Grenadier shade 1 + 'linear-gradient(45deg, #ff8b30, #ff7310)', // Grenadier shade 2 + 'linear-gradient(45deg, #ff8020, #ff5a00)', // Grenadier shade 3 + 'linear-gradient(45deg, #f06d15, #e05505)', // Grenadier shade 4 + 'linear-gradient(45deg, #d85f10, #c04805)', // Grenadier shade 5 + 'linear-gradient(45deg, #b85606, #a04605)' // Grenadier shade 6 + ], + // Shades for SilverChalice + [ + 'linear-gradient(45deg, #a3a8a8, #8f9494)', // SilverChalice shade 1 + 'linear-gradient(45deg, #989d9d, #848989)', // SilverChalice shade 2 + 'linear-gradient(45deg, #7e8484, #686e6e)', // SilverChalice shade 3 + 'linear-gradient(45deg, #6c7676, #545e5e)', // SilverChalice shade 4 + 'linear-gradient(45deg, #5c6363, #434949)', // SilverChalice shade 5 + 'linear-gradient(45deg, #494f4f, #353d3d)' // SilverChalice shade 6 + ] + ]; + } public function dashboard() @@ -70,7 +114,9 @@ class DashboardController extends AdminController $pendingActionsData = $pendingActionsController->getPendingActionsForDashBoard(); $businessTeamData = $this->policyTransactionModel->getBusinessReportList(); $financeTeamData = $this->policyTransactionModel->getFinanceReportList(); - + $businessTeamStatusData = $this->data_construct_for_bds($businessTeamData); + $financeTeamStatusData = $this->data_construct_for_bds($financeTeamData); + $groupedData = []; foreach ($results as $row) { @@ -163,6 +209,10 @@ class DashboardController extends AdminController $data['pendingActionsData'] = $pendingActionsData; $data['businessTeamCount'] = count($businessTeamData) ?? 0; $data['financeTeamCount'] = count($financeTeamData) ?? 0; + $data['businessTeamStatusData'] = $businessTeamStatusData; + $data['financeTeamStatusData'] = $financeTeamStatusData; + $data['policyStatus'] = $this->policyStatus; + $data['colorShades'] = $this->colorShades; // print_r($data);die; $data['page_name'] = 'Dashboard'; @@ -467,7 +517,7 @@ class DashboardController extends AdminController } - public function sendManualRemainder($client_id, $client_branch_id) + public function sendManualReminder($client_id, $client_branch_id) { $this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}"); @@ -494,5 +544,54 @@ class DashboardController extends AdminController } } + public function data_construct_for_bds($data){ + + $groupedData = [ + 'under_process' => [], + 'client_pending' => [], + 'insurer_pending' => [], + 'co_insurer_pending' => [], + 'tpa_pending' => [], + 'validated' => [], + 'cancelled' => [], + 'instalment_pending' => [], + 'completed' => [], + ]; + + // Loop through results and group them by their status + foreach ($data as $row) { + switch ($row['status']) { + case 'completed': + $groupedData['completed'][] = $row; + break; + case 'cancelled': + $groupedData['cancelled'][] = $row; + break; + case 'client_pending': + $groupedData['client_pending'][] = $row; + break; + case 'insurer_pending': + $groupedData['insurer_pending'][] = $row; + break; + case 'co_insurer_pending': + $groupedData['co_insurer_pending'][] = $row; + break; + case 'tpa_pending': + $groupedData['tpa_pending'][] = $row; + break; + case 'validated': + $groupedData['validated'][] = $row; + break; + case 'instalment_pending': + $groupedData['instalment_pending'][] = $row; + break; + default: + $groupedData['under_process'][] = $row; + break; + } + } + + return $groupedData; + } } diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 09e81058..20353e2f 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -319,6 +319,7 @@ class EmpDataServiceController extends BaseController ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') ->where('client_policy.id', $export_data['client_policy_id']) ->where('insurer_excel_export_template.event_name', $export_data['event_type']) + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 ->where('insurer_excel_export_template.type_name', $export_data['actions']) ->first(); @@ -530,6 +531,7 @@ class EmpDataServiceController extends BaseController ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') ->where('client_policy.id', $export_data['client_policy_id']) ->where('insurer_excel_export_template.event_name', $export_data['event_type']) + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 ->where('insurer_excel_export_template.type_name', $export_data['actions']) ->first(); @@ -665,6 +667,7 @@ class EmpDataServiceController extends BaseController ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') ->where('client_policy.id', $export_data['client_policy_id']) ->where('insurer_excel_export_template.event_name', $export_data['event_type']) + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 ->where('insurer_excel_export_template.type_name', $export_data['actions']) ->first(); @@ -776,6 +779,7 @@ class EmpDataServiceController extends BaseController ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') ->where('client_policy.id', $export_data['client_policy_id']) ->where('insurer_excel_export_template.event_name', $export_data['event_type']) + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 ->where('insurer_excel_export_template.type_name', $export_data['actions']) ->first(); @@ -868,7 +872,7 @@ class EmpDataServiceController extends BaseController }else if($value == 'inception'){ $export_data['event_type'] = 'inception'; - $dependentAdditionData = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data); + $inceptionData = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data); //Live issue changes 17-10-2024 }else if($value == 'dependent_addition'){ $export_data['event_type'] = 'dependent_addition'; @@ -943,12 +947,13 @@ class EmpDataServiceController extends BaseController $template_json = $this->clientPolicyModel - ->select('insurer_excel_export_template.jsoncolumns') - ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') - ->where('client_policy.id', $export_data['client_policy_id']) - ->where('insurer_excel_export_template.event_name', 'all') - ->where('insurer_excel_export_template.type_name', $export_data['actions']) - ->first(); + ->select('insurer_excel_export_template.jsoncolumns') + ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') + ->where('client_policy.id', $export_data['client_policy_id']) + ->where('insurer_excel_export_template.event_name', 'all') + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 + ->where('insurer_excel_export_template.type_name', $export_data['actions']) + ->first(); if(!empty($template_json) && $template_json != null){ diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 8d6ace5c..c13eb6ba 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1458,7 +1458,7 @@ class EmployeeRestController extends AdminController $string = ucwords($string); $result .= ' + '.$string; }else if($value != 0 && $key ==='self') { - $result = 'Can Add Self '; + $result = 'Allowed memebrs Self '; }else if($value != 0 && $key ==='childrens') { if($value > 1){ $result .= ' + '.$value.' Children'; }else{ $result .= ' + '.$value.' Child'; } }else if($value != 0 && $key ==='elders_count') { @@ -1477,7 +1477,7 @@ class EmployeeRestController extends AdminController if($first_two_chars == " +"){ $modified_string = substr($result, 3); - return "Can Add ".$modified_string; + return "Allowed memebrs ".$modified_string; }else{ return $result; } diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php new file mode 100644 index 00000000..4aad7955 --- /dev/null +++ b/app/Controllers/LeadsController.php @@ -0,0 +1,221 @@ +myLogger = \Config\Services::mylogger(); + + $this->clientModel = new ClientModel(); + $this->userModel = new UserModel(); + $this->clientBranchModel = new ClientBranchModel(); + $this->clientPolicyModel = new ClientPolicyModel(); + $this->levelContactModel = new LevelContactModel(); + $this->leadsModel = new LeadsModel(); + $this->policyTypeModel = new PolicyTypeModel(); + $this->kycEntityTypeModel = new KYCEntityTypeModel(); + $this->policyTransactionStatusModel = new PolicyTransactionStatusModel(); + + $this->issuer = [1 => 'JIBS', 2 => 'Nhance']; + $this->clientType = [1 => 'Group', 2 => 'Individual']; + $this->leadType = [1 => 'Fresh', 2 => 'Renewal']; + $this->leadsStatus = [ + 'queued' => 'Queued', + 'qcr_sent' => 'QCR sent', + 'lost' => 'Lost', + 'co_insurer_pending' => 'Co-Insurer Pending', + 'won' => 'Won', + 'completed_with_corrections' => 'Completed with Corrections', + 'completed_without_corrections' => 'Completed w/o Corrections', + ]; + } + + public function viewLeadsList() + { + $data['page_name'] = 'Leads'; + + $data['issuer'] = $this->issuer ; + $data['client_type'] = $this->clientType; + $data['lead_type'] = $this->leadType; + $data['lead_status'] = $this->leadsStatus; + + $data['policy_type'] = $this->policyTypeModel->where('is_active', 1)->findAll(); + $data['entity'] = $this->kycEntityTypeModel->where('is_active', 1)->findAll(); + $data['salse_team'] = $this->userModel + ->select('user_profiles.*') + ->join('user_teams', 'user_profiles.id = user_teams.user_id') + ->where('user_teams.team_id', 5) + ->where('user_teams.is_active', 1) + ->where('user_profiles.is_active', 1) + ->findAll(); + + $data['lead_data_list'] = $this->leadsModel->getLeadDataForLising(); + // dd($data); + $this->loadLayout('leads_list', $data); + } + + public function createLead() + { + // print_r($this->request->getPost()); die; + $id = $this->request->getPost('id'); + $data = $this->prepareLeadData(); + // print_r($this->request->getPost()); die; + + + if (!$id) { + return $this->insertNewLead($data); + } else { + return $this->updateOldLead($id, $data); + } + } + + private function prepareLeadData() + { + $data = $this->request->getPost(); + + if($data['lead_type'] == 2){ + $client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first(); + $data['client_name'] = $client_data['client_name']; + $data['client_short_name'] = $client_data['short_name']; + $data['entity_type_id'] = $client_data['entity_type_id']; + $data['client_type'] = $client_data['client_type']; + }else{ + $data['client_id'] = 0; + $data['client_branch_id'] = 0; + $data['source_policy_id'] = 0; + } + + $data['client_code'] = generate_client_code(); + if($data['client_code'] == 2){ + $data['client_code'] = generate_client_code('IC'); + } + + $data = $this->prepareMultipleLeadData($data); + + return $data; + } + + private function prepareMultipleLeadData($data) + { + $processedData = []; + foreach($data['policy_type_id'] as $index => $value){ + $processedData = [ + 'lead_type' => $data['lead_type'], + 'issuer' => $data['issuer'], + 'client_type' => $data['client_type'], + 'client_name' => $data['client_name'], + 'client_short_name' => $data['client_short_name'], + 'entity_type_id' => $data['entity_type_id'], + 'client_code' => $data['client_code'], + 'cost_center' => $data['cost_center'], + 'pan' => $data['pan'], + 'gst' => $data['gst'], + 'branch_name' => $data['branch_name'], + 'branch_code' => $data['branch_code'], + 'contact_person_name' => $data['contact_person_name'], + 'contact_person_mobile' => $data['contact_person_mobile'], + 'client_id' => $data['client_id'], + 'client_branch_id' => $data['client_branch_id'], + 'source_policy_id' => $data['source_policy_id'], + 'policy_type_id' => $value, + 'salse_person_id' => $data['salse_person_id'], + 'status' => $data['status'], + 'notes' => $data['notes'], + 'created_by' => $data['created_by'], + 'updated_by' => $data['updated_by'], + 'is_active' => $data['is_active'], + ]; + } + + return $processedData; + } + + private function insertNewLead($data) + { + $insert = $this->leadsModel->insert($data); + + if ($insert) { + $this->insertLeadStatus($insert, $data['status'], 3); + return $this->respond(['status' => true, 'lead_id' => $insert, 'message' => 'New Lead created successfully', 'data' =>$data], 200); + } + + return $this->respond(['status' => true, 'lead_id' => $insert, 'message' => "Failed to create Lead", 'data' =>$data], 200); + } + + private function updateOldLead($id, $data) + { + if ($this->leadsModel->update($id, $data)) { + + $this->insertLeadStatus($id, $data['status'], 3); + return $this->respond(['status' => true, 'lead_id' => $id, 'message' => "Lead updated successfully", 'data' =>$data], 200); + } + return $this->respond(['status' => false, 'lead_id' => $id, 'message' => "Failed to update Lead", 'data' =>$data], 200); + } + + // Get the Single Lead data for edit + public function getLeadDataForEdit($id) + { + + $data = $this->leadsModel + ->where('leads.id', $id) + ->where('leads.is_active', 1) + ->first(); + + if($data){ + return $this->respond(['status' => true, 'data' => $data], 200); + }else{ + return $this->respond(['status' => false], 200); + } + + } + + private function insertLeadStatus($primaryKey, $status, $statusType) + { + $statusData = [ + 'policy_tran_id' => $primaryKey, + 'status' => $status, + 'status_type' => $statusType, + 'created_by' => get_session_userid(), + ]; + $this->policyTransactionStatusModel->insert($statusData); + } + + +} diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 1eacb67f..0f735bdc 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -101,9 +101,10 @@ class PolicyTransactionController extends BaseController // Policy Transaction Inception public function viewInception() - { + { $data['page_name'] = 'Policy'; - + + // Static arrays for dropdowns $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['client_type'] = [1 => 'Group', 2 => 'Individual']; $data['issuing_type'] = [1 => 'Fresh', 2 => 'Renewal', 3 => 'Roll Over']; @@ -143,8 +144,8 @@ class PolicyTransactionController extends BaseController 'policy_start_date' => 'Policy Start Date', 'policy_end_date' => 'Policy End Date', ]; - - //filter datas + + // Filter data $start_date = $this->request->getGet('start_date'); $end_date = $this->request->getGet('end_date'); $client_id = $this->request->getGet('client_id'); @@ -153,28 +154,44 @@ class PolicyTransactionController extends BaseController $date_type = $this->request->getGet('date_type'); $issuer = $this->request->getGet('issuer'); $status = $this->request->getGet('status'); - - $start_date = (!isset($start_date) || $start_date === '' || $start_date === null) ? 0 : $start_date; - $end_date = (!isset($end_date) || $end_date === '' || $end_date === null) ? 0 : $end_date; - - $client_id = (!isset($client_id) || $client_id === '' || $client_id === null) ? 0 : $client_id; - $insurer_id = (!isset($insurer_id) || $insurer_id === '' || $insurer_id === null) ? 0 : $insurer_id; - $policy_type_id = (!isset($policy_type_id) || $policy_type_id === '' || $policy_type_id === null) ? 0 : $policy_type_id; - $date_type = (!isset($date_type) || $date_type === '' || $date_type === null) ? 0 : $date_type; - $issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer; - $status = (!isset($issuer) || $status === '' || $status === null) ? 0 : $status; - - - $data['inception_data_list'] = $this->policyTransactionModel->getInceptionTranctionListData($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status); - + + // Handle null or empty values + $start_date = empty($start_date) ? 0 : $start_date; + $end_date = empty($end_date) ? 0 : $end_date; + $client_id = empty($client_id) ? 0 : $client_id; + $insurer_id = empty($insurer_id) ? 0 : $insurer_id; + $policy_type_id = empty($policy_type_id) ? 0 : $policy_type_id; + $date_type = empty($date_type) ? 0 : $date_type; + $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 + ); + + // Fetch additional data $data['client'] = $this->clientModel->where('is_active', 1)->findAll(); $data['policy_type'] = $this->policyTypeModel->where('is_active', 1)->findAll(); $data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll(); - $data['entity'] = $this->kycEntityTypeModel->where('is_active', 1)->findAll(); + $data['entity'] = $this->kycEntityTypeModel->where('is_active', 1)->findAll(); $data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll(); - $data['insurer_branch'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames(); - $data['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames(); + $data['insurer_branch'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames(); + $data['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames(); + + // Fetch PP Teams Data + $data['ppTeamsData'] = $this->userModel + ->where('is_active', 1) + ->findAll(); + // Fetch Sales Team $data['salse_team'] = $this->userModel ->select('user_profiles.*') ->join('user_teams', 'user_profiles.id = user_teams.user_id') @@ -182,16 +199,22 @@ class PolicyTransactionController extends BaseController ->where('user_teams.is_active', 1) ->where('user_profiles.is_active', 1) ->findAll(); - + + // Fetch ACM $data['ACM'] = $this->userModel - ->where('user_profiles.role', 3) - ->where('user_profiles.is_active', 1) + ->where('role', 3) // Assuming `role` is in `user_profiles` + ->where('is_active', 1) ->findAll(); - - $this->loadLayout('policy_transaction_inception_list', $data); + // echo '
';
+        // print_r($data['ppTeamsData']); die;
+        
+        // dd($data);
+    
+        // Load view
+        $this->loadLayout('policy_transaction_inception_list', $data);
     }
-
+    
     // policy Transaction Create function start
     public function createInceptionPolicy()
     {
@@ -297,8 +320,8 @@ class PolicyTransactionController extends BaseController
             $data['ct_type'] = 1;
         }
 
-        $month = '01-'.(string)$this->request->getPost('month');
-        $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month));    
+        // $month = '01-'.(string)$this->request->getPost('month');
+        // $data['month'] = empty($data['month']) ? null : date('Y-m-d', strtotime($month));    
     
         // Determine $is_addon value
         $data['is_addon'] = in_array($data['policy_type_id'], [1, 2, 6, 7]) ? 1 :
@@ -729,6 +752,8 @@ class PolicyTransactionController extends BaseController
     
             if(!empty($data['month'])){
                 $data['month'] =  change_date_format($data['month'], 'Y-m-d', 'M/Y');
+            }else{
+                $data['month'] = null;
             }
     
             
@@ -744,7 +769,7 @@ class PolicyTransactionController extends BaseController
             ->findAll();
 
        
-           $data['base_policy_data'] = $this->clientPolicyModel
+        $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'])
@@ -752,13 +777,18 @@ class PolicyTransactionController extends BaseController
                 ->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')
-                        ->where('pt_files.pt_id', $id)
-                        ->where('pt_files.is_active', 1)
+                ->join('policy_transaction', 'pt_files.pt_id = policy_transaction.id')
+                ->where('pt_files.pt_id', $id)
+                ->where('pt_files.is_active', 1)
+                ->findAll();
+                
+        $data['pt_co_share_details'] = $this->PTCOShareDetailsModel
+                        ->where('pt_id', $id)
+                        ->where('is_active', 1)
+                        ->orderBy('id', 'asc')
                         ->findAll();
-        $data['pt_co_share_details'] = $this->PTCOShareDetailsModel->where('pt_id', $id)->where('is_active', 1)->findAll();
         $data['emp_data'] = $this->employeeModel
                         ->select('employees.*, employee_polices.id as emp_policy_id')
                         ->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
@@ -1146,9 +1176,9 @@ class PolicyTransactionController extends BaseController
                         'created_by' => get_session_userid(),
                     ];
 
-                    $uploadFilePath = $uploadFilePath . '/' . $uploadedFileName;
+                    // $uploadFilePath = $uploadFilePath . '/' . $uploadedFileName;
 
-                    $GoogleDriveController->uploadFiletoGdrive(client_policy_id: $client_policy_id, doc_type: 'POLICY', file_path: $uploadFilePath, file_name: $uploadedFileName);
+                    // $GoogleDriveController->uploadFiletoGdrive(client_policy_id: $client_policy_id, doc_type: 'POLICY', file_path: $uploadFilePath, file_name: $uploadedFileName);
 
                     // Insert into database
                     $insert = $this->PTFileModel->insert($docData);
@@ -1374,8 +1404,6 @@ class PolicyTransactionController extends BaseController
         $date_type = (!isset($date_type) || $date_type === '' || $date_type === null) ? 0 : $date_type;      
         $issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer;   
 
-
-
         $data['varience_list'] = $this->policyTransactionModel->getVarienceReportLIst($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer);
         $this->loadLayout('variance_report_list', $data); 
 
@@ -1462,6 +1490,46 @@ class PolicyTransactionController extends BaseController
         $this->loadLayout('finance_team_list', $data); 
     }
 
+    public function reportOutstanding()
+    {   
+        $data['page_name'] = 'Outstanding Report';
+
+        $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
+        $data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll();
+        $data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
+        $data['clients'] = $this->clientModel->where('is_active', 1)->findAll();
+        $data['date_type'] = [
+            'policy_issue_date' => 'Policy Issue Date',
+            'policy_start_date' => 'Policy Start Date',
+            'policy_end_date' => 'Policy End Date',
+            'data_received_date' => 'Data Received Date',
+            'closure_date' => 'Closure Date',
+        ];
+
+        //filter datas
+        $start_date = $this->request->getGet('start_date');
+        $end_date = $this->request->getGet('end_date');
+        $client_id = $this->request->getGet('client_id');
+        $insurer_id = $this->request->getGet('insurer_id');
+        $policy_type_id = $this->request->getGet('policy_type_id');
+        $date_type = $this->request->getGet('date_type');
+        $issuer = $this->request->getGet('issuer');
+        
+        $start_date = (!isset($start_date) || $start_date === '' || $start_date === null) ? 0 : $start_date;
+        $end_date = (!isset($end_date) || $end_date === '' || $end_date === null) ? 0 : $end_date;
+        
+        $client_id = (!isset($client_id) || $client_id === '' || $client_id === null) ? 0 : $client_id;
+        $insurer_id = (!isset($insurer_id) || $insurer_id === '' || $insurer_id === null) ? 0 : $insurer_id;      
+        $policy_type_id = (!isset($policy_type_id) || $policy_type_id === '' || $policy_type_id === null) ? 0 : $policy_type_id;      
+        $date_type = (!isset($date_type) || $date_type === '' || $date_type === null) ? 0 : $date_type;      
+        $issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer;   
+
+        $data['outstanting_list'] = $this->policyTransactionModel->getOutstandingReportLIst($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer);
+        // dd($this->policyTransactionModel->getLastQuery());
+        // dd($data);
+        $this->loadLayout('outstanding_report_list', $data); 
+
+    }
 
     //---------------------------------------------------------------------------------------------------
 
diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php
index b598cf95..c8d65de8 100755
--- a/app/Helpers/sendMailNotification.php
+++ b/app/Helpers/sendMailNotification.php
@@ -180,14 +180,6 @@ class sendMailNotification
             $client_data =$clientModel->where('id', $client_id)->first();
             $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
 
-            $client_policy_data = $clientPolicyModel->where('id', $client_policy_id)->first();
-
-            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
-                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $client_policy_id)->first();
-            }else{
-                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $client_policy_id)->first();
-            }
-
             // dd($notification_data);
 
             if (isset($notification_data) && $notification_data['enabled'] == 1) {
@@ -230,10 +222,20 @@ class sendMailNotification
                         
                         foreach ($item as $inner_item) {
 
+                            //getting policy premium data
+                            $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
+                            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
+                                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }else{
+                                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }
+                            //end of getting policy premium data
+
                             $policy_name = $inner_item['policy_name'];
                             
                             if ($inner_item['relationship'] == 'Self') {
                                 $emp_code = ' (' . $inner_item['emp_code'] . ')';
+                                $mail = $inner_item['email_corporate'];
                             } else {
                                 $emp_code = '';
                             }
@@ -385,14 +387,6 @@ class sendMailNotification
             $client_data =$clientModel->where('id', $client_id)->first();
             $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
 
-            $client_policy_data = $clientPolicyModel->where('id', $client_policy_id)->first();
-
-            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
-                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $client_policy_id)->first();
-            }else{
-                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $client_policy_id)->first();
-            }
-
             if (isset($notification_data) && $notification_data['enabled'] == 1) {        
 
                 $client_rm_data=  $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
@@ -436,6 +430,15 @@ class sendMailNotification
                         
                         foreach ($item as $inner_item) {
 
+                            //getting policy premium data
+                            $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
+                            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
+                                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }else{
+                                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }
+                            //end of getting policy premium data
+
                             $policy_name = $inner_item['policy_name'];
                             
                             if ($inner_item['relationship'] == 'Self') {
@@ -588,17 +591,8 @@ class sendMailNotification
             $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
             $clientRMModel =new ClientRMModel();
 
-
-            $client_policy_data = $clientPolicyModel->where('id', $client_policy_id)->first();
-
-            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
-                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $client_policy_id)->first();
-            }else{
-                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $client_policy_id)->first();
-            }
-
-
             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) {
@@ -641,6 +635,16 @@ class sendMailNotification
                         $is_addon = '';
                         
                         foreach ($item as $inner_item) {
+
+                            //getting policy premium data
+                            $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
+                            if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
+                                $policy_premium_data = $PolicyPremium1Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }else{
+                                $policy_premium_data = $PolicyPremium2Model->where('client_policy_id',  $inner_item['client_policy_id'])->where('is_active', '1')->first();
+                            }
+                            //end of getting policy premium data
+
                             $policy_name = $inner_item['policy_name'];
                             
                             if ($inner_item['relationship'] == 'Self') {
@@ -779,7 +783,7 @@ class sendMailNotification
                 }
 
                 return  $wholeData;
-           }
+            }
 
         }   
     }  
diff --git a/app/Models/ClientModel.php b/app/Models/ClientModel.php
index e188b5bd..3b40a3fb 100755
--- a/app/Models/ClientModel.php
+++ b/app/Models/ClientModel.php
@@ -114,5 +114,96 @@ class ClientModel extends Model
         
     }
 
+
+    public function getClientData($client_id = null)
+    {
+        // Load the database if not already loaded
+        $db = \Config\Database::connect();
+        
+        // Clients query
+        $clientQuery = $db->table('clients')
+            ->groupStart() // Start grouping OR conditions
+                ->where('client_type IS NULL OR client_type = ""')
+                ->orWhere('entity_type_id IS NULL OR entity_type_id = ""')
+                ->orWhere('client_name IS NULL OR client_name = ""')
+                ->orWhere('short_name IS NULL OR short_name = ""')
+                ->orWhere('pan IS NULL OR pan = ""')
+            ->groupEnd(); // End grouping OR conditions
+        
+        if ($client_id) {
+            // If client_id is passed, fetch data for this particular client
+            $clientQuery->where('id', $client_id);
+        }
+        
+        $clients = $clientQuery->get()->getResultArray();
+        
+        // Client Branch query
+        $branchQuery = $db->table('client_branch')
+            ->groupStart()
+                ->where('branch_name IS NULL OR branch_name = ""')
+                ->orWhere('branch_code IS NULL OR branch_code = ""')
+                ->orWhere('gst IS NULL OR gst = ""')
+                ->orWhere('units IS NULL OR units = ""')
+            ->groupEnd();
+        
+        if ($client_id) {
+            // Add filter for particular client's branches if client_id is passed
+            $branchQuery->where('client_id', $client_id);
+        }
+        
+        $clientBranches = $branchQuery->get()->getResultArray();
+        
+        // Client Policy query
+        $policyQuery = $db->table('client_policy')
+            ->groupStart()
+                ->where('client_id IS NULL OR client_id = ""')
+                ->orWhere('client_branch_id IS NULL OR client_branch_id = ""')
+                ->orWhere('policy_id IS NULL OR policy_id = ""')
+                ->orWhere('policy_type_id IS NULL OR policy_type_id = ""')
+                ->orWhere('insurer_id IS NULL OR insurer_id = ""')
+                ->orWhere('insurer_branch_id IS NULL OR insurer_branch_id = ""')
+                ->orWhere('tpa_id IS NULL OR tpa_id = ""')
+                ->orWhere('tpa_branch_id IS NULL OR tpa_branch_id = ""')
+                ->orWhere('policy_start_date IS NULL OR policy_start_date = ""')
+                ->orWhere('policy_end_date IS NULL OR policy_end_date = ""')
+                ->orWhere('policy_no IS NULL OR policy_no = ""')
+                ->orWhere('cd_ac_no IS NULL OR cd_ac_no = ""')
+                ->orWhere('policy_terms IS NULL OR policy_terms = ""')
+                ->orWhere('gst IS NULL OR gst = ""')
+            ->groupEnd();
+        
+        if ($client_id) {
+            // Add filter for particular client's policies if client_id is passed
+            $policyQuery->where('client_id', $client_id);
+        }
+        
+        $clientPolicies = $policyQuery->get()->getResultArray();
+        
+        // Client RM query
+        $rmQuery = $db->table('client_rm')
+            ->groupStart()
+                ->where('client_id IS NULL OR client_id = ""')
+                ->orWhere('user_id IS NULL OR user_id = ""')
+                ->orWhere('level IS NULL OR level = ""')
+            ->groupEnd();
+        
+        if ($client_id) {
+            // Add filter for particular client's RM if client_id is passed
+            $rmQuery->where('client_id', $client_id);
+        }
+        
+        $clientRms = $rmQuery->get()->getResultArray();
+        
+        // Combine all results into a single array
+        $result = [
+            'clients' => $clients,
+            'client_branches' => $clientBranches,
+            'client_policies' => $clientPolicies,
+            'client_rms' => $clientRms
+        ];
+        
+        return $result;
+    }
+
 }
 
diff --git a/app/Models/LeadsModel.php b/app/Models/LeadsModel.php
new file mode 100644
index 00000000..0f171b50
--- /dev/null
+++ b/app/Models/LeadsModel.php
@@ -0,0 +1,94 @@
+select('
+                        leads.*,
+                        kyc_entity_type.name as entity_type,
+                        policy_type.policy_type,
+                        user_profiles.first_name as salse_person_name
+                ')
+                ->join('kyc_entity_type', 'leads.entity_type_id = kyc_entity_type.id', 'left')
+                ->join('user_profiles', 'leads.salse_person_id = user_profiles.id', 'left')
+                ->join('policy_type', 'leads.policy_type_id = policy_type.id', 'left')
+                ->where('leads.is_active', 1)
+                ->where('leads.is_active', 1)
+                ->where('leads.is_active', 1)
+                ->findAll();
+
+    }
+    
+    
+}
diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php
index dca5d9b4..3fa28edd 100644
--- a/app/Models/PolicyTransactionModel.php
+++ b/app/Models/PolicyTransactionModel.php
@@ -565,7 +565,8 @@ class PolicyTransactionModel extends Model
                 'policy_transaction.action_type as action_type_full',
                 'pt_co_share_details.bp_amt',
                 'pt_co_share_details.tp_amt',
-                'pt_co_share_details.tep_amt'
+                'pt_co_share_details.tep_amt',
+                'policy_transaction.status'
             ])
             ->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
             ->join('clients', 'clients.id = policy_transaction.client_id', 'left')
@@ -573,7 +574,7 @@ class PolicyTransactionModel extends Model
             ->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
             ->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
             ->where('policy_transaction.is_active', 1)
-            ->where('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');
 
         if ($start_date != 0 && $end_date != 0 && $date_type != 0) {
@@ -633,7 +634,8 @@ class PolicyTransactionModel extends Model
                 END AS action_type,
                 policy_transaction.action_type AS action_type_full,
                 pt_co_share_details.exp_amt,
-                pt_co_share_details.variance
+                pt_co_share_details.variance,
+                policy_transaction.status
             ")
             ->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
             ->join('clients', 'clients.id = policy_transaction.client_id', 'left')
@@ -641,7 +643,7 @@ class PolicyTransactionModel extends Model
             ->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
             ->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
             ->where('policy_transaction.is_active', 1)
-            ->where('policy_transaction.status', 'completed')
+            // ->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');   
@@ -687,4 +689,103 @@ class PolicyTransactionModel extends Model
 
         return $builder->get()->getResultArray();
     }
+
+    public function getOutstandingReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0)
+    {
+        $builder = $this->db->table('policy_transaction')
+            ->select("
+                policy_transaction.id,
+                clients.client_name,
+                insurers.name AS insurer_name,
+                policy_type.policy_type,
+                policy_transaction.policy_no,
+                policy_transaction.endorsement_no,
+                CASE
+                    WHEN policy_transaction.action_type = 'inception' THEN 'I'
+                    ELSE 'E'
+                END AS action_type,
+                pt_co_share_details.exp_amt,
+                pt_co_share_details.variance,
+                insurer_statements.invoice_amount,
+                insurer_statements.invoice_status,
+    
+                ROUND((pt_co_share_details.actual_bp_brokerage_amt + pt_co_share_details.actual_tp_brokerage_amt + pt_co_share_details.actual_tep_brokerage_amt), 2) AS realization_amount2,
+                
+                (
+                    SELECT
+                    (SUM(inv_payment_details.inv_amt) + SUM(inv_payment_details.tds)) AS realization_amount
+                    FROM
+                    inv_payment_details
+                    WHERE
+                    inv_payment_details.statement_id = insurer_statements.id
+                    AND inv_payment_details.is_active = 1
+                        
+                ) AS realization_amount,
+    
+                ROUND(
+                    insurer_statements.invoice_amount - 
+                    (
+                        SELECT
+                        (SUM(inv_payment_details.inv_amt) + SUM(inv_payment_details.tds))
+                        FROM
+                        inv_payment_details
+                        WHERE
+                        inv_payment_details.statement_id = insurer_statements.id
+                        AND inv_payment_details.is_active = 1
+                    ),
+                2) AS outstanding_amount
+            ")
+            ->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
+            ->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
+            ->join('inv_payment_details', 'insurer_statements.id = inv_payment_details.statement_id', 'left')
+            ->join('clients', 'clients.id = policy_transaction.client_id', 'left')
+            ->join('insurers', 'pt_co_share_details.insurer_id = insurers.id', 'left')
+            ->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
+            ->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
+            ->where('policy_transaction.is_active', 1);
+    
+        // Date range filtering
+        if ($start_date != 0 && $end_date != 0 && $date_type != 0) {
+            $startDate = date('Y-m-d 00:00:00', strtotime($start_date));
+            $endDate = date('Y-m-d 23:59:59', strtotime($end_date));
+    
+            $builder->where('policy_transaction.' . $date_type . '>=', $startDate)
+                ->where('policy_transaction.' . $date_type . '<=', $endDate);
+        } else {
+            $fromDate = date('Y-m-d', strtotime('-30 days'));
+            $toDate = date('Y-m-d 23:59:59');
+    
+            $builder->where('policy_transaction.created_at >=', $fromDate)
+                ->where('policy_transaction.created_at <=', $toDate);
+        }
+    
+        // Additional filters
+        if ($client_id != 0) {
+            $builder->where('policy_transaction.client_id', $client_id);
+        }
+    
+        if ($insurer_id != 0) {
+            $builder->where('policy_transaction.insurer_id', $insurer_id);
+        }
+    
+        if ($policy_type_id != 0) {
+            $builder->where('client_policy.policy_type_id', $policy_type_id);
+        }
+    
+        if ($issuer != 0) {
+            $builder->where('policy_transaction.issuer', $issuer);
+        }
+    
+        if ($status != 0) {
+            $builder->where('policy_transaction.status', $status);
+        }
+    
+        // Filter where outstanding_amount is not null
+        $builder->having('outstanding_amount IS NOT NULL');
+    
+        $builder->orderBy('policy_transaction.id', 'desc');
+    
+        return $builder->get()->getResultArray();
+    }
+    
 }
diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php
index 89a5406f..16f0ec66 100755
--- a/app/Views/DashBoard.php
+++ b/app/Views/DashBoard.php
@@ -201,7 +201,7 @@ body {
                             Enrolment
                         
                     
-
+                    
 
                 
                 
- +
diff --git a/app/Views/bds_dash.php b/app/Views/bds_dash.php index 3e62985f..89a92413 100644 --- a/app/Views/bds_dash.php +++ b/app/Views/bds_dash.php @@ -123,29 +123,20 @@ body{ margin-top: 0; margin-bottom: 5px; } - -.modal-right{ - width: 100% !important; - justify-content: normal !important; -} - -.modal-body { - max-height: 100vh; - overflow-y: auto; - padding-left: 25px !important; - padding-right: 25px !important; - padding-top: 10px !important; - padding-bottom: 35% !important; -} -
-
- -
-
+ + +
+ + + +
+
Business Team Pending

@@ -155,12 +146,37 @@ body{
+ $value) { + $colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set + $shadeIndex = $index % $shadeCount; // Cycle through shades within the set + + // Get the background color for the current tile + $bgColor = $colorShades[$colorSetIndex][$shadeIndex]; + ?> + + + + - + -
-
+
+
Finance Team Pending

@@ -170,8 +186,35 @@ body{
+ $value) { + $colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set + $shadeIndex = $index % $shadeCount; // Cycle through shades within the set + + // Get the background color for the current tile + $bgColor = $colorShades[$colorSetIndex][$shadeIndex]; + ?> + + + + +
+
\ No newline at end of file diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php index 5ad5ea73..7f1ae499 100755 --- a/app/Views/employee_upload.php +++ b/app/Views/employee_upload.php @@ -103,7 +103,7 @@ option:disabled { diff --git a/app/Views/enrollment_list.php b/app/Views/enrollment_list.php index 4052ecb5..8459974c 100755 --- a/app/Views/enrollment_list.php +++ b/app/Views/enrollment_list.php @@ -714,12 +714,12 @@ } $.ajax({ - url: '' + client_id + '/' + client_branch_id, + url: '' + client_id + '/' + client_branch_id, type: "GET", dataType: 'json', success: function(res) { - console.log('send_manual_remainder', res) + console.log('send_manual_reminder', res) $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index e2538907..784b6a74 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -655,7 +655,15 @@
- + + +
  • @@ -672,7 +680,7 @@ Endorsement
  • - +
  • Statement upload @@ -684,13 +692,16 @@
  • Variance
  • +
  • + Outstanding +
  • Finance Team
  • - +
  • Business Team @@ -710,7 +721,7 @@
  • - --> +
    diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php new file mode 100644 index 00000000..83ba5210 --- /dev/null +++ b/app/Views/leads_form.php @@ -0,0 +1,587 @@ + + + + + + + + \ No newline at end of file diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php new file mode 100644 index 00000000..f062a1dd --- /dev/null +++ b/app/Views/leads_list.php @@ -0,0 +1,333 @@ + + + +
    +
    +
    +
    +
    +
    +

    Leads List

    +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + 0) { ?> + $row){ ?> + + + + + + + + + + + + + + + + + + + + + + + +
    S.No.
    Lead Type
    Issuer
    Client Type
    Client / Branch
    Entity Type
    Branch Name
    Branch Code
    Contact Person Name
    Contact Person Mobile
    Policy Type
    Status
    Action
    + +
    No data available
    +
    +
    +
    +
    +
    + + + + + diff --git a/app/Views/other_policy_terms.php b/app/Views/other_policy_terms.php index d21d40c4..c8ed3a48 100755 --- a/app/Views/other_policy_terms.php +++ b/app/Views/other_policy_terms.php @@ -249,7 +249,7 @@ $('body').on('click', '.btnPolicyMaster', function() { $('.loader-mask').delay(350).fadeOut('slow'); }, 500); - $('#nameOfThePolicyOnOther').html(' - ' + res.policy_name.name); + // $('#nameOfThePolicyOnOther').html(' - ' + res.policy_name.name); $('#emp_count').val(res.count) diff --git a/app/Views/outstanding_report_list.php b/app/Views/outstanding_report_list.php new file mode 100644 index 00000000..1c46f6a1 --- /dev/null +++ b/app/Views/outstanding_report_list.php @@ -0,0 +1,426 @@ + + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    + + +
    + + + +
    + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +

    Outstanding Report

    +
    + +
    +
    + + + + + + + + + + + + + + + + + $row){ ?> + + + + + + + + + + + + + + +
    S.NoClient NameInsurerPolicyEndorsement NoInvoice StatusInvoice AmountRealization AmountOutstanding Amount
    + +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/app/Views/policy_grid.php b/app/Views/policy_grid.php index 80351506..46f33c80 100755 --- a/app/Views/policy_grid.php +++ b/app/Views/policy_grid.php @@ -14,7 +14,7 @@ } .radio-group .form-check { - margin-right: -110px; + margin-right: -335px; } .radioalign{ @@ -2882,186 +2882,214 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p } $relationshipElement.empty(); + let html = ` -
    -
    - `; + +
    + + + `; + if (obj['self'] > 0) { let selfValue = additional_relationship['self'] || '1'; console.log('selfValue', selfValue); html += ` -
    - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    `; + + + + `; } if (obj['spouse'] > 0) { let spouseValue = additional_relationship['spouse'] || 'any'; html += ` -
    - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    `; + + + + `; } if (obj['childrens'] > 0) { - let childrensValue = additional_relationship['childrens'] || 'any'; html += ` -
    - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    `; + + + + `; } if (obj['parents'] > 0) { let parentsValue = additional_relationship['parents'] || 'any'; html += ` -
    - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    `; + + + + `; } if (obj['parents-in-law'] > 0) { let parentsInLawValue = additional_relationship['parents-in-law'] || 'any'; html += ` -
    - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    `; + + + + `; } html += ` + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    -
    `; + + `; - $relationshipElement.append(html); + console.log(html); - if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] == 0 && obj['spouse'] > 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] > 0) { - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { - $('.radio-group .form-check').css('margin-right', '-110px'); - } else if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ - $('.radio-group .form-check').css('margin-right', '-60px'); - } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ - $('.radio-group .form-check').css('margin-right', '-60px'); - } else { - $('.radio-group .form-check').css('margin-right', '-60px'); - } + $relationshipElement.append(html); - if(policy_type == 1 || policy_type == 6 || policy_type == 7){ - $('.radio-group .form-check').css('margin-right', '-50px'); - } + // if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] == 0 && obj['spouse'] > 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] > 0) { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) { + // $('.radio-group .form-check').css('margin-right', '-110px'); + // } else if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){ + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } else { + // $('.radio-group .form-check').css('margin-right', '-60px'); + // } + + // if(policy_type == 1 || policy_type == 6 || policy_type == 7){ + // $('.radio-group .form-check').css('margin-right', '-50px'); + // } } diff --git a/app/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 8d2d529d..cace5d10 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -361,6 +361,7 @@ Total + Agreed BP % @@ -370,9 +371,15 @@ Agreed TEP % - - Agreed Amount - + + + + + Agreed Amount + + + + Standard BP % @@ -382,42 +389,48 @@ Standard TEP % - - Actual BP Amount - - - Actual TP Amount - - - Actual TEP Amount - - - Actual BP % - - - Actual TP % - - - Actual TEP % - - - Actual BP
    Remuneration Amount - - - Actual TP
    Remuneration Amount - - - Actual TEP
    Remuneration Amount - - - Expected Amount - - - Variance - - - Reward - + + + + + Actual BP Amount + + + Actual TP Amount + + + Actual TEP Amount + + + Actual BP % + + + Actual TP % + + + Actual TEP % + + + Actual BP
    Remuneration Amount + + + Actual TP
    Remuneration Amount + + + Actual TEP
    Remuneration Amount + + + Expected Amount + + + Variance + + + Reward + + + + @@ -451,9 +464,21 @@