diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index e4b672d355d..cdf5a63ea22 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -33,6 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formorder.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php'); require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php"; require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.product.class.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; require_once DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"; require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); @@ -231,6 +232,11 @@ if ($_POST['action'] == 'addline' && $user->rights->fournisseur->commande->creer */ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->creer && $_POST['save'] == $langs->trans('Save')) { + $product=new Product($db); + if ($_POST["elrowid"]) + { + if ($product->fetch($_POST["elrowid"]) < 0) dol_print_error($db); + } $commande = new CommandeFournisseur($db,"",$id); if ($commande->fetch($id) < 0) dol_print_error($db); @@ -242,7 +248,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c $_POST['tva_tx'], 'HT', 0, - $_POST["type"] + isset($_POST["type"])?$_POST["type"]:$product->type ); if ($result >= 0) @@ -1069,17 +1075,18 @@ if ($id > 0 || ! empty($ref)) // Ligne en mode update if ($_GET["action"] == 'editline' && $user->rights->fournisseur->commande->creer && ($_GET["rowid"] == $commandline->id)) { + print "\n"; print '
id.'" method="post">'; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; // ancre pour retourner sur la ligne if (($conf->product->enabled || $conf->service->enabled) && $commandline->fk_product > 0) { - print ''; + print ''; print img_object($langs->trans('ShowProduct'),'product'); print ' '.$commandline->ref_fourn.''; print ' ('.$commandline->ref.')'; @@ -1112,7 +1119,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print '%'; - print ''; + print ''; print '
'; print '' . "\n"; print "
\n";