bornhack-website/src/economy/templates/includes/expense_list_panel.html

69 lines
2.6 KiB
HTML

{% if expense_list %}
<table class="table table-hover">
<thead>
<tr>
<th>Invoice Date</th>
<th>Created By</th>
{% if not reimbursement %}
<th>Paid by</th>
{% endif %}
<th>Creditor</th>
<th>Amount</th>
<th>Description</th>
<th>Responsible Team</th>
{% if not reimbursement %}
<th>Approved</th>
<th>Reimbursement</th>
{% endif %}
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for expense in expense_list %}
<tr>
<td>{{ expense.invoice_date }}</td>
<td>{{ expense.user }}</td>
{% if not reimbursement %}
<td>{% if expense.paid_by_bornhack %}BornHack{% else %}{{ expense.user }}{% endif %}</td>
{% endif %}
<td>{{ expense.creditor.name }}</td>
<td>{{ expense.amount }} DKK</td>
<td>{{ expense.description }}</td>
<td>{{ expense.responsible_team.name }} Team</td>
{% if not reimbursement %}
<td>{{ expense.approval_status }}</td>
<td>
{% if expense.reimbursement and not expense.paid_by_bornhack %}
{% if request.resolver_match.app_name == "backoffice" %}
<a href="{% url 'backoffice:reimbursement_detail' camp_slug=camp.slug pk=expense.reimbursement.pk %}" class="btn btn-primary"><i class="fas fa-search"></i> Details</a>
{% else %}
<a href="{% url 'economy:reimbursement_detail' camp_slug=camp.slug pk=expense.reimbursement.pk %}" class="btn btn-primary"><i class="fas fa-search"></i> Details</a>
{% endif %}
{% else %}
N/A
{% endif %}
</td>
{% endif %}
<td>
{% if request.resolver_match.app_name == "backoffice" %}
<a class="btn btn-primary" href="{% url 'backoffice:expense_detail' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-search"></i> Details</a>
{% if request.user.is_staff %}
<a class="btn btn-primary" href="{% url 'admin:index' %}economy/expense/{{ expense.uuid }}/change/"><i class="fas fa-edit"></i> Admin</a>
{% endif %}
{% else %}
<a class="btn btn-primary" href="{% url 'economy:expense_detail' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-search"></i> Details</a>
<a class="btn btn-primary" href="{% url 'economy:expense_update' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-edit"></i> Update</a>
<a class="btn btn-danger" href="{% url 'economy:expense_delete' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-times"></i> Delete</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>No expenses found.</h4>
{% endif %}