{% extends 'dashboard/layout.html' %}
{% load currency_filters %}

{% block title %}
Datacash transactions | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
        <a href="{% url dashboard:index %}">Dashboard</a>
        <span class="divider">/</span>
    </li>
    <li class="active"><a href=".">Datacash transactions</a></li>
</ul>
{% endblock %}

{% block dashboard_content %}

<div class="sub-header">
    <h2>Datacash transactions</h2>
</div>

<table class="table table-striped table-bordered">
	<thead>
		<tr>
			<th>Order number</th>
			<th>Method</th>
			<th>Amount</th>
			<th>Merchant reference</th>
			<th>Datacash reference</th>
			<th>Auth code</th>
			<th>Status</th>
			<th>Reason</th>
			<th>Date</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
    {% for txn in transactions %}
    <tr>
        <td>{{ txn.order_number }}</td>
        <td>{{ txn.method }}</td>
        <td>{{ txn.amount|currency }}</td>
        <td>{{ txn.merchant_reference }}</td>
        <td>{{ txn.datacash_reference }}</td>
        <td>{{ txn.auth_code }}</td>
        <td>{{ txn.status }}</td>
        <td>{{ txn.reason }}</td>
        <td>{{ txn.date_created }}</td>
		<td>
			<a href="{% url datacash-transaction-detail txn.pk %}" class="btn btn-info">View</a>
		</td>
    </tr>
    {% endfor %}
	</tbody>
</table>

{% if page_obj %}
    {% include "catalogue/partials/pagination.html" %}
{% endif %}
</form>

{% endblock dashboard_content %}