From 6462a0d99ab71c8af90a6c8c6134bc886658989c Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 30 Nov 2004 19:24:11 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20liste=20des=20commandes=20associ=E9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fourn/fiche.php | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index b47365354f9..f690bc7b00c 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -25,6 +25,7 @@ require("./pre.inc.php"); require("../contact.class.php"); $langs->load("bills"); +$langs->load("orders"); $langs->load("companies"); $socid = $_GET["socid"]; @@ -109,6 +110,57 @@ if ( $societe->fetch($socid) ) * */ print ''; + + /* + * + * Liste des commandes associées + * + */ + $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; + $sql .= " WHERE p.fk_soc =".$societe->id; + $sql .= " ORDER BY p.rowid DESC LIMIT 0,4"; + if ( $db->query($sql) ) + { + print ''; + $i = 0 ; + $num = $db->num_rows(); + if ($num > 0) + { + print ''; + print ""; + } + while ($i < $num && $i < 5) + { + $obj = $db->fetch_object(); + $var=!$var; + + print ""; + print ''; + print ""; + $i++; + } + $db->free(); + print "
id\">Dernières commandes
'; + print ' '; + print ''; + print $obj->ref.'"; + if ($obj->dc) + { + print dolibarr_print_date($obj->dc); + } + else + { + print "-"; + } + print "
"; + } + else + { + print $db->error(); + } + + /* * * Liste des factures associées @@ -161,6 +213,7 @@ if ( $societe->fetch($socid) ) */ print '
'; + print ''.$langs->trans("CreateOrder").''; print ''.$langs->trans("CreateBill").''; print '
';