2024-11-18 15:50:47 -05:00
|
|
|
<%= styled_form_with model: transfer, class: "space-y-4", data: { turbo_frame: "_top", controller: "transfer-form" } do |f| %>
|
2024-08-09 11:22:57 -04:00
|
|
|
<% if transfer.errors.present? %>
|
|
|
|
<div class="text-red-600 flex items-center gap-2">
|
|
|
|
<%= lucide_icon "circle-alert", class: "w-5 h-5" %>
|
|
|
|
<p class="text-sm"><%= @transfer.errors.full_messages.to_sentence %></p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2024-06-19 06:52:08 -04:00
|
|
|
<section>
|
2025-04-25 08:18:10 -06:00
|
|
|
<%= render "shared/transaction_type_tabs", active_tab: "transfer" %>
|
2024-06-19 06:52:08 -04:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section class="space-y-2">
|
2024-11-15 13:49:37 -05:00
|
|
|
<%= f.collection_select :from_account_id, Current.family.accounts.manual.alphabetically, :id, :name, { prompt: t(".select_account"), label: t(".from") }, required: true %>
|
|
|
|
<%= f.collection_select :to_account_id, Current.family.accounts.manual.alphabetically, :id, :name, { prompt: t(".select_account"), label: t(".to") }, required: true %>
|
2024-11-18 15:50:47 -05:00
|
|
|
<%= f.number_field :amount, label: t(".amount"), required: true, min: 0, placeholder: "100", step: 0.00000001 %>
|
2025-01-07 09:41:24 -05:00
|
|
|
<%= f.date_field :date, value: transfer.inflow_transaction&.entry&.date || Date.current, label: t(".date"), required: true, max: Date.current %>
|
2024-06-19 06:52:08 -04:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<%= f.submit t(".submit") %>
|
|
|
|
</section>
|
|
|
|
<% end %>
|