{% extends "books/report/base.tex" %}
{% load ledger %}

{% block packages %}
\usepackage{booktabs, graphics}
\newlfmP{busletter, orderfromdateto}

\addrfromskipbefore{10pt}
\dateskipbefore{16pt}
\dateskipafter{16pt}

{% if exchange.date_due %}
\speciala{ \textbf{ Due: {{exchange.date_due|date:"F jS, Y"}} } }{4}{3}
{% else %}
{% ifequal exchange.type.slug 'invoice' %}
\speciala{ \textbf{ Due: On Receipt } }{4}{3}
{% endifequal %}
{% endif %}

{% endblock %}

{% block content %}
	
\section{ {{exchange.memo|safe}} }

\begin{tabular}{rp{3.5in}rrr}
\toprule
Date & Description & Rate & Count & Amount (\$) \\
\midrule
{% for tran in exchange.transactions.all %}
{{tran.date|date:"m/d/y"}} & {{tran.memo|safe}} & {{tran.amount|currency}} & {{tran.quantity|currency}} & {{tran.total|currency}} \\
{% if not forloop.last %}
\addlinespace[0.075in]
{% endif %}
{% endfor %}
\midrule
\multicolumn{4}{r}{Total:} & {{exchange.total|currency}} \\
{% if show_project_balance %}
\addlinespace[0.05in]
\multicolumn{4}{r}{Previous Balance:} & {{exchange.previous_project_balance|currency}} \\
\addlinespace[0.05in]
\multicolumn{4}{r}{\bf{New Balance:}} & {{exchange.new_project_balance|currency}} \\
{% endif %}
\end{tabular}

{% endblock %}
