mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Account:: namespace simplifications and cleanup (#2110)
* Flatten Holding model * Flatten balance model * Entries domain renames * Fix valuations reference * Fix trades stream * Fix brakeman warnings * Fix tests * Replace existing entryable type references in DB
This commit is contained in:
60
app/views/transfer_matches/new.html.erb
Normal file
60
app/views/transfer_matches/new.html.erb
Normal file
@@ -0,0 +1,60 @@
|
||||
<%= modal_form_wrapper title: "Match transfer or payment" do %>
|
||||
<%= styled_form_with(
|
||||
url: transaction_transfer_match_path(@entry),
|
||||
scope: :transfer_match,
|
||||
class: "space-y-8",
|
||||
data: { turbo_frame: :_top }
|
||||
) do |f| %>
|
||||
<section class="space-y-4">
|
||||
<div class="space-y-2">
|
||||
<h2 class="text-sm font-medium text-gray-700">
|
||||
<%= @entry.amount.positive? ? "From account: #{@entry.account.name}" : "From account" %>
|
||||
</h2>
|
||||
|
||||
<% if @entry.amount.positive? %>
|
||||
<%= f.select(
|
||||
:entry_id,
|
||||
[[entry_name_detailed(@entry), @entry.id]],
|
||||
{
|
||||
label: "Outflow transaction",
|
||||
selected: @entry.id,
|
||||
},
|
||||
disabled: true
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "transfer_matches/matching_fields",
|
||||
form: f, entry: @entry, candidates: @transfer_match_candidates.map { |pm| pm.outflow_transaction.entry }, accounts: @accounts %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="flex justify-center py-2">
|
||||
<%= lucide_icon "arrow-down", class: "w-5 h-5" %>
|
||||
</div>
|
||||
|
||||
<section class="space-y-4">
|
||||
<div class="space-y-2">
|
||||
<h2 class="text-sm font-medium text-gray-700">
|
||||
<%= @entry.amount.negative? ? "To account: #{@entry.account.name}" : "To account" %>
|
||||
</h2>
|
||||
|
||||
<% if @entry.amount.negative? %>
|
||||
<%= f.select(
|
||||
:entry_id,
|
||||
[[entry_name_detailed(@entry), @entry.id]],
|
||||
{
|
||||
label: "Inflow transaction",
|
||||
selected: @entry.id,
|
||||
},
|
||||
disabled: true
|
||||
) %>
|
||||
<% else %>
|
||||
<%= render "transfer_matches/matching_fields",
|
||||
form: f, entry: @entry, candidates: @transfer_match_candidates.map { |pm| pm.inflow_transaction.entry }, accounts: @accounts %>
|
||||
<% end %>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<%= f.submit "Create transfer match", data: { turbo_submits_with: "Saving..."} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user