mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-03 20:55:05 +00:00 
			
		
		
		
	Fix issue with multi-currency in asset accounts.
This commit is contained in:
		@@ -432,9 +432,15 @@ class AccountController extends Controller
 | 
			
		||||
        $cache->addProperty($end);
 | 
			
		||||
        $cache->addProperty($account->id);
 | 
			
		||||
        if ($cache->has()) {
 | 
			
		||||
             return response()->json($cache->get()); // @codeCoverageIgnore
 | 
			
		||||
            return response()->json($cache->get()); // @codeCoverageIgnore
 | 
			
		||||
        }
 | 
			
		||||
        $currencies = $this->accountRepository->getUsedCurrencies($account);
 | 
			
		||||
 | 
			
		||||
        // if the account is not expense or revenue, just use the account's default currency.
 | 
			
		||||
        if (!in_array($account->accountType->type, [AccountType::REVENUE, AccountType::EXPENSE], true)) {
 | 
			
		||||
            $currencies= [$this->accountRepository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency()];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /** @var TransactionCurrency $currency */
 | 
			
		||||
        foreach ($currencies as $currency) {
 | 
			
		||||
            $chartData[] = $this->periodByCurrency($start, $end, $account, $currency);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user