Skip to content

Firefly III: a personal finances manager

#325

James Cole9deef5ac9262
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index 6a77568244..d7c7ed10fb 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -308,7 +308,7 @@ class JournalRepository implements JournalRepositoryInterface
}
// store or get budget
- if (intval($data['budget_id']) > 0) {
+ if (intval($data['budget_id']) > 0 && $transactionType->type !== TransactionType::TRANSFER) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($data['budget_id']);
$journal->budgets()->save($budget);
@@ -408,7 +408,7 @@ class JournalRepository implements JournalRepositoryInterface
// unlink all budgets and recreate them:
$journal->budgets()->detach();
- if (intval($data['budget_id']) > 0) {
+ if (intval($data['budget_id']) > 0 && $journal->transactionType->type !== TransactionType::TRANSFER) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::where('user_id', $this->user->id)->where('id', $data['budget_id'])->first();
$journal->budgets()->save($budget);