From 46278b9f94824470fad794d56e746fed962ed992 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 15 Oct 2024 14:42:46 +0530 Subject: [PATCH 1/8] FIX_BDS_HIDE_AND_SHOW_ISSUE_AND_SENMAIL_NOTIFICATION_FUNCTION_TEST_FUNCTION_AND_OTHRS : RV --- app/Config/Routes.php | 3 +- app/Controllers/ClientController.php | 157 ++-- app/Helpers/sendMailNotification.php | 58 +- .../policy_transaction_endorsement_form.php | 684 +++++++++------- .../policy_transaction_inception_form.php | 761 +++++++++++------- 5 files changed, 1014 insertions(+), 649 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 123b329a..c12db26c 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("testing", "ClientController::Testing"); +$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"); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 79dc65c4..6bad026d 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() 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/Views/policy_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 8d2d529d..543f2863 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -361,66 +361,74 @@ Total - - Agreed BP % - - - Agreed TP % - - - Agreed TEP % - - - Agreed Amount - - - Standard BP % - - - Standard TP % - - - 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 - + + + + + Agreed BP % + + + Agreed TP % + + + Agreed TEP % + + + Agreed Amount + + + Standard BP % + + + Standard TP % + + + 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 + + + + + + @@ -451,9 +459,21 @@ \ No newline at end of file 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_transaction_endorsement_form.php b/app/Views/policy_transaction_endorsement_form.php index 543f2863..cace5d10 100644 --- a/app/Views/policy_transaction_endorsement_form.php +++ b/app/Views/policy_transaction_endorsement_form.php @@ -362,29 +362,36 @@ Total - + + Agreed BP % + + + Agreed TP % + + + Agreed TEP % + + + - - Agreed BP % - - - Agreed TP % - - - Agreed TEP % - Agreed Amount - - Standard BP % - - - Standard TP % - - - Standard TEP % - + + + + + Standard BP % + + + Standard TP % + + + Standard TEP % + + + + Actual BP Amount @@ -427,8 +434,6 @@ - - @@ -954,6 +959,12 @@ function amountCalculation(input) { let standard_tp_per = parseFloat($('#standard_tp_' + input).val()) || 0; let standard_tep_per = parseFloat($('#standard_tep_' + input).val()) || 0; + let co_share_per = parseFloat($('#co_share_per_' + input).val()) || 0; + + let co_premium_amt = ((bp + tp + tep) * co_share_per) / 100; + $('#co_premium_' + input).val(!isNaN(co_premium_amt) && isFinite(co_premium_amt) ? co_premium_amt.toFixed(2) : '0.00'); + + // Calculate GST percentage let gst_per = igst; if (igst === 0) { @@ -1226,6 +1237,65 @@ function actualAmountCalculation(input, field = null){ // console.log('variance', variance); } +function co_share_percentage_calculation(input){ + + var inputs = $('[name="co_share_per[]"]'); + + // Find the empty input(s) + var emptyInputs = inputs.filter(function() { + return $(this).val().trim() === ''; // Check for empty values + }); + + // Get the number of empty inputs + var emptyCount = emptyInputs.length; + console.log('Number of empty inputs:', emptyCount); + + // If there's exactly one empty input, calculate and set its value + if (emptyCount === 1) { + // Calculate the sum of filled values + let sumFilled = 0; + inputs.each(function() { + var val = parseFloat($(this).val()) || 0; + sumFilled += val; + }); + + // Calculate the balance percentage + let balance_per = 100 - sumFilled; + console.log('Balance percentage:', balance_per); + + // Set the balance value to the empty input + emptyInputs.val(balance_per); + } + +} + +function select_leader_disable_premium_amt(input, value) { + if ($(input).is(':checked')) { + // Disable and add readonly-select class to all premiums except the one with the given value + $('input[name="base_premium[]"]').addClass('readonly-select'); + $('#base_premium_' + value).removeClass('readonly-select'); + + $('input[name="tp_premium[]"]').addClass('readonly-select'); + $('#tp_premium_' + value).removeClass('readonly-select'); + + $('input[name="ter_premium[]"]').addClass('readonly-select'); + $('#ter_premium_' + value).removeClass('readonly-select'); + + $('input[name="stamp_duty[]"]').addClass('readonly-select'); + $('#stamp_duty_' + value).removeClass('readonly-select'); + + $('input[name="co_premium[]"]').addClass('readonly-select'); + $('#co_premium_' + value).removeClass('readonly-select'); + } else { + // Enable and remove readonly-select class from all premiums except the one with the given value + $('input[name="base_premium[]"]').removeClass('readonly-select'); + $('input[name="tp_premium[]"]').removeClass('readonly-select'); + $('input[name="ter_premium[]"]').removeClass('readonly-select'); + $('input[name="stamp_duty[]"]').removeClass('readonly-select'); + $('input[name="co_premium[]"]').removeClass('readonly-select'); + } +} + function validateRange(input) { // if (input.value < 1) input.value = 1; if (input.value > 100) input.value = 100; @@ -1386,14 +1456,206 @@ function addInsurerColumn() { case 1: // Is Leader? newCell = ` `; break; case 2: // Co-Share % - newCell = ``; + newCell = ``; + break; + case 3: // Base Premium + newCell = ``; + break; + case 4: // TP Premium + newCell = ``; + break; + case 5: // Ter Premium + newCell = ``; + break; + case 6: // co Premium + newCell = ``; + break; + case 7: // CGST + newCell = ``; + break; + case 8: // SGST + newCell = ``; + break; + case 9: // IGST + newCell = ``; + break; + case 10: // GST Amount + newCell = ``; + break; + case 11: // Stamp Duty + newCell = ``; + break; + case 12: // Total + newCell = ``; + break; + case 13: // Agreed BP % + newCell = ``; + break; + case 14: // Agreed TP % + newCell = ``; + break; + case 15: // Agreed Ter % + newCell = ``; + break; + case 16: // Standard BP % + newCell = ``; + break; + case 17: // Standard TP % + newCell = ``; + break; + case 18: // Standard Ter % + newCell = ``; + break; + case 19: // Actual BP Amount + newCell = ``; + break; + case 20: // Actual TP Amount + newCell = ``; + break; + case 21: // Actual TEP Amount + newCell = ``; + break; + case 22: // Actual BP % + newCell = ``; + break; + case 23: // Actual TP % + newCell = ``; + break; + case 24: // Actual TEP % + newCell = ``; + break; + case 25: // Actual BP Brokerage Amount + newCell = ``; + break; + case 26: // Actual TP Brokerage Amount + newCell = ``; + break; + case 27: // Actual TEP Brokerage Amount + newCell = ``; + break; + case 28: // Expected Amount + newCell = ``; + break; + case 29: // Variance + newCell = ``; + break; + case 30: // Reward + newCell = ``; + break; + case 31: // ID For Update + newCell = ``; + break; + } + }else if(team_id.includes('3')){ + switch(index) { + case 0: // Insurer selection + newCell = ` + + `; + break; + case 1: // Is Leader? + newCell = ` + + + `; + break; + case 2: // Co-Share % + newCell = ``; + break; + case 3: // Base Premium + newCell = ``; + break; + case 4: // TP Premium + newCell = ``; + break; + case 5: // Ter Premium + newCell = ``; + break; + case 6: // co Premium + newCell = ``; + break; + case 7: // CGST + newCell = ``; + break; + case 8: // SGST + newCell = ``; + break; + case 9: // IGST + newCell = ``; + break; + case 10: // GST Amount + newCell = ``; + break; + case 11: // Stamp Duty + newCell = ``; + break; + case 12: // Total + newCell = ``; + break; + case 13: // Agreed BP % + newCell = ``; + break; + case 14: // Agreed TP % + newCell = ``; + break; + case 15: // Agreed Ter % + newCell = ``; + break; + case 16: // Standard BP % + newCell = ``; + break; + case 17: // Standard TP % + newCell = ``; + break; + case 18: // Standard Ter % + newCell = ``; + break; + case 19: // ID For Update + newCell = ``; + break; + } + }else if(team_id.includes('6')){ + switch(index) { + case 0: // Insurer selection + newCell = ` + + `; + break; + case 1: // Is Leader? + newCell = ` + + + `; + break; + case 2: // Co-Share % + newCell = ``; break; case 3: // Base Premium newCell = ``; @@ -1486,69 +1748,6 @@ function addInsurerColumn() { newCell = ``; break; } - }else if(team_id.includes('3')){ - switch(index) { - case 0: // Insurer selection - newCell = ` - - `; - break; - case 1: // Is Leader? - newCell = ` - - - `; - break; - case 2: // Co-Share % - newCell = ``; - break; - case 3: // Base Premium - newCell = ``; - break; - case 4: // TP Premium - newCell = ``; - break; - case 5: // Ter Premium - newCell = ``; - break; - case 6: // co Premium - newCell = ``; - break; - case 7: // CGST - newCell = ``; - break; - case 8: // SGST - newCell = ``; - break; - case 9: // IGST - newCell = ``; - break; - case 10: // GST Amount - newCell = ``; - break; - case 11: // Stamp Duty - newCell = ``; - break; - case 12: // Total - newCell = ``; - break; - case 13: // Agreed BP % - newCell = ``; - break; - case 14: // ID For Update - newCell = ``; - break; - } } // console.log(newCell); @@ -1668,7 +1867,154 @@ function populateTable(dataArray, status = false) { cell.find('select').val(insurer); break; case 1: // Is Leader? - cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1'); + cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1').change(); + break; + case 2: // Co-Share % + cell.find('input').val(data.co_share_per); + break; + case 3: // Base Premium + cell.find('input').val(status ? data.bp_amt : ''); + break; + case 4: // TP Premium + cell.find('input').val(status ? data.tp_amt : ''); + break; + case 5: // Ter Premium + cell.find('input').val(status ? data.tep_amt : ''); + break; + case 6: // Co Premium + cell.find('input').val(data.cop_amt); + break; + case 7: // CGST + cell.find('input').val(data.bp_cgst); + break; + case 8: // SGST + cell.find('input').val(data.bp_sgst); + break; + case 9: // IGST + cell.find('input').val(data.bp_igst); + break; + case 10: // GST Amount + cell.find('input').val(status ? data.bp_gst_amt : ''); + break; + case 11: // Stamp Duty + cell.find('input').val(status ? data.stamp_duty : ''); + break; + case 12: // Total + cell.find('input').val(status ? data.amount : ''); + break; + case 13: // Agreed BP % + cell.find('input').val(data.agreed_bp_per); + break; + case 14: // Agreed TP % + cell.find('input').val(data.agreed_tp_per); + break; + case 15: // Agreed Ter % + cell.find('input').val(data.agreed_tep_per); + break; + case 16: // Standard BP % + cell.find('input').val(data.standerd_bp_per); + break; + case 17: // Standard TP % + cell.find('input').val(data.standerd_tp_per); + break; + case 18: // Standard Ter % + cell.find('input').val(data.standerd_tep_per); + break; + case 19: // Actual BP Amount + cell.find('input').val(status ? data.actual_bp_amt : ''); + break; + case 20: // Actual TP Amount + cell.find('input').val(status ? data.actual_tp_amt : ''); + break; + case 21: // Actual Ter Amount + cell.find('input').val(status ? data.actual_tep_amt : ''); + break; + case 22: // Actual BP % + cell.find('input').val(status ? data.actual_bp_per : ''); + break; + case 23: // Actual TP % + cell.find('input').val(status ? data.actual_tp_per : ''); + break; + case 24: // Actual Ter % + cell.find('input').val(status ? data.actual_tep_per : ''); + break; + case 25: // Actual BP Brokerage Amount + cell.find('input').val(status ? data.actual_bp_brokerage_amt : ''); + break; + case 26: // Actual TP Brokerage Amount + cell.find('input').val(status ? data.actual_tp_brokerage_amt : ''); + break; + case 27: // Actual Ter Brokerage Amount + cell.find('input').val(status ? data.actual_tep_brokerage_amt : ''); + break; + case 28: // Expected Amount + cell.find('input').val(status ? data.exp_amt : ''); + break; + case 29: // Variance + cell.find('input').val(status ? data.variance : ''); + break; + case 30: // Reward + cell.find('input').val(status ? data.reward : ''); + break; + case 31: // Co-share ID (hidden field) + cell.find('input[type="hidden"]').val(status ? data.id : ''); + break; + } + }else if(team_id.includes('3')){ + switch (rowIndex) { + case 0: // Insurer selection + cell.find('select').val(insurer); + break; + case 1: // Is Leader? + cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1').change(); + break; + case 2: // Co-Share % + cell.find('input').val(data.co_share_per); + break; + case 3: // Base Premium + cell.find('input').val(status ? data.bp_amt : ''); + break; + case 4: // TP Premium + cell.find('input').val(status ? data.tp_amt : ''); + break; + case 5: // Ter Premium + cell.find('input').val(status ? data.tep_amt : ''); + break; + case 6: // Co Premium + cell.find('input').val(data.cop_amt); + break; + case 7: // CGST + cell.find('input').val(data.bp_cgst); + break; + case 8: // SGST + cell.find('input').val(data.bp_sgst); + break; + case 9: // IGST + cell.find('input').val(data.bp_igst); + break; + case 10: // GST Amount + cell.find('input').val(status ? data.bp_gst_amt : ''); + break; + case 11: // Stamp Duty + cell.find('input').val(status ? data.stamp_duty : ''); + break; + case 12: // Total + cell.find('input').val(status ? data.amount : ''); + break; + case 13: // Agreed BP % + cell.find('input').val(data.agreed_bp_per); + break; + case 14: // Co-share ID (hidden field) + cell.find('input[type="hidden"]').val(status ? data.id : ''); + break; + } + }else if(team_id.includes('6')){ + switch (rowIndex) { + case 0: // Insurer selection + cell.find('select').val(insurer); + break; + case 1: // Is Leader? + cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1').change(); break; case 2: // Co-Share % cell.find('input').val(data.co_share_per); @@ -1764,54 +2110,6 @@ function populateTable(dataArray, status = false) { cell.find('input[type="hidden"]').val(status ? data.id : ''); break; } - }else if(team_id.includes('3')){ - switch (rowIndex) { - case 0: // Insurer selection - cell.find('select').val(insurer); - break; - case 1: // Is Leader? - cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1'); - break; - case 2: // Co-Share % - cell.find('input').val(data.co_share_per); - break; - case 3: // Base Premium - cell.find('input').val(status ? data.bp_amt : ''); - break; - case 4: // TP Premium - cell.find('input').val(status ? data.tp_amt : ''); - break; - case 5: // Ter Premium - cell.find('input').val(status ? data.tep_amt : ''); - break; - case 6: // Co Premium - cell.find('input').val(data.cop_amt); - break; - case 7: // CGST - cell.find('input').val(data.bp_cgst); - break; - case 8: // SGST - cell.find('input').val(data.bp_sgst); - break; - case 9: // IGST - cell.find('input').val(data.bp_igst); - break; - case 10: // GST Amount - cell.find('input').val(status ? data.bp_gst_amt : ''); - break; - case 11: // Stamp Duty - cell.find('input').val(status ? data.stamp_duty : ''); - break; - case 12: // Total - cell.find('input').val(status ? data.amount : ''); - break; - case 13: // Agreed BP % - cell.find('input').val(data.agreed_bp_per); - break; - case 14: // Co-share ID (hidden field) - cell.find('input[type="hidden"]').val(status ? data.id : ''); - break; - } } }); }); diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 23713e6f..c6d0e22a 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -155,6 +155,7 @@ +
    @@ -353,7 +354,18 @@
    - + + +
    @@ -573,6 +585,7 @@
    +
    @@ -142,13 +127,13 @@
    -
    -
    @@ -184,14 +169,14 @@
    - +
    +
    +
    @@ -204,32 +189,36 @@
    -
    -
    -
    -
    + +
    +
    +
    @@ -287,13 +276,50 @@