mirror of
https://github.com/we-promise/sure.git
synced 2026-07-19 08:15:21 +00:00
Adds YnabImport (mirroring ActualImport) for YNAB "Export budget" register CSVs: - Amount — combines the split Outflow/Inflow columns into a single signed amount (inflow - |outflow|), stripping currency symbols and thousands separators. A single signed Amount column takes precedence when present. - Category — resolves across export shapes: the combined "Category Group/Category" column, the split "Category Group" + "Category", or legacy YNAB 4 "Master Category" + "Sub Category". - Names — falls back from a blank Payee to the Memo, then the default row name. - Validation — requires at least one amount source (Outflow/Inflow or Amount); a file exposing none leaves rows un-clean instead of importing zero-dollar entries. Enables the previously-disabled YNAB option on the imports screen (using the YNAB logo, like Mint) with its configuration partial, and removes the now-dead imports.new.coming_soon locale key. Documents the type in the API import-type enums (rswag request spec + swagger_helper + generated openapi.yaml). Closes #1255.
25 lines
1.5 KiB
Plaintext
25 lines
1.5 KiB
Plaintext
<%# locals: (import:) %>
|
|
|
|
<div class="flex items-center justify-between border border-secondary rounded-lg bg-success/5 p-5 gap-4 mb-4">
|
|
<span class="text-success">
|
|
<%= icon("check-circle", color: "current") %>
|
|
</span>
|
|
<p class="text-sm text-primary italic"><%= t(".preconfigured_notice") %></p>
|
|
</div>
|
|
|
|
<%= styled_form_with model: import, url: import_configuration_path(import), scope: :import, method: :patch, class: "space-y-4" do |form| %>
|
|
<div class="flex items-center gap-4">
|
|
<%= form.select :date_col_label, import.csv_headers, { include_blank: t(".leave_empty"), label: t(".date_label") }, required: true, disabled: import.complete? %>
|
|
<%= form.select :date_format, Family::DATE_FORMATS, { label: t(".date_format_label") }, label: true, required: true, disabled: import.complete? %>
|
|
</div>
|
|
|
|
<p class="text-xs text-secondary"><%= t(".amount_notice") %></p>
|
|
|
|
<%= form.select :account_col_label, import.csv_headers, { include_blank: t(".leave_empty"), label: t(".account_label") }, disabled: import.complete? %>
|
|
<%= form.select :name_col_label, import.csv_headers, { include_blank: t(".leave_empty"), label: t(".name_label") }, disabled: import.complete? %>
|
|
<%= form.select :category_col_label, import.csv_headers, { include_blank: t(".leave_empty"), label: t(".category_label") }, disabled: import.complete? %>
|
|
<%= form.select :notes_col_label, import.csv_headers, { include_blank: t(".leave_empty"), label: t(".notes_label") }, disabled: import.complete? %>
|
|
|
|
<%= form.submit t(".apply_configuration"), disabled: import.complete? %>
|
|
<% end %>
|