From 21ffaf5abd79c3d9eb8dde8a8996beb693db1099 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Aug 2005 00:11:23 +0000 Subject: [PATCH] =?UTF-8?q?Look:=20Modif=20esth=E9tiques=20mineures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/stock/product.php | 118 +++++++++++++++++-------------- 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index ce5f093c976..da34d079211 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -166,49 +166,52 @@ if ($_GET["id"]) print($mesg); print ''; - print ""; - print ''; - print ''; + + // Reference + print ''; + print ''; + print ''; + + // Libellé print ''; - print ''; + print ''; + + // Prix print ''; - print ''; + // Statut + print ''; - print ''; + + // TVA + $langs->load("bills"); + print ''; + + // Stock + if ($product->type == 0 && $conf->stock->enabled) + { + print ''; + if ($product->no_stock) + { + print "'; + } + print "
'.$langs->trans("Ref").''.$product->ref.''; - if ($product->envente) - { - print $langs->trans("OnSell"); - } - else - { - print $langs->trans("NotOnSell"); - } - print '
'.$langs->trans("Ref").''.$product->ref.'
'.$langs->trans("Label").''.$product->libelle.''.$langs->trans("Statistics").'
'.$langs->trans("SellingPrice").''.price($product->price).''; - print $langs->trans("Suppliers").' ['.$langs->trans("Add").']'; - - $sql = "SELECT s.nom, s.idp"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; - $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$product->id"; - $sql .= " ORDER BY lower(s.nom)"; - - if ( $db->query($sql) ) - { - $num = $db->num_rows(); - $i = 0; - print ''; - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print ''; - $i++; - } - print '
'.$objp->nom.'
'; - $db->free(); - } + print '
'.$langs->trans("Status").''; + if ($product->envente) print $langs->trans("OnSell"); + else print $langs->trans("NotOnSell"); print '
Stock seuil'.$product->seuil_stock_alerte.'
'.$langs->trans("VATRate").''.$product->tva_tx.' %
'.$langs->trans("Stock").'Pas de définition de stock pour ce produit"; + } + else + { + if ($product->stock_reel <= $product->seuil_stock_alerte) + { + print ''.$product->stock_reel.' Seuil : '.$product->seuil_stock_alerte; + } + else + { + print "".$product->stock_reel; + } + } + print '
"; /* @@ -221,13 +224,14 @@ if ($_GET["id"]) $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id; $sql .= " ORDER BY lower(e.label)"; - if ($db->query($sql)) + $resql=$db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; $total = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($resql); print ''.$obj->label.''.$obj->reel.''; ; $total = $total + $obj->reel; $i++; @@ -254,13 +258,14 @@ if ($_GET["id"]) $sql .= " WHERE statut = 1"; $sql .= " ORDER BY lower(e.label)"; - if ($db->query($sql)) + $resql=$db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($resql); print '