! -> Note
$ -> Affected files
+18-Sep-2008 Janusz Dobrowolski
+ Support for calling external pages during document entry (e.g. for adding customer/supplier/items).
$ /index.php
/includes/ui/ui_controls.inc
/sales/manage/customers.php
# Syntax error introduced in previous update fixed
$ /inventory/prices.php
+# Fixed retreiving of exchange rates [0000057]
+$ /gl/manage/exchange_rates.php
+ /includes/banking.inc
+ /includes/ui/ui_view.inc
18-Sep-2008 Joe Hunt
+ New Report - Bank Statement.
if (isset($_POST['get_rate']))
{
$_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.'));
+ }
$Ajax->activate('BuyRate');
}
small_amount_row(_("Exchange Rate:"), 'BuyRate', null, '',
$currency = $to_currency;
else
$currency = $from_currency;
+
$rate = get_ecb_rate($currency);
- if ($rate==0)
- {
- display_error(_("Cannot get exchange rate for this currency. Please add exchange rate manually on Exchange Rates page.") );
- $rate = get_exchange_rate_from_to($to_currency, $from_currency, $date_);
- } else
- {
+ if ($rate && ($date_==Today())) {
if (get_date_exchange_rate($currency, $date_))
update_exchange_rate($currency, $date_, $rate, $rate);
else
add_exchange_rate($currency, $date_, $rate, $rate);
- }
+ } else
+ $rate = get_exchange_rate_from_to($to_currency, $from_currency, $date_);
+
if ($from_currency == $comp_currency)
$rate = 1 / $rate;
$Ajax->activate('get_rate');
}
else
$rate = get_exchange_rate_from_to($to_currency, $from_currency, $date_);
+
$rate = number_format2($rate, user_exrate_dec());
label_row(_("Exchange Rate:"),"1 " . $from_currency . " = <span id='_ex_rate'>" . $rate . "</span> " . $to_currency .
($buttons?" " . submit('get_rate',_("Get"), false, $hint, true):""));