diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 506b39a1..285207f4 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -1862,6 +1862,7 @@ class EmpDataServiceController extends BaseController $status = $file['status']; $batch_code = $file['batch_code']; $user_id = $file['created_by']; + $policy_issue_date = $file['policy_issue_date']; $insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first(); @@ -2086,6 +2087,7 @@ class EmpDataServiceController extends BaseController 'no_of_dependent' => count($no_of_dependent ?? []) ?? null, 'base_premium' => $base_bremium_and_gst['base_premium'] ?? null, 'gst' => $base_bremium_and_gst['gst'] ?? null, + 'policy_issue_date' => $policy_issue_date ?? null, ]]); // $this->cashDepositCalculationForInception($depositeData); @@ -2417,6 +2419,7 @@ class EmpDataServiceController extends BaseController $batch_code = $file['batch_code']; $user_id = $file['created_by']; $event_type = $file['event_type']; + $policy_issue_date = $file['policy_issue_date']; $status_val = 'success'; @@ -2519,6 +2522,7 @@ class EmpDataServiceController extends BaseController 'endorsement_no' => $endorsement_id[0] ?? null, 'emp_count' => $emp_count ?? null, 'action_type' => $file['event_type'] ?? null, + 'policy_issue_date' => $policy_issue_date ?? null, ]]); @@ -2999,6 +3003,7 @@ class EmpDataServiceController extends BaseController $status = $file['status']; $batch_code = $file['batch_code']; $user_id = $file['created_by']; + $policy_issue_date = $file['policy_issue_date']; $insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first(); @@ -3179,6 +3184,7 @@ class EmpDataServiceController extends BaseController 'no_of_dependent' => count($no_of_dependent ?? []) ?? null, 'base_premium' => $base_bremium_and_gst['base_premium'] ?? null, 'gst' => $base_bremium_and_gst['gst'] ?? null, + 'policy_issue_date' => $policy_issue_date ?? null, ]]); } @@ -3537,6 +3543,7 @@ class EmpDataServiceController extends BaseController $status = $file['status']; $batch_code = $file['batch_code']; $user_id = $file['created_by']; + $policy_issue_date = $file['policy_issue_date']; $insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first(); @@ -3687,6 +3694,7 @@ class EmpDataServiceController extends BaseController 'no_of_dependent' => count($no_of_dependent ?? []) ?? null, 'base_premium' => $base_bremium_and_gst['base_premium'] ?? null, 'gst' => $base_bremium_and_gst['gst'] ?? null, + 'policy_issue_date' => $policy_issue_date ?? null, ]]); } @@ -4981,7 +4989,7 @@ class EmpDataServiceController extends BaseController 'policy_no' => $policy_data['policy_no'] ?? null, 'cd_ac_no' => $policy_data['cd_ac_no'] ?? null, 'cd_ac_pk' => $policy_data['cd_ac_pk'] ?? null, - 'policy_issue_date' => $policy_data['policy_start_date'] ?? null, + 'policy_issue_date' => $policy_data['policy_issue_date'] ?? null, 'policy_start_date' => $policy_data['policy_start_date'] ?? null, 'policy_end_date' => $policy_data['policy_end_date'] ?? null, 'data_received_date' => $policy_data['data_received_date'] ?? null, @@ -4992,7 +5000,7 @@ class EmpDataServiceController extends BaseController 'co_share' => $policy_data['co_share'] ?? 0, 'pre_payable_by' => $policy_data['pre_payable_by'] ?? 1, 'renewal_date' => $policy_data['policy_end_date'] ?? null, - 'month' => date('Y-m-01', strtotime($policy_data['policy_start_date'])) ?? null, + 'month' => date('Y-m-01', strtotime($policy_data['policy_issue_date'] ?? "")) ?? null, 'ct_type' => 1, 'is_cd_reduce_from_bds' => 0, 'client_type_id' => 0, diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 40e8af2b..91ed4ef6 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -515,6 +515,7 @@ class EmployeeController extends AdminController $client_branch_id = $this->request->getPost('client_branch_id'); $insurer_or_tpa = $this->request->getPost('insurer_or_tpa'); $actions = $this->request->getPost('action_type'); + $policy_issue_date = $this->request->getPost('policy_issue_date'); $client_data = $this->clientPolicyModel->getCliendDataForExcelFileName($client_policy_id); $file_name = generate_filename($client_data['short_name'], $event_type, $actions, $insurer_or_tpa, $client_data['policy_type'], $client_data['branch_code']); @@ -530,6 +531,13 @@ class EmployeeController extends AdminController 'actions' => $actions, 'file_name' => $file_name, ]; + + + $batch_data['policy_issue_date'] = (!empty($policy_issue_date) && strtotime($policy_issue_date) !== false) + ? change_date_format($policy_issue_date) + : null; + + if ($actions == 'export') { if ($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition' || $event_type == 'missed_inception' || ($event_type == 'MultipleEvents' && $insurer_or_tpa == 'tpa')) { diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 742ca2cf..545662e3 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -3676,6 +3676,7 @@ class LeadsController extends BaseController $result = $this->gmailSentHistoryModel ->where('pk', $id) ->where('module',"leads") + ->orderBy('created_at', 'desc') ->findAll(); if(!empty($result)){ $result = !empty($result) ? $result : []; diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index fe6ad35b..ad3633e2 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -299,7 +299,9 @@ class ThzController extends BaseController // $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray(); $details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name') ->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left') - ->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)->get()->getResultArray(); + ->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1) + ->orderBy('thz_history.created_at', 'desc') + ->get()->getResultArray(); diff --git a/app/Models/BatchFileModel.php b/app/Models/BatchFileModel.php index b8ebc8e9..e791553a 100755 --- a/app/Models/BatchFileModel.php +++ b/app/Models/BatchFileModel.php @@ -25,6 +25,7 @@ class BatchFileModel extends Model "status", "error_data", "client_branch_id", + "policy_issue_date", ]; // Callbacks diff --git a/app/Views/insurer_or_tpa_data.php b/app/Views/insurer_or_tpa_data.php index 6c22b23c..dc07ab1c 100755 --- a/app/Views/insurer_or_tpa_data.php +++ b/app/Views/insurer_or_tpa_data.php @@ -90,9 +90,15 @@ +