From 75a14e02d8e1429c5545d8785fa80792f568b153 Mon Sep 17 00:00:00 2001 From: fappels Date: Thu, 10 Sep 2015 23:29:13 +0200 Subject: [PATCH] Fix #3471 3.7 Rounding issue when dispatching non-integer --- htdocs/fourn/commande/dispatch.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 76d09d8f3d3..f4adaf1ba0d 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -264,9 +264,17 @@ if ($id > 0 || ! empty($ref)) $resql = $db->query($sql); if ($resql) { - while ( $row = $db->fetch_row($resql) ) + $num = $db->num_rows($resql); + $i = 0; + + if ($num) { - $products_dispatched[$row[0]] = price2num($row[2], 5); + while ($i < $num) + { + $objd = $db->fetch_object($resql); + $products_dispatched[$objd->rowid] = price2num($objd->qty, 5); + $i++; + } } $db->free($resql); }