{#- Win Rates export (A4 landscape, dompdf) - same matrix as the event page's Win Rates tab. -#} {%- macro wr_cell(c) -%} {%- if not c.offered -%} — {%- elseif c.settled == 0 -%} No settled bets {%- else -%} {%- set p = c.payoutRate -%} {%- set tone = p is null ? '' : (p > 100 ? 'red' : (p < 100 ? 'green' : '')) -%}
{{ p is null ? '—' : p|number_format(1) ~ '%' }}
Win {{ c.winRate|number_format(1) }}% · {{ c.won }}/{{ c.settled }}
₱{{ c.payout|number_format(0) }} / ₱{{ c.stake|number_format(0) }}
{%- endif -%} {%- endmacro -%} {%- import _self as wr -%}

Win Rates — {{ event.management.name }}

Event date: {{ event.eventDate|date('F j, Y') }}  |  Races: {{ races|length }}  |  Generated: {{ generatedAt|date('F j, Y g:i A') }}

Payout % (large) = amount paid out ÷ amount staked on settled tickets — red over 100% (the house lost), green under 100% (the house won). Win % = winning tickets ÷ settled tickets (a boxed ticket counts once). Last line: payout / stake (₱, rounded). Settled bets only (won + lost), test accounts excluded; multi-race bets count under their last leg's race.

{% if winRateMatrix.columns is empty or races is empty %}

{{ races is empty ? 'No races added yet.' : 'No bet types offered on this event yet.' }}

{% else %} {% for col in winRateMatrix.columns %} {% endfor %} {% for row in winRateMatrix.rows %} {% for col in winRateMatrix.columns %} {% endfor %} {% endfor %} {% for col in winRateMatrix.columns %} {% endfor %}
Race{{ col.label }}All bet types
{{ row.label }}{{ wr.wr_cell(row.cells[col.key]) }}{{ wr.wr_cell(row.all) }}
Total{{ wr.wr_cell(winRateMatrix.totals[col.key]) }}{{ wr.wr_cell(winRateMatrix.grandTotal) }}
{% endif %}