My Payouts

<% if @events.any? %>
<% @events.each do |event| %>

<%= event.name %>

Date: <%= event.start_time.strftime('%B %d, %Y at %I:%M %p') %>

Status: <%= event.payout_status.humanize %>

<% if event.earnings.pending.any? %>

Gross: €<%= (event.total_earnings_cents / 100.0).round(2) %>

Fees (10%): €<%= (event.total_fees_cents / 100.0).round(2) %>

Net: €<%= (event.net_earnings_cents / 100.0).round(2) %>

<% if event.can_request_payout? %> <%= button_to "Request Payout", promoter_payouts_path(event_id: event.id), method: :post, class: "w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %> <% else %>

Payout not available yet

<% end %> <% else %>

No pending earnings

<% end %>
<% end %>
<% else %>

No events found

You haven't created any events yet.

<%= link_to "Create Event", new_promoter_event_path, class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" %>
<% end %>