diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index e12b33e8c6c..a800bb50bdf 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -687,11 +687,6 @@ else
{
print '
';
- if ($commande->statut == 0 && $user->rights->commande->supprimer)
- {
- print '
'.$langs->trans("Delete").'';
- }
-
if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer)
{
print '
Expédier';
@@ -706,18 +701,23 @@ else
}
}
+ if ($commande->statut == 0 && $user->rights->commande->supprimer)
+ {
+ print '
'.$langs->trans("Delete").'';
+ }
+
if ($commande->statut == 1)
{
- $nb_expedition = $commande->nb_expedition();
- if ($user->rights->commande->valider && $nb_expedition == 0)
- {
- print '
'.$langs->trans("Cancel").'';
- }
+ $nb_expedition = $commande->nb_expedition();
+ if ($user->rights->commande->valider && $nb_expedition == 0)
+ {
+ print '
'.$langs->trans("Cancel").'';
+ }
}
print "
";
}
- print "\n";
+ print "
\n";
print '
| ';
@@ -754,7 +754,7 @@ else
}
else
{
- print $db->error();
+ dolibarr_print_error($db);
}
print " | ";
@@ -791,7 +791,7 @@ else
}
else
{
- print $db->error();
+ dolibarr_print_error($db);
}
print " |
";
@@ -799,7 +799,10 @@ else
* Documents générés
*
*/
- $file = FAC_OUTPUTDIR . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
+ $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
+ $relativepath = $commande->ref."/".$commande->ref.".pdf";
+
+ $var=true;
if (file_exists($file))
{
@@ -807,8 +810,8 @@ else
print_titre("Documents");
print '';
}
+
/*
*
*