diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 98dcbeb62fa..ae4e7554421 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -356,18 +356,19 @@ if ($_GET["action"] == 'create' && $user->rights->commande->creer)
print '
| '.$langs->trans("Ref").' | '.$langs->trans("Product").' | ';
print ''.$langs->trans("Price").' | '.$langs->trans("Discount").' | '.$langs->trans("Qty").' |
';
+ $var=false;
+
$sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent";
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid";
$sql .= " ORDER BY pt.rowid ASC";
$result = $db->query($sql);
if ($result)
{
- $num = $db->num_rows();
+ $num = $db->num_rows($result);
$i = 0;
- $var=True;
while ($i < $num)
{
- $objp = $db->fetch_object();
+ $objp = $db->fetch_object($result);
$var=!$var;
print "| [$objp->ref] | \n";
print ''.img_object($langs->trans("ShowProduct"),"product").' '.$objp->product.' | ';
@@ -608,10 +609,13 @@ else
print ' | | ';
print "
\n";
}
- $var=True;
+
+ $var=true;
while ($i < $num)
{
$objp = $db->fetch_object($result);
+
+ $var=!$var;
print "";
if ($objp->fk_product > 0)
{
@@ -910,5 +914,5 @@ else
$db->close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+llxFooter('$Date$ - $Revision$');
?>
diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 997ec588b66..8e4d9efe3a9 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -200,6 +200,7 @@ if ($_GET["id"] > 0)
while ($i < $num)
{
$objp = $db->fetch_object($result);
+ $var=!$var;
print "
";
if ($objp->fk_product > 0)
{
@@ -360,11 +361,11 @@ if ($_GET["id"] > 0)
else
{
// Commande non trouvée
- print "Commande inexistante ou accés refusé";
+ print "Commande inexistante";
}
}
$db->close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+llxFooter('$Date$ - $Revision$');
?>