FIX_DELETION_FILE_IMPORT&EXPORT&TRUNCATE
This commit is contained in:
parent
f60a900dee
commit
5bba669dac
@ -1320,10 +1320,10 @@ class EmployeeServiceController extends AdminController
|
|||||||
$row[4] = change_date_format($row[4],'d-M-Y','Y-m-d');// date of exit from excel
|
$row[4] = change_date_format($row[4],'d-M-Y','Y-m-d');// date of exit from excel
|
||||||
// Kint::dump($row[4]);
|
// Kint::dump($row[4]);
|
||||||
// check if insurer configured with add one day for deletion
|
// check if insurer configured with add one day for deletion
|
||||||
if($insurer['deletion_add_day'] == true)
|
// if($insurer['deletion_add_day'] == true)
|
||||||
{
|
// {
|
||||||
$row[4] = (new \DateTime($row[4]))->modify('+1 day')->format('Y-m-d');
|
// $row[4] = (new \DateTime($row[4]))->modify('+1 day')->format('Y-m-d');
|
||||||
}
|
// }
|
||||||
// dd($row[4]);
|
// 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']);
|
||||||
@ -1355,6 +1355,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
->where('emp_code',$employee['emp_code'])
|
->where('emp_code',$employee['emp_code'])
|
||||||
->where('name',$employee['name'])
|
->where('name',$employee['name'])
|
||||||
->where('field_name','emp_status')
|
->where('field_name','emp_status')
|
||||||
|
->where('status !=','truncated')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
// dd($existing_endorsements);
|
// dd($existing_endorsements);
|
||||||
|
|||||||
@ -511,10 +511,10 @@ if (!function_exists('name_and_empid_check_in_db'))
|
|||||||
->where("ep.is_active",1)
|
->where("ep.is_active",1)
|
||||||
->where("ep.status",'active')
|
->where("ep.status",'active')
|
||||||
// ->where("ep.client_id",$client_id)
|
// ->where("ep.client_id",$client_id)
|
||||||
->where('name',$row[2])->where('emp_code',$row[1])
|
->where('name',trim($row[2]))->where('emp_code',trim($row[1]))
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
// dd($employeeModel->getLastQuery());
|
// kint::dump($employeeModel->getLastQuery()->getQuery());
|
||||||
|
|
||||||
|
|
||||||
if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res))
|
if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res))
|
||||||
|
|||||||
@ -627,19 +627,19 @@ class EmployeePolicyModel extends Model
|
|||||||
|
|
||||||
LEFT JOIN(
|
LEFT JOIN(
|
||||||
|
|
||||||
select aa.emp_code, aa.new_value as 'empstatus', bb.new_value as 'changeevent', cc.new_value as 'dateofexit', dd.new_value as 'reasonforexit', ee.new_value as 'status' from
|
select aa.emp_code, aa.new_value as 'empstatus', bb.new_value as 'changeevent', cc.new_value as 'dateofexit', dd.new_value as 'reasonforexit', ee.new_value as 'status' from
|
||||||
|
|
||||||
( SELECT a1.emp_code, a1.field_name, a1.new_value from emp_endorsement as a1 where a1.field_name = 'emp_status') aa
|
( SELECT a1.emp_code, a1.field_name, a1.new_value from emp_endorsement as a1 where a1.field_name = 'emp_status' and a1.status != 'truncated') aa
|
||||||
left join
|
left join
|
||||||
( SELECT b1.emp_code, b1.field_name, b1.new_value from emp_endorsement as b1 where b1.field_name = 'change_event') bb on aa.emp_code = bb.emp_code
|
( SELECT b1.emp_code, b1.field_name, b1.new_value from emp_endorsement as b1 where b1.field_name = 'change_event' and b1.status != 'truncated') bb on aa.emp_code = bb.emp_code
|
||||||
left join
|
left join
|
||||||
( SELECT c1.emp_code, c1.field_name, c1.new_value from emp_endorsement as c1 where c1.field_name = 'date_of_exit') cc on aa.emp_code = cc.emp_code
|
( SELECT c1.emp_code, c1.field_name, c1.new_value from emp_endorsement as c1 where c1.field_name = 'date_of_exit' and c1.status != 'truncated') cc on aa.emp_code = cc.emp_code
|
||||||
left join
|
left join
|
||||||
( SELECT d1.emp_code, d1.field_name, d1.new_value from emp_endorsement as d1 where d1.field_name = 'reason_for_exit') dd on aa.emp_code = dd.emp_code
|
( SELECT d1.emp_code, d1.field_name, d1.new_value from emp_endorsement as d1 where d1.field_name = 'reason_for_exit' and d1.status != 'truncated') dd on aa.emp_code = dd.emp_code
|
||||||
left JOIN
|
left JOIN
|
||||||
( SELECT e1.emp_code, e1.field_name, e1.new_value from emp_endorsement as e1 where e1.field_name = 'status') ee on aa.emp_code = ee.emp_code
|
( SELECT e1.emp_code, e1.field_name, e1.new_value from emp_endorsement as e1 where e1.field_name = 'status' and e1.status != 'truncated') ee on aa.emp_code = ee.emp_code
|
||||||
|
|
||||||
) as deletiondata on a.emp_code = deletiondata.emp_code
|
) as deletiondata on a.emp_code = deletiondata.emp_code and a.status != 'truncated'
|
||||||
|
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(
|
(
|
||||||
@ -661,6 +661,7 @@ class EmployeePolicyModel extends Model
|
|||||||
AND employees.client_branch_id = {$client_branch_id}
|
AND employees.client_branch_id = {$client_branch_id}
|
||||||
AND (a.endorsement_id IS NULL OR a.endorsement_id = '')
|
AND (a.endorsement_id IS NULL OR a.endorsement_id = '')
|
||||||
AND a.actions = 'd'
|
AND a.actions = 'd'
|
||||||
|
AND a.status != 'truncated'
|
||||||
AND employee_polices.is_active = 1
|
AND employee_polices.is_active = 1
|
||||||
AND employee_polices.status = 'active'
|
AND employee_polices.status = 'active'
|
||||||
AND employees.is_active = 1
|
AND employees.is_active = 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user