{% extends 'timepiece/time-sheet/base.html' %}
{% load timepiece_tags %}
{% load url from future %}

{% block title %}Invoice Detail{% endblock %}

{% block content %}
    {% invoice_subheaders 'detail' %}
    {% include 'timepiece/time-sheet/invoice/_invoice_detail.html' %}

    {% if totals %}
        <h3>Totals</h3>
            <table>
                <tr>
                    <th>Activity Type</th>
                    <th>Total Hours</th>
                </tr>
                {% for name, hours_activities in totals %}
                    <tr class="ledger_header">
                        <th>{{ name|title }}</th>
                        <td class="hours"> {{ hours_activities.0 }} </td>
                    </tr>
                    {% for name, hours in hours_activities.1 %}
                        <tr>
                            <td class="nested">{{ name|title }}</td>
                            <td class="hours">{{ hours }} </td> 
                        </tr>
                    {% endfor %}
                {% endfor %}
            </table>
        <br />
    {% endif %}
{% endblock %}
