Code fixes for date time change
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
"custom8": null,
|
||||
"custom9": null,
|
||||
"custom10": null,
|
||||
"termination_date": "0000-00-00",
|
||||
"termination_date": null,
|
||||
"notes": null,
|
||||
"status": "Active",
|
||||
"ethnicity": null,
|
||||
|
||||
@@ -106,7 +106,7 @@ class AttendanceActionManager extends SubActionManager
|
||||
}
|
||||
$attendance->in_time = $inDateTime;
|
||||
if (empty($outDateTime)) {
|
||||
$attendance->out_time = "0000-00-00 00:00:00";
|
||||
$attendance->out_time = null;
|
||||
} else {
|
||||
$attendance->out_time = $outDateTime;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class AttendanceActionManager extends SubActionManager
|
||||
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Punch Out \ time:".$openPunch->out_time);
|
||||
} else {
|
||||
$openPunch->in_time = $dateTime;
|
||||
$openPunch->out_time = '0000-00-00 00:00:00';
|
||||
$openPunch->out_time = null;
|
||||
$openPunch->note = $req->note;
|
||||
$openPunch->image_in = $req->image;
|
||||
$openPunch->employee = $employee->id;
|
||||
|
||||
@@ -98,7 +98,7 @@ class Employee extends BaseModel
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($obj->$k) && $oldObjOrig->$k = '0000-00-00') {
|
||||
if (empty($obj->$k) && ($oldObjOrig->$k = '0000-00-00' || empty($oldObjOrig->$k))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ FROM Employees e";
|
||||
|
||||
if (empty($request['department']) || $request['department'] == "NULL") {
|
||||
$params = array();
|
||||
$query = "where ((termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW())";
|
||||
$query = "where ((termination_date is NULL or termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW())";
|
||||
} else {
|
||||
$depts = $this->getChildCompanyStuctures($request['department']);
|
||||
$query = "where department in (".implode(",", $depts).") and (((termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW()))";
|
||||
$query = "where department in (".implode(",", $depts).") and (((termination_date is NULL or termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW()))";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user