From 878f54b1e9a5c460c082f44ef204cd46034d518d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 17 Aug 2012 17:23:36 +0200 Subject: [PATCH] Fix: invoice supplier, disable "add" button and show error message if a product with no supplier price is selected --- htdocs/fourn/facture/fiche.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 3d428927de0..fad6aa855e2 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1805,10 +1805,12 @@ else $var=! $var; print ''; print ''; - $form->select_produits_fournisseurs($object->socid,'','idprodfournprice'); + + $ajaxoptions=array('disabled' => 'addPredefinedProductButton', 'error' => $langs->trans("NoPriceDefinedForThisSupplier")); + $form->select_produits_fournisseurs($object->socid, '', 'idprodfournprice', '', '', $ajaxoptions); if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) print '
'; - + if (is_object($hookmanager)) { $parameters=array('htmlname'=>'idprodfournprice'); @@ -1819,12 +1821,12 @@ else if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; $doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70); $doleditor->Create(); - + print ''; print ''; print ' '; print ' '; - print ''; + print ''; print ''; print ''; }