Files
nikolark b5c9094b64 ✨ Add user register mutation
🔥 Remove a bunch of legacy code
2022-02-19 15:26:30 +01:00

72 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% block active_inventory %}active{% endblock %}
{% block content %}
<section id="inventory" class="row">
<div class="row">
<div class="col-md-7">
<h2>Varebeholdning</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Vare</th>
<th>Beholdning</th>
<th>Innkjøpspris</th>
<th>Verdi</th>
<th>I salg</th>
<th>Sist oppdatert</th>
</tr>
</thead>
<tbody>
{% for product in products %}
<tr class="{% if not product.active %}info inactive{% elif product.inventory_amount <= 0 %}warning{% else %}success{% endif %}">
<td>{{ product.name }}</td>
<td class="product-amount">{{ product.inventory_amount }}</td>
<td>{{ product.wholesale_unit_price|default:"-" }}</td>
<td>{{ product.wholesale_value|default:"-" }}</td>
<td class="product-active">{% if product.active %}<i class="glyphicon glyphicon-ok"></i>{% endif %}</td>
<td>{{ product.updated|date:"c" }}</td>
</tr>
{% endfor %}
<tr>
<td>Sum</td>
<td>{{ num_products }}</td>
<td></td>
<td>{{ wholesale_value }}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-5">
<h2>Varetransaksjoner</h2>
<div class="text-right">
<a href="{% url 'inventory-add' %}" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Sett inn varer</a>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>Når</th>
<th>Hva</th>
<th>Antall</th>
<th>Hvem</th>
</tr>
</thead>
<tbody>
{% for t in transactions %}
<tr>
<td>{{ t.created }}</td>
<td>{{ t.product }}</td>
<td>{{ t.amount }}</td>
<td>{% if t.user.profile.image %}<img src="{{ t.user.profile.image }}" class="customer" title="{{ t.user.first_name }} {{ t.user.last_name|slice:":1"}}" />{% else %}{{ t.user.first_name }} {{ t.user.last_name|slice:":1"}}{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</section>
{% endblock %}