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

{% block title %}Invoice Hours for Time Sheet{% endblock %}

{% block content %}
  <h2>Invoice {{ project.name }} Hours {% if from_date %}from {{ from_date.date }} to {{ to_date.date }}{% else %}through {{ to_date.date }}{% endif %}</h2>
  <br />
  <form method="post">{% csrf_token %}
      <table class='vertical'>
        {{ invoice_form }}
        <tr>
          <td>&nbsp;</td>
          <td class='submit'>
            <input type='button' value='Cancel' onclick='history.go(-1)' />
            &nbsp;
            <input type='submit' name='submit' value='Create Invoice &rarr;' />
          </td>
        </tr>
      </table>
  </form>
<br />
{% if totals %}
<h3>Totals</h3>
    <table>
        <tr>
            <th>Activity Type</th>
            <th>Total Hours</th>
        </tr>
        {% for type, hours in totals %}
            <tr>
                <th>{{ type }}</th>
                <td class="hours"> {{ hours }} </td>
            </tr>
        {% endfor %}
    </table>
<br />
{% endif %}
<h3>Selected Entries</h3>
{% include 'timepiece/time-sheet/_weekly_entry_list.html' %}

{% endblock %}
