From 05ecbe1eea71fec32cf5eb41bf638e247766aa12 Mon Sep 17 00:00:00 2001
From: Hadi Nategh <hn@stylite.de>
Date: Wed, 19 Nov 2014 08:41:08 +0000
Subject: [PATCH] Keep the actual value of ts_quantity while storing it as it
 is used in price calculation, and rounding it cuases miscalculation of price

---
 timesheet/inc/class.timesheet_ui.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php
index 788a566016..b83e408599 100644
--- a/timesheet/inc/class.timesheet_ui.inc.php
+++ b/timesheet/inc/class.timesheet_ui.inc.php
@@ -169,7 +169,9 @@ class timesheet_ui extends timesheet_bo
 				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)
 					{
-						$this->data['ts_quantity'] = round($this->data['ts_duration'] / 60.0, 2);
+						// 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'])
 					{