From 8265e28cf53b432f00a35edf60641371493236a6 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 3 Dec 2025 09:35:42 +0530 Subject: [PATCH 01/23] FIX_FILTER_CORS --- app/Config/Filters.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 9badfb5c..2128f042 100755 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -15,6 +15,7 @@ use App\Filters\CloseDbConnection; use App\Filters\AuthClientApi; use App\Filters\CommissionApiFilter; use App\Filters\VerifyAppSignature; +use App\Filters\Cors; use App\Filters\AuthJWT; @@ -41,6 +42,7 @@ class Filters extends BaseConfig 'CloseDbConnection' => CloseDbConnection::class, 'CommissionApiFilter'=> CommissionApiFilter::class, 'appSignature' => VerifyAppSignature::class, + 'Cors' => Cors::class, ]; /** From 4aeb2a101c1abdc871ad40a4cf345c0e8d6f0de2 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 3 Dec 2025 09:37:34 +0530 Subject: [PATCH 02/23] CHANGE_SAMPLE_EXCEL --- .../sample_bds_bulk_upload_excel.xlsx | Bin 7583 -> 7719 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/sample_excel/sample_bds_bulk_upload_excel.xlsx b/public/sample_excel/sample_bds_bulk_upload_excel.xlsx index 6606bc4ebbdfc86a80717aea91187adf3e96440e..c1f4d0e6c40c0f8f49057f019fe5b4c0322623da 100644 GIT binary patch delta 3855 zcmZ8k2UL^G5>7%3MIaJt2t|7D9qC}`ML=naAkw8*fzUe$1SB9$q$*OR3nC>n=`9FI zi=ZG)1OaKj@b0Yp+dPLg^?}+Art@xg8>MKItp$e2;opK z2~-4KNpAuP0=z_(6SE;LY&@QeLPM8pYR@}B&T8|d74Hmkj>OGe`So*;Rw7BwFCvns zVlPkU7{DciO=Tw8{%gG_-eddwUD>h*o=tYp&kro9yVN(}t<<(GNzp$v!8PCNk9nw} zWc!51U0z^a>(2TO8>5O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Tn?K6+NVc?E@3w!MR;{yPz~vl;V~yq%ObA^ z_x$=&g=*75m4YW32o-M7`X-|LU|t=e&gufqo(6aJS*f_>w>HXy z)KU?Ch@{&j)lmFot0pKcv9%nGYZbng`PPL4VJ5Au6tir-!y)noqoo0L$Bl;sW5&{J zj!s?Fp(?(`8u=`9rshMk{aDleW*g~;*V_u*SD`Az^c>29&eZZrRQDE+$j;9GqD6M% z?3_CmofqRjg&1R>zW7*Gay0$!&3jPIixw@1Dqg5Hs0uwsF4p>AZiw@1vkc=RW5%7p1gTzgUc~$l)a{Yf From b2b2fea4b056005716abd000aa07f49de4fd53f5 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 3 Dec 2025 09:54:12 +0530 Subject: [PATCH 03/23] FIX_GST_ISSUE --- app/Controllers/EmpDataServiceController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 99829bf0..f4787b33 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -5366,6 +5366,12 @@ class EmpDataServiceController extends BaseController 'amount' => ($params['base_premium'] ?? 0) + ($params['gst'] ?? 0), ]; + if(isset($policy_data['gst']) && $policy_data['gst'] != null){ + $coShareData['bp_igst'] = $policy_data['gst']; + $coShareData['bp_sgst'] = 0; + $coShareData['bp_cgst'] = 0; + } + if(isset($lead_data['agreed_percentage']) && !empty($lead_data['agreed_percentage'])){ $coShareData['exp_amt'] = (($params['base_premium'] ?? 0) * ($lead_data['agreed_percentage'] ?? 0)) / 100; }else{ From 297688aa19eab27a416bfbd1fb06fb87a5e571ec Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 3 Dec 2025 11:26:03 +0530 Subject: [PATCH 04/23] FIX_COMMEMT_LOG --- app/Filters/Cors.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Filters/Cors.php b/app/Filters/Cors.php index c47f2762..6aae35d9 100644 --- a/app/Filters/Cors.php +++ b/app/Filters/Cors.php @@ -107,11 +107,11 @@ class Cors implements FilterInterface ); } - $this->log('CORS filter initialized', [ - 'allowed_origins' => $this->allowedOrigins, - 'allow_credentials' => $this->allowCredentials, - 'allowed_methods' => $this->allowedMethods, - ]); + // $this->log('CORS filter initialized', [ + // 'allowed_origins' => $this->allowedOrigins, + // 'allow_credentials' => $this->allowCredentials, + // 'allowed_methods' => $this->allowedMethods, + // ]); } /** From 9d27a276af48ede712e08b02f659daf43b738cb6 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Wed, 3 Dec 2025 11:38:28 +0530 Subject: [PATCH 05/23] FIX_Policy 2 Becareful --- app/Config/Routes.php | 2 + .../PolicyTransactionController.php | 428 +- app/Views/layout/header.php | 3 + .../policy_transaction_inception_form_2.php | 6498 +++++++++++++++++ .../policy_transaction_inception_list.php | 13 + .../policy_transaction_inception_list_2.php | 1784 +++++ app/Views/pt_form_file_upload_tab.php | 2 +- app/Views/pt_form_file_upload_tab_2.php | 90 + 8 files changed, 8818 insertions(+), 2 deletions(-) create mode 100644 app/Views/policy_transaction_inception_form_2.php create mode 100644 app/Views/policy_transaction_inception_list_2.php create mode 100644 app/Views/pt_form_file_upload_tab_2.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 92552865..6331fc7f 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -432,6 +432,8 @@ $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { $routes->get("list/(:any)", "PolicyTransactionController::getInceptionDataForEdit/$1"); $routes->get("remove/(:any)", "PolicyTransactionController::removeCDMaster/$1"); $routes->get("removePolicyTransaction/(:any)", "PolicyTransactionController::removePolicyTransaction/$1"); + $routes->match(['get', 'post'], 'list2', 'PolicyTransactionController::viewInception2'); + $routes->get("list2/(:any)", "PolicyTransactionController::getInceptionDataForEdit2/$1"); }); $routes->group("endorsement", ["filter" => "authMVC"], function ($routes) { diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 97a24a24..3233a1dd 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -671,8 +671,9 @@ // Fetch Sales Team $data['salse_team'] = $this->userModel - ->select('user_profiles.*') + ->select('user_profiles.*,nhance_branch.id as nhance_branch_id, nhance_branch.branch_name as nhance_branch_name') ->join('user_teams', 'user_profiles.id = user_teams.user_id') + ->join('nhance_branch', 'user_profiles.nhance_branch_id = nhance_branch.id','left') ->where('user_teams.team_id', 5) ->where('user_teams.is_active', 1) ->where('user_profiles.is_active', 1) @@ -690,6 +691,7 @@ ->where('is_active', 1) ->findAll(); // echo '
';
+            
             // print_r($data['ppTeamsData']); die;
 
             // dd($data);
@@ -698,6 +700,160 @@
             $this->loadLayout('policy_transaction_inception_list', $data);
         }
 
+        public function viewInception2()
+        {   
+            $bds_edit_pt_id = $this->request->getGet('pt_id') ?? null;
+            $data['tab_name']  = 'Policies';
+            $data['page_name'] = 'Policies';
+
+            // Static arrays for dropdowns
+            $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
+            $data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();
+            $data['client_type'] = [1 => 'Group', 2 => 'Individual'];
+            $data['issuing_type'] = [1 => 'Fresh', 2 => 'Renewal', 3 => 'Roll Over'];
+            $data['policy_status'] = [
+                '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',
+                'lost' => 'Lost',
+            ];
+            $data['invoice_status_array'] = [
+                'yet_to_generate' => 'Pending',
+                'generated' => 'Generated',
+                'send' => 'Sent',
+                'recived' => 'Payment Received',
+            ];
+            // $data['vehicle_type'] = [
+            //     'two_wheeler' => 'Two Wheeler',
+            //     'four_wheeler' => 'Four Wheeler',
+            //     'truck' => 'Truck',
+            //     'bus' => 'Bus',
+            //     'van' => 'Van',
+            //     'suv' => 'SUV',
+            //     'motorcycle' => 'Motorcycle',
+            //     'bicycle' => 'Bicycle'
+            // ];
+            $data['vehicle_type'] = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
+            $data['rto_details'] = db_connect()->table('rto_master')->where('is_active', 1)->get()->getResultArray();
+
+            $data['vehicle_des'] = [
+                'commercial' => 'Commercial',
+                'private' => 'Private',
+            ];
+            $data['date_type'] = [
+                'policy_issue_date' => 'Policy Issue Date',
+                'policy_start_date' => 'Policy Start Date',
+                'policy_end_date' => 'Policy End Date',
+            ];
+
+            // Filter data
+            $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');
+            $status = $this->request->getGet('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`
+
+            if(empty($bds_edit_pt_id)){
+                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
+                    );
+                }
+            }else{
+                $data['inception_data_list'] = [];
+            }
+
+
+
+            // Fetch additional data
+            $data['client'] = $this->clientModel->where('is_active', 1)->findAll();
+            $data['client_branch'] = $this->clientBranchModel->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['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
+            $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.*,nhance_branch.id as nhance_branch_id, nhance_branch.branch_name as nhance_branch_name')
+                ->join('user_teams', 'user_profiles.id = user_teams.user_id')
+                ->join('nhance_branch', 'user_profiles.nhance_branch_id = nhance_branch.id','left')
+                ->where('user_teams.team_id', 5)
+                ->where('user_teams.is_active', 1)
+                ->where('user_profiles.is_active', 1)
+                ->findAll();
+
+            // Fetch Partner Agent
+            $data['partner_agent'] = db_connect()->table('partner_agent')
+                                            ->where('is_active', 1)
+                                            ->get()
+                                            ->getResultArray();
+            
+            // Fetch ACM
+            $data['ACM'] = $this->userModel
+                ->where('role', 3)  // Assuming `role` is in `user_profiles`
+                ->where('is_active', 1)
+                ->findAll();
+                // echo '
';
+            
+            // print_r($data['ppTeamsData']); die;
+
+            // dd($data);
+
+            // Load view
+            $this->loadLayout('policy_transaction_inception_list_2', $data);
+        }
+
         // policy Transaction Create function start
         public function createInceptionPolicy()
         {   
@@ -1483,6 +1639,276 @@
             }
         }
 
+        // Get the Single Inception Tranction data for edit
+        public function getInceptionDataForEdit2($id)
+        {
+            $data = $this->policyTransactionModel
+                ->select('
+                            policy_transaction.*, 
+                            clients.short_name as client_short_name, 
+                            clients.client_type, 
+                            clients.entity_type_id, 
+                            policy_type.policy_type,
+                            client_policy.tpa_id as master_tpa_id,
+                            client_policy.tpa_branch_id as master_tpa_branch_id,
+                            client_policy.policy_type_id as master_policy_type_id,
+                            client_policy.is_addon,
+                            client_policy.base_policy,
+                            ( 
+                                select last_action_date
+                                from policy_transaction_status
+                                where policy_tran_id = policy_transaction.id
+                                and status = policy_transaction.status
+                                order by id desc
+                                limit 1
+
+                            ) as last_action_date
+                        ')
+                ->join('clients', 'clients.id = policy_transaction.client_id')
+                ->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
+                ->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
+                ->where('policy_transaction.id', $id)
+                ->where('policy_transaction.is_active', 1)
+                ->first();
+
+            $data['created_at'] = (isset($data['created_at']) && $data['created_at'] !== null && $data['created_at'] !== '')
+                ? date('d/m/Y h:i:s A', strtotime($data['created_at']))
+                : null;
+
+            $data['updated_at'] = (isset($data['updated_at']) && $data['updated_at'] !== null && $data['updated_at'] !== '')
+                ? date('d/m/Y h:i:s A', strtotime($data['updated_at']))
+                : null;
+
+
+            if (!empty($data['policy_issue_date'])) {
+                $data['policy_issue_date'] =  change_date_format($data['policy_issue_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['policy_start_date'])) {
+                $data['policy_start_date'] =  change_date_format($data['policy_start_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['policy_end_date'])) {
+                $data['policy_end_date'] =  change_date_format($data['policy_end_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['renewal_date'])) {
+                $data['renewal_date'] =  change_date_format($data['renewal_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['rollover_date'])) {
+                $data['rollover_date'] =  change_date_format($data['rollover_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['endorse_eff_date'])) {
+                $data['endorse_eff_date'] =  change_date_format($data['endorse_eff_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['last_action_date'])) {
+                $data['last_action_date'] =  change_date_format($data['last_action_date'], 'Y-m-d', 'd/m/Y');
+            }
+
+            if (!empty($data['month'])) {
+                $data['month'] =  change_date_format($data['month'], 'Y-m-d', 'M/Y');
+            } else {
+                $data['month'] = null;
+            }
+
+            // print_r($data); die;
+
+            $data['renewal_policy'] = $this->clientPolicyModel
+                ->select('client_policy.*, policy_type.policy_type')
+                ->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
+                ->where('client_policy.client_id', $data['client_id'])
+                ->where('client_policy.client_branch_id', $data['client_branch_id'])
+                ->where('client_policy.is_active', 1)
+                ->findAll();
+
+            $data['base_policy_data'] = $this->clientPolicyModel
+                ->select('client_policy.*, policy_type.policy_type')
+                ->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
+                ->where('client_policy.client_id', $data['client_id'])
+                ->where('client_policy.client_branch_id', $data['client_branch_id'])
+                ->whereIn('client_policy.policy_type_id', [2, 3])
+                ->where('client_policy.is_active', 1)
+                ->findAll();
+
+            $pt_bp_amt = $this->PTCOShareDetailsModel
+                ->select('bp_amt, amount')
+                ->where('pt_id', $id)
+                ->where('co_share_type', 1)
+                ->where('is_active', 1)
+                ->first();
+
+            // dd(db_connect()->getLastQuery() ,$pt_bp_amt);
+            $data['base_cd_amount'] = $pt_bp_amt['amount'] ?? null;
+
+
+            $ptFileQuery = $this->PTFileModel
+                ->join('policy_transaction', 'pt_files.pt_id = policy_transaction.id')
+                ->where('pt_files.pt_id', $id)
+                ->where('pt_files.is_active', 1);
+
+            if (!in_array(get_role_id(), [1, 5]) && empty(array_intersect(user_team(), [MANAGEMENT_TEAM_ID, FINANCE_TEAM_ID, BUSINESS_TEAM_ID]))) {
+
+                if (get_role_id() == 4 && in_array(POS_TEAM_ID, user_team())) {
+                    $ptFileQuery->where('pt_files.created_by', get_session_userid());
+                }
+            }
+
+            $data['pt_files'] = $ptFileQuery->findAll();
+
+
+
+            $data['pt_co_share_details'] = $this->PTCOShareDetailsModel
+                ->select("
+                        pt_co_share_details.*,
+                
+                        (
+                            SELECT
+                                COUNT(*)
+                            FROM
+                                co_share_stmt_details
+                            WHERE
+                                co_share_stmt_details.co_share_id = pt_co_share_details.id
+                                AND co_share_stmt_details.is_active = 1
+                        ) AS record_count,
+
+                            (
+                                SELECT 
+                                    SUM(actual_bp_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_bp_amount,
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tp_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tp_amount,
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tep_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tep_amount,
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_bp_per) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_bp_percentage,
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tp_per) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tp_percentage,
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tep_per) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tep_percentage,
+                            
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_bp_brokerage_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_bp_brokerage_amount,
+                            
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tp_brokerage_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tp_brokerage_amount,
+                            
+                            
+                            (
+                                SELECT 
+                                    SUM(actual_tep_brokerage_amt) 
+                                FROM 
+                                    co_share_stmt_details 
+                                WHERE 
+                                    co_share_id = pt_co_share_details.id 
+                                    AND is_active = 1
+                                    
+                            ) AS actual_tep_brokerage_amount,
+
+                            DATE_FORMAT(pt_policy_issue_date, '%d/%m/%Y') AS pt_policy_issue_date
+
+                    ")
+                ->where('pt_id', $id)
+                ->where('is_active', 1)
+                ->orderBy('id', 'asc')
+                ->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')
+                ->where('employees.client_id', $data['client_id'])
+                ->where('employees.is_active', 1)->findAll();
+            // $data['client_kyc']   = $this->clientKYCDocsModel->where('client_id',  $data['client_id'])->findAll();
+
+            $clientController = new ClientController();
+            $data['client_kyc_primary_table']  =  $clientController->generateKycPrimaryTable($data['client_id']);
+            $data['client_kyc_other_table']  =  $clientController->generateKycOthersTable($data['client_id']);
+
+            $data['vehicle_docs'] = $this->clientKYCDocsModel
+                ->where('client_id',  $data['client_id'])
+                ->where('vehicle_id', $data['vehicle_id'])
+                ->findAll();
+
+            // print_r( $data['pt_co_share_details']); die;
+            // return $data;
+            if ($data) {
+                return $this->respond(['status' => true, 'data' => $data], 200);
+            } else {
+                return $this->respond(['status' => false], 200);
+            }
+        }
+
         public function removePolicyTransaction($id, $type = 0)
         {   
             if ($id) {
diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php
index d55658d0..43ba28ee 100755
--- a/app/Views/layout/header.php
+++ b/app/Views/layout/header.php
@@ -1890,6 +1890,9 @@
                                                     
  • Policy
  • +
  • + Policy 2 +
  • Endorsement
  • diff --git a/app/Views/policy_transaction_inception_form_2.php b/app/Views/policy_transaction_inception_form_2.php new file mode 100644 index 00000000..d73ab07d --- /dev/null +++ b/app/Views/policy_transaction_inception_form_2.php @@ -0,0 +1,6498 @@ + + + + + + +
    + +
    +
    +
    +
    +
    + +
    +

    Add Policy

    +
    +
    + +
    +
    + Back +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    + + +
    + +
    + + +
    + + + + + + + +
    + + +
    + +
    + + + +
    + +
    + + +
    + +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    + + +
    + +
    +
    + +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + +
    + + + +
    +
    +
    +
    +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index 64c113fe..ae82bc2c 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -1768,4 +1768,17 @@ function removePolicyTransaction(input, pt_id, policy_type_id) { }); } +function showForm(form) { + + if (form == 1) { + $('#form1').show(); + $('#form2').hide(); + } + + if (form == 2) { + $('#form1').hide(); + $('#form2').show(); + } +} + \ No newline at end of file diff --git a/app/Views/policy_transaction_inception_list_2.php b/app/Views/policy_transaction_inception_list_2.php new file mode 100644 index 00000000..7df52f9e --- /dev/null +++ b/app/Views/policy_transaction_inception_list_2.php @@ -0,0 +1,1784 @@ + + + + +
    +
    +
    +
    +

    + Filter + + + +

    +
    +
    +
    +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + +
    + + +
    + +
    + +
    + + + +
    + + +
    + + + + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    Policy List

    +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + $row){ ?> + + + + + + + + + + + + + + + + + + + + +
    S.No.
    Issuer
    Business Type
    Client Type
    Client / Branch
    Insurer
    Policy
    Policy No
    Policy Issue Date
    D.O.C
    D.O.E
    No of Insured
    No of Dependents
    Status
    User
    Action
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/app/Views/pt_form_file_upload_tab.php b/app/Views/pt_form_file_upload_tab.php index cb8968fe..f5f6f10a 100644 --- a/app/Views/pt_form_file_upload_tab.php +++ b/app/Views/pt_form_file_upload_tab.php @@ -7,7 +7,7 @@