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 "| Facture | ".$langs->trans("Date")." | \n";
+ print "| ".$langs->trans("Bills")." | ".$langs->trans("Date")." | \n";
$var=True;
while ($i < $num)
{
- $objp = $db->fetch_object();
+ $objp = $db->fetch_object($result);
$var=!$var;
print "";
print '| '.stripslashes($objp->facnumber).' | ';
@@ -631,7 +632,7 @@ if ($id > 0)
if (file_exists($file))
{
- print_titre("Documents");
+ print_titre($langs->trans("Documents"));
print '';
print "| ".$langs->trans("Order")." PDF | ";
|