diff --git a/app/Http/Controllers/ExchangeRates/IndexController.php b/app/Http/Controllers/ExchangeRates/IndexController.php new file mode 100644 index 0000000000..0fa0180c24 --- /dev/null +++ b/app/Http/Controllers/ExchangeRates/IndexController.php @@ -0,0 +1,52 @@ +middleware( + function ($request, $next) { + app('view')->share('mainTitleIcon', 'fa-exchange'); + app('view')->share('title', (string) trans('firefly.header_exchange_rates')); + return $next($request); + } + ); + } + + public function index() + { + return view('exchange-rates.index'); + } + +} diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index fbbb9d8969..1de3cb857c 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -242,7 +242,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface return $room; } - // amount is negative and $currentamount is smaller than $amount + // amount is negative and $currentAmount is smaller than $amount if (-1 === bccomp($amount, '0') && 1 === bccomp($compare, $amount)) { app('log')->debug(sprintf('Max amount to remove is %f', $repetition->current_amount)); app('log')->debug(sprintf('Cannot remove %f from piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); diff --git a/resources/lang/en_US/breadcrumbs.php b/resources/lang/en_US/breadcrumbs.php index 5a89a6b9b3..9dba742c88 100644 --- a/resources/lang/en_US/breadcrumbs.php +++ b/resources/lang/en_US/breadcrumbs.php @@ -89,4 +89,7 @@ return [ // notifications 'notification_index' => 'Owner notifications', + + // exchange rates + 'exchange_rates_index' => 'Exchange rates', ]; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index b435d5e571..fa0cb6b42b 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -1394,6 +1394,11 @@ return [ 'slack_url_label' => 'Slack "incoming webhook" URL', 'discord_url_label' => 'Discord webhook URL', + // exchange rates + 'menu_exchange_rates_index' => 'Exchange rates', + 'header_exchange_rates' => 'Exchange rates', + 'exchange_rates_intro' =>'Firefly III supports downloading and using exchange rates. Read more about this in the documentation.', + // Financial administrations 'administration_index' => 'Financial administration', 'administrations_index_menu' => 'Financial administration(s)', diff --git a/resources/views/exchange-rates/index.twig b/resources/views/exchange-rates/index.twig new file mode 100644 index 0000000000..6bab169fd7 --- /dev/null +++ b/resources/views/exchange-rates/index.twig @@ -0,0 +1,51 @@ +{% extends './layout/default' %} + +{% block breadcrumbs %} + {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }} +{% endblock %} + +{% block content %} +
+ {{ 'exchange_rates_intro'|_ }} +
+