diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.php index d364514dd3..99dae64026 100644 --- a/app/Services/Internal/Update/JournalUpdateService.php +++ b/app/Services/Internal/Update/JournalUpdateService.php @@ -150,7 +150,15 @@ class JournalUpdateService foreach ($journal->transactions as $transaction) { $service->updateBudget($transaction, $budgetId); } + return $journal; } + // clear budget. + /** @var Transaction $transaction */ + foreach ($journal->transactions as $transaction) { + $transaction->budgets()->sync([]); + } + // remove budgets from journal: + $journal->budgets()->sync([]); return $journal; } diff --git a/tests/Feature/Controllers/ProfileControllerTest.php b/tests/Feature/Controllers/ProfileControllerTest.php index 1138b109c8..8fff851215 100644 --- a/tests/Feature/Controllers/ProfileControllerTest.php +++ b/tests/Feature/Controllers/ProfileControllerTest.php @@ -126,7 +126,7 @@ class ProfileControllerTest extends TestCase } /** - * @covers \FireflyIII\Http\Controllers\ProfileControllerAccount + * @covers \FireflyIII\Http\Controllers\ProfileController */ public function testDeleteAccount(): void { @@ -141,7 +141,7 @@ class ProfileControllerTest extends TestCase } /** - * @covers \FireflyIII\Http\Controllers\ProfileControllerCode + * @covers \FireflyIII\Http\Controllers\ProfileController */ public function testDeleteCode(): void {