<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title"><i class="fa fa-shopping-cart"></i> {{ heading_title }}</h3>
  </div>
  <div class="table-responsive">
    <table class="table table-bordered">
      <thead>
        <tr>
          <th>Stock Status</th>
          <th>Product Count</th>
        </tr>
      </thead>
      <tbody>
      {% set grand_total = 0 %}
      {% for row in stock_status_summary %}
      {% set grand_total = grand_total + row.total %}
      <tr>
        <td>{{ row.stock_status }}</td>
        <td>{{ row.total }}</td>
      </tr>
      {% else %}
      <tr><td colspan="2">No data available</td></tr>
      {% endfor %}
      
      {% if stock_status_summary %}
      <tr>
        <td><strong>Total</strong></td>
        <td><strong>{{ grand_total }}</strong></td>
      </tr>
      {% endif %}
    </tbody>
    </table>
  </div>
</div>