diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php index b500796ced2..cad91bd7233 100644 --- a/htdocs/fourn/product/fourn.php +++ b/htdocs/fourn/product/fourn.php @@ -34,6 +34,19 @@ $user->getrights('produit'); if (!$user->rights->produit->lire) accessforbidden(); +if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) +{ + $product = new Product($db); + if( $product->fetch($_GET["id"]) ) + { + $product->update_buyprice($_GET["id_fourn"], '1', $_POST["price"], $user); + } + + Header('Location :fourn.php?id='.$product->id.'&id_fourn='.$_GET["id_fourn"]); +} + + + llxHeader("","",$langs->trans("CardProduct0")); /* @@ -45,16 +58,18 @@ if ($_GET["id"]) { $product = new Product($db); $result = $product->fetch($_GET["id"]); + $fourn = new Fournisseur($db); $result = $fourn->fetch($_GET["id_fourn"]); + + $product->get_buyprice($fourn->id, 1); } if ( $result ) { - if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') - { + /* * En mode visu */ @@ -73,15 +88,34 @@ if ($_GET["id"]) dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); print '
| '; + $cat = new Categorie ($db); + $way = $cat->print_primary_way($product->id," > ",'fourn/product/liste.php'); + if ($way == "") + { + print "Ce produit n'appartient à aucune catégorie"; + } + else + { + print $langs->trans("Categorie")." : "; + print $way; + } + print ' | ||
| '.$langs->trans("InternalRef").' | '.$product->ref.' | '; print '|
| '.$langs->trans("Label").' | '.$product->libelle.' | |
| '.$langs->trans("Label").' | '.$product->libelle.' | |
| '.$langs->trans("Supplier").' | '.$fourn->nom_url.' | '; - print '|
| '.$langs->trans("BuiingPrice").' | '.price($product->buyprice).' | '; + print '|
| '.$langs->trans("Description").' | '.nl2br($product->description).' | |