FIX_THE_DAILY_REPORT_AND_ADD_CLIENT_LOGO_FOR_HR
This commit is contained in:
parent
5291609040
commit
370979e548
@ -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 = [
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -166,19 +166,19 @@
|
||||
</div>
|
||||
|
||||
<div class="content" style="padding:20px;">
|
||||
<div class="report-date" style="color:#7f8c8d;font-size:13px;margin-bottom:16px;text-align:right;">Date: <?= $today ?></div>
|
||||
<div class="report-date" style="color:#7f8c8d;font-size:13px;margin-bottom:16px;text-align:right;">Date: <?= $today ?? "" ?></div>
|
||||
|
||||
<!-- File Operations -->
|
||||
<h3 class="section-title" style="font-size:17px;color:#2c3e50;border-bottom:2px solid #3498db;display:inline-block;margin:18px 0 12px;padding-bottom:4px;">Inception & Endorsement (File Upload)</h3>
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #3498db;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Total Inception</div>
|
||||
<div class="stat-value"><?= $total_inception_count ?></div>
|
||||
<div class="stat-value"><?= $total_inception_count ?? 0 ?></div>
|
||||
<div class="stat-note">Employee file uploads marked as inception</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #3498db;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Total Endorsement</div>
|
||||
<div class="stat-value"><?= $total_endorsement_count ?></div>
|
||||
<div class="stat-value"><?= $total_endorsement_count ?? 0 ?></div>
|
||||
<div class="stat-note">All non‑inception successful uploads</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -203,12 +203,12 @@
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #e67e22;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">TPA (Inception / Endorsement)</div>
|
||||
<div class="stat-value"><?= $total_tpa_incetion_count ?> / <?= $total_tpa_endorsement_count ?></div>
|
||||
<div class="stat-value"><?= $total_tpa_incetion_count ?? 0 ?> / <?= $total_tpa_endorsement_count ?? 0 ?></div>
|
||||
<div class="stat-note">Successful TPA events</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #9b59b6;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Insurer (Inception / Endorsement)</div>
|
||||
<div class="stat-value"><?= $total_insurer_incetion_count ?> / <?= $total_insurer_endorsement_count ?></div>
|
||||
<div class="stat-value"><?= $total_insurer_incetion_count ?? 0 ?> / <?= $total_insurer_endorsement_count ?? 0 ?></div>
|
||||
<div class="stat-note">Successful insurer events</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -218,22 +218,22 @@
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #27ae60;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Opportunities & Won</div>
|
||||
<div class="stat-value"><?= $total_opportunity_count ?> / <?= $total_placement_count ?></div>
|
||||
<div class="stat-value"><?= $total_opportunity_count ?? 0 ?> / <?= $total_placement_count ?? 0 ?></div>
|
||||
<div class="stat-note">Total opportunities created vs converted</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #16a085;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">RFQ (Created / Sent to Insurer)</div>
|
||||
<div class="stat-value"><?= $total_rfq_created_count ?> / <?= $total_rfq_insurer_send_count ?></div>
|
||||
<div class="stat-value"><?= $total_rfq_created_count ?? 0 ?> / <?= $total_rfq_insurer_send_count ?? 0 ?></div>
|
||||
<div class="stat-note">Movement from opportunity to RFQ</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #2980b9;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">QCR (Created / Sent to Client)</div>
|
||||
<div class="stat-value"><?= $total_qcr_created_count ?> / <?= $total_qcr_client_send_count ?></div>
|
||||
<div class="stat-value"><?= $total_qcr_created_count ?? 0 ?> / <?= $total_qcr_client_send_count ?? 0 ?></div>
|
||||
<div class="stat-note">Quotes prepared and shared</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #8e44ad;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Total Leads & Activities</div>
|
||||
<div class="stat-value"><?= $total_lead_count ?> / <?= $total_activity_count ?></div>
|
||||
<div class="stat-value"><?= $total_lead_count ?? 0 ?> / <?= $total_activity_count ?? 0 ?></div>
|
||||
<div class="stat-note">Lead entries and logged touchpoints</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -243,12 +243,12 @@
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #d35400;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Total BDS Transactions</div>
|
||||
<div class="stat-value"><?= $total_bds_count ?></div>
|
||||
<div class="stat-value"><?= $total_bds_count ?? 0 ?></div>
|
||||
<div class="stat-note">All policy transactions processed</div>
|
||||
</div>
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #c0392b;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">BDS (Policy / Endorsement)</div>
|
||||
<div class="stat-value"><?= $total_bds_policy_wise_count ?> / <?= $total_bds_endorsement_wise_count ?></div>
|
||||
<div class="stat-value"><?= $total_bds_policy_wise_count ?? 0?> / <?= $total_bds_endorsement_wise_count ?? 0 ?></div>
|
||||
<div class="stat-note">Split of inceptions vs endorsements</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -289,7 +289,7 @@
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card" style="width:100%;display:block;background:#f8f9fa;padding:12px 14px;border-radius:6px;border-left:4px solid #d35400;box-sizing:border-box;margin-bottom:10px;">
|
||||
<div class="stat-label">Total Claims Registered for the day</div>
|
||||
<div class="stat-value"><?= $total_claim_count ?></div>
|
||||
<div class="stat-value"><?= $total_claim_count ?? 0 ?></div>
|
||||
<div class="stat-note"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user