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,7 +1805,9 @@ else
$var=! $var; $var=! $var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td colspan="4">'; 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 (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) print '<br>';
@ -1824,7 +1826,7 @@ else
print '<td align="right"><input type="text" name="qty" value="1" size="1"></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>&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 '</tr>';
print '</form>'; print '</form>';
} }