mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Sync account after balance deletion
- Fixes #1416 - Fixes timezone bugs in forms
This commit is contained in:
parent
455257bf51
commit
2722254be9
4 changed files with 4 additions and 3 deletions
|
@ -37,6 +37,7 @@ class TransactionsController < ApplicationController
|
||||||
|
|
||||||
def bulk_delete
|
def bulk_delete
|
||||||
destroyed = Current.family.entries.destroy_by(id: bulk_delete_params[:entry_ids])
|
destroyed = Current.family.entries.destroy_by(id: bulk_delete_params[:entry_ids])
|
||||||
|
destroyed.map(&:account).uniq.each(&:sync_later)
|
||||||
redirect_back_or_to transactions_url, notice: t(".success", count: destroyed.count)
|
redirect_back_or_to transactions_url, notice: t(".success", count: destroyed.count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= form.date_field :date, label: true, value: Date.current %>
|
<%= form.date_field :date, label: true, value: Date.today %>
|
||||||
|
|
||||||
<div data-trade-form-target="amountInput" hidden>
|
<div data-trade-form-target="amountInput" hidden>
|
||||||
<%= form.money_field :amount, label: t(".amount"), disable_currency: true %>
|
<%= form.money_field :amount, label: t(".amount"), disable_currency: true %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
class: "space-y-4",
|
class: "space-y-4",
|
||||||
data: { turbo: false } do |form| %>
|
data: { turbo: false } do |form| %>
|
||||||
<div class="space-y-3">
|
<div class="space-y-3">
|
||||||
<%= form.date_field :date, label: true, required: true, value: Date.current, min: Account::Entry.min_supported_date, max: Date.current %>
|
<%= form.date_field :date, label: true, required: true, value: Date.today, min: Account::Entry.min_supported_date, max: Date.today %>
|
||||||
<%= form.money_field :amount, label: t(".amount"), required: true, default_currency: Current.family.currency %>
|
<%= form.money_field :amount, label: t(".amount"), required: true, default_currency: Current.family.currency %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<%= f.fields_for :entryable do |ef| %>
|
<%= f.fields_for :entryable do |ef| %>
|
||||||
<%= ef.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %>
|
<%= ef.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= f.date_field :date, label: t(".date"), required: true, min: Account::Entry.min_supported_date, max: Date.current, value: Date.current %>
|
<%= f.date_field :date, label: t(".date"), required: true, min: Account::Entry.min_supported_date, max: Date.today, value: Date.today %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue