- if (!check_num('BuyRate', 0))
- {
- display_error( _("The exchange rate must be numeric and greater than zero."));
- set_focus('BuyRate');
- return false;
- }
- if ($_POST['BuyRate'] <= 0)
+ if (input_num('BuyRate') <= 0)
- $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev']));
- if ($_POST['BuyRate'] == 0) {
- display_error(_('This currency is not listed by ECB. Enter exchange rate manually.'));
- }
+ $_POST['BuyRate'] =
+ exrate_format(retrieve_exrate($_POST['curr_abrev'], $_POST['date_']));
$Ajax->activate('BuyRate');
}
small_amount_row(_("Exchange Rate:"), 'BuyRate', null, '',
$Ajax->activate('BuyRate');
}
small_amount_row(_("Exchange Rate:"), 'BuyRate', null, '',