Files
Inv_web/templates/history.html
2026-07-19 00:00:11 +03:00

177 lines
3.7 KiB
HTML

{% extends "base.html" %}
{% block body_class %}page-bg bg-history{% endblock %}
{% block content %}
<style>
table.history-add-table {
width: 100%;
table-layout: fixed;
}
table.history-issue-table {
width: 100%;
table-layout: fixed;
}
table.history-order-table {
width: 100%;
table-layout: fixed;
}
table.history-add-table th,
table.history-add-table td,
table.history-issue-table th,
table.history-issue-table td,
table.history-order-table th,
table.history-order-table td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
<h3>История{% if filter_label %}: {{ filter_label }}{% endif %}</h3>
{% if filter_type == 'ADD' %}
<table class="table table-bordered table-sm history-add-table">
<colgroup>
<col style="width: 200px;">
<col style="width: 200px;">
<col style="width: 70px;">
<col style="width: 60px;">
<col style="width: 100px;">
</colgroup>
<tr>
<th>Штрихкод</th>
<th>Модель</th>
<th>Кол-во</th>
<th>Тип</th>
<th>Дата</th>
</tr>
{% for r in rows %}
<tr>
<td>{{ display_stock_barcode(r[2]) }}</td>
<td>{{ r[3] or '' }}</td>
<td>{{ r[4] }}</td>
<td>
{% if r[1] == 'ORDER' %}
Заказан
{% elif r[1] == 'ADD' %}
Приход
{% elif r[1] == 'ISSUE' %}
Выдан
{% else %}
{{ r[1] }}
{% endif %}
</td>
<td>{{ r[0].strftime('%Y-%m-%d') if r[0] else '' }}</td>
</tr>
{% endfor %}
</table>
{% elif filter_type == 'ISSUE' %}
<table class="table table-bordered table-sm history-issue-table">
<colgroup>
<col style="width: 200px;">
<col>
<col style="width: 70px;">
<col>
<col style="width: 60px;">
<col style="width: 80px;">
</colgroup>
<tr>
<th>Штрихкод</th>
<th>Модель</th>
<th>Кол-во</th>
<th>Кабинет</th>
<th>Тип</th>
<th>Дата</th>
</tr>
{% for r in rows %}
<tr>
<td>{{ display_stock_barcode(r[2]) }}</td>
<td>{{ r[3] or '' }}</td>
<td>{{ r[4] }}</td>
<td>{{ r[5] }}</td>
<td>
{% if r[1] == 'ORDER' %}
Заказан
{% elif r[1] == 'ADD' %}
Приход
{% elif r[1] == 'ISSUE' %}
Выдан
{% else %}
{{ r[1] }}
{% endif %}
</td>
<td>{{ r[0].strftime('%Y-%m-%d') if r[0] else '' }}</td>
</tr>
{% endfor %}
</table>
{% elif filter_type == 'ORDER' %}
<table class="table table-bordered table-sm history-order-table">
<colgroup>
<col style="width: 200px;">
<col>
<col style="width: 70px;">
<col style="width: 80px;">
<col style="width: 80px;">
</colgroup>
<tr>
<th>Штрихкод</th>
<th>Модель</th>
<th>Кол-во</th>
<th>Тип</th>
<th>Дата</th>
</tr>
{% for r in rows %}
<tr>
{% set order_barcode = display_stock_barcode(r[2]) %}
<td>{{ '—' if normalize_model_name(order_barcode) == normalize_model_name(r[3]) else order_barcode }}</td>
<td>{{ r[3] or '' }}</td>
<td>{{ r[4] }}</td>
<td>
{% if r[1] == 'ORDER' %}
Заказан
{% elif r[1] == 'ADD' %}
Приход
{% elif r[1] == 'ISSUE' %}
Выдан
{% else %}
{{ r[1] }}
{% endif %}
</td>
<td>{{ r[0].strftime('%Y-%m-%d') if r[0] else '' }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<table class="table table-bordered table-sm">
<tr>
<th>Дата</th>
<th>Тип</th>
<th>Штрихкод</th>
<th>Кол-во</th>
{% if filter_type not in ['ADD', 'ORDER'] %}
<th>Кабинет</th>
{% endif %}
</tr>
{% for r in rows %}
<tr>
<td>{{ r[0] }}</td>
<td>
{% if r[1] == 'ORDER' %}
Заказан
{% elif r[1] == 'ADD' %}
Приход
{% elif r[1] == 'ISSUE' %}
Выдан
{% else %}
{{ r[1] }}
{% endif %}
</td>
<td>{{ display_stock_barcode(r[2]) }}</td>
<td>{{ r[4] }}</td>
{% if filter_type not in ['ADD', 'ORDER'] %}
<td>{{ r[5] }}</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}