Billing Stripe, link regia mobile e staff solo trasmissione.
Aggiunge fatturazione club, pagina regia condivisibile senza account, roster squadre e rimuove la modalità controller dall'app (v1.1.0). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
23
backend/app/views/admin/billing_invoices/index.html.erb
Normal file
23
backend/app/views/admin/billing_invoices/index.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<h1>Fatture — <%= @club.name %></h1>
|
||||
<p><%= link_to "← Dashboard", admin_root_path %> · <%= link_to "Nuova fattura", new_admin_club_billing_invoice_path(@club), class: "btn btn-primary" %></p>
|
||||
|
||||
<% if @invoices.any? %>
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr><th>Numero</th><th>Data</th><th>Importo</th><th>Stato</th><th>PDF</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invoices.each do |inv| %>
|
||||
<tr>
|
||||
<td><%= inv.number %></td>
|
||||
<td><%= inv.issued_on %></td>
|
||||
<td><%= inv.formatted_amount %></td>
|
||||
<td><%= inv.status %></td>
|
||||
<td><%= inv.pdf.attached? ? "Sì" : "No" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>Nessuna fattura.</p>
|
||||
<% end %>
|
||||
36
backend/app/views/admin/billing_invoices/new.html.erb
Normal file
36
backend/app/views/admin/billing_invoices/new.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<h1>Nuova fattura Aruba — <%= @club.name %></h1>
|
||||
<p style="color:#666">Carica il PDF emesso da Aruba Fatture e collega il pagamento se disponibile.</p>
|
||||
|
||||
<div class="card">
|
||||
<%= form_with model: @invoice, url: admin_club_billing_invoices_path(@club), multipart: true do |f| %>
|
||||
<%= f.label :number, "Numero fattura" %>
|
||||
<%= f.text_field :number, required: true %>
|
||||
|
||||
<%= f.label :issued_on, "Data emissione" %>
|
||||
<%= f.date_field :issued_on, required: true %>
|
||||
|
||||
<%= label_tag :amount_euros, "Importo (€)" %>
|
||||
<%= number_field_tag "billing_invoice[amount_euros]", nil, step: 0.01, min: 0.01, required: true %>
|
||||
|
||||
<%= f.label :status, "Stato" %>
|
||||
<%= f.select :status, Billing::Invoice::STATUSES %>
|
||||
|
||||
<%= f.label :billing_payment_id, "Pagamento collegato (opzionale)" %>
|
||||
<%= f.collection_select :billing_payment_id, @club.billing_payments.recent, :id,
|
||||
->(p) { "#{p.paid_at&.to_date || p.created_at.to_date} — #{p.formatted_amount}" },
|
||||
{ include_blank: "Nessuno" } %>
|
||||
|
||||
<%= f.label :aruba_document_id, "ID documento Aruba (opzionale)" %>
|
||||
<%= f.text_field :aruba_document_id %>
|
||||
|
||||
<%= f.label :pdf, "PDF fattura" %>
|
||||
<%= f.file_field :pdf, accept: "application/pdf", required: true %>
|
||||
|
||||
<%= f.label :notes, "Note interne" %>
|
||||
<%= f.text_area :notes, rows: 2 %>
|
||||
|
||||
<%= f.submit "Registra fattura", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p><%= link_to "← Elenco fatture", admin_club_billing_invoices_path(@club) %></p>
|
||||
@@ -99,7 +99,10 @@
|
||||
<td><%= s.match.team.name %> vs <%= s.match.opponent_name %></td>
|
||||
<td><span class="badge badge--<%= s.status == 'live' ? 'live' : (s.status == 'paused' ? 'paused' : 'connecting') %>"><%= s.status %></span></td>
|
||||
<td class="muted"><%= s.started_at&.strftime("%d/%m %H:%M") || "—" %></td>
|
||||
<td><%= link_to "Dettaglio", admin_session_path(s) %></td>
|
||||
<td class="admin-actions">
|
||||
<%= link_to "Dettaglio", admin_session_path(s) %>
|
||||
<%= button_to "Termina", stop_admin_session_path(s), method: :post, class: "admin-btn admin-btn--danger admin-btn--sm", form: { data: { turbo_confirm: "Terminare questa sessione?" } } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<h2>Session <%= @session.id %></h2>
|
||||
<p>Status: <strong><%= @session.status %></strong></p>
|
||||
<% unless @session.terminal? %>
|
||||
<p>
|
||||
<%= button_to "Termina sessione",
|
||||
stop_admin_session_path(@session),
|
||||
method: :post,
|
||||
class: "admin-btn admin-btn--danger",
|
||||
form: { data: { turbo_confirm: "Terminare la trasmissione? Il path RTMP verrà rimosso e lo stato passerà a ended." } } %>
|
||||
</p>
|
||||
<% end %>
|
||||
<p>Match: <%= @session.match.team.name %> vs <%= @session.match.opponent_name %></p>
|
||||
<% if @session.youtube_broadcast_id %>
|
||||
<p>YouTube: <a href="https://studio.youtube.com/video/<%= @session.youtube_broadcast_id %>/livestreaming" target="_blank">Broadcast</a></p>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<h2><%= @team.name %></h2>
|
||||
<p>Sport: <%= @team.sport %></p>
|
||||
<% if @team.club %>
|
||||
<p>Società: <%= @team.club.name %> · <%= link_to "Fatture società", admin_club_billing_invoices_path(@team.club) %></p>
|
||||
<% end %>
|
||||
<p>YouTube: <%= @team.youtube_credential ? "Connesso" : link_to("Connetti", "/api/v1/teams/#{@team.id}/youtube/authorize") %></p>
|
||||
|
||||
<h3>Partite</h3>
|
||||
|
||||
Reference in New Issue
Block a user