Make sure transfers can't get a budget.

This commit is contained in:
James Cole 2018-03-11 14:13:23 +01:00
parent c2dfbcba10
commit e97283b34b
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -26,6 +26,7 @@ namespace FireflyIII\Factory;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Services\Internal\Support\TransactionServiceTrait;
use FireflyIII\User;
use Illuminate\Support\Collection;
@ -124,6 +125,11 @@ class TransactionFactory
}
// set budget:
if ($journal->transactionType->type === TransactionType::TRANSFER) {
$data['budget_id'] = null;
$data['budget_name'] = null;
}
$budget = $this->findBudget($data['budget_id'], $data['budget_name']);
$this->setBudget($source, $budget);
$this->setBudget($dest, $budget);