diff --git a/myproject/inventory/templates/inventory/writeoff_document/detail.html b/myproject/inventory/templates/inventory/writeoff_document/detail.html new file mode 100644 index 0000000..8015779 --- /dev/null +++ b/myproject/inventory/templates/inventory/writeoff_document/detail.html @@ -0,0 +1,209 @@ +{% extends 'base.html' %} + +{% block title %}Документ списания {{ document.document_number }}{% endblock %} + +{% block content %} +
+ + + + + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + +
+ +
+
+
+
+ {{ document.document_number }} + {% if document.status == 'draft' %} + Черновик + {% elif document.status == 'confirmed' %} + Проведён + {% elif document.status == 'cancelled' %} + Отменён + {% endif %} +
+ {% if document.can_edit %} +
+
+ {% csrf_token %} + +
+
+ {% csrf_token %} + +
+
+ {% endif %} +
+
+
+
+

Склад

+

{{ document.warehouse.name }}

+
+
+

Дата документа

+

{{ document.date|date:"d.m.Y" }}

+
+
+

Создан

+

{{ document.created_at|date:"d.m.Y H:i" }}

+
+
+ + {% if document.notes %} +
+

Примечания

+

{{ document.notes }}

+
+ {% endif %} + + {% if document.confirmed_at %} +
+
+

Проведён

+

{{ document.confirmed_at|date:"d.m.Y H:i" }}

+
+
+

Провёл

+

{% if document.confirmed_by %}{{ document.confirmed_by.username }}{% else %}-{% endif %}

+
+
+ {% endif %} +
+
+ + +
+
+
Позиции документа
+
+
+
+ + + + + + + + {% if document.can_edit %} + + {% endif %} + + + + {% for item in document.items.all %} + + + + + + {% if document.can_edit %} + + {% endif %} + + {% empty %} + + + + {% endfor %} + + {% if document.items.exists %} + + + + + + + + {% endif %} +
ТоварКоличествоПричинаПримечания
+ {{ item.product.name }} + {{ item.quantity }} + {{ item.get_reason_display }} + + {% if item.notes %}{{ item.notes|truncatechars:50 }}{% else %}-{% endif %} + +
+ {% csrf_token %} + +
+
+ + Позиций пока нет +
Итого:{{ document.total_quantity }}
+
+
+
+
+ + + {% if document.can_edit %} +
+
+
+
Добавить товар
+
+
+
+ {% csrf_token %} + +
+ + {{ item_form.product }} + {% if item_form.product.errors %} +
{{ item_form.product.errors.0 }}
+ {% endif %} +
+ +
+ + {{ item_form.quantity }} + {% if item_form.quantity.errors %} +
{{ item_form.quantity.errors.0 }}
+ {% endif %} +
+ +
+ + {{ item_form.reason }} +
+ +
+ + {{ item_form.notes }} +
+ + +
+
+
+
+ {% endif %} +
+
+{% endblock %} diff --git a/myproject/inventory/templates/inventory/writeoff_document/form.html b/myproject/inventory/templates/inventory/writeoff_document/form.html new file mode 100644 index 0000000..b22f8f1 --- /dev/null +++ b/myproject/inventory/templates/inventory/writeoff_document/form.html @@ -0,0 +1,62 @@ +{% extends 'base.html' %} + +{% block title %}Создать документ списания{% endblock %} + +{% block content %} +
+ + + +
+
+
+
+
+ Новый документ списания +
+
+
+
+ {% csrf_token %} + +
+ + {{ form.warehouse }} + {% if form.warehouse.errors %} +
{{ form.warehouse.errors.0 }}
+ {% endif %} +
+ +
+ + {{ form.date }} + {% if form.date.errors %} +
{{ form.date.errors.0 }}
+ {% endif %} +
+ +
+ + {{ form.notes }} +
+ +
+ + + Отмена + +
+
+
+
+
+
+
+{% endblock %} diff --git a/myproject/inventory/templates/inventory/writeoff_document/list.html b/myproject/inventory/templates/inventory/writeoff_document/list.html new file mode 100644 index 0000000..1c9a3df --- /dev/null +++ b/myproject/inventory/templates/inventory/writeoff_document/list.html @@ -0,0 +1,109 @@ +{% extends 'base.html' %} + +{% block title %}Документы списания{% endblock %} + +{% block content %} +
+ +
+

+ Документы списания +

+ + Создать документ + +
+ + + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + + +
+
+
+ + + + + + + + + + + + + + + {% for doc in documents %} + + + + + + + + + + + {% empty %} + + + + {% endfor %} + +
НомерДатаСкладСтатусПозицийКоличествоСоздал
+ + {{ doc.document_number }} + + {{ doc.date|date:"d.m.Y" }}{{ doc.warehouse.name }} + {% if doc.status == 'draft' %} + Черновик + {% elif doc.status == 'confirmed' %} + Проведён + {% elif doc.status == 'cancelled' %} + Отменён + {% endif %} + {{ doc.items.count }}{{ doc.total_quantity }} + {% if doc.created_by %}{{ doc.created_by.username }}{% else %}-{% endif %} + + + + +
+ + Документов списания пока нет +
+
+
+
+ + + {% if page_obj.has_other_pages %} + + {% endif %} +
+{% endblock %}