From a9d7eafcedd522b14befbac13c3f67e2eb72fa4a Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 27 Jan 2026 17:16:20 +0530 Subject: [PATCH] CHANGE_SET_LEAD_CD_AMOUT_IN_NEW_CD_AMT_IN_CLIENT_POLICY --- app/Models/ClientPolicyModel.php | 12 +++++++++++- app/Views/cd_master_add_modal.php | 1 - app/Views/client_list.php | 6 +++++- app/Views/client_policy.php | 27 +++++++++++++++++++++++---- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index 8f84def5..204324c5 100755 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -118,7 +118,16 @@ class ClientPolicyModel extends Model return $this->db->table('client_policy') - ->select('client_policy.*') + ->select(' + + client_policy.*, + CASE + WHEN client_policy.policy_entry_from = 3 + AND client_policy.cd_ac_pk IS NULL + THEN leads.cd_amount + ELSE NULL + END AS lead_cd_amount + ', false) ->select('insurers.name as insurer_name, insurers.short_name as insurer_short') ->select('tpa.name as tpa_name, tpa.short_name as tpa_short') ->select('policy_type.policy_type as policy_type_name') @@ -132,6 +141,7 @@ class ClientPolicyModel extends Model ->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left') ->join('policy_type', 'policy_type.id = client_policy.policy_type_id') ->join('client_branch', 'client_branch.id = client_policy.client_branch_id') + ->join('leads', 'client_policy.is_from_lead = leads.id', 'left') ->where('client_policy.client_id', $client_id) // ->where('client_policy.policy_status', 1) ->where('client_policy.is_active', 1) diff --git a/app/Views/cd_master_add_modal.php b/app/Views/cd_master_add_modal.php index 84de0dd8..d07b87d4 100644 --- a/app/Views/cd_master_add_modal.php +++ b/app/Views/cd_master_add_modal.php @@ -289,7 +289,6 @@ $('#opening_date').val(''); $('#cd_ac_no_for_cd_master').val(''); - $('#opening_bal').val(''); // $('#CDMasterForm').attr('action', ''); $('#title').html('Add Opening Amount'); $('#cd_master_btn_Submit').html('Submit'); diff --git a/app/Views/client_list.php b/app/Views/client_list.php index 0277d199..c9b5a2b7 100755 --- a/app/Views/client_list.php +++ b/app/Views/client_list.php @@ -645,7 +645,11 @@ function featchClient(){ $('.loader-mask').delay(350).fadeOut('slow'); if(res.status == true){ - let client_url = '' + res.client_id + '?client_policy_id=' + res.client_policy_id+'#police-tab'; + let client_url = '' + + res.client_id + + '?cd_amt=' + (res.cd_amount ?? 0) + + '&client_policy_id=' + res.client_policy_id + + '#police-tab'; toastr.success(res.message, 'SUCCESS') window.location.href = client_url }else{ diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index e520a493..398a0faf 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -527,7 +527,7 @@ input:checked + .slider_blue::before {