From 42141b90524b5c20652bfb5ada8aedbe04ad9559 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 15 Apr 2005 11:40:16 +0000 Subject: [PATCH] =?UTF-8?q?Am=E9lioration=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/fiche.php | 9 +++- htdocs/expedition/commande.php | 80 +++++++++++++++++++++------------- 2 files changed, 58 insertions(+), 31 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 6f0be0181b3..07e692b6ea9 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -30,7 +30,7 @@ require("./pre.inc.php"); -$langs->load("orders"); +$langs->load("sendings"); $langs->load("companies"); $langs->load("bills"); @@ -429,6 +429,13 @@ else $hselected = $h; $h++; + if ($conf->expedition->enabled && $user->rights->expedition->lire) + { + $head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id; + $head[$h][1] = $langs->trans("SendingCard"); + $h++; + } + $head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id; $head[$h][1] = $langs->trans("ComptaCard"); $h++; diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index e0b2f725f4c..8b6ad36888e 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -78,35 +78,42 @@ if ($_GET["id"] > 0) $author = new User($db); $author->id = $commande->user_author_id; $author->fetch(); + + $h=0; + $head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id; + $head[$h][1] = $langs->trans("OrderCard"); + $h++; + + $head[$h][0] = DOL_URL_ROOT."/expedition/commande.php?id=".$commande->id; + $head[$h][1] = $langs->trans("SendingCard"); + $hselected = $h; + $h++; - print_titre("Commande : ".$commande->ref); - + dolibarr_fiche_head($head, $hselected, $soc->nom." / ".$langs->trans("Order")." : $commande->ref"); /* * Confirmation de la validation * */ if ($_GET["action"] == 'cloture') { - $html->form_confirm("commande.php?id=".$_GET["id"],"Cloturer la commande","Etes-vous sûr de cloturer cette commande ?","confirm_cloture"); + $html->form_confirm("commande.php?id=".$_GET["id"],"Clôturer la commande","Etes-vous sûr de vouloir clôturer cette commande ?","confirm_cloture"); + print "
"; } /* * */ - print '
'; - print ''; - print ''; print ''; print ''; - print "'; print '"; - print ''; - print "\n"; + print ''; + print '\n"; print '"; } - print '
'.$langs->trans("Customer").'"; + print ''; print ''.$soc->nom.''; print $commande->statuts[$commande->statut]; print "
'.$langs->trans("Date").'".strftime("%A %d %B %Y",$commande->date)."
'.$langs->trans("Date").''.strftime("%A %d %B %Y",$commande->date)."Source : ' . $commande->sources[$commande->source] ; if ($commande->source == 0) @@ -124,7 +131,7 @@ if ($_GET["id"] > 0) print '
Note : '.nl2br($commande->note)."
'; + print '

'; /* * Lignes de commandes @@ -133,10 +140,12 @@ if ($_GET["id"] > 0) echo ''; $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice"; - $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product) WHERE l.fk_commande = ".$commande->id." AND p.fk_product_type <> 1 ORDER BY l.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l "; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product)"; + $sql .= " WHERE l.fk_commande = ".$commande->id." AND p.fk_product_type <> 1 ORDER BY l.rowid"; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { $num = $db->num_rows(); $i = 0; $total = 0; @@ -216,34 +225,45 @@ if ($_GET["id"] > 0) * * */ - if ($reste_a_livrer_total > 0) + if ($reste_a_livrer_total > 0 && $commande->brouillon == 0) { + + print ''; + print ''; + print ''; + print '
'; + $entrepot = new Entrepot($db); - $langs->load("stocks"); + $langs->load("stocks"); + + print ''; print ''; - print ''; /* - print ''; - print ''; + print ''; + print ''; */ - print ''; + + print "
'.$langs->trans("NewSending").'
'.$langs->trans("Warehouse").''; + print ''; $html->select_array("entrepot_id",$entrepot->list_array()); print '
Mode d\'expédition'; - $html->select_array("entrepot_id",$entrepot->list_array()); - print '
Mode d\'expédition'; + $html->select_array("entrepot_id",$entrepot->list_array()); + print '
'; + print '
'; if (sizeof($entrepot->list_array())) { + print ''; } else { - print 'Aucun entrpôt définit, definissez en un'; + print 'Aucun entrepôt définit, definissez en un'; } print '
"; + print "
\n"; } - print ""; - print "\n"; + /* * Alerte de seuil @@ -261,22 +281,22 @@ if ($_GET["id"] > 0) $sql .= " WHERE e.rowid = ps.fk_entrepot AND ps.fk_product = p.rowid AND ps.fk_product = $key"; $sql .= " AND e.statut = 1 AND reel < $value"; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; $var=True; while ($i < $num) { - $obja = $db->fetch_object($result); + $obja = $db->fetch_object($resql); print ""; print ''.$obja->label.''.$obja->entrepot.'Stock : '.$obja->reel.''; print "\n"; $i++; } - $db->free(); + $db->free($resql); } } } @@ -305,7 +325,7 @@ if ($_GET["id"] > 0) $sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande, ed.qty as qty_livre, e.ref, e.rowid as expedition_id"; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd , ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."expedition as e"; $sql .= " WHERE cd.fk_commande = ".$commande->id." AND cd.rowid = ed.fk_commande_ligne AND ed.fk_expedition = e.rowid"; - $sql .= " ORDER BY cd.fk_product"; + $sql .= " ORDER BY e.rowid DESC, cd.fk_product"; $resql = $db->query($sql); if ($resql) {