diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index 08a2b82a..3ff685d7 100755 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -1015,34 +1015,27 @@ class DashboardController extends AdminController $db2 = \Config\Database::connect('preDB'); - $builder = $db2->table('employees'); - $total_employee_draft_count = $builder->join('employee_polices', 'employees.id = employee_polices.employee_id') - ->select('employee_polices.status, count(*) as count') + $total_employee_draft_count = $db2->table('employee_polices') + ->join('employees', 'employees.id = employee_polices.employee_id') ->where('DATE(employee_polices.created_at)', $today) ->where('employee_polices.is_active', 1) ->where('employees.is_active', 1) - ->whereIn('employee_polices.status', ['draft']) - ->groupBy('employee_polices.status') + ->where('employee_polices.status', 'draft') ->countAllResults(); - - $builder1 = $db2->table('employees'); - $total_employee_enrolled_count = $builder1->join('employee_polices', 'employees.id = employee_polices.employee_id') - ->select('employee_polices.status, count(*) as count') + $total_employee_enrolled_count = $db2->table('employee_polices') + ->join('employees', 'employees.id = employee_polices.employee_id') ->where('DATE(employee_polices.created_at)', $today) ->where('employee_polices.is_active', 1) ->where('employees.is_active', 1) - ->whereIn('employee_polices.status', ['enrolled']) - ->groupBy('employee_polices.status') + ->where('employee_polices.status', 'enrolled') ->countAllResults(); - - $builder2 = $db2->table('files'); - $total_open_for_enrollemnt_policy_count = $builder2 - ->select('COUNT(*) as count') - ->where('enrollment_open_date <=', $today) - ->where('enrollment_close_date >=', $today) + + $total_open_for_enrollemnt_policy_count = $db2->table('client_policy') + ->where('open_date <=', $today) + ->where('close_date >=', $today) ->where('is_active', 1) - ->where('status', 'success') + ->where('policy_status', 1) ->countAllResults(); $data = [ diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 3066ada1..fcf7c9f6 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2266,6 +2266,7 @@ class EmployeeRestController extends AdminController client_policy.insurer_id as insurer_id, DATE_FORMAT(client_policy.policy_start_date, '%d-%m-%Y') AS policy_start_date, DATE_FORMAT(client_policy.policy_end_date, '%d-%m-%Y') AS policy_expiry_date, + clients.client_logo as client_logo, ( select COALESCE(ROUND(SUM(rata_premimum + gst)), 0) from employee_polices @@ -2275,6 +2276,7 @@ class EmployeeRestController extends AdminController ) as total_premium, CASE WHEN policy_type.allocg IN ('Non-EB', 'Marine') THEN 'Non-EB' ELSE 'EB' END as allocg ", false) + ->join('clients', 'clients.id = client_policy.client_id', 'left') ->join('policy_type', 'policy_type.id = client_policy.policy_type_id', 'left') ->where('md5(client_policy.client_id)', $this->request->getGet('client_id')) ->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id')) @@ -2293,6 +2295,7 @@ class EmployeeRestController extends AdminController $value['policy_name'] = $policyTypeData->long_name; $value['insurer_name'] = $insurerData->name; $value['insurer_short_name'] = $insurerData->short_name; + $value['client_logo'] = ! empty($value['client_logo']) ? base_url() . 'public/uploads/logo/' . $value['client_logo'] : ''; $employeeDetails = $this->employeePolicyModel->getEmployeePolicy(client_id: $value['client_id'], policy_id: $value['client_policy_id'], status: 0, branch_id: $this->request->getGet('client_branch_id'), status_type: 'inactive'); // dd($employeeDetails); $activeCount = 0; diff --git a/app/Views/daily_report_email_template.php b/app/Views/daily_report_email_template.php index 0b43ca82..47a19a4c 100644 --- a/app/Views/daily_report_email_template.php +++ b/app/Views/daily_report_email_template.php @@ -166,19 +166,19 @@
-
Date:
+
Date:

Inception & Endorsement (File Upload)

Total Inception
-
+
Employee file uploads marked as inception
Total Endorsement
-
+
All non‑inception successful uploads
@@ -203,12 +203,12 @@
TPA (Inception / Endorsement)
-
/
+
/
Successful TPA events
Insurer (Inception / Endorsement)
-
/
+
/
Successful insurer events
@@ -218,22 +218,22 @@
Opportunities & Won
-
/
+
/
Total opportunities created vs converted
RFQ (Created / Sent to Insurer)
-
/
+
/
Movement from opportunity to RFQ
QCR (Created / Sent to Client)
-
/
+
/
Quotes prepared and shared
Total Leads & Activities
-
/
+
/
Lead entries and logged touchpoints
@@ -243,12 +243,12 @@
Total BDS Transactions
-
+
All policy transactions processed
BDS (Policy / Endorsement)
-
/
+
/
Split of inceptions vs endorsements
@@ -289,7 +289,7 @@
Total Claims Registered for the day
-
+