<div class="scenario-widget scenario-cashflow">
  <div class="scenario-widget__header">
    <span class="scenario-widget__location">{{ scenario.location }}, {{ scenario.country }}</span>
    <span class="scenario-widget__config">{{ t.scenario_cashflow_config_title | tformat(years=s.holdYears) }}</span>
  </div>
  <div class="scenario-widget__body">
    <div class="scenario-widget__table-wrap">
      <table class="scenario-widget__table">
        <thead>
          <tr>
            <th></th>
            {% for a in d.annuals %}
            <th class="text-right">{{ t.scenario_year_label }} {{ a.year }}</th>
            {% endfor %}
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>{{ t.scenario_revenue_label }}</td>
            {% for a in d.annuals %}
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(a.revenue) }}</td>
            {% endfor %}
          </tr>
          <tr>
            <td>EBITDA</td>
            {% for a in d.annuals %}
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(a.ebitda) }}</td>
            {% endfor %}
          </tr>
          <tr>
            <td>{{ t.scenario_debt_service_label }}</td>
            {% for a in d.annuals %}
            <td class="text-right mono">&euro;{{ "{:,.0f}".format(a.ds) }}</td>
            {% endfor %}
          </tr>
          <tr>
            <td><strong>{{ t.scenario_net_cashflow_label }}</strong></td>
            {% for a in d.annuals %}
            <td class="text-right mono"><strong>&euro;{{ "{:,.0f}".format(a.ncf) }}</strong></td>
            {% endfor %}
          </tr>
          <tr>
            <td>{{ t.scenario_cumulative_ncf_label }}</td>
            {% set cum = namespace(total=-d.capex) %}
            {% for a in d.annuals %}
            {% set cum.total = cum.total + a.ncf %}
            <td class="text-right mono {% if cum.total >= 0 %}text-accent{% else %}text-danger{% endif %}">&euro;{{ "{:,.0f}".format(cum.total) }}</td>
            {% endfor %}
          </tr>
        </tbody>
        <tfoot>
          <tr>
            <td>DSCR</td>
            {% for entry in d.dscr %}
            <td class="text-right mono">{{ "{:.2f}".format(entry.dscr) }}x</td>
            {% endfor %}
          </tr>
        </tfoot>
      </table>
    </div>
  </div>
  <div class="scenario-widget__cta">
    <a href="{{ url_for('planner.index') }}">{{ t.scenario_cta_try_numbers }}</a>
  </div>
</div>
