mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed edit of multi currency transaction, ##651
This commit is contained in:
parent
01fedc0bf8
commit
2b1ab5c6ef
@ -259,18 +259,9 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
$journal->description = $data['description'];
|
||||
$journal->date = $data['date'];
|
||||
$accounts = $this->storeAccounts($journal->transactionType, $data);
|
||||
$data = $this->verifyNativeAmount($data, $accounts);
|
||||
$amount = strval($data['amount']);
|
||||
|
||||
if ($data['currency_id'] !== $journal->transaction_currency_id) {
|
||||
// user has entered amount in foreign currency.
|
||||
// amount in "our" currency is $data['exchanged_amount']:
|
||||
$amount = strval($data['exchanged_amount']);
|
||||
// other values must be stored as well:
|
||||
$data['original_amount'] = $data['amount'];
|
||||
$data['original_currency_id'] = $data['currency_id'];
|
||||
|
||||
}
|
||||
|
||||
// unlink all categories, recreate them:
|
||||
$journal->categories()->detach();
|
||||
$journal->budgets()->detach();
|
||||
|
Loading…
Reference in New Issue
Block a user