Skip to content
Snippets Groups Projects
Commit 86b1a9cb authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge remote-tracking branch 'origin/3.5' into 3.6

parents e1a92c82 a3032d56
Branches
Tags
No related merge requests found
...@@ -262,9 +262,17 @@ if ($id > 0 || ! empty($ref)) ...@@ -262,9 +262,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);
} }
...@@ -320,7 +328,7 @@ if ($id > 0 || ! empty($ref)) ...@@ -320,7 +328,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