Skip to content

Bug: Budget field empty / budgets not loaded when switching source account #795

@output42

Description

@output42

Bug Description

When creating a withdrawal transaction, the budget dropdown works correctly
for the pre-configured default source account. When switching to any other
asset account, the budget field is either empty (no budgets listed) or
disappears entirely.

Steps to Reproduce

  1. Open "Add Transaction"
  2. Leave the default source account → budget dropdown shows all budgets ✅
  3. Change the source account to any other asset account (e.g. C24 Giro,
    PayPal, cash wallet)
  4. Budget field is empty or disappears ❌

Expected Behavior

Budgets are not account-specific in Firefly III — all budgets should be
available regardless of which asset account is selected as the source.

Actual Behavior

Budgets only appear when the default source account is selected.
With any other asset account the budget list is empty, or the field
disappears entirely.

Root Cause (suspected)

In lib/pages/transaction.dart, checkTXType() determines the transaction
type via accountsToTransaction(_sourceAccountType, _destinationAccountType).
The budget widget is conditionally shown:

AnimatedHeight(
  child: (_transactionType == .withdrawal)
      ? TransactionBudget(...)
      : const SizedBox.shrink(),
),

The fallback in checkTXType() sets the type to withdrawal when
_sourceAccountType == .assetAccount and destination is unknown:

if (txType == .swaggerGeneratedUnknown &&
    _sourceAccountType == .assetAccount &&
    _destinationAccountType == .swaggerGeneratedUnknown) {
  txType = .withdrawal;
}

_sourceAccountType may not be correctly set to .assetAccount when the
user selects a non-default account from the dropdown — causing the type to
remain unknown and the budget field to be hidden or not populated.

Environment

  • Firefly III: fireflyiii/core:latest (self-hosted)
  • All affected accounts are of type defaultAsset or cashWalletAsset
  • Tested with multiple asset accounts: same result for all non-default accounts

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions