mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-22 14:33:11 -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
|
* find budget using repository
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (isset($data['budget_id'])) {
|
if (isset($data['budget_id'])) {
|
||||||
$budget = $this->_budgets->find($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];
|
$budgetids = !isset($budget) || (isset($budget) && is_null($budget)) ? [] : [$budget->id];
|
||||||
$catids = is_null($category) ? [] : [$category->id];
|
$catids = is_null($category) ? [] : [$category->id];
|
||||||
$journal->budgets()->sync($budgetids);
|
$components = array_merge($budgetids,$catids);
|
||||||
$journal->categories()->sync($catids);
|
$journal->components()->sync($components);
|
||||||
$journal->save();
|
$journal->save();
|
||||||
if (isset($data['return_journal']) && $data['return_journal'] == true) {
|
if (isset($data['return_journal']) && $data['return_journal'] == true) {
|
||||||
return $journal;
|
return $journal;
|
||||||
|
Loading…
Reference in New Issue
Block a user