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:
parent
5d1a2937bb
commit
9a2a7b31d4
45 changed files with 342 additions and 84 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue