Fix: invoice supplier, disable "add" button and show error message if a

product with no supplier price is selected
This commit is contained in:
Regis Houssin 2012-08-17 17:23:36 +02:00
parent 7394525388
commit 878f54b1e9

View File

@ -1805,10 +1805,12 @@ else
$var=! $var;
print '<tr '.$bc[$var].'>';
print '<td colspan="4">';
$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 '<br>';
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 '</td>';
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td align="center" valign="middle" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '<td align="center" valign="middle" colspan="2"><input type="submit" id="addPredefinedProductButton" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
}