1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Support setting conversion base currency

This commit is contained in:
Hillel Coren 2018-02-01 09:32:29 +02:00
parent dae5dcc3ef
commit 479a710cb6
3 changed files with 3 additions and 2 deletions

View File

@ -190,7 +190,7 @@ class SendReminders extends Command
$data = CurlUtils::get(config('ninja.exchange_rates_url'));
$data = json_decode($data);
Currency::whereCode('EUR')->update(['exchange_rate' => 1]);
Currency::whereCode(config('ninja.exchange_rates_base'))->update(['exchange_rate' => 1]);
foreach ($data->rates as $code => $rate) {
Currency::whereCode($code)->update(['exchange_rate' => $rate]);

View File

@ -21,5 +21,6 @@ return [
// data services
'exchange_rates_url' => env('EXCHANGE_RATES_URL', 'https://api.fixer.io/latest'),
'exchange_rates_base' => env('EXCHANGE_RATES_BASE', 'EUR'),
];

View File

@ -15,7 +15,7 @@
countryMap[country.id] = country;
}
fx.base = 'EUR';
fx.base = '{{ config('ninja.exchange_rates_base') }}';
fx.rates = {!! cache('currencies')
->keyBy('code')
->map(function($item, $key) {