diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index 443427ca31b..dd3f12203e3 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -472,7 +472,9 @@ if ($_GET["id"] > 0) { $obja = $db->fetch_object($resql); print ""; - print ''.$obja->label.''.$obja->entrepot.'Stock : '.$obja->reel.''; + print ''; + print img_warning($langs->trans("Late")); + print $obja->label.''.$obja->entrepot.'Stock : '.$obja->reel.''; print "\n"; $i++; } @@ -493,9 +495,12 @@ if ($_GET["id"] > 0) $sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande"; $sql .= " , ed.qty as qty_livre, e.ref, ed.fk_expedition as expedition_id"; $sql .= ",".$db->pdate("e.date_expedition")." as date_expedition"; + if ($conf->livraison->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref"; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " , ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."expedition as e"; + if ($conf->livraison->enabled) $sql .= " , ".MAIN_DB_PREFIX."livraison as l"; $sql .= " WHERE cd.fk_commande = ".$commande->id; + if ($conf->livraison->enabled) $sql .= " AND l.fk_commande = cd.fk_commande"; $sql .= " AND cd.rowid = ed.fk_commande_ligne"; $sql .= " AND ed.fk_expedition = e.rowid"; $sql .= " AND e.fk_statut > 0"; @@ -524,9 +529,15 @@ if ($_GET["id"] > 0) while ($i < $num) { $var=!$var; - $objp = $db->fetch_object($resql); + $objp = $db->fetch_object($resql); print ""; print ''.img_object($langs->trans("ShowSending"),'sending').' '.$objp->ref.''; + + if ($conf->livraison->enabled) + { + print ''.img_object($langs->trans("ShowSending"),'generic').' '.$objp->livraison_ref.''; + } + if ($objp->fk_product > 0) { $product = new Product($db);