">
diff --git a/app/views/transactions/show.html.erb b/app/views/transactions/show.html.erb
index 4af991f1a..3d8910dcb 100644
--- a/app/views/transactions/show.html.erb
+++ b/app/views/transactions/show.html.erb
@@ -203,28 +203,6 @@
<% end %>
-
- <%= styled_form_with model: @entry,
- url: transaction_path(@entry),
- class: "p-3",
- data: { controller: "auto-submit-form" } do |f| %>
-
-
-
<%= t(".exclude_from_cashflow") %>
-
- <% if @entry.account.investment? || @entry.account.crypto? %>
- <%= t(".exclude_from_cashflow_description_investment") %>
- <% else %>
- <%= t(".exclude_from_cashflow_description") %>
- <% end %>
-
-
-
- <%= f.toggle :exclude_from_cashflow, { data: { auto_submit_form_target: "auto" } } %>
-
- <% end %>
-
-
<% if @entry.account.investment? || @entry.account.crypto? %>
<%= styled_form_with model: @entry,
diff --git a/config/locales/views/transactions/en.yml b/config/locales/views/transactions/en.yml
index 267adce43..3b295b2f4 100644
--- a/config/locales/views/transactions/en.yml
+++ b/config/locales/views/transactions/en.yml
@@ -33,9 +33,6 @@ en:
details: Details
exclude: Exclude
exclude_description: Excluded transactions will be removed from budgeting calculations and reports.
- exclude_from_cashflow: Exclude from Cashflow
- exclude_from_cashflow_description: Hide from income/expense reports and Sankey chart. Useful for transactions you don't want in cashflow analysis.
- exclude_from_cashflow_description_investment: Hide from income/expense reports and Sankey chart. Use for internal investment activity like fund swaps, reinvestments, or money market sweeps.
activity_type: Activity Type
activity_type_description: Type of investment activity (Buy, Sell, Dividend, etc.). Auto-detected or set manually.
one_time_title: One-time %{type}
@@ -76,7 +73,6 @@ en:
transaction:
pending: Pending
pending_tooltip: Pending transaction — may change when posted
- excluded_from_cashflow_tooltip: Excluded from cashflow reports
activity_type_tooltip: Investment activity type
possible_duplicate: Duplicate?
potential_duplicate_tooltip: This may be a duplicate of another transaction
diff --git a/db/migrate/20260110120000_add_investment_cashflow_support.rb b/db/migrate/20260110120000_add_investment_cashflow_support.rb
index 26cffbc55..39765f4f1 100644
--- a/db/migrate/20260110120000_add_investment_cashflow_support.rb
+++ b/db/migrate/20260110120000_add_investment_cashflow_support.rb
@@ -1,13 +1,5 @@
class AddInvestmentCashflowSupport < ActiveRecord::Migration[7.2]
+ # No-op: exclude_from_cashflow was consolidated into the existing 'excluded' toggle
def change
- # Flag for excluding from cashflow (user-controllable)
- # Used for internal investment activity like fund swaps
- add_column :entries, :exclude_from_cashflow, :boolean, default: false, null: false
- add_index :entries, :exclude_from_cashflow
-
- # Holdings snapshot for comparison (provider-agnostic)
- # Used to detect internal investment activity by comparing holdings between syncs
- add_column :accounts, :holdings_snapshot_data, :jsonb
- add_column :accounts, :holdings_snapshot_at, :datetime
end
end
diff --git a/test/models/income_statement_test.rb b/test/models/income_statement_test.rb
index ba5fa3e81..e4af61d66 100644
--- a/test/models/income_statement_test.rb
+++ b/test/models/income_statement_test.rb
@@ -286,35 +286,6 @@ class IncomeStatementTest < ActiveSupport::TestCase
assert_equal Money.new(1050, @family.currency), totals.expense_money # 900 + 150
end
- # NEW TESTS: exclude_from_cashflow Feature
- test "excludes transactions with exclude_from_cashflow flag from totals" do
- # Create an expense transaction and mark it as excluded from cashflow
- excluded_entry = create_transaction(account: @checking_account, amount: 250, category: @groceries_category)
- excluded_entry.update!(exclude_from_cashflow: true)
-
- income_statement = IncomeStatement.new(@family)
- totals = income_statement.totals(date_range: Period.last_30_days.date_range)
-
- # Should NOT include the excluded transaction
- assert_equal 4, totals.transactions_count # Only original 4 transactions
- assert_equal Money.new(1000, @family.currency), totals.income_money
- assert_equal Money.new(900, @family.currency), totals.expense_money
- end
-
- test "excludes income transactions with exclude_from_cashflow flag" do
- # Create income and mark as excluded from cashflow
- excluded_income = create_transaction(account: @checking_account, amount: -500, category: @income_category)
- excluded_income.update!(exclude_from_cashflow: true)
-
- income_statement = IncomeStatement.new(@family)
- totals = income_statement.totals(date_range: Period.last_30_days.date_range)
-
- # Should NOT include the excluded income
- assert_equal 4, totals.transactions_count
- assert_equal Money.new(1000, @family.currency), totals.income_money # Original income only
- assert_equal Money.new(900, @family.currency), totals.expense_money
- end
-
test "excludes investment_contribution transactions from income statement" do
# Create a transfer to investment account (marked as investment_contribution)
investment_contribution = create_transaction(
@@ -332,23 +303,4 @@ class IncomeStatementTest < ActiveSupport::TestCase
assert_equal Money.new(1000, @family.currency), totals.income_money
assert_equal Money.new(900, @family.currency), totals.expense_money
end
-
- test "exclude_from_cashflow works with median calculations" do
- # Clear existing transactions
- Entry.joins(:account).where(accounts: { family_id: @family.id }).destroy_all
-
- # Create expenses: 100, 200, 300
- create_transaction(account: @checking_account, amount: 100, category: @groceries_category)
- create_transaction(account: @checking_account, amount: 200, category: @groceries_category)
- excluded_entry = create_transaction(account: @checking_account, amount: 300, category: @groceries_category)
-
- # Exclude the 300 transaction from cashflow
- excluded_entry.update!(exclude_from_cashflow: true)
-
- income_statement = IncomeStatement.new(@family)
-
- # Median should only consider non-excluded transactions (100, 200)
- # Monthly total = 300, so median = 300.0
- assert_equal 300.0, income_statement.median_expense(interval: "month")
- end
end