Code fixes for date time change

This commit is contained in:
gamonoid
2017-09-03 21:35:00 +02:00
parent 0e2c5daacf
commit 71dbfe430e
5 changed files with 7 additions and 7 deletions

View File

@@ -43,7 +43,7 @@
"custom8": null,
"custom9": null,
"custom10": null,
"termination_date": "0000-00-00",
"termination_date": null,
"notes": null,
"status": "Active",
"ethnicity": null,
@@ -72,4 +72,4 @@
"supervisor_Name_id": [],
"supervisor_Name": "IceHrm Employee",
"image": "http:\/\/app.app.dev\/images\/user_female.png"
}
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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()))";
}