Skip to content
Snippets Groups Projects
Commit 8bdfdc01 authored by fappels's avatar fappels
Browse files

Fix #3471 3.5 Rounding issue when dispatching non-integer

parent 249883dd
No related branches found
No related tags found
No related merge requests found
...@@ -229,9 +229,17 @@ if ($id > 0 || ! empty($ref)) ...@@ -229,9 +229,17 @@ if ($id > 0 || ! empty($ref))
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
while ( $row = $db->fetch_row($resql) ) $num = $db->num_rows($resql);
$i = 0;
if ($num)
{ {
$products_dispatched[$row[0]] = $row[1]; while ($i < $num)
{
$objd = $db->fetch_object($resql);
$products_dispatched[$objd->fk_product] = price2num($objd->qty, 5);
$i++;
}
} }
$db->free($resql); $db->free($resql);
} }
...@@ -277,7 +285,7 @@ if ($id > 0 || ! empty($ref)) ...@@ -277,7 +285,7 @@ if ($id > 0 || ! empty($ref))
} }
else else
{ {
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]); // Calculation of dispatched $remaintodispatch=(price2num($objp->qty, 5) - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
if ($remaintodispatch < 0) $remaintodispatch=0; if ($remaintodispatch < 0) $remaintodispatch=0;
if ($remaintodispatch) if ($remaintodispatch)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment