mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Only withdrawal can have a budget.
This commit is contained in:
@@ -458,7 +458,7 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
private function storeBudgetWithJournal(TransactionJournal $journal, int $budgetId)
|
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 */
|
/** @var \FireflyIII\Models\Budget $budget */
|
||||||
$budget = Budget::find($budgetId);
|
$budget = Budget::find($budgetId);
|
||||||
$journal->budgets()->save($budget);
|
$journal->budgets()->save($budget);
|
||||||
|
|||||||
Reference in New Issue
Block a user