feat: add KS-3/payments, tech debt fixes, UI polish, and KS-2 Excel/Word export
Tasks 008-016: KS-6a journal, KS-3 documents, payments with allocations, tech debt cleanup, financial privacy, document tree, storno mechanism, row-click UI, BOQ collapse/sticky header, and KS-2 export to Excel/Word via shared DTO architecture.
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ 'Редактирование' if document else 'Создание' }} КС-3{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<nav class="mb-3">
|
||||
<a href="/projects/{{ project.id }}" class="btn btn-outline-secondary btn-sm">← К проекту</a>
|
||||
</nav>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>{{ 'Редактирование КС-3' if document else 'Создание КС-3' }}</h2>
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/projects/{{ project.id }}/ks3{% if document %}/{{ document.id }}/edit{% endif %}">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-3">
|
||||
<label for="number" class="form-label">Номер КС-3</label>
|
||||
<input type="text" class="form-control" id="number" name="number" required
|
||||
value="{{ document.number if document else '' }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="document_date" class="form-label">Дата</label>
|
||||
<input type="date" class="form-control" id="document_date" name="document_date" required
|
||||
value="{{ document.date.isoformat() if document else '' }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="reporting_period_from" class="form-label">Период с</label>
|
||||
<input type="date" class="form-control" id="reporting_period_from" name="reporting_period_from" required
|
||||
value="{{ document.reporting_period_from.isoformat() if document and document.reporting_period_from else '' }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="reporting_period_to" class="form-label">Период по</label>
|
||||
<input type="date" class="form-control" id="reporting_period_to" name="reporting_period_to" required
|
||||
value="{{ document.reporting_period_to.isoformat() if document and document.reporting_period_to else '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-12">
|
||||
<label for="comment" class="form-label">Комментарий</label>
|
||||
<input type="text" class="form-control" id="comment" name="comment"
|
||||
value="{{ document.comment if document and document.comment else '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Выберите проведённые КС-2</h4>
|
||||
|
||||
{% if available_ks2 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm" style="table-layout: fixed;">
|
||||
<colgroup>
|
||||
<col style="width: 40px">
|
||||
<col style="width: 100px">
|
||||
<col style="width: 90px">
|
||||
<col>
|
||||
<col style="width: 120px">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>№ КС-2</th>
|
||||
<th>Дата</th>
|
||||
<th>Период</th>
|
||||
<th class="text-end text-nowrap">Сумма</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in available_ks2 %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" class="form-check-input" name="ks2_ids"
|
||||
value="{{ item.id }}"
|
||||
{% if item.id in selected_ids %}checked{% endif %}>
|
||||
</td>
|
||||
<td>{{ item.number }}</td>
|
||||
<td>{{ item.date.strftime('%d.%m.%Y') }}</td>
|
||||
<td>{% if item.period_from and item.period_to %}{{ item.period_from.strftime('%d.%m.%Y') }} — {{ item.period_to.strftime('%d.%m.%Y') }}{% endif %}</td>
|
||||
<td class="text-end text-nowrap">{{ item.total | money }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">Нет проведённых КС-2 для выбора.</div>
|
||||
{% endif %}
|
||||
|
||||
<button type="submit" class="btn btn-primary">{{ 'Сохранить' if document else 'Создать' }}</button>
|
||||
<a href="/projects/{{ project.id }}/ks3{% if document %}/{{ document.id }}{% endif %}" class="btn btn-secondary">Отмена</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user