From 6539b66cdc4cb389dd32885f798765c123752008 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 25 Aug 2017 10:11:31 -0600 Subject: [PATCH] * Timesheet - Fix 0 quantity was not allowed --- timesheet/inc/class.timesheet_ui.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index c9b1d2541c..9c0d726af2 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -187,13 +187,13 @@ class timesheet_ui extends timesheet_bo case 'save': case 'save_new': case 'apply': - if ((!$this->data['ts_quantity'] || $this->ts_viewtype == 'short') && $this->data['ts_duration']) // set the quantity (in h) from the duration (in min) + if (($this->data['ts_quantity'] === '' || $this->ts_viewtype == 'short') && $this->data['ts_duration']) // set the quantity (in h) from the duration (in min) { // We need to keep the actual value of ts_quantity when we are storing it, as it is used in price calculation // and rounding it causes miscalculation on prices $this->data['ts_quantity'] = $this->data['ts_duration'] / 60.0; } - if (!$this->data['ts_quantity']) + if ($this->data['ts_quantity'] === '') { $etpl->set_validation_error('ts_quantity',lang('Field must not be empty !!!')); }