do not show the expense which represents the actual reimbursement, and do not count it towards the total
This commit is contained in:
parent
93b0bff50b
commit
fc3a993547
|
@ -34,7 +34,7 @@
|
|||
<td>{{ reim.notes|default:"N/A" }}</td>
|
||||
<td>{{ reim.amount }} DKK</td>
|
||||
<td>{{ reim.paid }}</td>
|
||||
<td>{% for expense in reim.expenses.all %}{{ expense.pk }}<br>{% endfor %}</td>
|
||||
<td>{% for expense in reim.expenses.all %}{% if not expense.paid_by_bornhack %}{{ expense.pk }} - {{ expense.amount }} DKK - {{ expense.description }}<br>{% endif %}{% endfor %}</td>
|
||||
<td>
|
||||
<a class="btn btn-primary" href="{% url "backoffice:reimbursement_detail" camp_slug=camp.slug pk=reim.pk %}">Details</a>
|
||||
</td>
|
||||
|
|
|
@ -175,7 +175,7 @@ class Reimbursement(CampRelatedModel, UUIDModel):
|
|||
The total amount for a reimbursement is calculated by adding up the amounts for all the related expenses
|
||||
"""
|
||||
amount = 0
|
||||
for expense in self.expenses.all():
|
||||
for expense in self.expenses.filter(paid_by_bornhack=False):
|
||||
amount += expense.amount
|
||||
return amount
|
||||
|
||||
|
|
|
@ -3,17 +3,13 @@
|
|||
<div class="panel-body">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Amount</th>
|
||||
<th>Total Amount</th>
|
||||
<td>{{ reimbursement.amount }} DKK</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Economy Team Notes</th>
|
||||
<td>{{ reimbursement.notes|default:"N/A" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Total amount</th>
|
||||
<td>{{ reimbursement.amount }} DKK</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Paid</th>
|
||||
<td>{{ reimbursement.paid }}</td>
|
||||
|
|
Loading…
Reference in a new issue