Transactions

<%= render DS::Menu.new do |menu| %> <% menu.with_item(variant: "link", text: "New rule", href: new_rule_path(resource_type: "transaction"), icon: "plus", data: { turbo_frame: :modal }) %> <% menu.with_item(variant: "link", text: "Edit rules", href: rules_path, icon: "git-branch", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Edit categories", href: categories_path, icon: "shapes", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Edit tags", href: tags_path, icon: "tags", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Edit merchants", href: family_merchants_path, icon: "store", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Edit imports", href: imports_path, icon: "hard-drive-upload", data: { turbo_frame: :_top }) %> <% menu.with_item(variant: "link", text: "Import", href: new_import_path, icon: "download", data: { turbo_frame: "modal", class_name: "md:!hidden" }) %> <% end %> <%= render DS::Link.new( text: "New transaction", icon: "plus", variant: "primary", href: new_transaction_path, frame: :modal, class: "hidden md:inline-flex" ) %> <%= render DS::Link.new( icon: "plus", variant: "icon-inverse", href: new_transaction_path, frame: :modal, class: "rounded-full md:hidden" ) %>
<%= render "summary", totals: @search.totals %>
" data-bulk-select-plural-label-value="<%= t(".transactions") %>" class="flex flex-col bg-container rounded-xl shadow-border-xs px-3 py-4 lg:p-4 relative group"> <%= form_with url: imports_path, method: :post, class: "hidden", data: { drag_and_drop_import_target: "form" } do |f| %> <%= f.hidden_field "import[type]", value: "TransactionImport" %> <%= f.file_field "import[csv_file]", class: "hidden", data: { drag_and_drop_import_target: "input" }, accept: ".csv" %> <% end %> <%= render "imports/drag_drop_overlay", title: "Drop CSV to import", subtitle: "Upload transactions directly" %> <%= render "transactions/searches/search" %> <% if @pagy.count > 0 || (@projected_recurring.any? && @q.blank?) %>
<% if @transactions.any? %>
<%= check_box_tag "selection_entry", class: "checkbox checkbox--light hidden lg:block", data: { action: "bulk-select#togglePageSelection", checkbox_toggle_target: "selectionEntry" } %>

transaction

amount

<% end %>
<% if @projected_recurring.any? && @q.blank? %>
">

<%= t("recurring_transactions.upcoming") %>

<% @projected_recurring.group_by(&:next_expected_date).sort.each do |date, transactions| %>
<%= l(date, format: :long) %>
<% transactions.each do |recurring_transaction| %> <%= render "recurring_transactions/projected_transaction", recurring_transaction: recurring_transaction %> <% end %>
<% end %>
<% end %> <%= entries_by_date(@transactions.map(&:entry), totals: true) do |entries| %> <%= render entries %> <% end %>
<% else %> <%= render "entries/empty" %> <% end %>
<%= render "shared/pagination", pagy: @pagy %>