diff --git a/htdocs/compta/commande.php b/htdocs/compta/commande.php index 6b94aca7be4..137671844ae 100644 --- a/htdocs/compta/commande.php +++ b/htdocs/compta/commande.php @@ -69,8 +69,14 @@ if ($_GET["id"] > 0) $author = new User($db); $author->id = $commande->user_author_id; $author->fetch(); - - print_titre("Commande : ".$commande->ref); + + + $head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; + $head[0][1] = "Commande : $commande->ref"; + $h = 1; + $a = 0; + + dolibarr_fiche_head($head, $a); /* * Commande @@ -198,34 +204,6 @@ if ($_GET["id"] > 0) print $db->error(); } print ''; - /* - * Barre d'actions - */ - - if ($user->societe_id == 0 && !$commande->facturee) - { - print '
| '; - print 'Facturer'; - print ' | '; - print '- | '; - print '- | '; - if (!$commande->facturee) - { - print ''; - print 'Classer comme facturée'; - print ' | '; - } - else - { - print '- | '; - } - print '- | '; - - print "
\n";
/*
* Documents générés
@@ -253,16 +231,19 @@ if ($_GET["id"] > 0)
*/
print "";
}
- /*
- * Factures associees
- */
- $sql = "SELECT f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.rowid as facid, f.fk_user_author, f.paye";
- $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as fp WHERE fp.fk_facture = f.rowid AND fp.fk_commande = ".$commande->id;
+ /*
+ * Factures associees
+ */
+ $sql = "SELECT f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.rowid as facid, f.fk_user_author, f.paye";
+ $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as fp WHERE fp.fk_facture = f.rowid AND fp.fk_commande = ".$commande->id;
+
+ if ($db->query($sql) )
+ {
+ $num_fac_asso = $db->num_rows();
+ $i = 0; $total = 0;
- if ($db->query($sql) )
+ if ($num_fac_asso > 0)
{
- $num_fac_asso = $db->num_rows();
- $i = 0; $total = 0;
print "
";
if ($num_fac_asso > 1)
{
@@ -307,18 +288,38 @@ if ($_GET["id"] > 0)
}
print "