Files
PyRIGS/RIGS/templates/item_table.html
2020-04-06 02:43:19 +01:00

57 lines
1.7 KiB
HTML

<div class="table-responsive">
<table class="table table-hover" id="item-table" {% if edit %}data-orderurl="{#% url 'item_order' %#}"{% endif %}>
<thead>
<tr>
<th scope="col">Item</th>
{% if perms.RIGS.view_event %}
<th scope="col">Price</th>
{% endif %}
<th scope="col">Quantity</th>
{% if perms.RIGS.view_event %}
<th scope="col">Sub-total</th>
{% endif %}
{% if edit %}
<th scope="col" class="text-right align-self-start">
<button type="button" class="btn btn-success btn-xs item-add"
data-toggle="modal"
data-target="#itemModal">
<i class="fas fa-plus"></i> Add Item
</button>
</th>
{% endif %}
</tr>
</thead>
<tbody id="item-table-body">
{% for item in object.items.all %}
{% include 'item_row.html' %}
{% endfor %}
</tbody>
{% if perms.RIGS.view_event %}
<tfoot>
<tr>
<td rowspan="3" colspan="2"></td>
<td>Total (ex. VAT)</td>
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
</tr>
<tr>
{% if not object.pk %}
<td id="vat-rate" data-rate="{{currentVAT.rate}}">VAT @
{{currentVAT.as_percent|floatformat}}% (TBC)</td>
{% else %}
<td id="vat-rate" data-rate="{{object.vat_rate.rate}}">VAT @
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
{% endif %}
<td colspan="2">£ <span id="vat">{{object.vat|default:0|floatformat:2}}</span></td>
</tr>
<tr>
<td>Total</td>
<td colspan="2">£ <span id="total">{{object.total|default:0|floatformat:2}}</span></td>
</tr>
</tfoot>
{% endif %}
</table>
</div>
<table class="hidden invisible">
{% include 'item_row.html' %}
</table>