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 |