mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
Deposit works as well.
This commit is contained in:
@@ -187,7 +187,7 @@ class TransactionController extends Controller
|
||||
if ($journal->hasMeta('original_currency_id')) {
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$originalCurrency = $repository->find(intval($journal->hasMeta('original_currency_id')));
|
||||
$originalCurrency = $repository->find(intval($journal->getMeta('original_currency_id')));
|
||||
}
|
||||
|
||||
return view('transactions.show', compact('journal', 'events', 'subTitle', 'what', 'transactions', 'originalCurrency'));
|
||||
|
||||
@@ -187,6 +187,15 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
$amount = strval($data['exchanged_amount']);
|
||||
}
|
||||
break;
|
||||
case TransactionType::DEPOSIT:
|
||||
$accountCurrencyId = intval($accounts['destination']->getMeta('currency_id'));
|
||||
if ($accountCurrencyId !== $currencyId) {
|
||||
$data['original_amount'] = $data['amount'];
|
||||
$data['original_currency_id'] = $currencyId;
|
||||
$currencyId = $accountCurrencyId;
|
||||
$amount = strval($data['exchanged_amount']);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new FireflyException(sprintf('Currency exchange routine cannot handle %s', $transactionType->type));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user