The personal finance app for everyone (by everyone)
Ruby
Add a setting to turn off transfer auto-matching and a page to review pending matches (#3034)
GFR15669d073845
diff --git a/app/controllers/auto_matches_controller.rb b/app/controllers/auto_matches_controller.rbnew file mode 100644index 0000000000..540b638129--- /dev/null+++ b/app/controllers/auto_matches_controller.rb@@ -0,0 +1,125 @@+class AutoMatchesController < ApplicationController+ layout "settings"++ # The toggle is family-wide and turning it off destroys every pending+ # suggestion, including ones between other members' private accounts.+ before_action :require_admin!, only: :update_settings++ def index+ @family = Current.family+ scope = Transfer.pending+ .where(inflow_transaction_id: accessible_transaction_ids)+ .where(outflow_transaction_id: accessible_transaction_ids)+ .includes(inflow_transaction: [ { entry: :account }, :merchant ], outflow_transaction: [ { entry: :account }, :merchant ])+ .order(created_at: :desc)+ @pagy, @pending_transfers = pagy(scope, limit: safe_per_page)+ # Confirm/reject write to both legs (TransfersController#update), so a+ # read-only sharer -- accessible but not writable -- would see dead CTAs+ # that just bounce with a flash. Precompute which accounts they can+ # actually write to, mirroring TransfersController#show's writable check.+ @writable_account_ids = Account.writable_by(Current.user).where(family: @family).ids.to_set+ end++ def update_settings+ was_disabled = Current.family.auto_match_transfers_disabled?+ now_disabled = nil++ # One transaction, so a failed cleanup doesn't leave auto match off with+ # some suggestions still pending.+ Family.transaction do+ Current.family.update!(auto_match_settings_params)+ now_disabled = Current.family.auto_match_transfers_disabled?+ cleanup_pending_auto_matches! if !was_disabled && now_disabled+ end+ # Re-enabling should have an immediate effect rather than waiting for the+ # next scheduled sync -- run the (potentially slow, family-wide) match+ # scan in the background instead of blocking this request.+ AutoMatchTransfersJob.perform_later(Current.family) if was_disabled && !now_disabled++ respond_to do |format|+ format.html do+ flash[:notice] = t(".settings_updated")+ redirect_to auto_matches_path+ end+ end+ end++ def bulk_update+ status = bulk_update_params[:status]+ transfer_ids = Array(bulk_update_params[:transfer_ids]).reject(&:blank?)++ unless %w[confirmed rejected].include?(status) && transfer_ids.present?+ redirect_to auto_matches_path, alert: t(".invalid_selection")+ return+ end++ writable_account_ids = Account.writable_by(Current.user).where(family: Current.family).ids.to_set++ transfers = Transfer.pending+ .where(id: transfer_ids)+ .where(inflow_transaction_id: accessible_transaction_ids)+ .where(outflow_transaction_id: accessible_transaction_ids)+ .includes(inflow_transaction: { entry: :account }, outflow_transaction: { entry: :account })++ updated_count = 0+ transfers.each do |transfer|+ next unless writable_account_ids.include?(transfer.from_account&.id) &&+ writable_account_ids.include?(transfer.to_account&.id)++ begin+ # Reloads under a row lock, so a match a concurrent request already+ # confirmed or rejected is skipped instead of being resolved twice.+ transfer.with_lock do+ next unless transfer.pending?++ status == "confirmed" ? transfer.confirm! : transfer.reject!+ updated_count += 1+ end+ rescue ActiveRecord::RecordNotFound+ # Already rejected (destroyed) by a concurrent action; skip it and+ # keep going through the rest of the selection.+ next+ end+ end++ notice = status == "confirmed" ? t(".bulk_confirmed", count: updated_count) : t(".bulk_rejected", count: updated_count)+ redirect_to auto_matches_path, notice: notice+ end++ private+ def accessible_transaction_ids+ Current.family.transactions+ .joins(entry: :account)+ .merge(Account.accessible_by(Current.user))+ .select(:id)+ end++ def auto_match_settings_params+ { auto_match_transfers_disabled: params[:auto_match_transfers_disabled] == "true" }+ end++ # Turning the toggle off stops future matching but previously suggested+ # pending matches would otherwise sit in the list (and on the+ # transaction rows) indefinitely. Destroy rather than reject!: reject!+ # writes a RejectedTransfer row that permanently excludes the pair from+ # future auto-matching (auto_match_transfers! runs with+ # include_rejected: false), which would surprise a user who re-enables+ # the toggle later expecting the same pairs to resurface.+ def cleanup_pending_auto_matches!+ family_transaction_ids = Current.family.transactions.select(:id)+ # Only clean up genuine auto-match suggestions -- both legs still+ # kind == "standard". A pending transfer imported with a kind already+ # set (Family::DataImporter, Demo::Generator) isn't an auto-match+ # suggestion, so the toggle leaves it in place.+ Transfer.pending+ .where(inflow_transaction_id: family_transaction_ids)+ .where(outflow_transaction_id: family_transaction_ids)+ .joins(:inflow_transaction, :outflow_transaction)+ .where(inflow_transaction: { kind: "standard" }, outflow_transaction: { kind: "standard" })+ .find_each(&:destroy!)+ end++ def bulk_update_params+ params.permit(:status, transfer_ids: [])+ end+enddiff --git a/app/javascript/controllers/auto_match_bulk_select_controller.js b/app/javascript/controllers/auto_match_bulk_select_controller.jsnew file mode 100644index 0000000000..b28f639e59--- /dev/null+++ b/app/javascript/controllers/auto_match_bulk_select_controller.js@@ -0,0 +1,55 @@+import { Controller } from "@hotwired/stimulus";++// Connects to data-controller="auto-match-bulk-select"+// Lightweight row-selection for the auto matches review table: toggles a+// selection bar with confirm/reject buttons that submit the selected+// transfer ids to AutoMatchesController#bulk_update.+export default class extends Controller {+ static targets = ["selectAll", "row", "bar", "count"];++ connect() {+ this._updateBar();+ }++ toggleAll(e) {+ this.rowTargets.forEach((row) => {+ row.checked = e.target.checked;+ });+ this._updateBar();+ }++ toggleRow() {+ if (this.hasSelectAllTarget) {+ this.selectAllTarget.checked =+ this.rowTargets.length > 0 && this.rowTargets.every((row) => row.checked);+ }+ this._updateBar();+ }++ populateIds(e) {+ const form = e.target;+ form.querySelectorAll("input[name='transfer_ids[]']").forEach((el) => el.remove());++ this._selectedIds().forEach((id) => {+ const input = document.createElement("input");+ input.type = "hidden";+ input.name = "transfer_ids[]";+ input.value = id;+ form.appendChild(input);+ });+ }++ _selectedIds() {+ return this.rowTargets.filter((row) => row.checked).map((row) => row.dataset.id);+ }++ _updateBar() {+ const selected = this._selectedIds().length;+ if (this.hasBarTarget) {+ this.barTarget.classList.toggle("hidden", selected === 0);+ }+ if (this.hasCountTarget) {+ this.countTarget.textContent = selected;+ }+ }+}diff --git a/app/jobs/auto_match_transfers_job.rb b/app/jobs/auto_match_transfers_job.rbnew file mode 100644index 0000000000..1259d7ab22--- /dev/null+++ b/app/jobs/auto_match_transfers_job.rb@@ -0,0 +1,7 @@+class AutoMatchTransfersJob < ApplicationJob+ queue_as :medium_priority++ def perform(family)+ family.auto_match_transfers!+ end+enddiff --git a/app/models/family/auto_transfer_matchable.rb b/app/models/family/auto_transfer_matchable.rbindex d3de897d96..0db2215e8a 100644--- a/app/models/family/auto_transfer_matchable.rb+++ b/app/models/family/auto_transfer_matchable.rb@@ -61,6 +61,8 @@ module Family::AutoTransferMatchableenddef auto_match_transfers!(account: nil, exchange_rate_tolerance: Family::AutoTransferMatchable.exchange_rate_tolerance)+ return if auto_match_transfers_disabled?+# Exclude already matched transfers. Cross-currency FX-tolerance matching is# restricted to provider-linked accounts ONLY on this automatic path -- a# coincidental amount/FX-rate match applied here has no human reviewing itdiff --git a/app/views/auto_matches/_pending_transfer.html.erb b/app/views/auto_matches/_pending_transfer.html.erbnew file mode 100644index 0000000000..ba7015f870--- /dev/null+++ b/app/views/auto_matches/_pending_transfer.html.erb@@ -0,0 +1,67 @@+<%# locals: (transfer:) %>++<% writable = @writable_account_ids.include?(transfer.from_account&.id) && @writable_account_ids.include?(transfer.to_account&.id) %>++<tr id="<%= dom_id(transfer) %>" class="border-b border-subdued hover:bg-surface-hover">+ <td class="py-3 pl-4 pr-2">+ <% if writable %>+ <%= check_box_tag "transfer_#{transfer.id}", "1", false,+ class: "checkbox checkbox--light",+ data: {+ id: transfer.id,+ auto_match_bulk_select_target: "row",+ action: "auto-match-bulk-select#toggleRow"+ } %>+ <% end %>+ </td>+ <td class="py-3 px-2 text-sm">+ <%= link_to entry_path(transfer.outflow_transaction.entry),+ data: { turbo_frame: "drawer", turbo_prefetch: false },+ class: "hover:underline" do %>+ <div class="font-medium text-primary"><%= transfer.outflow_transaction.entry.name %></div>+ <% end %>+ <div class="text-xs text-secondary">+ <%= transfer.from_account&.name %><%= " • #{transfer.outflow_transaction.merchant.name}" if transfer.outflow_transaction.merchant&.present? %>+ </div>+ <div class="text-xs text-secondary privacy-sensitive"><%= format_money(transfer.outflow_transaction.entry.amount_money) %></div>+ </td>+ <td class="py-3 px-2 text-sm">+ <%= link_to entry_path(transfer.inflow_transaction.entry),+ data: { turbo_frame: "drawer", turbo_prefetch: false },+ class: "hover:underline" do %>+ <div class="font-medium text-primary"><%= transfer.inflow_transaction.entry.name %></div>+ <% end %>+ <div class="text-xs text-secondary">+ <%= transfer.to_account&.name %><%= " • #{transfer.inflow_transaction.merchant.name}" if transfer.inflow_transaction.merchant&.present? %>+ </div>+ <div class="text-xs text-secondary privacy-sensitive"><%= format_money(transfer.inflow_transaction.entry.amount_money.abs) %></div>+ </td>+ <td class="py-3 px-2 text-sm text-secondary">+ <%= l(transfer.date, format: :short) %>+ </td>+ <td class="py-3 px-2 text-sm text-right">+ <% if writable %>+ <div class="flex items-center justify-end gap-2">+ <%= render DS::Button.new(+ variant: :icon,+ icon: "check",+ href: transfer_path(transfer, transfer: { status: "confirmed" }),+ method: :patch,+ data: { turbo: false },+ aria: { label: t("transactions.transfer_match.confirm_match") }+ ) %>++ <%= render DS::Button.new(+ variant: :icon,+ icon: "x",+ href: transfer_path(transfer, transfer: { status: "rejected" }),+ method: :patch,+ data: { turbo: false },+ aria: { label: t("transactions.transfer_match.reject_match") }+ ) %>+ </div>+ <% else %>+ <span class="text-xs text-secondary"><%= t("account_sharings.show.permissions.read_only") %></span>+ <% end %>+ </td>+</tr>diff --git a/app/views/auto_matches/index.html.erb b/app/views/auto_matches/index.html.erbnew file mode 100644index 0000000000..e79cb446b8--- /dev/null+++ b/app/views/auto_matches/index.html.erb@@ -0,0 +1,103 @@+<%= content_for :page_title, t("auto_matches.title") %>++<div class="space-y-4 flex flex-col">+ <div class="bg-container rounded-xl shadow-border-xs p-4">+ <div class="flex items-center justify-between">+ <div>+ <p class="text-sm font-medium text-primary"><%= t("auto_matches.settings.enable_label") %></p>+ <p class="text-xs text-secondary"><%= t("auto_matches.settings.enable_description") %></p>+ <% unless Current.user.admin? %>+ <p class="text-xs text-subdued"><%= t("auto_matches.settings.admin_only") %></p>+ <% end %>+ </div>+ <% toggle = render DS::Toggle.new(+ id: "auto_match_transfers_enabled",+ name: "toggle_display",+ checked: [email protected]_match_transfers_disabled?,+ disabled: !Current.user.admin?,+ data: { auto_submit_form_target: "auto" }+ ) %>+ <% if Current.user.admin? %>+ <%= form_with url: update_settings_auto_matches_path, method: :patch, data: { turbo_frame: "_top", controller: "auto-submit-form" } do |f| %>+ <%= f.hidden_field :auto_match_transfers_disabled, value: @family.auto_match_transfers_disabled? ? "false" : "true" %>+ <%= toggle %>+ <% end %>+ <% else %>+ <%= toggle %>+ <% end %>+ </div>+ </div>++ <div class="bg-container rounded-xl shadow-border-xs p-4">+ <% if @pending_transfers.empty? %>+ <%= render DS::EmptyState.new(+ icon: "link-2",+ title: t("auto_matches.empty.title"),+ description: t("auto_matches.empty.description")+ ) %>+ <% else %>+ <div class="rounded-xl bg-container-inset space-y-1 p-1" data-controller="auto-match-bulk-select">+ <div class="flex items-center gap-1.5 px-4 py-2 text-xs font-medium text-secondary uppercase">+ <p><%= t("auto_matches.title") %></p>+ <span class="text-subdued"><%= t("auto_matches.table.separator") %></span>+ <p><%= @pagy.count %></p>+ </div>++ <%# Deliberately NOT wrapping the table: each row's Confirm/Reject+ button renders its own button_to form (DS::Button#href), and a+ <form> cannot legally contain another <form> -- browsers flatten+ nested forms, which merged every row's authenticity_token into+ this one and broke individual confirm/reject with a CSRF error. %>+ <%= form_with url: bulk_update_auto_matches_path, method: :patch, data: { turbo_frame: "_top", action: "submit->auto-match-bulk-select#populateIds" } do %>+ <div class="hidden items-center justify-between gap-2 px-4 py-2 mb-1 rounded-lg bg-container shadow-border-xs"+ data-auto-match-bulk-select-target="bar">+ <p class="text-xs text-secondary">+ <span data-auto-match-bulk-select-target="count">0</span> <%= t("auto_matches.bulk_actions.selected_label") %>+ </p>+ <div class="flex items-center gap-2">+ <button type="submit" name="status" value="confirmed" class="text-xs font-medium text-primary hover:underline">+ <%= t("auto_matches.bulk_actions.confirm_selected") %>+ </button>+ <button type="submit" name="status" value="rejected" class="text-xs font-medium text-destructive hover:underline">+ <%= t("auto_matches.bulk_actions.reject_selected") %>+ </button>+ </div>+ </div>+ <% end %>++ <div class="bg-container rounded-lg shadow-border-xs overflow-x-auto">+ <table class="w-full">+ <thead>+ <tr class="text-xs uppercase font-medium text-secondary border-b border-divider">+ <th class="text-left py-3 pl-4 pr-2 w-8">+ <%= check_box_tag "select_all", "1", false,+ class: "checkbox checkbox--light",+ data: {+ auto_match_bulk_select_target: "selectAll",+ action: "auto-match-bulk-select#toggleAll"+ },+ aria: { label: t("auto_matches.bulk_actions.select_all") } %>+ </th>+ <th class="text-left py-3 px-2"><%= t("auto_matches.table.from") %></th>+ <th class="text-left py-3 px-2"><%= t("auto_matches.table.to") %></th>+ <th class="text-left py-3 px-2"><%= t("auto_matches.table.date") %></th>+ <th class="text-right py-3 px-2"><%= t("auto_matches.table.actions") %></th>+ </tr>+ </thead>+ <tbody>+ <% @pending_transfers.each do |transfer| %>+ <%= render "pending_transfer", transfer: transfer %>+ <% end %>+ </tbody>+ </table>+ </div>++ <% if @pagy.pages > 1 %>+ <div class="px-2 py-2">+ <%= render "shared/pagination", pagy: @pagy %>+ </div>+ <% end %>+ </div>+ <% end %>+ </div>+</div>diff --git a/app/views/settings/_settings_nav.html.erb b/app/views/settings/_settings_nav.html.erbindex 172dcbc2eb..5616277599 100644--- a/app/views/settings/_settings_nav.html.erb+++ b/app/views/settings/_settings_nav.html.erb@@ -20,6 +20,7 @@ nav_sections = [{ label: t(".rules_label"), path: rules_path, icon: "git-branch" },{ label: t(".merchants_label"), path: family_merchants_path, icon: "store" },{ label: t(".recurring_transactions_label"), path: recurring_transactions_path, icon: "repeat" },+ { label: t(".auto_matches_label"), path: auto_matches_path, icon: "link-2" },{ label: t(".statement_vault_label"), path: account_statements_path, icon: "archive", if: Current.user&.admin? }]},diff --git a/config/locales/views/auto_matches/ca.yml b/config/locales/views/auto_matches/ca.ymlnew file mode 100644index 0000000000..14c4ad58ff--- /dev/null+++ b/config/locales/views/auto_matches/ca.yml@@ -0,0 +1,32 @@+---+ca:+ auto_matches:+ title: Coincidències automàtiques+ settings:+ enable_label: Activa la coincidència automàtica+ enable_description: Detecta i suggereix automàticament coincidències de transferències entre comptes a cada sincronització. Els suggeriments no s'apliquen fins que els confirmis a continuació.+ admin_only: Només els administradors poden canviar aquesta configuració.+ update_settings:+ settings_updated: S'ha actualitzat la configuració de coincidència automàtica+ bulk_update:+ invalid_selection: Selecciona almenys un suggeriment per confirmar o rebutjar+ bulk_confirmed:+ one: S'ha confirmat 1 transferència+ other: "S'han confirmat %{count} transferències"+ bulk_rejected:+ one: S'ha rebutjat 1 transferència+ other: "S'han rebutjat %{count} transferències"+ empty:+ title: No hi ha suggeriments de coincidència automàtica pendents+ description: Quan una sincronització detecti una possible transferència entre dos dels teus comptes, apareixerà aquí per revisar-la.+ table:+ from: Des de+ to: A+ date: Data+ actions: Accions+ separator: "·"+ bulk_actions:+ selected_label: seleccionats+ confirm_selected: Confirma la selecció+ reject_selected: Rebutja la selecció+ select_all: Selecciona-ho totdiff --git a/config/locales/views/auto_matches/de.yml b/config/locales/views/auto_matches/de.ymlnew file mode 100644index 0000000000..a9664db0b5--- /dev/null+++ b/config/locales/views/auto_matches/de.yml@@ -0,0 +1,32 @@+---+de:+ auto_matches:+ title: Automatischer Abgleich+ settings:+ enable_label: Automatischen Abgleich aktivieren+ enable_description: Erkennt und schlägt bei jeder Synchronisierung automatisch Überweisungsabgleiche zwischen Konten vor. Vorschläge werden erst angewendet, nachdem du sie unten bestätigt hast.+ admin_only: Nur Admins können diese Einstellung ändern.+ update_settings:+ settings_updated: Einstellungen für den automatischen Abgleich aktualisiert+ bulk_update:+ invalid_selection: Wähle mindestens einen Vorschlag zum Bestätigen oder Ablehnen aus+ bulk_confirmed:+ one: 1 Überweisung bestätigt+ other: "%{count} Überweisungen bestätigt"+ bulk_rejected:+ one: 1 Überweisung abgelehnt+ other: "%{count} Überweisungen abgelehnt"+ empty:+ title: Keine ausstehenden Vorschläge für den automatischen Abgleich+ description: Wenn eine Synchronisierung eine wahrscheinliche Überweisung zwischen zwei deiner Konten erkennt, erscheint sie hier zur Überprüfung.+ table:+ from: Von+ to: An+ date: Datum+ actions: Aktionen+ separator: "·"+ bulk_actions:+ selected_label: ausgewählt+ confirm_selected: Auswahl bestätigen+ reject_selected: Auswahl ablehnen+ select_all: Alle auswählendiff --git a/config/locales/views/auto_matches/en.yml b/config/locales/views/auto_matches/en.ymlnew file mode 100644index 0000000000..e29c4fe5ad--- /dev/null+++ b/config/locales/views/auto_matches/en.yml@@ -0,0 +1,32 @@+---+en:+ auto_matches:+ title: Auto Matches+ settings:+ enable_label: Enable Auto Match+ enable_description: Automatically detect and suggest transfer matches between accounts on every sync. Suggestions are not applied until you confirm them below.+ admin_only: Only admins can change this setting.+ update_settings:+ settings_updated: Auto match settings updated+ bulk_update:+ invalid_selection: Select at least one suggestion to confirm or reject+ bulk_confirmed:+ one: Confirmed 1 transfer+ other: Confirmed %{count} transfers+ bulk_rejected:+ one: Rejected 1 transfer+ other: Rejected %{count} transfers+ empty:+ title: No pending auto-match suggestions+ description: When a sync detects a likely transfer between two of your accounts, it will show up here for review.+ table:+ from: From+ to: To+ date: Date+ actions: Actions+ separator: "·"+ bulk_actions:+ selected_label: selected+ confirm_selected: Confirm selected+ reject_selected: Reject selected+ select_all: Select alldiff --git a/config/locales/views/auto_matches/es.yml b/config/locales/views/auto_matches/es.ymlnew file mode 100644index 0000000000..b5849a6db3--- /dev/null+++ b/config/locales/views/auto_matches/es.yml@@ -0,0 +1,32 @@+---+es:+ auto_matches:+ title: Coincidencias automáticas+ settings:+ enable_label: Activar coincidencia automática+ enable_description: Detecta y sugiere automáticamente coincidencias de transferencias entre cuentas en cada sincronización. Las sugerencias no se aplican hasta que las confirmes a continuación.+ admin_only: Solo los administradores pueden cambiar esta configuración.+ update_settings:+ settings_updated: Configuración de coincidencia automática actualizada+ bulk_update:+ invalid_selection: Selecciona al menos una sugerencia para confirmar o rechazar+ bulk_confirmed:+ one: Se confirmó 1 transferencia+ other: "Se confirmaron %{count} transferencias"+ bulk_rejected:+ one: Se rechazó 1 transferencia+ other: "Se rechazaron %{count} transferencias"+ empty:+ title: No hay sugerencias de coincidencia automática pendientes+ description: Cuando una sincronización detecte una posible transferencia entre dos de tus cuentas, aparecerá aquí para su revisión.+ table:+ from: Desde+ to: Hasta+ date: Fecha+ actions: Acciones+ separator: "·"+ bulk_actions:+ selected_label: seleccionadas+ confirm_selected: Confirmar selección+ reject_selected: Rechazar selección+ select_all: Seleccionar tododiff --git a/config/locales/views/auto_matches/fr.yml b/config/locales/views/auto_matches/fr.ymlnew file mode 100644index 0000000000..ac874909fe--- /dev/null+++ b/config/locales/views/auto_matches/fr.yml@@ -0,0 +1,32 @@+---+fr:+ auto_matches:+ title: Rapprochements automatiques+ settings:+ enable_label: Activer le rapprochement automatique+ enable_description: Détecte et suggère automatiquement des rapprochements de virements entre comptes à chaque synchronisation. Les suggestions ne sont appliquées qu'après confirmation ci-dessous.+ admin_only: Seuls les administrateurs peuvent modifier ce paramètre.+ update_settings:+ settings_updated: Paramètres de rapprochement automatique mis à jour+ bulk_update:+ invalid_selection: Sélectionnez au moins une suggestion à confirmer ou rejeter+ bulk_confirmed:+ one: 1 virement confirmé+ other: "%{count} virements confirmés"+ bulk_rejected:+ one: 1 virement rejeté+ other: "%{count} virements rejetés"+ empty:+ title: Aucune suggestion de rapprochement automatique en attente+ description: Lorsqu'une synchronisation détecte un virement probable entre deux de vos comptes, il apparaîtra ici pour vérification.+ table:+ from: De+ to: Vers+ date: Date+ actions: Actions+ separator: "·"+ bulk_actions:+ selected_label: sélectionnés+ confirm_selected: Confirmer la sélection+ reject_selected: Rejeter la sélection+ select_all: Tout sélectionnerdiff --git a/config/locales/views/auto_matches/hu.yml b/config/locales/views/auto_matches/hu.ymlnew file mode 100644index 0000000000..0af5f8ce86--- /dev/null+++ b/config/locales/views/auto_matches/hu.yml@@ -0,0 +1,32 @@+---+hu:+ auto_matches:+ title: Automatikus egyeztetés+ settings:+ enable_label: Automatikus egyeztetés engedélyezése+ enable_description: Minden szinkronizáláskor automatikusan felismeri és javasolja az átutalások egyeztetését a számlák között. A javaslatok csak akkor lépnek életbe, ha alább megerősíted őket.+ admin_only: Ezt a beállítást csak adminisztrátorok módosíthatják.+ update_settings:+ settings_updated: Az automatikus egyeztetés beállításai frissültek+ bulk_update:+ invalid_selection: Válassz ki legalább egy javaslatot a megerősítéshez vagy elutasításhoz+ bulk_confirmed:+ one: 1 átutalás megerősítve+ other: "%{count} átutalás megerősítve"+ bulk_rejected:+ one: 1 átutalás elutasítva+ other: "%{count} átutalás elutasítva"+ empty:+ title: Nincs függőben lévő automatikus egyeztetési javaslat+ description: Ha egy szinkronizálás valószínű átutalást észlel két számlád között, itt jelenik meg ellenőrzésre.+ table:+ from: Honnan+ to: Hová+ date: Dátum+ actions: Műveletek+ separator: "·"+ bulk_actions:+ selected_label: kiválasztva+ confirm_selected: Kiválasztottak megerősítése+ reject_selected: Kiválasztottak elutasítása+ select_all: Összes kiválasztásadiff --git a/config/locales/views/auto_matches/it.yml b/config/locales/views/auto_matches/it.ymlnew file mode 100644index 0000000000..e8d3140c82--- /dev/null+++ b/config/locales/views/auto_matches/it.yml@@ -0,0 +1,32 @@+---+it:+ auto_matches:+ title: Corrispondenze automatiche+ settings:+ enable_label: Attiva corrispondenza automatica+ enable_description: Rileva e suggerisce automaticamente le corrispondenze dei trasferimenti tra conti a ogni sincronizzazione. I suggerimenti non vengono applicati finché non li confermi qui sotto.+ admin_only: Solo gli amministratori possono modificare questa impostazione.+ update_settings:+ settings_updated: Impostazioni di corrispondenza automatica aggiornate+ bulk_update:+ invalid_selection: Seleziona almeno un suggerimento da confermare o rifiutare+ bulk_confirmed:+ one: 1 trasferimento confermato+ other: "%{count} trasferimenti confermati"+ bulk_rejected:+ one: 1 trasferimento rifiutato+ other: "%{count} trasferimenti rifiutati"+ empty:+ title: Nessun suggerimento di corrispondenza automatica in sospeso+ description: Quando una sincronizzazione rileva un probabile trasferimento tra due dei tuoi conti, apparirà qui per la revisione.+ table:+ from: Da+ to: A+ date: Data+ actions: Azioni+ separator: "·"+ bulk_actions:+ selected_label: selezionati+ confirm_selected: Conferma selezionati+ reject_selected: Rifiuta selezionati+ select_all: Seleziona tuttodiff --git a/config/locales/views/auto_matches/nl.yml b/config/locales/views/auto_matches/nl.ymlnew file mode 100644index 0000000000..d79bb3c67f--- /dev/null+++ b/config/locales/views/auto_matches/nl.yml@@ -0,0 +1,32 @@+---+nl:+ auto_matches:+ title: Automatische matching+ settings:+ enable_label: Automatische matching inschakelen+ enable_description: Detecteert en stelt automatisch overschrijvingsmatches tussen rekeningen voor bij elke synchronisatie. Suggesties worden pas toegepast nadat je ze hieronder bevestigt.+ admin_only: Alleen beheerders kunnen deze instelling wijzigen.+ update_settings:+ settings_updated: Instellingen voor automatische matching bijgewerkt+ bulk_update:+ invalid_selection: Selecteer minstens één suggestie om te bevestigen of af te wijzen+ bulk_confirmed:+ one: 1 overschrijving bevestigd+ other: "%{count} overschrijvingen bevestigd"+ bulk_rejected:+ one: 1 overschrijving afgewezen+ other: "%{count} overschrijvingen afgewezen"+ empty:+ title: Geen openstaande suggesties voor automatische matching+ description: Wanneer een synchronisatie een waarschijnlijke overschrijving tussen twee van je rekeningen detecteert, verschijnt deze hier ter beoordeling.+ table:+ from: Van+ to: Naar+ date: Datum+ actions: Acties+ separator: "·"+ bulk_actions:+ selected_label: geselecteerd+ confirm_selected: Selectie bevestigen+ reject_selected: Selectie afwijzen+ select_all: Alles selecterendiff --git a/config/locales/views/auto_matches/pl.yml b/config/locales/views/auto_matches/pl.ymlnew file mode 100644index 0000000000..10bef2a414--- /dev/null+++ b/config/locales/views/auto_matches/pl.yml@@ -0,0 +1,36 @@+---+pl:+ auto_matches:+ title: Automatyczne dopasowywanie+ settings:+ enable_label: Włącz automatyczne dopasowywanie+ enable_description: Automatycznie wykrywa i sugeruje dopasowania przelewów między kontami przy każdej synchronizacji. Sugestie nie są stosowane, dopóki ich nie potwierdzisz poniżej.+ admin_only: Tylko administratorzy mogą zmienić to ustawienie.+ update_settings:+ settings_updated: Zaktualizowano ustawienia automatycznego dopasowywania+ bulk_update:+ invalid_selection: Wybierz co najmniej jedną sugestię do potwierdzenia lub odrzucenia+ bulk_confirmed:+ one: Potwierdzono 1 przelew+ few: "Potwierdzono %{count} przelewy"+ many: "Potwierdzono %{count} przelewów"+ other: "Potwierdzono %{count} przelewu"+ bulk_rejected:+ one: Odrzucono 1 przelew+ few: "Odrzucono %{count} przelewy"+ many: "Odrzucono %{count} przelewów"+ other: "Odrzucono %{count} przelewu"+ empty:+ title: Brak oczekujących sugestii automatycznego dopasowania+ description: Gdy synchronizacja wykryje prawdopodobny przelew między dwoma Twoimi kontami, pojawi się tutaj do przeglądu.+ table:+ from: Od+ to: Do+ date: Data+ actions: Działania+ separator: "·"+ bulk_actions:+ selected_label: zaznaczonych+ confirm_selected: Potwierdź zaznaczone+ reject_selected: Odrzuć zaznaczone+ select_all: Zaznacz wszystkodiff --git a/config/locales/views/auto_matches/pt-BR.yml b/config/locales/views/auto_matches/pt-BR.ymlnew file mode 100644index 0000000000..d4cefde744--- /dev/null+++ b/config/locales/views/auto_matches/pt-BR.yml@@ -0,0 +1,32 @@+---+pt-BR:+ auto_matches:+ title: Correspondências automáticas+ settings:+ enable_label: Ativar correspondência automática+ enable_description: Detecta e sugere automaticamente correspondências de transferências entre contas a cada sincronização. As sugestões não são aplicadas até que você as confirme abaixo.+ admin_only: Somente administradores podem alterar esta configuração.+ update_settings:+ settings_updated: Configurações de correspondência automática atualizadas+ bulk_update:+ invalid_selection: Selecione pelo menos uma sugestão para confirmar ou rejeitar+ bulk_confirmed:+ one: 1 transferência confirmada+ other: "%{count} transferências confirmadas"+ bulk_rejected:+ one: 1 transferência rejeitada+ other: "%{count} transferências rejeitadas"+ empty:+ title: Nenhuma sugestão de correspondência automática pendente+ description: Quando uma sincronização detectar uma provável transferência entre duas das suas contas, ela aparecerá aqui para revisão.+ table:+ from: De+ to: Para+ date: Data+ actions: Ações+ separator: "·"+ bulk_actions:+ selected_label: selecionadas+ confirm_selected: Confirmar selecionadas+ reject_selected: Rejeitar selecionadas+ select_all: Selecionar tudodiff --git a/config/locales/views/auto_matches/pt-PT.yml b/config/locales/views/auto_matches/pt-PT.ymlnew file mode 100644index 0000000000..cceb3c742f--- /dev/null+++ b/config/locales/views/auto_matches/pt-PT.yml@@ -0,0 +1,32 @@+---+pt-PT:+ auto_matches:+ title: Correspondências automáticas+ settings:+ enable_label: Ativar correspondência automática+ enable_description: Deteta e sugere automaticamente correspondências de transferências entre contas em cada sincronização. As sugestões só são aplicadas depois de as confirmares abaixo.+ admin_only: Apenas administradores podem alterar esta definição.+ update_settings:+ settings_updated: Definições de correspondência automática atualizadas+ bulk_update:+ invalid_selection: Seleciona pelo menos uma sugestão para confirmar ou rejeitar+ bulk_confirmed:+ one: 1 transferência confirmada+ other: "%{count} transferências confirmadas"+ bulk_rejected:+ one: 1 transferência rejeitada+ other: "%{count} transferências rejeitadas"+ empty:+ title: Sem sugestões de correspondência automática pendentes+ description: Quando uma sincronização detetar uma provável transferência entre duas das tuas contas, esta aparecerá aqui para revisão.+ table:+ from: De+ to: Para+ date: Data+ actions: Ações+ separator: "·"+ bulk_actions:+ selected_label: selecionadas+ confirm_selected: Confirmar selecionadas+ reject_selected: Rejeitar selecionadas+ select_all: Selecionar tudodiff --git a/config/locales/views/auto_matches/ro.yml b/config/locales/views/auto_matches/ro.ymlnew file mode 100644index 0000000000..f2eea846f7--- /dev/null+++ b/config/locales/views/auto_matches/ro.yml@@ -0,0 +1,34 @@+---+ro:+ auto_matches:+ title: Potriviri automate+ settings:+ enable_label: Activează potrivirea automată+ enable_description: Detectează și sugerează automat potriviri de transferuri între conturi la fiecare sincronizare. Sugestiile nu sunt aplicate până când nu le confirmi mai jos.+ admin_only: Doar administratorii pot modifica această setare.+ update_settings:+ settings_updated: Setările de potrivire automată au fost actualizate+ bulk_update:+ invalid_selection: Selectează cel puțin o sugestie de confirmat sau respins+ bulk_confirmed:+ one: 1 transfer confirmat+ few: "%{count} transferuri confirmate"+ other: "%{count} de transferuri confirmate"+ bulk_rejected:+ one: 1 transfer respins+ few: "%{count} transferuri respinse"+ other: "%{count} de transferuri respinse"+ empty:+ title: Nicio sugestie de potrivire automată în așteptare+ description: Când o sincronizare detectează un transfer probabil între două dintre conturile tale, acesta va apărea aici pentru revizuire.+ table:+ from: De la+ to: Către+ date: Data+ actions: Acțiuni+ separator: "·"+ bulk_actions:+ selected_label: selectate+ confirm_selected: Confirmă selecția+ reject_selected: Respinge selecția+ select_all: Selectează totdiff --git a/config/locales/views/auto_matches/ru.yml b/config/locales/views/auto_matches/ru.ymlnew file mode 100644index 0000000000..e332e82d16--- /dev/null+++ b/config/locales/views/auto_matches/ru.yml@@ -0,0 +1,36 @@+---+ru:+ auto_matches:+ title: Автоматическое сопоставление+ settings:+ enable_label: Включить автоматическое сопоставление+ enable_description: Автоматически определяет и предлагает совпадения переводов между счетами при каждой синхронизации. Предложения не применяются, пока вы их не подтвердите ниже.+ admin_only: Только администраторы могут изменить этот параметр.+ update_settings:+ settings_updated: Настройки автоматического сопоставления обновлены+ bulk_update:+ invalid_selection: Выберите хотя бы одно предложение для подтверждения или отклонения+ bulk_confirmed:+ one: Подтверждён 1 перевод+ few: "Подтверждено %{count} перевода"+ many: "Подтверждено %{count} переводов"+ other: "Подтверждено %{count} перевода"+ bulk_rejected:+ one: Отклонён 1 перевод+ few: "Отклонено %{count} перевода"+ many: "Отклонено %{count} переводов"+ other: "Отклонено %{count} перевода"+ empty:+ title: Нет ожидающих предложений автоматического сопоставления+ description: Когда синхронизация обнаружит вероятный перевод между двумя вашими счетами, он появится здесь для проверки.+ table:+ from: Откуда+ to: Куда+ date: Дата+ actions: Действия+ separator: "·"+ bulk_actions:+ selected_label: выбрано+ confirm_selected: Подтвердить выбранное+ reject_selected: Отклонить выбранное+ select_all: Выбрать всёdiff --git a/config/locales/views/auto_matches/tr.yml b/config/locales/views/auto_matches/tr.ymlnew file mode 100644index 0000000000..dd27528c2d--- /dev/null+++ b/config/locales/views/auto_matches/tr.yml@@ -0,0 +1,32 @@+---+tr:+ auto_matches:+ title: Otomatik Eşleştirme+ settings:+ enable_label: Otomatik Eşleştirmeyi Etkinleştir+ enable_description: Her senkronizasyonda hesaplar arasındaki transfer eşleşmelerini otomatik olarak algılar ve önerir. Öneriler, aşağıda onaylamadıkça uygulanmaz.+ admin_only: Bu ayarı yalnızca yöneticiler değiştirebilir.+ update_settings:+ settings_updated: Otomatik eşleştirme ayarları güncellendi+ bulk_update:+ invalid_selection: Onaylamak veya reddetmek için en az bir öneri seçin+ bulk_confirmed:+ one: 1 transfer onaylandı+ other: "%{count} transfer onaylandı"+ bulk_rejected:+ one: 1 transfer reddedildi+ other: "%{count} transfer reddedildi"+ empty:+ title: Bekleyen otomatik eşleştirme önerisi yok+ description: Bir senkronizasyon, hesaplarınızdan ikisi arasında olası bir transfer algıladığında, incelemeniz için burada görünecektir.+ table:+ from: Kimden+ to: Kime+ date: Tarih+ actions: İşlemler+ separator: "·"+ bulk_actions:+ selected_label: seçildi+ confirm_selected: Seçilenleri onayla+ reject_selected: Seçilenleri reddet+ select_all: Tümünü seçdiff --git a/config/locales/views/auto_matches/uk.yml b/config/locales/views/auto_matches/uk.ymlnew file mode 100644index 0000000000..178c09a885--- /dev/null+++ b/config/locales/views/auto_matches/uk.yml@@ -0,0 +1,36 @@+---+uk:+ auto_matches:+ title: Автоматичне зіставлення+ settings:+ enable_label: Увімкнути автоматичне зіставлення+ enable_description: Автоматично виявляє та пропонує збіги переказів між рахунками під час кожної синхронізації. Пропозиції не застосовуються, доки ви не підтвердите їх нижче.+ admin_only: Лише адміністратори можуть змінити це налаштування.+ update_settings:+ settings_updated: Налаштування автоматичного зіставлення оновлено+ bulk_update:+ invalid_selection: Виберіть принаймні одну пропозицію для підтвердження або відхилення+ bulk_confirmed:+ one: Підтверджено 1 переказ+ few: "Підтверджено %{count} перекази"+ many: "Підтверджено %{count} переказів"+ other: "Підтверджено %{count} переказу"+ bulk_rejected:+ one: Відхилено 1 переказ+ few: "Відхилено %{count} перекази"+ many: "Відхилено %{count} переказів"+ other: "Відхилено %{count} переказу"+ empty:+ title: Немає очікуваних пропозицій автоматичного зіставлення+ description: Коли синхронізація виявить ймовірний переказ між двома вашими рахунками, він з'явиться тут для перевірки.+ table:+ from: Звідки+ to: Куди+ date: Дата+ actions: Дії+ separator: "·"+ bulk_actions:+ selected_label: вибрано+ confirm_selected: Підтвердити вибране+ reject_selected: Відхилити вибране+ select_all: Вибрати всеdiff --git a/config/locales/views/auto_matches/vi.yml b/config/locales/views/auto_matches/vi.ymlnew file mode 100644index 0000000000..7b0c8373d6--- /dev/null+++ b/config/locales/views/auto_matches/vi.yml@@ -0,0 +1,32 @@+---+vi:+ auto_matches:+ title: Tự động khớp lệnh chuyển khoản+ settings:+ enable_label: Bật tự động khớp lệnh+ enable_description: Tự động phát hiện và đề xuất các giao dịch chuyển khoản trùng khớp giữa các tài khoản sau mỗi lần đồng bộ. Các đề xuất sẽ không được áp dụng cho đến khi bạn xác nhận bên dưới.+ admin_only: Chỉ quản trị viên mới có thể thay đổi cài đặt này.+ update_settings:+ settings_updated: Đã cập nhật cài đặt tự động khớp lệnh+ bulk_update:+ invalid_selection: Chọn ít nhất một đề xuất để xác nhận hoặc từ chối+ bulk_confirmed:+ one: Đã xác nhận 1 giao dịch chuyển khoản+ other: "Đã xác nhận %{count} giao dịch chuyển khoản"+ bulk_rejected:+ one: Đã từ chối 1 giao dịch chuyển khoản+ other: "Đã từ chối %{count} giao dịch chuyển khoản"+ empty:+ title: Không có đề xuất khớp lệnh tự động nào đang chờ xử lý+ description: Khi quá trình đồng bộ phát hiện một giao dịch chuyển khoản có khả năng xảy ra giữa hai tài khoản của bạn, nó sẽ hiển thị ở đây để xem xét.+ table:+ from: Từ+ to: Đến+ date: Ngày+ actions: Hành động+ separator: "·"+ bulk_actions:+ selected_label: đã chọn+ confirm_selected: Xác nhận mục đã chọn+ reject_selected: Từ chối mục đã chọn+ select_all: Chọn tất cảdiff --git a/config/locales/views/auto_matches/zh-CN.yml b/config/locales/views/auto_matches/zh-CN.ymlnew file mode 100644index 0000000000..8aa770d77c--- /dev/null+++ b/config/locales/views/auto_matches/zh-CN.yml@@ -0,0 +1,28 @@+---+zh-CN:+ auto_matches:+ title: 自动匹配+ settings:+ enable_label: 启用自动匹配+ enable_description: 每次同步时自动检测并建议账户之间的转账匹配。建议在您于下方确认之前不会被应用。+ admin_only: 只有管理员可以更改此设置。+ update_settings:+ settings_updated: 自动匹配设置已更新+ bulk_update:+ invalid_selection: 请至少选择一项建议以确认或拒绝+ bulk_confirmed: 已确认 %{count} 笔转账+ bulk_rejected: 已拒绝 %{count} 笔转账+ empty:+ title: 暂无待处理的自动匹配建议+ description: 当同步检测到您的两个账户之间可能存在转账时,它将显示在此处供您审核。+ table:+ from: 从+ to: 到+ date: 日期+ actions: 操作+ separator: "·"+ bulk_actions:+ selected_label: 项已选择+ confirm_selected: 确认所选+ reject_selected: 拒绝所选+ select_all: 全选diff --git a/config/locales/views/auto_matches/zh-TW.yml b/config/locales/views/auto_matches/zh-TW.ymlnew file mode 100644index 0000000000..08550698f5--- /dev/null+++ b/config/locales/views/auto_matches/zh-TW.yml@@ -0,0 +1,28 @@+---+zh-TW:+ auto_matches:+ title: 自動配對+ settings:+ enable_label: 啟用自動配對+ enable_description: 每次同步時自動偵測並建議帳戶之間的轉帳配對。建議在您於下方確認之前不會套用。+ admin_only: 只有管理員可以變更此設定。+ update_settings:+ settings_updated: 自動配對設定已更新+ bulk_update:+ invalid_selection: 請至少選擇一項建議以確認或拒絕+ bulk_confirmed: 已確認 %{count} 筆轉帳+ bulk_rejected: 已拒絕 %{count} 筆轉帳+ empty:+ title: 目前沒有待處理的自動配對建議+ description: 當同步偵測到您的兩個帳戶之間可能存在轉帳時,會顯示在此處供您審核。+ table:+ from: 從+ to: 到+ date: 日期+ actions: 操作+ separator: "·"+ bulk_actions:+ selected_label: 項已選取+ confirm_selected: 確認所選+ reject_selected: 拒絕所選+ select_all: 全選diff --git a/config/locales/views/settings/ca.yml b/config/locales/views/settings/ca.ymlindex 35f71afce4..f004217336 100644--- a/config/locales/views/settings/ca.yml+++ b/config/locales/views/settings/ca.yml@@ -818,6 +818,7 @@ ca:accounts_label: Comptesadvanced_section_title: Avançatai_prompts_label: Prompts d'IA+ auto_matches_label: Coincidències automàtiquesapi_key_label: Clau APIapi_keys_label: Clau APIappearance_label: Aparençadiff --git a/config/locales/views/settings/de.yml b/config/locales/views/settings/de.ymlindex ba8917fef0..6e04f34b51 100644--- a/config/locales/views/settings/de.yml+++ b/config/locales/views/settings/de.yml@@ -191,6 +191,7 @@ de:accounts_label: Kontenadvanced_section_title: Erweitertai_prompts_label: KI-Eingabeaufforderungen+ auto_matches_label: Automatischer Abgleichapi_key_label: API-Schlüsselpayment_label: Zahlungcategories_label: Kategoriendiff --git a/config/locales/views/settings/en.yml b/config/locales/views/settings/en.ymlindex 7b2b6e373d..673d50e63f 100644--- a/config/locales/views/settings/en.yml+++ b/config/locales/views/settings/en.yml@@ -359,6 +359,7 @@ en:accounts_label: Accountsadvanced_section_title: Advancedai_prompts_label: AI Prompts+ auto_matches_label: Auto Matchesclassifier_label: Classifierbackground_jobs_label: Background jobsapi_key_label: API Keysdiff --git a/config/locales/views/settings/es.yml b/config/locales/views/settings/es.ymlindex 15c2c8e923..ec919961c2 100644--- a/config/locales/views/settings/es.yml+++ b/config/locales/views/settings/es.yml@@ -269,6 +269,7 @@ es:accounts_label: Cuentasadvanced_section_title: Avanzadoai_prompts_label: Indicaciones de IA+ auto_matches_label: Coincidencias automáticasapi_key_label: Clave APIpayment_label: Pagocategories_label: Categoríasdiff --git a/config/locales/views/settings/fr.yml b/config/locales/views/settings/fr.ymlindex 89934e2000..2e6c908ac4 100644--- a/config/locales/views/settings/fr.yml+++ b/config/locales/views/settings/fr.yml@@ -687,6 +687,7 @@ fr:accounts_label: Comptesadvanced_section_title: Avancéai_prompts_label: Prompts IA+ auto_matches_label: Rapprochements automatiquesapi_key_label: Clé APIapi_keys_label: Clés APIappearance_label: Apparencediff --git a/config/locales/views/settings/hu.yml b/config/locales/views/settings/hu.ymlindex 82d24bda67..30c89691a3 100644--- a/config/locales/views/settings/hu.yml+++ b/config/locales/views/settings/hu.yml@@ -193,6 +193,7 @@ hu:accounts_label: Számlákadvanced_section_title: Speciálisai_prompts_label: MI promptok+ auto_matches_label: Automatikus egyeztetésapi_key_label: API-kulcspayment_label: Fizetéscategories_label: Kategóriákdiff --git a/config/locales/views/settings/it.yml b/config/locales/views/settings/it.ymlindex 999980651c..45ba7e2014 100644--- a/config/locales/views/settings/it.yml+++ b/config/locales/views/settings/it.yml@@ -264,6 +264,7 @@ it:accounts_label: Contiadvanced_section_title: Avanzateai_prompts_label: Prompt AI+ auto_matches_label: Corrispondenze automaticheapi_key_label: Chiave APIpayment_label: Pagamentocategories_label: Categoriediff --git a/config/locales/views/settings/nl.yml b/config/locales/views/settings/nl.ymlindex 40361ff69c..c6a154f921 100644--- a/config/locales/views/settings/nl.yml+++ b/config/locales/views/settings/nl.yml@@ -121,6 +121,7 @@ nl:accounts_label: Accountsadvanced_section_title: Geavanceerdai_prompts_label: AI Prompts+ auto_matches_label: Automatische matchingapi_key_label: API Keypayment_label: Betalingcategories_label: Categorieëndiff --git a/config/locales/views/settings/pl.yml b/config/locales/views/settings/pl.ymlindex f12a0963c6..c154f7a14b 100644--- a/config/locales/views/settings/pl.yml+++ b/config/locales/views/settings/pl.yml@@ -850,6 +850,7 @@ pl:accounts_label: Kontaadvanced_section_title: Zaawansowaneai_prompts_label: Prompty AI+ auto_matches_label: Automatyczne dopasowywanieapi_key_label: Klucz APIapi_keys_label: Klucz APIappearance_label: Wygląddiff --git a/config/locales/views/settings/pt-BR.yml b/config/locales/views/settings/pt-BR.ymlindex f4b4603190..f2d8b9f9f9 100644--- a/config/locales/views/settings/pt-BR.yml+++ b/config/locales/views/settings/pt-BR.yml@@ -141,6 +141,7 @@ pt-BR:accounts_label: Contasadvanced_section_title: Avançadoai_prompts_label: Sugestões de IA+ auto_matches_label: Correspondências automáticasapi_key_label: Chave da APIpayment_label: Pagamentocategories_label: Categoriasdiff --git a/config/locales/views/settings/pt-PT.yml b/config/locales/views/settings/pt-PT.ymlindex 589220222d..e66218d5fd 100644--- a/config/locales/views/settings/pt-PT.yml+++ b/config/locales/views/settings/pt-PT.yml@@ -326,6 +326,7 @@ pt-PT:accounts_label: Contasadvanced_section_title: Avançadoai_prompts_label: Prompts de IA+ auto_matches_label: Correspondências automáticasbackground_jobs_label: Tarefas em segundo planoapi_key_label: Chaves de APIpayment_label: Pagamentodiff --git a/config/locales/views/settings/ro.yml b/config/locales/views/settings/ro.ymlindex 96a82a4810..99b5b4aa0d 100644--- a/config/locales/views/settings/ro.yml+++ b/config/locales/views/settings/ro.yml@@ -104,6 +104,7 @@ ro:accounts_label: Conturiadvanced_section_title: Avansatai_prompts_label: Prompturi AI+ auto_matches_label: Potriviri automateapi_key_label: Cheie APIpayment_label: Platăcategories_label: Categoriidiff --git a/config/locales/views/settings/ru.yml b/config/locales/views/settings/ru.ymlindex 65d8e7342a..f64ba50cb5 100644--- a/config/locales/views/settings/ru.yml+++ b/config/locales/views/settings/ru.yml@@ -788,6 +788,7 @@ ru:accounts_label: Счетаadvanced_section_title: Расширенныеai_prompts_label: Запросы ИИ+ auto_matches_label: Автоматическое сопоставлениеapi_key_label: API-ключиapi_keys_label: API-ключиappearance_label: Внешний видdiff --git a/config/locales/views/settings/tr.yml b/config/locales/views/settings/tr.ymlindex fbc033b63b..9ccfb7fb3b 100644--- a/config/locales/views/settings/tr.yml+++ b/config/locales/views/settings/tr.yml@@ -806,6 +806,7 @@ tr:accounts_label: Hesaplaradvanced_section_title: Gelişmişai_prompts_label: Yapay Zeka İstemleri+ auto_matches_label: Otomatik Eşleştirmeapi_key_label: API Anahtarıapi_keys_label: API Anahtarlarıappearance_label: Görünümdiff --git a/config/locales/views/settings/uk.yml b/config/locales/views/settings/uk.ymlindex d18c667416..d03ec5d267 100644--- a/config/locales/views/settings/uk.yml+++ b/config/locales/views/settings/uk.yml@@ -350,6 +350,7 @@ uk:accounts_label: Рахункиadvanced_section_title: Розширеніai_prompts_label: Промпти ШІ+ auto_matches_label: Автоматичне зіставленняbackground_jobs_label: Фонові завданняapi_key_label: Ключі APIpayment_label: Оплатаdiff --git a/config/locales/views/settings/vi.yml b/config/locales/views/settings/vi.ymlindex 22bb71e102..64c1eb7f17 100644--- a/config/locales/views/settings/vi.yml+++ b/config/locales/views/settings/vi.yml@@ -234,6 +234,7 @@ vi:accounts_label: Tài khoảnadvanced_section_title: Nâng caoai_prompts_label: Câu lệnh AI+ auto_matches_label: Tự động khớp lệnh chuyển khoảnapi_key_label: Khóa APIpayment_label: Thanh toáncategories_label: Danh mụcdiff --git a/config/locales/views/settings/zh-CN.yml b/config/locales/views/settings/zh-CN.ymlindex 73cb873bfe..0a55954efa 100644--- a/config/locales/views/settings/zh-CN.yml+++ b/config/locales/views/settings/zh-CN.yml@@ -234,6 +234,7 @@ zh-CN:accounts_label: 账户advanced_section_title: 高级ai_prompts_label: AI 提示词+ auto_matches_label: 自动匹配api_key_label: API 密钥payment_label: 付款categories_label: 分类diff --git a/config/locales/views/settings/zh-TW.yml b/config/locales/views/settings/zh-TW.ymlindex b322478d32..fe99614bd4 100644--- a/config/locales/views/settings/zh-TW.yml+++ b/config/locales/views/settings/zh-TW.yml@@ -312,6 +312,7 @@ zh-TW:accounts_label: 帳戶管理advanced_section_title: 進階設定ai_prompts_label: AI 提示詞+ auto_matches_label: 自動配對background_jobs_label: 背景工作api_key_label: API 金鑰payment_label: 付款diff --git a/config/routes.rb b/config/routes.rbindex e0cfda3df8..5194f67c97 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -636,6 +636,13 @@ Rails.application.routes.draw doendend+ resources :auto_matches, only: %i[index] do+ collection do+ patch :update_settings+ patch :bulk_update+ end+ end+resources :insights, only: %i[index] docollection dopost :refreshdiff --git a/db/migrate/20260923120000_add_auto_match_transfers_disabled_to_families.rb b/db/migrate/20260923120000_add_auto_match_transfers_disabled_to_families.rbnew file mode 100644index 0000000000..7ded4eab00--- /dev/null+++ b/db/migrate/20260923120000_add_auto_match_transfers_disabled_to_families.rb@@ -0,0 +1,5 @@+class AddAutoMatchTransfersDisabledToFamilies < ActiveRecord::Migration[8.1]+ def change+ add_column :families, :auto_match_transfers_disabled, :boolean, default: false, null: false+ end+enddiff --git a/db/schema.rb b/db/schema.rbindex 300ea3a0f8..7ee2f17aad 100644--- a/db/schema.rb+++ b/db/schema.rb@@ -842,6 +842,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_10_20_090001) docreate_table "families", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|t.jsonb "ai_prompt_overrides", default: {}, null: falset.string "assistant_type", default: "builtin", null: false+ t.boolean "auto_match_transfers_disabled", default: false, null: falset.boolean "auto_sync_on_login", default: true, null: falset.jsonb "bayes_settings", default: {}, null: falset.string "bills_feed_token"diff --git a/test/controllers/auto_matches_controller_test.rb b/test/controllers/auto_matches_controller_test.rbnew file mode 100644index 0000000000..98a7ce9855--- /dev/null+++ b/test/controllers/auto_matches_controller_test.rb@@ -0,0 +1,224 @@+require "test_helper"++class AutoMatchesControllerTest < ActionDispatch::IntegrationTest+ include EntriesTestHelper++ setup do+ sign_in users(:family_admin)+ @family = families(:dylan_family)+ end++ test "index lists pending auto-matched transfers for the family" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!++ get auto_matches_url+ assert_response :success+ assert_select "tr##{ActionView::RecordIdentifier.dom_id(outflow_entry.transaction.transfer)}"+ end++ test "index does not include transfers already confirmed" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ outflow_entry.transaction.transfer.confirm!++ get auto_matches_url+ assert_response :success+ assert_select "tr##{ActionView::RecordIdentifier.dom_id(outflow_entry.transaction.transfer)}", false+ end++ test "index excludes matches where the outflow account is private to another family member" do+ # other_asset is owned by family_admin and not shared with family_member;+ # depository is shared with family_member (full_control).+ outflow_entry = create_transaction(date: Date.current, account: accounts(:other_asset), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: -500)+ @family.auto_match_transfers!++ sign_in users(:family_member)+ get auto_matches_url+ assert_response :success+ assert_select "tr##{ActionView::RecordIdentifier.dom_id(outflow_entry.transaction.transfer)}", false+ end++ # Regression: the bulk-select <form> used to wrap the whole table,+ # including each row's own Confirm/Reject button_to form. Nested <form>+ # elements are invalid HTML -- browsers flatten them, which merged every+ # row's authenticity_token into the outer form and made clicking an+ # individual Confirm/Reject button submit the *bulk* form instead,+ # raising ActionController::InvalidAuthenticityToken in production.+ test "index does not nest the per-row confirm/reject forms inside the bulk-select form" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!++ get auto_matches_url+ assert_response :success++ doc = Nokogiri::HTML::Document.parse(response.body)+ bulk_form = doc.at_css("form[action='#{bulk_update_auto_matches_path}']")+ assert_not_nil bulk_form+ assert_empty bulk_form.css("form"), "no <form> should be nested inside the bulk-update form"++ row = doc.at_css("tr##{ActionView::RecordIdentifier.dom_id(outflow_entry.transaction.transfer)}")+ row_forms = row.css("form")+ assert_equal 2, row_forms.size, "expected the row's own confirm and reject forms"+ assert row_forms.all? { |f| f["action"].start_with?(transfer_path(outflow_entry.transaction.transfer)) },+ "the per-row confirm/reject forms should still target the transfer"+ end++ test "update_settings disables auto match" do+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }+ assert_redirected_to auto_matches_url+ assert @family.reload.auto_match_transfers_disabled?+ end++ test "update_settings is refused for a member and keeps pending suggestions" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ transfer = outflow_entry.transaction.reload.transfer++ sign_in users(:family_member)+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }++ assert_redirected_to accounts_url+ assert_not @family.reload.auto_match_transfers_disabled?+ assert Transfer.exists?(transfer.id)+ end++ test "update_settings is refused for a guest" do+ users(:family_member).update!(role: "guest")+ sign_in users(:family_member)++ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }++ assert_redirected_to accounts_url+ assert_not @family.reload.auto_match_transfers_disabled?+ end++ test "index renders the toggle read-only for a member" do+ sign_in users(:family_member)+ get auto_matches_url++ assert_response :success+ assert_select "form[action='#{update_settings_auto_matches_path}']", false+ assert_select "input#auto_match_transfers_enabled[disabled]"+ end++ test "update_settings keeps auto match on when cleaning up a suggestion fails" do+ create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ Transfer.any_instance.stubs(:destroy!).raises(ActiveRecord::RecordNotDestroyed.new("boom"))++ assert_raises(ActiveRecord::RecordNotDestroyed) do+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }+ end++ assert_not @family.reload.auto_match_transfers_disabled?+ end++ test "bulk update notices use the Polish few form" do+ I18n.with_locale(:pl) do+ assert_equal "Potwierdzono 2 przelewy", I18n.t("auto_matches.bulk_update.bulk_confirmed", count: 2)+ assert_equal "Odrzucono 3 przelewy", I18n.t("auto_matches.bulk_update.bulk_rejected", count: 3)+ end+ end++ test "bulk update confirms the selected matches and applies their transfer kinds" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ transfer = outflow_entry.transaction.reload.transfer++ patch bulk_update_auto_matches_url, params: { status: "confirmed", transfer_ids: [ transfer.id ] }++ assert_redirected_to auto_matches_url+ assert transfer.reload.confirmed?+ assert_equal "cc_payment", outflow_entry.transaction.reload.kind+ assert_equal "funds_movement", inflow_entry.transaction.reload.kind+ end++ test "bulk update rejects the selected matches" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ inflow_entry = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ transfer = outflow_entry.transaction.reload.transfer++ patch bulk_update_auto_matches_url, params: { status: "rejected", transfer_ids: [ transfer.id ] }++ assert_not Transfer.exists?(transfer.id)+ assert RejectedTransfer.exists?(inflow_transaction_id: inflow_entry.transaction.id, outflow_transaction_id: outflow_entry.transaction.id)+ end++ test "bulk update skips a match that was resolved after the list was loaded" do+ outflow_entry = create_transaction(date: Date.current, account: accounts(:depository), amount: 500)+ create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500)+ @family.auto_match_transfers!+ transfer = outflow_entry.transaction.reload.transfer++ # A concurrent request resolves the match between loading and locking it.+ Transfer.any_instance.stubs(:pending?).returns(false)+ Transfer.any_instance.expects(:reject!).never++ patch bulk_update_auto_matches_url, params: { status: "rejected", transfer_ids: [ transfer.id ] }++ assert_redirected_to auto_matches_url+ assert Transfer.exists?(transfer.id)+ end++ test "update_settings re-enables auto match" do+ @family.update!(auto_match_transfers_disabled: true)++ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "false" }+ assert_redirected_to auto_matches_url+ assert_not @family.reload.auto_match_transfers_disabled?+ end++ test "update_settings enqueues an immediate match scan when re-enabling" do+ @family.update!(auto_match_transfers_disabled: true)++ assert_enqueued_with(job: AutoMatchTransfersJob, args: [ @family ]) do+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "false" }+ end+ end++ test "update_settings does not enqueue a match scan when disabling" do+ assert_no_enqueued_jobs(only: AutoMatchTransfersJob) do+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }+ end+ end++ test "update_settings does not enqueue a match scan when the setting doesn't change" do+ assert_no_enqueued_jobs(only: AutoMatchTransfersJob) do+ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "false" }+ end+ end++ # cleanup_pending_auto_matches! used to match every Transfer.pending for+ # the family, so disabling the toggle would also destroy a pending transfer+ # that arrived with a kind already set by an import path+ # (Family::DataImporter, Demo::Generator) -- not a genuine auto-match+ # suggestion.+ test "update_settings disabling destroys genuine pending auto-matches but preserves imported pending transfers with a kind already set" do+ genuine_outflow = create_transaction(date: Date.current, account: accounts(:depository), amount: 500, kind: "standard")+ genuine_inflow = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -500, kind: "standard")+ @family.auto_match_transfers!+ genuine_transfer = genuine_outflow.transaction.reload.transfer+ assert genuine_transfer.present? && genuine_transfer.pending?++ imported_outflow = create_transaction(date: Date.current, account: accounts(:depository), amount: 700, kind: "investment_contribution")+ imported_inflow = create_transaction(date: Date.current, account: accounts(:credit_card), amount: -700, kind: "funds_movement")+ imported_transfer = Transfer.create!(inflow_transaction: imported_inflow.transaction, outflow_transaction: imported_outflow.transaction)+ assert imported_transfer.pending?++ patch update_settings_auto_matches_url, params: { auto_match_transfers_disabled: "true" }++ assert_not Transfer.exists?(genuine_transfer.id)+ assert Transfer.exists?(imported_transfer.id)+ assert_equal "investment_contribution", imported_outflow.transaction.reload.kind+ assert_equal "funds_movement", imported_inflow.transaction.reload.kind+ end+enddiff --git a/test/jobs/auto_match_transfers_job_test.rb b/test/jobs/auto_match_transfers_job_test.rbnew file mode 100644index 0000000000..ada154ab34--- /dev/null+++ b/test/jobs/auto_match_transfers_job_test.rb@@ -0,0 +1,10 @@+require "test_helper"++class AutoMatchTransfersJobTest < ActiveJob::TestCase+ test "runs auto-match for the given family" do+ family = families(:empty)+ family.expects(:auto_match_transfers!).once++ AutoMatchTransfersJob.perform_now(family)+ end+enddiff --git a/test/models/family/auto_transfer_matchable_test.rb b/test/models/family/auto_transfer_matchable_test.rbindex fee0cf8411..7ce7b70eb9 100644--- a/test/models/family/auto_transfer_matchable_test.rb+++ b/test/models/family/auto_transfer_matchable_test.rb@@ -721,6 +721,17 @@ class Family::AutoTransferMatchableTest < ActiveSupport::TestCaseassert_equal 2, sql.scan(":require_common_writer = FALSE").sizeend+ test "does not auto-match transfers when the family has disabled auto match" do+ @family.update!(auto_match_transfers_disabled: true)++ create_transaction(date: Date.current, account: @depository, amount: 500)+ create_transaction(date: Date.current, account: @credit_card, amount: -500)++ assert_no_difference -> { Transfer.count } do+ @family.auto_match_transfers!+ end+ end+# Regression tests for loan transfer kind assignment bug# The kind should be determined by the DESTINATION account (inflow), not the source (outflow)test "loan payment (cash to loan) assigns loan_payment kind to outflow" do