{% extends "books/report/report_base.html" %}
{% load ledger %}

{% block title %}
{{ exchange.date|date:"m-d-Y" }} {{ exchange.type.label }} for {{ exchange.business.name }}
{% endblock %}

{% block header %}{{ exchange.type.label }}{% endblock %}

{% block meta %}
<table id="report-meta-data">
	<tr>
		<th>{{ exchange.type.label }}:</th>
		<td>{{ exchange.id }}</td>
	</tr>
	<tr>
		<th>Date:</th>
		<td>{{ exchange.date|date:"m/d/Y" }}</td>
	</tr>
	<tr>
		<th>Date Due:</th>
		<td>{{ exchange.date_due|date:"m/d/Y"  }}</td>
	</tr>
</table>
{% endblock %}

{% block content %}
<table id="transactions">
	{% for tran in exchange.transactions.all %}
	<tr>
		<td>{{ tran.credit.number }}</td>
		<td>{{ tran.credit.name }}</td>
		<td class='dollars'>${{ tran.total|currency }}</td>
		<td>{{ tran.memo }}</td>
	</tr>
	{% endfor %}
	<tr>
		<td></td>
		<th>Subtotal</th>
		<td class='dollars'>${{ exchange.subtotal|currency }}</td>
		<td></td>
	</tr>
	<tr>
		<td></td>
		<th>Total</th>
		<td class='dollars'>${{ exchange.total|currency }}</td>
		<td></td>
	</tr>
</table>

{% endblock %}

