From 875f38caaa238816dab7e6b8d63cc1904e3c3ade Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 5 Jul 2024 14:53:50 +0530 Subject: [PATCH] CHANGE_THE_FIELD_NAME_SEZ_TO_ENABLE_SEZ : RV --- app/Models/ClientPolicyModel.php | 24 ++++++++++++++++++------ app/Views/client_branch.php | 2 +- app/Views/policy_type_list.php | 6 +++--- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index ef056e3e..18aed0f1 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -263,13 +263,25 @@ public function getBalances($clientId) public function getDepositlistsummary($id) { + // return $this->db->table('cash_deposit') + // ->select('insurer_id') + // ->select('SUM(CASE WHEN transaction_type = "Credit" THEN amount ELSE -amount END) AS balance') + // ->where('client_id', $id) + // ->groupBy('insurer_id') + // ->get() + // ->getResult(); + return $this->db->table('cash_deposit') - ->select('insurer_id') - ->select('SUM(CASE WHEN transaction_type = "Credit" THEN amount ELSE -amount END) AS balance') - ->where('client_id', $id) - ->groupBy('insurer_id') - ->get() - ->getResult(); + ->select('cash_deposit.insurer_id, cash_deposit.cd_ac_no') + ->select('(SUM(CASE WHEN cash_deposit.transaction_type = \'Credit\' THEN cash_deposit.amount ELSE -cash_deposit.amount END) + cd_master.opening_bal) AS balance') + ->join('cd_master', 'cd_master.cd_ac_no = cash_deposit.cd_ac_no') + ->where('cash_deposit.client_id', 56) + ->groupBy(['cash_deposit.insurer_id', 'cash_deposit.cd_ac_no', 'cd_master.opening_bal']) + ->orderBy('cash_deposit.insurer_id', 'DESC') + ->orderBy('cash_deposit.cd_ac_no', 'DESC') + ->get() + ->getResult(); + } diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php index b027e620..3ff68b11 100644 --- a/app/Views/client_branch.php +++ b/app/Views/client_branch.php @@ -98,7 +98,7 @@ - + diff --git a/app/Views/policy_type_list.php b/app/Views/policy_type_list.php index 79146f09..076e92bf 100644 --- a/app/Views/policy_type_list.php +++ b/app/Views/policy_type_list.php @@ -15,9 +15,9 @@ Policy Type - Bap - Allocg - Alloci + BAP + Category + BAP Category Action