Docs: начальная структура проекта
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
11
app/templates/documents/cash_doc_form.html
Normal file
11
app/templates/documents/cash_doc_form.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ title }} — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
<a href="{{ cancel_url|default:'#' }}" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
{% endblock %}
|
||||
35
app/templates/documents/cash_expense_list.html
Normal file
35
app/templates/documents/cash_expense_list.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Расходы денежных средств — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Расходы денежных средств</h2>
|
||||
<p><a href="{% url 'documents:cash_expense_create' %}" class="btn btn-primary">Создать</a></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер</th>
|
||||
<th>Отправитель</th>
|
||||
<th>Сумма</th>
|
||||
<th>Заказ поставщику</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in object_list %}
|
||||
<tr>
|
||||
<td>{{ obj.date }}</td>
|
||||
<td>{{ obj.number }}</td>
|
||||
<td>{{ obj.sender }}</td>
|
||||
<td>{{ obj.amount }}</td>
|
||||
<td>{{ obj.supplier_order|default:"—" }}</td>
|
||||
<td>
|
||||
<a href="{% url 'documents:cash_expense_edit' obj.pk %}">Изменить</a>
|
||||
| <a href="{% url 'documents:cash_expense_delete' obj.pk %}" class="text-danger">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6">Нет расходов.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
35
app/templates/documents/cash_inflow_list.html
Normal file
35
app/templates/documents/cash_inflow_list.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Поступления денежных средств — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Поступления денежных средств</h2>
|
||||
<p><a href="{% url 'documents:cash_inflow_create' %}" class="btn btn-primary">Создать</a></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер</th>
|
||||
<th>Получатель</th>
|
||||
<th>Сумма</th>
|
||||
<th>Заказ клиента</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in object_list %}
|
||||
<tr>
|
||||
<td>{{ obj.date }}</td>
|
||||
<td>{{ obj.number }}</td>
|
||||
<td>{{ obj.recipient }}</td>
|
||||
<td>{{ obj.amount }}</td>
|
||||
<td>{{ obj.customer_order|default:"—" }}</td>
|
||||
<td>
|
||||
<a href="{% url 'documents:cash_inflow_edit' obj.pk %}">Изменить</a>
|
||||
| <a href="{% url 'documents:cash_inflow_delete' obj.pk %}" class="text-danger">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6">Нет поступлений.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
35
app/templates/documents/cash_transfer_list.html
Normal file
35
app/templates/documents/cash_transfer_list.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Перемещения денежных средств — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Перемещения денежных средств</h2>
|
||||
<p><a href="{% url 'documents:cash_transfer_create' %}" class="btn btn-primary">Создать</a></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер</th>
|
||||
<th>Отправитель</th>
|
||||
<th>Получатель</th>
|
||||
<th>Сумма</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in object_list %}
|
||||
<tr>
|
||||
<td>{{ obj.date }}</td>
|
||||
<td>{{ obj.number }}</td>
|
||||
<td>{{ obj.sender }}</td>
|
||||
<td>{{ obj.recipient }}</td>
|
||||
<td>{{ obj.amount }}</td>
|
||||
<td>
|
||||
<a href="{% url 'documents:cash_transfer_edit' obj.pk %}">Изменить</a>
|
||||
| <a href="{% url 'documents:cash_transfer_delete' obj.pk %}" class="text-danger">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6">Нет перемещений.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
11
app/templates/documents/confirm_delete.html
Normal file
11
app/templates/documents/confirm_delete.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Удалить — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Удалить запись?</h2>
|
||||
<p>{{ object }}</p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger">Удалить</button>
|
||||
<a href="{{ request.META.HTTP_REFERER|default:'/' }}" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
{% endblock %}
|
||||
37
app/templates/documents/customer_order_list.html
Normal file
37
app/templates/documents/customer_order_list.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Заказы клиентов — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Заказы клиентов</h2>
|
||||
<p><a href="{% url 'documents:customer_order_create' %}" class="btn btn-primary">Создать заказ</a></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер</th>
|
||||
<th>Вид заказа</th>
|
||||
<th>Организация</th>
|
||||
<th>Клиент</th>
|
||||
<th>Стоимость заказа</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in object_list %}
|
||||
<tr>
|
||||
<td>{{ obj.date }}</td>
|
||||
<td>{{ obj.number }}</td>
|
||||
<td>{{ obj.order_kind }}</td>
|
||||
<td>{{ obj.organization }}</td>
|
||||
<td>{{ obj.client }}</td>
|
||||
<td>{{ obj.total_amount }}</td>
|
||||
<td>
|
||||
<a href="{% url 'documents:customer_order_edit' obj.pk %}">Изменить</a>
|
||||
| <a href="{% url 'documents:customer_order_delete' obj.pk %}" class="text-danger">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="7">Нет заказов.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
48
app/templates/documents/order_form.html
Normal file
48
app/templates/documents/order_form.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ title }} — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<h3>Товары</h3>
|
||||
{{ formset.management_form }}
|
||||
<table class="table" id="order-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Товар</th>
|
||||
<th>Цена</th>
|
||||
<th>Валюта</th>
|
||||
<th>Количество</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Удалить</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for f in formset %}
|
||||
<tr class="item-row">
|
||||
<td>{{ f.id }}{{ f.product }}</td>
|
||||
<td>{{ f.price }}</td>
|
||||
<td>{{ f.currency }}</td>
|
||||
<td>{{ f.quantity }}</td>
|
||||
<td class="row-amount">—</td>
|
||||
<td>{% if f.DELETE %}{{ f.DELETE }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
<a href="{% url 'documents:customer_order_list' %}" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
document.querySelector('form').addEventListener('input', function() {
|
||||
document.querySelectorAll('#order-items .item-row').forEach(function(row) {
|
||||
var price = parseFloat(row.querySelector('input[name$="-price"]')?.value) || 0;
|
||||
var qty = parseFloat(row.querySelector('input[name$="-quantity"]')?.value) || 0;
|
||||
row.querySelector('.row-amount').textContent = (price * qty).toFixed(2);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
46
app/templates/documents/supplier_order_form.html
Normal file
46
app/templates/documents/supplier_order_form.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ title }} — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<h3>Товары</h3>
|
||||
{{ formset.management_form }}
|
||||
<table class="table" id="supplier-order-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Товар</th>
|
||||
<th>Цена</th>
|
||||
<th>Валюта</th>
|
||||
<th>Количество</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Удалить</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for f in formset %}
|
||||
<tr class="item-row">
|
||||
<td>{{ f.id }}{{ f.product }}</td>
|
||||
<td>{{ f.price }}</td>
|
||||
<td>{{ f.currency }}</td>
|
||||
<td>{{ f.quantity }}</td>
|
||||
<td class="row-amount">—</td>
|
||||
<td>{% if f.DELETE %}{{ f.DELETE }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||||
<a href="{% url 'documents:supplier_order_list' %}" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
<script>
|
||||
document.querySelector('form').addEventListener('input', function() {
|
||||
document.querySelectorAll('#supplier-order-items .item-row').forEach(function(row) {
|
||||
var price = parseFloat(row.querySelector('input[name$=\"-price\"]')?.value) || 0;
|
||||
var qty = parseFloat(row.querySelector('input[name$=\"-quantity\"]')?.value) || 0;
|
||||
row.querySelector('.row-amount').textContent = (price * qty).toFixed(2);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
37
app/templates/documents/supplier_order_list.html
Normal file
37
app/templates/documents/supplier_order_list.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Заказы поставщику — ERP WaterSurf{% endblock %}
|
||||
{% block content %}
|
||||
<h2>Заказы поставщику</h2>
|
||||
<p><a href="{% url 'documents:supplier_order_create' %}" class="btn btn-primary">Создать заказ</a></p>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер</th>
|
||||
<th>Организация</th>
|
||||
<th>Поставщик</th>
|
||||
<th>Стоимость в валюте</th>
|
||||
<th>Стоимость заказа</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for obj in object_list %}
|
||||
<tr>
|
||||
<td>{{ obj.date }}</td>
|
||||
<td>{{ obj.number }}</td>
|
||||
<td>{{ obj.organization }}</td>
|
||||
<td>{{ obj.supplier }}</td>
|
||||
<td>{{ obj.total_in_currency }}</td>
|
||||
<td>{{ obj.total_amount }}</td>
|
||||
<td>
|
||||
<a href="{% url 'documents:supplier_order_edit' obj.pk %}">Изменить</a>
|
||||
| <a href="{% url 'documents:supplier_order_delete' obj.pk %}" class="text-danger">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="7">Нет заказов.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user