Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
73a12f57a9
@ -94,12 +94,12 @@ define('EVENT_PRIORITY_NORMAL', 100);
|
|||||||
define('EVENT_PRIORITY_HIGH', 10);
|
define('EVENT_PRIORITY_HIGH', 10);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @User Role Constant
|
* @User Teams Constant
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('ENROLLMENT_TEAM_ID', '1');
|
define('ENROLLMENT_TEAM_ID', '1');
|
||||||
define('CLAIMS_TEAM_ID', '2');
|
define('CLAIMS_TEAM_ID', '2');
|
||||||
define('BUSINESS_TEAM_ID', '3');
|
// define('BUSINESS_TEAM_ID', '3'); // old don't delete it
|
||||||
|
define('BUSINESS_TEAM_ID', '4'); // 25th OCT 2025 changed
|
||||||
define('FINANCE_TEAM_ID', '4');
|
define('FINANCE_TEAM_ID', '4');
|
||||||
define('SALES_TEAM_ID', '5');
|
define('SALES_TEAM_ID', '5');
|
||||||
define('MANAGEMENT_TEAM_ID', '6');
|
define('MANAGEMENT_TEAM_ID', '6');
|
||||||
@ -107,9 +107,8 @@ define('BUSINESS_SUPPORT_TEAM_ID', '7');
|
|||||||
define('POS_TEAM_ID', '8');
|
define('POS_TEAM_ID', '8');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @User Teams Constant
|
* @User Role Constant
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('ADMIN_ROLE_ID', 1);
|
define('ADMIN_ROLE_ID', 1);
|
||||||
define('MANAGER_ROLE_ID', 2);
|
define('MANAGER_ROLE_ID', 2);
|
||||||
define('ACCOUNT_MANAGER_ROLE_ID', 3);
|
define('ACCOUNT_MANAGER_ROLE_ID', 3);
|
||||||
|
|||||||
@ -1457,6 +1457,47 @@ class EmpDataServiceController extends BaseController
|
|||||||
//get the employee data for excel file validation
|
//get the employee data for excel file validation
|
||||||
$employee_data = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($ref_data, 1);
|
$employee_data = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($ref_data, 1);
|
||||||
|
|
||||||
|
// ----------------- CD BALANCE CHECK ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$cash_balance = $this->clientDepositModel
|
||||||
|
->where('cd_ac_pk', $client_policy_data['cd_ac_pk'])
|
||||||
|
->where('is_active', 1)
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($cash_balance == null) {
|
||||||
|
$balance = $this->CDMasterModel
|
||||||
|
->where('client_id', $file['client_id'])
|
||||||
|
->where('insurer_id', $client_policy_data['insurer_id'])
|
||||||
|
->where('id', $client_policy_data['cd_ac_pk'])
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$cash_balance['balance'] = $balance['opening_bal'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the total amount from the objects
|
||||||
|
$totals = 0;
|
||||||
|
foreach ($employee_data as $item) {
|
||||||
|
$totals = $totals + $item['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$totals = round($totals, 2);
|
||||||
|
|
||||||
|
//check CD amt insufficient only insurer, not tpa
|
||||||
|
if($file['insurer_or_tpa'] == 'insurer')
|
||||||
|
{
|
||||||
|
if (!empty($cash_balance)) {
|
||||||
|
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||||
|
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||||
|
$this->batchFileModel->where('id', $file_id)->set(['status' => 'failed-7', 'error_data' => 'Insufficient deposit balance. Available CD Balance: ' . $cash_balance['balance'] . ', Excel Total Amount: ' . $totals])->update();
|
||||||
|
return ['status' => 'error', 'message' => 'Insufficient deposit balance. Available CD Balance: ' . $cash_balance['balance'] . ', Required Amount: ' . $totals];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------- END CD BALANCE CHECK ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
if ($employee_data == null || empty($employee_data)) {
|
if ($employee_data == null || empty($employee_data)) {
|
||||||
|
|
||||||
if ($insurer_or_tpa == 'tpa') {
|
if ($insurer_or_tpa == 'tpa') {
|
||||||
@ -2569,6 +2610,7 @@ class EmpDataServiceController extends BaseController
|
|||||||
'event_type' => $file['event_type'],
|
'event_type' => $file['event_type'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||||
|
|
||||||
$file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name'];
|
$file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name'];
|
||||||
|
|
||||||
@ -2691,6 +2733,47 @@ class EmpDataServiceController extends BaseController
|
|||||||
|
|
||||||
// dd($endorsement_data, $excel_data);
|
// dd($endorsement_data, $excel_data);
|
||||||
|
|
||||||
|
// ----------------- CD BALANCE CHECK ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$cash_balance = $this->clientDepositModel
|
||||||
|
->where('cd_ac_pk', $client_policy_data['cd_ac_pk'])
|
||||||
|
->where('is_active', 1)
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($cash_balance == null) {
|
||||||
|
$balance = $this->CDMasterModel
|
||||||
|
->where('client_id', $file['client_id'])
|
||||||
|
->where('insurer_id', $client_policy_data['insurer_id'])
|
||||||
|
->where('id', $client_policy_data['cd_ac_pk'])
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$cash_balance['balance'] = $balance['opening_bal'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the total amount from the objects
|
||||||
|
$totals = 0;
|
||||||
|
foreach ($endorsement_data as $item) {
|
||||||
|
$totals = $totals + $item['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$totals = round($totals, 2);
|
||||||
|
|
||||||
|
//check CD amt insufficient only insurer, not tpa
|
||||||
|
if($file['insurer_or_tpa'] == 'insurer')
|
||||||
|
{
|
||||||
|
if (!empty($cash_balance)) {
|
||||||
|
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||||
|
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||||
|
$this->batchFileModel->where('id', $file_id)->set(['status' => 'failed-7', 'error_data' => 'Insufficient deposit balance. Available CD Balance: ' . $cash_balance['balance'] . ', Excel Total Amount: ' . $totals])->update();
|
||||||
|
return ['status' => 'error', 'message' => 'Insufficient deposit balance. Available CD Balance: ' . $cash_balance['balance'] . ', Required Amount: ' . $totals];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------- END CD BALANCE CHECK ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($endorsement_data == null || empty($endorsement_data)) {
|
if ($endorsement_data == null || empty($endorsement_data)) {
|
||||||
|
|
||||||
|
|||||||
@ -388,13 +388,11 @@ class EmployeeController extends AdminController
|
|||||||
batch_files.client_branch_id,
|
batch_files.client_branch_id,
|
||||||
|
|
||||||
CASE
|
CASE
|
||||||
WHEN batch_files.status = 'partially success' OR batch_files.status = 'in-progress-partially' THEN
|
WHEN batch_files.status IN ('partially success', 'in-progress-partially', 'failed-7')
|
||||||
batch_files.error_data
|
THEN batch_files.error_data
|
||||||
ELSE
|
ELSE NULL
|
||||||
NULL
|
|
||||||
END AS error_data,
|
END AS error_data,
|
||||||
|
|
||||||
|
|
||||||
clients.short_name as client_short_name,
|
clients.short_name as client_short_name,
|
||||||
client_branch.branch_name,
|
client_branch.branch_name,
|
||||||
client_policy.policy_no,
|
client_policy.policy_no,
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class UserController extends AdminController
|
|||||||
// echo '<pre>';
|
// echo '<pre>';
|
||||||
// print_r($data); die;
|
// print_r($data); die;
|
||||||
$data['roleData'] = $this->roleModel->select('id, role')->findAll();
|
$data['roleData'] = $this->roleModel->select('id, role')->findAll();
|
||||||
$data['teamData'] = $this->teamModel->select('id, name')->findAll();
|
$data['teamData'] = $this->teamModel->select('id, name')->where('is_active',1)->findAll();
|
||||||
$this->loadLayout('UserList', $data);
|
$this->loadLayout('UserList', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,9 +156,11 @@ class UserController extends AdminController
|
|||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// echo ":/ in 159";
|
||||||
if (!$this->request->getPost()) {
|
if (!$this->request->getPost()) {
|
||||||
return redirect()->to(base_url('/user/list'));
|
return redirect()->to(base_url('/user/list'));
|
||||||
} else {
|
} else {
|
||||||
|
// echo ":/ in 163";
|
||||||
$id = $this->request->getPost('PrimaryKey');
|
$id = $this->request->getPost('PrimaryKey');
|
||||||
$teams = $this->request->getPost('team');
|
$teams = $this->request->getPost('team');
|
||||||
$userData = $this->request->getPost();
|
$userData = $this->request->getPost();
|
||||||
@ -166,6 +168,7 @@ class UserController extends AdminController
|
|||||||
unset($userData['PrimaryKey']);
|
unset($userData['PrimaryKey']);
|
||||||
|
|
||||||
$existingData = $this->userModel->where('id',$id)->first();;
|
$existingData = $this->userModel->where('id',$id)->first();;
|
||||||
|
// dd($existingData);die;
|
||||||
|
|
||||||
// Update data in the 'users' table based on the $id
|
// Update data in the 'users' table based on the $id
|
||||||
$userData['updated_by'] = get_session_userid();
|
$userData['updated_by'] = get_session_userid();
|
||||||
|
|||||||
@ -673,7 +673,34 @@ table.dataTable tbody td {
|
|||||||
<td>BDS - All access</td>
|
<td>BDS - All access</td>
|
||||||
<td>All access</td>
|
<td>All access</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="team-cell" rowspan="6">Accounts</td>
|
||||||
|
<td>BDS - Policy Transaction</td>
|
||||||
|
<td>Policy | Endorsement | Statement Upload</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>BDS - Report</td>
|
||||||
|
<td>TAT wise | ACM Status wise | ACM TAT wise</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>BDS - Policy Report</td>
|
||||||
|
<td>BDS | Variance | Outstanding | IRDA | Renewal | TAT Band </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>BDS - Pending Actions</td>
|
||||||
|
<td>Finance Team</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>BDS - Masters</td>
|
||||||
|
<td>Vehicle | CD | Insurer</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>BDS - Documents</td>
|
||||||
|
<td>✓</td>
|
||||||
|
</tr>
|
||||||
|
<!-- Temporary please don't delete (start's) -->
|
||||||
|
<!--
|
||||||
|
<tr>
|
||||||
<td class="team-cell" rowspan="5">Finance</td>
|
<td class="team-cell" rowspan="5">Finance</td>
|
||||||
<td>BDS - Policy Transaction</td>
|
<td>BDS - Policy Transaction</td>
|
||||||
<td>Policy | Endorsement | Statement Upload</td>
|
<td>Policy | Endorsement | Statement Upload</td>
|
||||||
@ -715,6 +742,8 @@ table.dataTable tbody td {
|
|||||||
<td>BDS - Documents</td>
|
<td>BDS - Documents</td>
|
||||||
<td>✓</td>
|
<td>✓</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
-->
|
||||||
|
<!-- Temporary please don't delete (ends) -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="team-cell" rowspan="2">POS</td>
|
<td class="team-cell" rowspan="2">POS</td>
|
||||||
<td>BDS - Policy Transaction</td>
|
<td>BDS - Policy Transaction</td>
|
||||||
|
|||||||
@ -82,14 +82,15 @@
|
|||||||
|
|
||||||
<?php } else if ($file['status'] == 'partially success') { ?>
|
<?php } else if ($file['status'] == 'partially success') { ?>
|
||||||
|
|
||||||
<?php echo $file['status']; ?>
|
<?php echo $file['status']; ?>
|
||||||
<?php if ($file['error_data'] != 0) { ?>
|
|
||||||
|
|
||||||
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
<?php if ($file['error_data'] != 0) { ?>
|
||||||
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
|
||||||
|
|
||||||
|
|
||||||
<?php } ?>
|
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
|
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'in-progress-partially') { ?>
|
<?php } else if ($file['status'] == 'in-progress-partially') { ?>
|
||||||
|
|
||||||
@ -98,7 +99,6 @@
|
|||||||
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
||||||
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php } else if ($file['status'] == 'failed-1') { ?>
|
<?php } else if ($file['status'] == 'failed-1') { ?>
|
||||||
@ -135,6 +135,11 @@
|
|||||||
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
data-placement="top" title="There is no data to update"></a>
|
data-placement="top" title="There is no data to update"></a>
|
||||||
|
|
||||||
|
<?php } else if ($file['status'] == 'failed-7') { ?>
|
||||||
|
|
||||||
|
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
|
||||||
|
data-placement="top" title="<?= $file['error_data'] ?>"></a>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<?php echo $file['status']; ?>
|
<?php echo $file['status']; ?>
|
||||||
|
|||||||
@ -1766,7 +1766,7 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<!-- Masters -->
|
<!-- Masters -->
|
||||||
<?php if (get_role_id() == 1 || get_role_id() == 5 || get_role_id() == 4) { ?>
|
<?php if (get_role_id() == 1 || get_role_id() == 5 || ( get_role_id() == 4 && (in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())))) { ?>
|
||||||
|
|
||||||
<li class="li-seperate" id="masters-li">
|
<li class="li-seperate" id="masters-li">
|
||||||
<a href="#sidebarPolicies" data-toggle="collapse" class=" img-inactive">
|
<a href="#sidebarPolicies" data-toggle="collapse" class=" img-inactive">
|
||||||
@ -1895,7 +1895,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<!-- BDS -->
|
<!-- BDS -->
|
||||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
<?php if ((get_role_id() == 1 || get_role_id() == 5 || get_role_id() == 4) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
||||||
<li class="li-seperate" id="policy-transactions-li">
|
<li class="li-seperate" id="policy-transactions-li">
|
||||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect img-inactive">
|
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect img-inactive">
|
||||||
<img
|
<img
|
||||||
@ -1930,9 +1930,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
<?php if ((get_role_id() == 1 || get_role_id() == 5) ||(get_role_id() == 4 && in_array(FINANCE_TEAM_ID, user_team())) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
||||||
|
|
||||||
<?php if (in_array(get_role_id(), [1, 5]) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team())) { ?>
|
<?php if (in_array(get_role_id(), [1, 5]) ||(get_role_id() == 4 && in_array(FINANCE_TEAM_ID, user_team())) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team())) { ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
|
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
|
||||||
<i class="ri-file-chart-fill"></i>
|
<i class="ri-file-chart-fill"></i>
|
||||||
@ -1943,7 +1943,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
|
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if (in_array(get_role_id(), [1, 5]) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
<?php if (in_array(get_role_id(), [1, 5]) || (get_role_id() == 4 && in_array(FINANCE_TEAM_ID, user_team())) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
|
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
|
||||||
</li>
|
</li>
|
||||||
@ -2023,6 +2023,11 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php if ((get_role_id() === 4 && in_array(FINANCE_TEAM_ID, user_team())) || in_array(BUSINESS_TEAM_ID, user_team())) { ?>
|
||||||
|
<li>
|
||||||
|
<a href="<?= base_url('/master/insurer/list') ?>">Insurer Master</a>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user