Fix transaction filters when transfers are present (#1986)

* Proper filtering of transfers in search

* Fix transaction search
This commit is contained in:
Zach Gollwitzer
2025-03-11 15:38:45 -04:00
committed by GitHub
parent ed55ef624b
commit dd75cadebc
4 changed files with 96 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
<div class="space-y-4 h-fit max-h-full flex flex-col" data-controller="focus-record" data-focus-record-id-value="<%= @focused_record ? dom_id(@focused_record) : nil %>">
<div class="space-y-4 pb-20 flex flex-col" data-controller="focus-record" data-focus-record-id-value="<%= @focused_record ? dom_id(@focused_record) : nil %>">
<%= render "header" %>
<%= render "summary", totals: @totals %>
@@ -7,7 +7,7 @@
data-controller="bulk-select"
data-bulk-select-singular-label-value="<%= t(".transaction") %>"
data-bulk-select-plural-label-value="<%= t(".transactions") %>"
class="overflow-y-auto flex flex-col bg-white rounded-xl shadow-border-xs p-4">
class="flex flex-col bg-white rounded-xl shadow-border-xs p-4">
<%= render "transactions/searches/search" %>
<div id="entry-selection-bar" data-bulk-select-target="selectionBar" class="flex justify-center hidden">
@@ -29,8 +29,7 @@
</div>
<div class="space-y-6">
<%= entries_by_date(@transactions.map(&:entry), totals: true) do |entries| %>
<%# Only render the outflow side of transfers to avoid duplicate entries %>
<%= render partial: "account/entries/entry", collection: entries.reject { |e| e.entryable.transfer_as_inflow.present? } %>
<%= render entries %>
<% end %>
</div>
</div>