1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 06:25:19 +02:00

Migrate valuations controller to new reconciliation methods

This commit is contained in:
Zach Gollwitzer 2025-07-10 10:31:40 -04:00
parent 25f0c78c47
commit d80cb9f812
19 changed files with 187 additions and 171 deletions

View file

@ -10,7 +10,7 @@
<% menu.with_item(
variant: "link",
text: "New balance",
text: "Account #{account.asset? ? "value" : "balance"} update",
icon: "circle-dollar-sign",
href: new_valuation_path(account_id: @account.id),
data: { turbo_frame: :modal }) %>

View file

@ -10,8 +10,8 @@
<div class="space-y-3">
<%= form.hidden_field :name, value: "Balance update" %>
<%= form.date_field :date, label: true, required: true, value: Date.current, min: Entry.min_supported_date, max: Date.current %>
<%= form.money_field :amount, label: t(".amount"), required: true %>
<%= form.money_field :amount, label: t(".amount"), required: true, disable_currency: true %>
</div>
<%= form.submit t(".submit") %>
<%= form.submit "Update account #{entry.account.asset? ? "value" : "balance"}" %>
<% end %>

View file

@ -1,6 +1,12 @@
<% term = @entry.account.asset? ? "value" : "balance" %>
<%= render DialogComponent.new do |dialog| %>
<% dialog.with_header(title: t(".title")) %>
<% dialog.with_header(title: "Account #{term} update") %>
<% dialog.with_body do %>
<%= render "form", entry: @entry, error_message: @error_message %>
<p class="text-sm text-secondary mt-4">
This action "resets" the account's <%= term %> to the new value, on the date. Subsequent entries after this date will reference the new value.
</p>
<% end %>
<% end %>