Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
224222b64a
@ -18,6 +18,7 @@ use App\Models\EmpEndorsementModel;
|
|||||||
use App\Models\MessageModel;
|
use App\Models\MessageModel;
|
||||||
use App\Models\ClientBranchModel;
|
use App\Models\ClientBranchModel;
|
||||||
use App\Models\NotificationModel;
|
use App\Models\NotificationModel;
|
||||||
|
use App\Models\InsurerModel;
|
||||||
|
|
||||||
use App\Helpers\sendMailNotification;
|
use App\Helpers\sendMailNotification;
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
protected $messageModel;
|
protected $messageModel;
|
||||||
protected $clientBranchModel;
|
protected $clientBranchModel;
|
||||||
protected $notificationModel;
|
protected $notificationModel;
|
||||||
|
protected $insurerModel;
|
||||||
|
|
||||||
protected $general_relationships = [
|
protected $general_relationships = [
|
||||||
'self' => [
|
'self' => [
|
||||||
@ -649,6 +651,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
$this->messageModel = new MessageModel();
|
$this->messageModel = new MessageModel();
|
||||||
$this->clientBranchModel = new ClientBranchModel();
|
$this->clientBranchModel = new ClientBranchModel();
|
||||||
$this->notificationModel = new NotificationModel();
|
$this->notificationModel = new NotificationModel();
|
||||||
|
$this->insurerModel = new InsurerModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function excelFileFormatValidation($params)
|
public function excelFileFormatValidation($params)
|
||||||
@ -1295,21 +1298,31 @@ class EmployeeServiceController extends AdminController
|
|||||||
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||||
|
|
||||||
unset($excel_data[0]);
|
unset($excel_data[0]);
|
||||||
// dd($excel_data);
|
// kint::dump($excel_data);
|
||||||
$endorsement_data = [];
|
$endorsement_data = [];
|
||||||
|
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||||
|
$insurer = new InsurerModel();
|
||||||
|
$insurer = ($insurer->find($policy_terms[0]->insurer_id));
|
||||||
|
// kint::dump($insurer);
|
||||||
//make closure funciton which is going to use only by this method
|
//make closure funciton which is going to use only by this method
|
||||||
$endorsement = function($data,$file,$row){
|
$endorsement = function($data,$file,$row) use ($insurer){
|
||||||
|
|
||||||
$group_key = rand(100000, 999999);
|
$group_key = rand(100000, 999999);
|
||||||
|
$row[4] = change_date_format($row[4],'d-M-Y','Y-m-d');// date of exit from excel
|
||||||
|
// Kint::dump($row[4]);
|
||||||
|
// check if insurer configured with add one day for deletion
|
||||||
|
if($insurer['deletion_add_day'] == true)
|
||||||
|
{
|
||||||
|
$row[4] = (new \DateTime($row[4]))->modify('+1 day')->format('Y-m-d');
|
||||||
|
}
|
||||||
|
// dd($row[4]);
|
||||||
//for emp table
|
//for emp table
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'emp_status','old_value' => $data['emp_status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'emp_status','old_value' => $data['emp_status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||||
// dd( $this->empEndorsementModel->getLastQuery());
|
// dd( $this->empEndorsementModel->getLastQuery());
|
||||||
// $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'change_event','old_value' => $data['change_event'],'new_value' => 'deletion','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
// $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'change_event','old_value' => $data['change_event'],'new_value' => 'deletion','created_by' => $file['created_by'],'remarks' => 'general deletion']);
|
||||||
|
|
||||||
// for employee policy table
|
// for employee policy table
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'date_of_exit','old_value' => $data['date_of_exit'],'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'date_of_exit','old_value' => $data['date_of_exit'],'new_value' => $row[4],'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'reason_for_exit','old_value' => $data['reason_for_exit'],'new_value' => $row[5],'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'reason_for_exit','old_value' => $data['reason_for_exit'],'new_value' => $row[5],'created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||||
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'status','old_value' => $data['status'],'new_value' => 'inactive','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
$this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'status','old_value' => $data['status'],'new_value' => 'inactive','created_by' => $file['created_by'],'remarks' => 'general deletion','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||||
};
|
};
|
||||||
@ -1326,6 +1339,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
// dd($employee);
|
// dd($employee);
|
||||||
if(is_array($employee) && count($employee))
|
if(is_array($employee) && count($employee))
|
||||||
{
|
{
|
||||||
|
// dd($employee);
|
||||||
$existing_endorsements = $this->empEndorsementModel->where('actions','d')
|
$existing_endorsements = $this->empEndorsementModel->where('actions','d')
|
||||||
->where('table_name','employees')
|
->where('table_name','employees')
|
||||||
->where('endorsement_id is null')
|
->where('endorsement_id is null')
|
||||||
@ -1334,9 +1348,10 @@ class EmployeeServiceController extends AdminController
|
|||||||
->where('field_name','emp_status')
|
->where('field_name','emp_status')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
// dd($existing_endorsements);
|
||||||
if(!count($existing_endorsements))
|
if(!count($existing_endorsements))
|
||||||
{
|
{
|
||||||
|
// dd($employee);
|
||||||
if(strtolower($employee['relationship']) != 'self')
|
if(strtolower($employee['relationship']) != 'self')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -241,6 +241,13 @@ if(!function_exists('check_si'))
|
|||||||
$return_array = array('status' => true,'error' => '');
|
$return_array = array('status' => true,'error' => '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($policy_details['policy_type_id'] == 3 && strtolower($row['5']) == 'self') // if GMC parent and current relation is self then skip this . so set all true;
|
||||||
|
{
|
||||||
|
$is_si_found = true;
|
||||||
|
$is_age_slab_found = true;
|
||||||
|
$return_array = array('status' => true,'error' => '');
|
||||||
|
}
|
||||||
|
|
||||||
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA','SI','MI']))// check rule only of action column data available
|
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA','SI','MI']))// check rule only of action column data available
|
||||||
{
|
{
|
||||||
$received_si = $row['current_action'] == 'SI' ? $row[3] : $row[6];
|
$received_si = $row['current_action'] == 'SI' ? $row[3] : $row[6];
|
||||||
|
|||||||
@ -84,6 +84,7 @@ class ClientModel extends Model
|
|||||||
$clientBranchModel = new ClientBranchModel();
|
$clientBranchModel = new ClientBranchModel();
|
||||||
$clientBranchs = $clientBranchModel->select(['client_branch.id','client_branch.branch_name','client_branch.branch_code', 'client_branch.client_id','client_branch.units'])
|
$clientBranchs = $clientBranchModel->select(['client_branch.id','client_branch.branch_name','client_branch.branch_code', 'client_branch.client_id','client_branch.units'])
|
||||||
->where('client_branch.client_id',$client['id'])
|
->where('client_branch.client_id',$client['id'])
|
||||||
|
->where('client_branch.is_active',1)
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
$client['branchs'] = $clientBranchs;
|
$client['branchs'] = $clientBranchs;
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class InsurerModel extends Model
|
|||||||
"is_active",
|
"is_active",
|
||||||
"addition_add_day",
|
"addition_add_day",
|
||||||
"is_multi_event",
|
"is_multi_event",
|
||||||
|
"deletion_add_day",
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user