1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 03:55:20 +02:00

First sketch of budgeting module

This commit is contained in:
Zach Gollwitzer 2024-12-30 17:29:59 -05:00
parent 5d1a2937bb
commit 9a2a7b31d4
45 changed files with 342 additions and 84 deletions

View file

@ -22,10 +22,9 @@ class Account::TransactionsController < ApplicationController
end
def mark_transfers
Current.family
.entries
.where(id: bulk_update_params[:entry_ids])
.mark_transfers!
selected_entries = Current.family.entries.account_transactions.where(id: bulk_update_params[:entry_ids])
TransferMatcher.new(Current.family).match!(selected_entries)
redirect_back_or_to transactions_url, notice: t(".success")
end
@ -33,8 +32,12 @@ class Account::TransactionsController < ApplicationController
def unmark_transfers
Current.family
.entries
.account_transactions
.includes(:entryable)
.where(id: bulk_update_params[:entry_ids])
.update_all marked_as_transfer: false
.each do |entry|
entry.entryable.update!(category_id: nil)
end
redirect_back_or_to transactions_url, notice: t(".success")
end