diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index 59cd19121..e90456ed6 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -199,11 +199,11 @@ class TimerecordingModel $id = $filter['id']; if (is_numeric($starttime) && is_numeric($endtime)) { if ($id && is_numeric($id)) { - $where .= " AND `id` != $id AND `days`='0'"; + $where .= " AND `id` != $id "; } - $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id,start ASC"; + $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) AND `days` = 0 ORDER by user_id,start ASC"; -//var_dump($where);exit; +//echo ($where);die(); } } if (array_key_exists("type", $filter)) { diff --git a/application/TimerecordingBilling/TimerecordingBillingController.php b/application/TimerecordingBilling/TimerecordingBillingController.php index 48b4fe84c..a3348342a 100644 --- a/application/TimerecordingBilling/TimerecordingBillingController.php +++ b/application/TimerecordingBilling/TimerecordingBillingController.php @@ -159,10 +159,18 @@ class TimerecordingBillingController extends mfBaseController $time = $nlztime['minutes'] / 60; $time = round($time, 2); $time = str_replace(".", ",", $time); + if ($nlztime['unpaid'] == "0") { + $pay = $time; + } else { + $pay = 0; + } + } else { $time = ""; + $pay = ""; } - $bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], "", "3", $nlztime['start'], $nlztime['end'], $time, $hours]; + + $bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], "", "3", $nlztime['start'], $nlztime['end'], $time, $pay]; fputcsv($file, $bodyarray, ";"); } } diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 7df46f181..2fd32f5db 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -563,6 +563,7 @@ class TimerecordingReportController extends mfBaseController $nlzTimes[$timerecording->id]['start'] = date("d.m.Y", $timerecording->start); $nlzTimes[$timerecording->id]['end'] = date("d.m.Y", $timerecording->end); $nlzTimes[$timerecording->id]['minutes'] = $seconds / 60; + $nlzTimes[$timerecording->id]['unpaid'] = $timerecording->timerecordingCategory->unpaid; $nlzTimes[$timerecording->id]['category'] = $timerecording->timerecordingCategory->name; $nlzTimes[$timerecording->id]['categoryshort'] = $timerecording->timerecordingCategory->short; } @@ -622,6 +623,7 @@ class TimerecordingReportController extends mfBaseController $nlzTimes[$timerecording->id]['start'] = date("d.m.Y", $timerecording->start); $nlzTimes[$timerecording->id]['end'] = date("d.m.Y", $timerecording->end); $nlzTimes[$timerecording->id]['days'] = $sumdays; + $nlzTimes[$timerecording->id]['unpaid'] = $timerecording->timerecordingCategory->unpaid; $nlzTimes[$timerecording->id]['category'] = $timerecording->timerecordingCategory->name; $nlzTimes[$timerecording->id]['categoryshort'] = $timerecording->timerecordingCategory->short;