The personal finance app for everyone
Sync account after balance deletion
Zach Gollwitzer2722254be9a6
diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rbindex 6360bd19..b1733585 100644--- a/app/controllers/transactions_controller.rb+++ b/app/controllers/transactions_controller.rb@@ -37,6 +37,7 @@ class TransactionsController < ApplicationControllerdef bulk_deletedestroyed = 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)enddiff --git a/app/views/account/trades/_form.html.erb b/app/views/account/trades/_form.html.erbindex f8c4033a..41180a20 100644--- a/app/views/account/trades/_form.html.erb+++ b/app/views/account/trades/_form.html.erb@@ -12,7 +12,7 @@</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><%= form.money_field :amount, label: t(".amount"), disable_currency: true %>diff --git a/app/views/account/valuations/_form.html.erb b/app/views/account/valuations/_form.html.erbindex 6eba543e..a84d2ae5 100644--- a/app/views/account/valuations/_form.html.erb+++ b/app/views/account/valuations/_form.html.erb@@ -5,7 +5,7 @@class: "space-y-4",data: { turbo: false } do |form| %><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 %></div>diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erbindex 050ad297..284ed4da 100644--- a/app/views/transactions/_form.html.erb+++ b/app/views/transactions/_form.html.erb@@ -18,7 +18,7 @@<%= f.fields_for :entryable do |ef| %><%= ef.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %><% 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>