Skip to content

Firefly III: a personal finances manager

Only withdrawal can have a budget.

James Cole47bebb614e58
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index 5d81adf1a6..6b3e476b50 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -458,7 +458,7 @@ class JournalRepository implements JournalRepositoryInterface
*/
private function storeBudgetWithJournal(TransactionJournal $journal, int $budgetId)
{
- if (intval($budgetId) > 0 && $journal->transactionType->type !== TransactionType::TRANSFER) {
+ if (intval($budgetId) > 0 && $journal->transactionType->type === TransactionType::WITHDRAWAL) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($budgetId);
$journal->budgets()->save($budget);