From 22b88181009d55d7fdd7c0efcdf3d4afd73ee954 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Sep 2017 14:41:46 +0200 Subject: [PATCH] FIX #7359 --- htdocs/fichinter/class/fichinter.class.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index eaf10c357e4..b9bb40bdd7a 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -559,9 +559,10 @@ class Fichinter extends CommonObject /** * Returns amount based on user thm * - * @return float amount + * @return float Amount */ - function getAmount() { + function getAmount() + { global $db; $amount = 0; @@ -571,13 +572,11 @@ class Fichinter extends CommonObject $thm = $this->author->thm; - foreach($this->lines as &$line) { - - $amount+=$line->qty * $thm; - + foreach($this->lines as $line) { + $amount += ($line->duration / 60 / 60 * $thm); } - return $amount; + return price2num($amount, 'MT'); } /**