Feature: компактные формы поступления, перемещения, расхода денежных средств
Made-with: Cursor
This commit is contained in:
10
HISTORY.md
10
HISTORY.md
@@ -1,5 +1,15 @@
|
|||||||
# История изменений ERP WaterSurf
|
# История изменений ERP WaterSurf
|
||||||
|
|
||||||
|
## 2025-02-25 22:00 UTC – Компактные формы денежных документов (поступление, перемещение, расход)
|
||||||
|
|
||||||
|
**Проблема**: Формы поступления, перемещения и расхода денежных средств выводили все поля списком с подписями сверху.
|
||||||
|
|
||||||
|
**Решение**: Общий шаблон cash_doc_form.html переведён на компактную раскладку по образцу заказов: первая строка — Дата и Номер (подпись слева от поля, 10 и 15 символов), остальные поля — парами в одну строку в две колонки (подпись слева). Добавлены виджеты даты/номера в CashInflowForm, CashTransferForm, CashExpenseForm.
|
||||||
|
|
||||||
|
**Изменения**: documents/forms.py (виджеты date/number в трёх формах), documents/cash_doc_form.html (компактная разметка с ws-form-compact).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 2025-02-25 21:45 UTC – Подписи полей слева от полей в одну строку
|
## 2025-02-25 21:45 UTC – Подписи полей слева от полей в одну строку
|
||||||
|
|
||||||
**Проблема**: Подписи полей в формах заказов были расположены над полями ввода.
|
**Проблема**: Подписи полей в формах заказов были расположены над полями ввода.
|
||||||
|
|||||||
@@ -73,15 +73,27 @@ class CashInflowForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = CashInflow
|
model = CashInflow
|
||||||
fields = ("date", "number", "recipient", "amount", "customer_order", "comment", "author")
|
fields = ("date", "number", "recipient", "amount", "customer_order", "comment", "author")
|
||||||
|
widgets = {
|
||||||
|
"date": forms.DateInput(attrs={"size": 10}),
|
||||||
|
"number": forms.TextInput(attrs={"size": 15, "maxlength": 15}),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class CashTransferForm(forms.ModelForm):
|
class CashTransferForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = CashTransfer
|
model = CashTransfer
|
||||||
fields = ("date", "number", "sender", "recipient", "amount", "comment", "author")
|
fields = ("date", "number", "sender", "recipient", "amount", "comment", "author")
|
||||||
|
widgets = {
|
||||||
|
"date": forms.DateInput(attrs={"size": 10}),
|
||||||
|
"number": forms.TextInput(attrs={"size": 15, "maxlength": 15}),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class CashExpenseForm(forms.ModelForm):
|
class CashExpenseForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = CashExpense
|
model = CashExpense
|
||||||
fields = ("date", "number", "sender", "amount", "supplier_order", "comment", "author")
|
fields = ("date", "number", "sender", "amount", "supplier_order", "comment", "author")
|
||||||
|
widgets = {
|
||||||
|
"date": forms.DateInput(attrs={"size": 10}),
|
||||||
|
"number": forms.TextInput(attrs={"size": 15, "maxlength": 15}),
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,15 +3,31 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="ws-card">
|
<div class="ws-card">
|
||||||
<h2 class="ws-page-title">{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
|
<h2 class="ws-page-title">{% if object %}Редактировать{% else %}Создать{% endif %} {{ title }}</h2>
|
||||||
<form method="post" class="ws-form-card">
|
<form method="post" class="ws-form-card ws-form-compact">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% for field in form %}
|
<div class="ws-form-row ws-form-row-date-number">
|
||||||
<div class="ws-form-group">
|
<div class="ws-form-group ws-field-date">
|
||||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
<label for="{{ form.date.id_for_label }}">{{ form.date.label }}</label>
|
||||||
{{ field }}
|
{{ form.date }}
|
||||||
{% if field.errors %}<small class="ws-text-danger">{{ field.errors.0 }}</small>{% endif %}
|
{% if form.date.errors %}<small class="ws-text-danger">{{ form.date.errors.0 }}</small>{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="ws-form-group ws-field-number">
|
||||||
|
<label for="{{ form.number.id_for_label }}">{{ form.number.label }}</label>
|
||||||
|
{{ form.number }}
|
||||||
|
{% if form.number.errors %}<small class="ws-text-danger">{{ form.number.errors.0 }}</small>{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ws-form-row ws-form-row-2">
|
||||||
|
{% for field in form %}
|
||||||
|
{% if field.name != 'date' and field.name != 'number' %}
|
||||||
|
<div class="ws-form-group">
|
||||||
|
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||||
|
{{ field }}
|
||||||
|
{% if field.errors %}<small class="ws-text-danger">{{ field.errors.0 }}</small>{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
|
||||||
<div class="ws-btn-group" style="margin-top: 1.25rem;">
|
<div class="ws-btn-group" style="margin-top: 1.25rem;">
|
||||||
<button type="submit" class="btn btn-ws-primary">Сохранить</button>
|
<button type="submit" class="btn btn-ws-primary">Сохранить</button>
|
||||||
<a href="{{ cancel_url|default:'#' }}" class="btn btn-ws-secondary">Отмена</a>
|
<a href="{{ cancel_url|default:'#' }}" class="btn btn-ws-secondary">Отмена</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user