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:
44
app/views/transfer_matches/_matching_fields.html.erb
Normal file
44
app/views/transfer_matches/_matching_fields.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<%# locals: (form:, entry:, candidates:, accounts:) %>
|
||||
|
||||
<% if candidates.any? %>
|
||||
<div data-controller="transfer-match" class="space-y-2">
|
||||
<p class="text-sm text-secondary">
|
||||
Select a method for matching your transactions.
|
||||
</p>
|
||||
|
||||
<%= form.select :method,
|
||||
[
|
||||
["Match existing transaction (recommended)", "existing"],
|
||||
["Create new transaction", "new"]
|
||||
],
|
||||
{ selected: "existing", label: "Matching method" },
|
||||
data: { action: "change->transfer-match#update" } %>
|
||||
|
||||
<div data-transfer-match-target="existingSelect">
|
||||
<%= form.select :matched_entry_id,
|
||||
candidates.map { |entry|
|
||||
[entry_name_detailed(entry), entry.id]
|
||||
},
|
||||
{ label: "Matching transaction" } %>
|
||||
</div>
|
||||
|
||||
<div data-transfer-match-target="newSelect" class="hidden">
|
||||
<%= form.select :target_account_id,
|
||||
accounts.map { |account| [account.name, account.id] },
|
||||
{ label: "Target account" } %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="text-sm text-secondary">
|
||||
We couldn't find any transactions to match from your other accounts.
|
||||
Please select an account and we will create a new inflow transaction for you.
|
||||
</p>
|
||||
|
||||
<%= form.hidden_field :method, value: "new" %>
|
||||
|
||||
<div>
|
||||
<%= form.select :target_account_id,
|
||||
accounts.map { |account| [account.name, account.id] },
|
||||
{ label: "Target account" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user