From e16a69ba0fcf4e83c4c3934f205f5666f65bb64f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Mar 2005 02:40:18 +0000 Subject: [PATCH] Fix: Erreur sql sur affichage page --- htdocs/fourn/commande/fiche.php | 35 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index fc66fcce025..ee162e1f73f 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -21,7 +21,8 @@ * */ -/** \file htdocs/fourn/commande/fiche.php +/** + \file htdocs/fourn/commande/fiche.php \ingroup commande \brief Fiche commande \version $Revision$ @@ -506,14 +507,6 @@ if ($id > 0) { print '
'; - if ($commande->statut == 0) - { - if ($user->rights->fournisseur->commande->creer) - { - print ''.$langs->trans("Delete").''; - } - } - if ($commande->statut == 0 && $num_lignes > 0) { if ($user->rights->fournisseur->commande->valider) @@ -540,6 +533,14 @@ if ($id > 0) } } + if ($commande->statut == 0) + { + if ($user->rights->fournisseur->commande->creer) + { + print ''.$langs->trans("Delete").''; + } + } + print "
"; } print "

\n"; @@ -579,7 +580,7 @@ if ($id > 0) } else { - print $db->error(); + dolibarr_print_error($db); } print " "; @@ -589,22 +590,22 @@ if ($id > 0) $sql = "SELECT f.rowid,f.facnumber,".$db->pdate("f.datef")." as df"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as cf"; $sql .= " WHERE f.rowid = cf.fk_facture AND cf.fk_commande = ". $commande->id; - + $result = $db->query($sql); - if ($result && 0) + if ($result) { - $num = $db->num_rows(); + $num = $db->num_rows($result); if ($num) { - print_titre("Factures"); + print_titre($langs->trans("Bills")); $i = 0; $total = 0; print ''; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $db->fetch_object($result); $var=!$var; print ""; print ''; @@ -631,7 +632,7 @@ if ($id > 0) if (file_exists($file)) { - print_titre("Documents"); + print_titre($langs->trans("Documents")); print '
Facture".$langs->trans("Date")."
".$langs->trans("Bills")."".$langs->trans("Date")."
'.stripslashes($objp->facnumber).'
'; print "";
".$langs->trans("Order")." PDF