Code fixes for date time change
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
"custom8": null,
|
"custom8": null,
|
||||||
"custom9": null,
|
"custom9": null,
|
||||||
"custom10": null,
|
"custom10": null,
|
||||||
"termination_date": "0000-00-00",
|
"termination_date": null,
|
||||||
"notes": null,
|
"notes": null,
|
||||||
"status": "Active",
|
"status": "Active",
|
||||||
"ethnicity": null,
|
"ethnicity": null,
|
||||||
@@ -72,4 +72,4 @@
|
|||||||
"supervisor_Name_id": [],
|
"supervisor_Name_id": [],
|
||||||
"supervisor_Name": "IceHrm Employee",
|
"supervisor_Name": "IceHrm Employee",
|
||||||
"image": "http:\/\/app.app.dev\/images\/user_female.png"
|
"image": "http:\/\/app.app.dev\/images\/user_female.png"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class AttendanceActionManager extends SubActionManager
|
|||||||
}
|
}
|
||||||
$attendance->in_time = $inDateTime;
|
$attendance->in_time = $inDateTime;
|
||||||
if (empty($outDateTime)) {
|
if (empty($outDateTime)) {
|
||||||
$attendance->out_time = "0000-00-00 00:00:00";
|
$attendance->out_time = null;
|
||||||
} else {
|
} else {
|
||||||
$attendance->out_time = $outDateTime;
|
$attendance->out_time = $outDateTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class AttendanceActionManager extends SubActionManager
|
|||||||
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Punch Out \ time:".$openPunch->out_time);
|
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Punch Out \ time:".$openPunch->out_time);
|
||||||
} else {
|
} else {
|
||||||
$openPunch->in_time = $dateTime;
|
$openPunch->in_time = $dateTime;
|
||||||
$openPunch->out_time = '0000-00-00 00:00:00';
|
$openPunch->out_time = null;
|
||||||
$openPunch->note = $req->note;
|
$openPunch->note = $req->note;
|
||||||
$openPunch->image_in = $req->image;
|
$openPunch->image_in = $req->image;
|
||||||
$openPunch->employee = $employee->id;
|
$openPunch->employee = $employee->id;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class Employee extends BaseModel
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($obj->$k) && $oldObjOrig->$k = '0000-00-00') {
|
if (empty($obj->$k) && ($oldObjOrig->$k = '0000-00-00' || empty($oldObjOrig->$k))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ FROM Employees e";
|
|||||||
|
|
||||||
if (empty($request['department']) || $request['department'] == "NULL") {
|
if (empty($request['department']) || $request['department'] == "NULL") {
|
||||||
$params = array();
|
$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 {
|
} else {
|
||||||
$depts = $this->getChildCompanyStuctures($request['department']);
|
$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