mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 01:16:46 -06:00
Simpler get currency routine
This commit is contained in:
parent
c5489a7c55
commit
fade9ae6f9
@ -132,16 +132,9 @@ class JavascriptController extends Controller
|
||||
public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
{
|
||||
$account = $repository->findNull((int) $request->get('account'));
|
||||
$currencyId = 0;
|
||||
if (null !== $account) {
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int) $repository->getMetaValue($account, 'currency_id');
|
||||
}
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currency = $currencyRepository->findNull($currencyId);
|
||||
if (null === $currency) {
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
if(null !== $account) {
|
||||
$currency = $repository->getAccountCurrency($account) ?? $currency;
|
||||
}
|
||||
|
||||
$localeconv = app('amount')->getLocaleInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user