Allow punch out time to be null - fix for mysql strict date mode
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$migrationList = [];
|
||||
$migrationList[] = 'v20171001_200201_update_attendance_out';
|
||||
$migrationList[] = 'v20170918_200000_add_attendance_image_out';
|
||||
$migrationList[] = 'v20170908_200000_payroll_group';
|
||||
$migrationList[] = 'v20170702_190500_add_attendance_image';
|
||||
|
||||
23
migrations/v20171001_200201_update_attendance_out.php
Normal file
23
migrations/v20171001_200201_update_attendance_out.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Classes\Migration;
|
||||
|
||||
class v20171001_200201_update_attendance_out extends AbstractMigration{
|
||||
|
||||
public function up(){
|
||||
|
||||
$sql = <<<'SQL'
|
||||
alter table Attendance modify column `out_time` datetime default NULL;
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
public function down(){
|
||||
$sql = <<<'SQL'
|
||||
alter table Attendance modify column `out_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00';
|
||||
SQL;
|
||||
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -135,7 +135,6 @@ 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->note = $req->note;
|
||||
$openPunch->image_in = $req->image;
|
||||
$openPunch->employee = $employee->id;
|
||||
|
||||
Reference in New Issue
Block a user