Merge pull request #3503 from fappels/3.7-dispatch-rounding
Fix #3471 3.7 Rounding issue when dispatching non-integer
This commit is contained in:
commit
a83b3ae7e8
@ -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]] = $row[2];
|
||||
while ($i < $num)
|
||||
{
|
||||
$objd = $db->fetch_object($resql);
|
||||
$products_dispatched[$objd->rowid] = price2num($objd->qty, 5);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
@ -322,7 +330,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else
|
||||
{
|
||||
$remaintodispatch=($objp->qty - $products_dispatched[$objp->rowid]); // Calculation of dispatched
|
||||
$remaintodispatch=(price2num($objp->qty, 5) - $products_dispatched[$objp->rowid]); // Calculation of dispatched
|
||||
if ($remaintodispatch < 0) $remaintodispatch=0;
|
||||
if ($remaintodispatch)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user