mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 02:52:44 +00:00
Fix for #1364
This commit is contained in:
@@ -189,7 +189,8 @@ class SplitController extends Controller
|
||||
$destinationAccounts = $this->repository->getJournalDestinationAccounts($journal);
|
||||
$array = [
|
||||
'journal_description' => $request->old('journal_description', $journal->description),
|
||||
'journal_amount' => $this->repository->getJournalTotal($journal),
|
||||
'journal_amount' => '0',
|
||||
'journal_foreign_amount' => '0',
|
||||
'sourceAccounts' => $sourceAccounts,
|
||||
'journal_source_account_id' => $request->old('journal_source_account_id', $sourceAccounts->first()->id),
|
||||
'journal_source_account_name' => $request->old('journal_source_account_name', $sourceAccounts->first()->name),
|
||||
@@ -213,9 +214,12 @@ class SplitController extends Controller
|
||||
'transactions' => $this->getTransactionDataFromJournal($journal),
|
||||
];
|
||||
// update transactions array with old request data.
|
||||
|
||||
$array['transactions'] = $this->updateWithPrevious($array['transactions'], $request->old());
|
||||
|
||||
// update journal amount and foreign amount:
|
||||
$array['journal_amount'] = array_sum(array_column($array['transactions'], 'amount'));
|
||||
$array['journal_foreign_amount'] = array_sum(array_column($array['transactions'], 'foreign_amount'));
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user