{% load currency_filters %}

<table class="table table-striped">
    <thead>
        <tr class="row">
            <th class="col-sm-2">Date</th>
            <th class="col-sm-2">Ref</th>
            <th class="col-sm-4">Detail</th>
            <th class="col-sm-2">Amount</th>
            <th class="text-right col-sm-2">Actions</th>
        </tr>
    </thead>
    <tbody>
        {% for paym in payments %}
        <tr class="row">
            <td class="col-sm-2">{{ paym.date_paid }}</td>
            <td class="col-sm-2">{{ paym.reference|default:"-" }}</td>
            <td class="col-sm-4">{{ paym.detail }}</td>
            <td class="col-sm-2">{{ paym.amount|currency }}</td>
            <td class="text-right col-sm-4">
                <a href="{% url 'books:payment-edit' paym.pk %}" class="btn btn-default btn-xs" role="button">Edit</a>
                <a href="{% url 'books:payment-delete' paym.pk %}" class="btn btn-danger btn-xs" role="button">Delete</a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
