Добавлено разделение типов поступлений на склад
- Добавлено поле receipt_type в модель IncomingBatch с типами: supplier, inventory, adjustment - Исправлен баг в InventoryProcessor: теперь корректно создается IncomingBatch при инвентаризации - Создан IncomingAdjustmentCreateView для оприходования без инвентаризации - Обновлены формы, шаблоны и админка для поддержки разных типов поступлений - Добавлена навигация и URL для оприходования - Тип поступления отображается в списках приходов и партий
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:warehouse-list' %}">Склады</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:incoming-list' %}">Приходы</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:incoming-create' %}">Поступление товара</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:incoming-adjustment-create' %}">Оприходование</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:sale-list' %}">Продажи</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:inventory-list' %}">Инвентаризация</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'inventory:writeoff-list' %}">Списания</a></li>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% extends 'inventory/base_inventory_minimal.html' %}
|
||||
{% load inventory_filters %}
|
||||
{% block inventory_title %}Массовое поступление товара{% endblock %}
|
||||
{% block inventory_title %}{% if is_adjustment %}Оприходование товара{% else %}Массовое поступление товара{% endif %}{% endblock %}
|
||||
{% block breadcrumb_current %}Приходы{% endblock %}
|
||||
{% block inventory_content %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="mb-0">Поступление товара от поставщика</h4>
|
||||
<h4 class="mb-0">{% if is_adjustment %}Оприходование товара{% else %}Поступление товара от поставщика{% endif %}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Ошибки общей формы -->
|
||||
@@ -48,6 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not is_adjustment %}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ form.supplier_name.label }}</label>
|
||||
{{ form.supplier_name }}
|
||||
@@ -55,6 +56,9 @@
|
||||
<div class="text-danger small">{{ form.supplier_name.errors.0 }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ form.receipt_type }}
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ form.notes.label }}</label>
|
||||
@@ -120,7 +124,7 @@
|
||||
<!-- ============== КНОПКИ ============== -->
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary" id="submitBtn">
|
||||
<i class="bi bi-check-circle"></i> Создать поступление
|
||||
<i class="bi bi-check-circle"></i> {% if is_adjustment %}Создать оприходование{% else %}Создать поступление{% endif %}
|
||||
</button>
|
||||
<a href="{% url 'inventory:incoming-list' %}" class="btn btn-secondary">
|
||||
<i class="bi bi-x-circle"></i> Отмена
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<tr>
|
||||
<th>Товар</th>
|
||||
<th>Склад</th>
|
||||
<th>Тип</th>
|
||||
<th>Количество</th>
|
||||
<th>Цена закупки</th>
|
||||
<th>Номер документа</th>
|
||||
@@ -34,6 +35,11 @@
|
||||
<tr>
|
||||
<td><strong>{{ incoming.product.name }}</strong></td>
|
||||
<td>{{ incoming.batch.warehouse.name }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{% if incoming.batch.receipt_type == 'supplier' %}primary{% elif incoming.batch.receipt_type == 'inventory' %}info{% else %}success{% endif %}">
|
||||
{{ incoming.batch.get_receipt_type_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ incoming.quantity|smart_quantity }} шт</td>
|
||||
<td>{{ incoming.cost_price }} руб.</td>
|
||||
<td>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<tr>
|
||||
<th>Номер документа</th>
|
||||
<th>Склад</th>
|
||||
<th>Тип</th>
|
||||
<th>Поставщик</th>
|
||||
<th>Товары</th>
|
||||
<th>Кол-во</th>
|
||||
@@ -31,6 +32,11 @@
|
||||
<tr>
|
||||
<td><strong>{{ batch.document_number }}</strong></td>
|
||||
<td>{{ batch.warehouse.name }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{% if batch.receipt_type == 'supplier' %}primary{% elif batch.receipt_type == 'inventory' %}info{% else %}success{% endif %}">
|
||||
{{ batch.get_receipt_type_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ batch.supplier_name|default:"—" }}</td>
|
||||
<td>
|
||||
<small>
|
||||
|
||||
Reference in New Issue
Block a user