mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-22 06:23:12 -06:00
Fixed a bug that will properly attach both budgets AND categories
This commit is contained in:
parent
0ef5825d98
commit
d9b70f7ad8
@ -93,6 +93,7 @@ class Transaction implements TransactionInterface
|
||||
/*
|
||||
* find budget using repository
|
||||
*/
|
||||
|
||||
if (isset($data['budget_id'])) {
|
||||
$budget = $this->_budgets->find($data['budget_id']);
|
||||
}
|
||||
@ -172,8 +173,8 @@ class Transaction implements TransactionInterface
|
||||
*/
|
||||
$budgetids = !isset($budget) || (isset($budget) && is_null($budget)) ? [] : [$budget->id];
|
||||
$catids = is_null($category) ? [] : [$category->id];
|
||||
$journal->budgets()->sync($budgetids);
|
||||
$journal->categories()->sync($catids);
|
||||
$components = array_merge($budgetids,$catids);
|
||||
$journal->components()->sync($components);
|
||||
$journal->save();
|
||||
if (isset($data['return_journal']) && $data['return_journal'] == true) {
|
||||
return $journal;
|
||||
|
Loading…
Reference in New Issue
Block a user