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

{% block title %}Timepiece General Ledger{% endblock %}

{% block content %}
<h2>Timepiece General Ledger</h2>
<ul class='header-actions-left'>
    <li><a href="{% url timepiece-entries %}">Return to Time Sheet</a></li>
</ul>

{# {% ledger_date_filters %} #}

<form method="get" action="" id="date-filter" accept-charset="utf-8">
    <ul id='ledger-date-fieldlist'>
        {{ form.as_ul }}
        <li>
            <input type='submit' name='submit' value='Update' id='id_date_form_submit_btn'/>
        </li>
        <li>
            <input type='button' name='clear' value='Clear' id='id_date_form_clear_btn'/>
        </li>
    </ul>
</form>
<div style="float:left;padding:10px;">
<h3>Hours by Project</h3>

<br />
<table>
    {% for entry in project_totals %}
    <tr>
        <td><a href='{% url view_project entry.project__business__id,entry.project__id %}'>{{ entry.project__name }}</a></td>
        <td>{{ entry.hours|floatformat:2 }}</td>
    </tr>
    {% endfor %}
    <tr>
        <th colspan='2'>&nbsp;</th>
    </tr>
    <tr>
        <th>Total:</th>
        <td>{{ total_hours|floatformat:2 }}</td>
    </tr>
</table>
</div>
<div style="float:left;padding:10px;">
<h3>Hours by People</h3>
<br />
<table>
    {% for entry in people_totals %}
    <tr>
        <td>{{ entry.user__first_name}} {{ entry.user__last_name }}</td>
        <td>{{ entry.hours|floatformat:2 }}</td>
    </tr>
    {% endfor %}
    <tr>
        <th colspan='2'>&nbsp;</th>
    </tr>
</table>
</div>
{% endblock %}
