';
+
print "";
- print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+
+ $nblignes=6;
+ if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
+ if ($product->type == 1) $nblignes++;
+
+ // Reference
+ print ''.$langs->trans("Ref").' | '.$product->ref.' | ';
+ print '';
+ // Photo
+ $nbphoto=$product->show_photo($conf->produit->dir_output,1);
+ print ' | ';
print '
';
- print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
+
+ // Libellé
+ print '
| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print '
';
// Prix
print '| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ';
- if ($product->type == 0) $nbligne=5;
- else $nbligne=5;
- print '';
-
- $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)";
-
- $result=$db->query($sql);
- if ($result)
- {
- $num_fournisseur = $db->num_rows($result);
- $i = 0;
- print '';
- $db->free($result);
- }
- print ' |
';
+ print '';
// Statut
print '| '.$langs->trans("Status").' | ';
@@ -409,9 +380,12 @@ if ($_GET["id"])
else print $langs->trans("NotOnSell");
print ' |
';
+ // TVA
$langs->load("bills");
print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.' % |
';
- if ($product->type == 0 && defined("MAIN_MODULE_STOCK"))
+
+ // Stock
+ if ($product->type == 0 && $conf->stock->enabled)
{
print '| '.$langs->trans("Stock").' | ';
if ($product->no_stock)
@@ -431,8 +405,11 @@ if ($_GET["id"])
}
print '
';
}
+
+ // Description
print '| '.$langs->trans("Description").' | '.nl2br($product->description).' |
';
+ // Durée
if ($product->type == 1)
{
print '| '.$langs->trans("Duration").' | '.$product->duration_value.' ';
@@ -448,36 +425,11 @@ if ($_GET["id"])
print ' |
';
}
+
print "
'.$langs->trans("PriceRemoved").'.
';
+ }
+ else
+ {
+ $_GET["action"] = '';
+ }
+ }
+ else { // On supprime un fournisseur
+ if ($product->remove_fournisseur($user, $_GET["id_fourn"]) > 0)
+ {
+ $_GET["action"] = '';
+ $mesg = ''.$langs->trans("SupplierRemoved").'.
';
+ }
+ else
+ {
+ $_GET["action"] = '';
+ }
+ }
+ }
+}
+
if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
@@ -67,8 +98,12 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
$mesg='