{% extends "report_base.html" %}
{% load ledger %}

{% block title %}
{{ project.name }} Statement
{% endblock %}

{% block header %}
{{ project.name }} Statement
{% endblock %}

{% block meta %}
<table id="report-meta-data">
	<tr>
		<th>Date:</th>
		<td>{% now "m/d/Y" %}</td>
	</tr>
</table>
{% endblock %}

{% block content %}


<table class="transactions">
	<tr><th colspan='3' style='text-align: center;'>Invoices</th></tr>	
	{% for tran in debits %}
	<tr>
		<td>{{ tran.exchange.date|date:"m/d/Y" }}</td>
		<td>{{ tran.memo }}</td>
		<td class='dollars'>${{ tran.total|currency }}</td>
	</tr>
	{% endfor %}
	<tr>
		<td></td>
		<th>Total</th>
		<td class='dollars'>${{ debit_total|currency }}</td>
	</tr>
	<tr><td colspan='3'>&nbsp;</td><tr>
	<tr><th colspan='3' style='text-align: center;'>Payments Received</th></tr>	
	{% for tran in credits %}
	<tr>
		<td>{{ tran.exchange.date|date:"m/d/Y" }}</td>
		<td>{{ tran.memo }}</td>
		<td class='dollars'>${{ tran.total|currency }}</td>
	</tr>
	{% endfor %}
	<tr>
		<td></td>
		<th>Total</th>
		<td class='dollars'>${{ credit_total|currency }}</td>
	</tr>
	<tr><td colspan='3'>&nbsp;</td><tr>
	<tr>
		<td></td>
		<th>Outstanding Balance</th>
		<td class='dollars'>${{ outstanding_balance|currency }}</td>
	</tr>
</table>
{% endblock %}