Files
work-volume-tracker/app/templates/payments/form.html
T
Арсентьев Александр 9cfb341774 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.
2026-09-27 13:38:45 +03:00

92 lines
4.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}{{ 'Редактирование' if payment else 'Новый' }} платёж — {{ project.name }}{% endblock %}
{% block content %}
<div class="container mt-4">
<nav class="mb-3">
<a href="/projects/{{ project.id }}" class="btn btn-outline-secondary btn-sm">&larr; К проекту</a>
</nav>
<h2>{{ 'Редактирование платежа' if payment else 'Новый платёж' }}</h2>
{% if error %}
<div class="alert alert-danger" role="alert">{{ error }}</div>
{% endif %}
<form method="post" action="/projects/{{ project.id }}/payments{% if payment %}/{{ payment.id }}/edit{% endif %}">
<div class="row mb-3">
<div class="col-md-3">
<label for="payment_date" class="form-label">Дата</label>
<input type="date" class="form-control" id="payment_date" name="payment_date" required
value="{{ payment.date.isoformat() if payment else '' }}">
</div>
<div class="col-md-3">
<label for="document_number" class="form-label">Номер документа</label>
<input type="text" class="form-control" id="document_number" name="document_number"
value="{{ payment.document_number if payment and payment.document_number else '' }}">
</div>
<div class="col-md-3">
<label for="amount" class="form-label">Сумма</label>
<input type="number" class="form-control" id="amount" name="amount" required min="0.01" step="0.01"
value="{{ payment.amount if payment else '' }}">
</div>
<div class="col-md-3">
<label for="currency" class="form-label">Валюта</label>
<input type="text" class="form-control" id="currency" name="currency" required
value="{{ payment.currency if payment else 'RUB' }}">
</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="{{ payment.comment if payment and payment.comment else '' }}">
</div>
</div>
<h4>Распределение по КС-3</h4>
<p class="text-muted">Укажите суммы распределения. Можно оставить пустым.</p>
{% if available_ks3 %}
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>№ КС-3</th>
<th>Дата</th>
<th>Период</th>
<th class="text-end text-nowrap">Сумма КС-3</th>
<th class="text-end text-nowrap">Оплачено</th>
<th class="text-end text-nowrap">Остаток</th>
<th>Распределить</th>
</tr>
</thead>
<tbody>
{% for item in available_ks3 %}
<tr>
<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>
<td class="text-end text-nowrap">{{ item.paid | money }}</td>
<td class="text-end text-nowrap">{{ item.outstanding | money }}</td>
<td style="min-width: 120px">
<input type="number" class="form-control form-control-sm" name="alloc_{{ item.id }}"
min="0" step="0.01" placeholder="0.00"
value="{{ current_allocs.get(item.id, '') if current_allocs else '' }}">
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-info">Нет проведённых КС-3 для распределения.</div>
{% endif %}
<button type="submit" class="btn btn-primary">{{ 'Сохранить' if payment else 'Создать' }}</button>
<a href="/projects/{{ project.id }}/payments{% if payment %}/{{ payment.id }}{% endif %}" class="btn btn-secondary">Отмена</a>
</form>
</div>
{% endblock %}