Completa i18n IT/EN/FR/DE/ES su sito pubblico, area autenticata e admin.
Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,45 +1,45 @@
|
||||
<h1>Fattura <%= @invoice.number %> — <%= @club.name %></h1>
|
||||
<h1><%= t("admin.billing_invoices.edit.title", number: @invoice.number, club: @club.name) %></h1>
|
||||
<p style="color:#666">
|
||||
Stato: <strong><%= @invoice.status %></strong>
|
||||
<%= t("admin.billing_invoices.edit.status_label") %> <strong><%= @invoice.status %></strong>
|
||||
<% if @invoice.emailed_at.present? %>
|
||||
· Inviata il <%= @invoice.emailed_at.in_time_zone.strftime("%d/%m/%Y %H:%M") %>
|
||||
· <%= t("admin.billing_invoices.edit.sent_at", date: @invoice.emailed_at.in_time_zone.strftime("%d/%m/%Y %H:%M")) %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<div class="card">
|
||||
<%= form_with model: @invoice, url: admin_club_billing_invoice_path(@club, @invoice), multipart: true, method: :patch do |f| %>
|
||||
<%= f.label :number, "Numero fattura" %>
|
||||
<%= f.label :number, t("admin.billing_invoices.edit.number_label") %>
|
||||
<%= f.text_field :number, required: true, disabled: @invoice.status.in?(%w[sent]) %>
|
||||
|
||||
<%= f.label :issued_on, "Data emissione" %>
|
||||
<%= f.label :issued_on, t("admin.billing_invoices.edit.issued_on_label") %>
|
||||
<%= f.date_field :issued_on, required: true, disabled: @invoice.status.in?(%w[sent]) %>
|
||||
|
||||
<%= label_tag :amount_euros, "Importo (€)" %>
|
||||
<%= label_tag :amount_euros, t("admin.billing_invoices.edit.amount_label") %>
|
||||
<%= number_field_tag "billing_invoice[amount_euros]",
|
||||
@invoice.amount_cents / 100.0,
|
||||
step: 0.01, min: 0.01, required: true, disabled: @invoice.status.in?(%w[sent]) %>
|
||||
|
||||
<% if @payment %>
|
||||
<p style="color:#888;font-size:0.9rem">Pagamento: <%= @payment.display_description %> — <%= @payment.formatted_amount %></p>
|
||||
<p style="color:#888;font-size:0.9rem"><%= t("admin.billing_invoices.edit.payment_info", description: @payment.display_description, amount: @payment.formatted_amount) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= f.label :pdf, "PDF fattura" %>
|
||||
<%= f.label :pdf, t("admin.billing_invoices.edit.pdf_label") %>
|
||||
<% if @invoice.pdf.attached? %>
|
||||
<p style="color:#888">PDF già caricato: <%= @invoice.pdf.filename %></p>
|
||||
<p style="color:#888"><%= t("admin.billing_invoices.edit.pdf_already", filename: @invoice.pdf.filename) %></p>
|
||||
<% end %>
|
||||
<%= f.file_field :pdf, accept: "application/pdf" %>
|
||||
|
||||
<%= f.label :notes, "Note interne" %>
|
||||
<%= f.label :notes, t("admin.billing_invoices.edit.notes_label") %>
|
||||
<%= f.text_area :notes, rows: 2 %>
|
||||
|
||||
<div style="margin-top:16px;display:flex;gap:10px;flex-wrap:wrap">
|
||||
<% unless @invoice.status.in?(%w[sent]) %>
|
||||
<%= f.submit "Salva bozza", class: "btn btn-secondary" %>
|
||||
<%= f.submit "Emetti e invia via email", class: "btn btn-primary",
|
||||
data: { turbo_confirm: "Inviare la fattura a #{@club.billing_email}?" } %>
|
||||
<%= f.submit t("admin.billing_invoices.edit.save_draft"), name: "commit_action", value: "draft", class: "btn btn-secondary" %>
|
||||
<%= f.submit t("admin.billing_invoices.edit.issue_send"), name: "commit_action", value: "issue", class: "btn btn-primary",
|
||||
data: { turbo_confirm: t("admin.billing_invoices.edit.issue_confirm", email: @club.billing_email) } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p><%= link_to "← Pagamenti e fatture", admin_club_billing_invoices_path(@club) %></p>
|
||||
<p><%= link_to t("admin.billing_invoices.edit.back"), admin_club_billing_invoices_path(@club) %></p>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<h1>Fatturazione — <%= @club.name %></h1>
|
||||
<h1><%= t("admin.billing_invoices.index.title", club: @club.name) %></h1>
|
||||
<p>
|
||||
<%= link_to "← Dashboard", admin_root_path %>
|
||||
· <%= link_to "Nuova fattura (senza pagamento)", new_admin_club_billing_invoice_path(@club), class: "btn btn-secondary" %>
|
||||
<%= link_to t("admin.billing_invoices.index.back_dashboard"), admin_root_path %>
|
||||
· <%= link_to t("admin.billing_invoices.index.new_invoice"), new_admin_club_billing_invoice_path(@club), class: "btn btn-secondary" %>
|
||||
</p>
|
||||
|
||||
<h2 style="margin-top:24px;font-size:1.1rem">Pagamenti</h2>
|
||||
<h2 style="margin-top:24px;font-size:1.1rem"><%= t("admin.billing_invoices.index.payments_title") %></h2>
|
||||
<% if @payments.any? %>
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Importo</th>
|
||||
<th>Fattura</th>
|
||||
<th><%= t("admin.billing_invoices.index.table.date") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table.description") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table.amount") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table.invoice") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -26,16 +26,16 @@
|
||||
<td>
|
||||
<% if inv %>
|
||||
<%= inv.number %> — <%= inv.status %>
|
||||
<% if inv.pdf.attached? %> (PDF)<% end %>
|
||||
<% if inv.pdf.attached? %><%= t("admin.billing_invoices.index.pdf_suffix") %><% end %>
|
||||
<% else %>
|
||||
—
|
||||
<%= t("admin.common.dash") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if inv %>
|
||||
<%= link_to "Modifica / invia PDF", edit_admin_club_billing_invoice_path(@club, inv) %>
|
||||
<%= link_to t("admin.billing_invoices.index.edit_send_pdf"), edit_admin_club_billing_invoice_path(@club, inv) %>
|
||||
<% else %>
|
||||
<%= link_to "Crea fattura", new_admin_club_billing_invoice_path(@club, billing_payment_id: payment.id), class: "btn btn-primary", style: "padding:6px 10px;font-size:0.85rem" %>
|
||||
<%= link_to t("admin.billing_invoices.index.create_invoice"), new_admin_club_billing_invoice_path(@club, billing_payment_id: payment.id), class: "btn btn-primary", style: "padding:6px 10px;font-size:0.85rem" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -43,14 +43,21 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>Nessun pagamento registrato per questa società.</p>
|
||||
<p><%= t("admin.billing_invoices.index.no_payments") %></p>
|
||||
<% end %>
|
||||
|
||||
<h2 style="margin-top:32px;font-size:1.1rem">Tutte le fatture</h2>
|
||||
<h2 style="margin-top:32px;font-size:1.1rem"><%= t("admin.billing_invoices.index.all_invoices_title") %></h2>
|
||||
<% if @invoices.any? %>
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr><th>Numero</th><th>Data</th><th>Importo</th><th>Stato</th><th>Pagamento</th><th></th></tr>
|
||||
<tr>
|
||||
<th><%= t("admin.billing_invoices.index.table2.number") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table2.date") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table2.amount") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table2.status") %></th>
|
||||
<th><%= t("admin.billing_invoices.index.table2.payment") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invoices.each do |inv| %>
|
||||
@@ -59,12 +66,12 @@
|
||||
<td><%= inv.issued_on %></td>
|
||||
<td><%= inv.formatted_amount %></td>
|
||||
<td><%= inv.status %></td>
|
||||
<td><%= inv.billing_payment_id.present? ? "Sì" : "No" %></td>
|
||||
<td><%= link_to "Modifica", edit_admin_club_billing_invoice_path(@club, inv) %></td>
|
||||
<td><%= inv.billing_payment_id.present? ? t("admin.common.yes") : t("admin.common.no") %></td>
|
||||
<td><%= link_to t("admin.billing_invoices.index.edit"), edit_admin_club_billing_invoice_path(@club, inv) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>Nessuna fattura.</p>
|
||||
<p><%= t("admin.billing_invoices.index.no_invoices") %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<h1>Nuova fattura — <%= @club.name %></h1>
|
||||
<h1><%= t("admin.billing_invoices.new.title", club: @club.name) %></h1>
|
||||
<% if @payment %>
|
||||
<p style="color:#666">Collegata al pagamento del <%= @payment.paid_at&.to_date || @payment.created_at.to_date %> (<%= @payment.formatted_amount %>).</p>
|
||||
<p style="color:#666"><%= t("admin.billing_invoices.new.linked_payment", date: (@payment.paid_at&.to_date || @payment.created_at.to_date), amount: @payment.formatted_amount) %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="card">
|
||||
<%= form_with model: @invoice, url: admin_club_billing_invoices_path(@club) do |f| %>
|
||||
<%= f.hidden_field :billing_payment_id if @payment %>
|
||||
|
||||
<%= f.label :number, "Numero fattura" %>
|
||||
<%= f.label :number, t("admin.billing_invoices.new.number_label") %>
|
||||
<%= f.text_field :number, required: true %>
|
||||
|
||||
<%= f.label :issued_on, "Data emissione" %>
|
||||
<%= f.label :issued_on, t("admin.billing_invoices.new.issued_on_label") %>
|
||||
<%= f.date_field :issued_on, required: true %>
|
||||
|
||||
<%= label_tag :amount_euros, "Importo (€)" %>
|
||||
<%= label_tag :amount_euros, t("admin.billing_invoices.new.amount_label") %>
|
||||
<%= number_field_tag "billing_invoice[amount_euros]",
|
||||
(@invoice.amount_cents ? @invoice.amount_cents / 100.0 : nil),
|
||||
step: 0.01, min: 0.01, required: true %>
|
||||
|
||||
<%= f.label :notes, "Note interne (opzionale)" %>
|
||||
<%= f.label :notes, t("admin.billing_invoices.new.notes_label") %>
|
||||
<%= f.text_area :notes, rows: 2 %>
|
||||
|
||||
<p style="color:#666;font-size:0.9rem;margin-top:12px">
|
||||
Salva la bozza, poi carica il PDF e inviala al cliente dalla schermata successiva.
|
||||
<%= t("admin.billing_invoices.new.hint") %>
|
||||
</p>
|
||||
|
||||
<%= f.submit "Crea bozza fattura", class: "btn btn-primary" %>
|
||||
<%= f.submit t("admin.billing_invoices.new.submit"), class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p><%= link_to "← Pagamenti e fatture", admin_club_billing_invoices_path(@club) %></p>
|
||||
<p><%= link_to t("admin.billing_invoices.new.back"), admin_club_billing_invoices_path(@club) %></p>
|
||||
|
||||
Reference in New Issue
Block a user