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:
+27
-2
@@ -4,11 +4,36 @@
|
||||
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}Work Volume Tracker{% endblock %}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.money-value { transition: filter 0.15s; }
|
||||
.money-hidden .money-value { filter: blur(6px); user-select: none; pointer-events: none; }
|
||||
.clickable-row { cursor: pointer; }
|
||||
.clickable-row:hover { background-color: rgba(0,0,0,0.04); }
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<body class="bg-light money-hidden">
|
||||
<main class="container py-4">
|
||||
<div class="d-flex justify-content-end mb-2">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" id="toggleMoney" title="Показать/скрыть финансовые суммы" aria-label="Показать или скрыть финансовые суммы">👁</button>
|
||||
</div>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
var btn = document.getElementById('toggleMoney');
|
||||
if (btn) btn.addEventListener('click', function() {
|
||||
document.body.classList.toggle('money-hidden');
|
||||
});
|
||||
|
||||
document.querySelectorAll('.clickable-row').forEach(function(row) {
|
||||
row.addEventListener('click', function(e) {
|
||||
if (e.target.closest('a, button, form, input, select, textarea')) return;
|
||||
var url = row.dataset.url;
|
||||
if (url) window.location.href = url;
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<tr class="clickable-row" data-url="/projects/{{ project.id }}/ks2/{{ row.document.id }}">
|
||||
<td>{{ row.document.number }}</td>
|
||||
<td>{{ row.document.date.strftime('%d.%m.%Y') }}{% if row.document.reporting_period_from and row.document.reporting_period_to %}<br><small class="text-muted">{{ row.document.reporting_period_from.strftime('%d.%m.%Y') }} — {{ row.document.reporting_period_to.strftime('%d.%m.%Y') }}</small>{% endif %}</td>
|
||||
<td>
|
||||
@@ -36,7 +36,7 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ row.item_count }}</td>
|
||||
<td class="text-end text-nowrap">{{ row.amount | money }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.amount | money }}</td>
|
||||
<td>
|
||||
<a href="/projects/{{ project.id }}/ks2/{{ row.document.id }}" class="btn btn-sm btn-outline-primary">Просмотр</a>
|
||||
</td>
|
||||
|
||||
+37
-12
@@ -15,9 +15,13 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<p><strong>Статус:</strong>
|
||||
<span class="badge bg-{{ 'success' if document.status == 'issued' else 'secondary' }}">
|
||||
{{ 'Проведён' if document.status == 'issued' else 'Черновик' }}
|
||||
</span>
|
||||
{% if document.status == 'cancelled' %}
|
||||
<span class="badge bg-danger">Сторнирован</span>
|
||||
{% elif document.status == 'issued' %}
|
||||
<span class="badge bg-success">Проведён</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Черновик</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if document.reporting_period_from and document.reporting_period_to %}
|
||||
<p><strong>Период:</strong> {{ document.reporting_period_from.strftime('%d.%m.%Y') }} — {{ document.reporting_period_to.strftime('%d.%m.%Y') }}</p>
|
||||
@@ -25,9 +29,32 @@
|
||||
{% if document.comment %}
|
||||
<p><strong>Комментарий:</strong> {{ document.comment }}</p>
|
||||
{% endif %}
|
||||
<div class="mt-2">
|
||||
<a href="/projects/{{ project.id }}/ks2/{{ document.id }}/export/excel" class="btn btn-outline-success btn-sm">📊 Excel</a>
|
||||
<a href="/projects/{{ project.id }}/ks2/{{ document.id }}/export/word" class="btn btn-outline-primary btn-sm">📄 Word</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if document.status == 'cancelled' %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
КС-2 сторнирован. Документ неизменяем, исключён из финансовых агрегатов. История сохранена.
|
||||
</div>
|
||||
<a href="/projects/{{ project.id }}/ks2" class="btn btn-secondary">Назад к списку</a>
|
||||
{% else %}
|
||||
|
||||
{% if document.status == 'issued' %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
КС-2 проведено. Документ не может быть изменён.
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<form method="post" action="/projects/{{ project.id }}/ks2/{{ document.id }}/cancel" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger"
|
||||
onclick="return confirm('ВНИМАНИЕ: Сторнировать КС-2? Документ будет исключён из финансовых агрегатов. Действие необратимо.')">Сторнировать</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h4>Позиции</h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -46,16 +73,16 @@
|
||||
<tr>
|
||||
<td>{{ line.work_item.name }}</td>
|
||||
<td>{{ line.work_item.unit or '' }}</td>
|
||||
<td class="text-end text-nowrap">{{ line.quantity }}</td>
|
||||
<td class="text-end text-nowrap">{{ line.unit_price | money }}</td>
|
||||
<td class="text-end text-nowrap">{{ line.amount | money }}</td>
|
||||
<td class="text-end text-nowrap">{{ line.quantity|quantity2 }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ line.unit_price | money }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ line.amount | money }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4" class="text-end">Итого</th>
|
||||
<th class="text-end text-nowrap">{{ total | money }}</th>
|
||||
<th class="text-end text-nowrap money-value">{{ total | money }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -71,9 +98,6 @@
|
||||
<a href="/projects/{{ project.id }}/ks2" class="btn btn-secondary">Назад к списку</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
КС-2 проведено. Документ не может быть изменён.
|
||||
</div>
|
||||
|
||||
<h4>Источники факта</h4>
|
||||
|
||||
@@ -95,7 +119,7 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ source.daily_report_item.report.report_date.strftime('%d.%m.%Y') }}</td>
|
||||
<td>{{ source.quantity }}</td>
|
||||
<td>{{ source.quantity|quantity2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
@@ -105,7 +129,8 @@
|
||||
|
||||
<a href="/projects/{{ project.id }}/ks2" class="btn btn-secondary">Назад к списку</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -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 %}
|
||||
@@ -0,0 +1,55 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}КС-3 проекта {{ 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">← К проекту</a>
|
||||
</nav>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>КС-3 проекта {{ project.name }}</h2>
|
||||
<a href="/projects/{{ project.id }}/ks3/new" class="btn btn-primary mb-3">Создать КС-3</a>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Номер</th>
|
||||
<th>Дата</th>
|
||||
<th>Период</th>
|
||||
<th>Статус</th>
|
||||
<th>КС-2</th>
|
||||
<th class="text-end text-nowrap">Сумма</th>
|
||||
<th>Действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr class="clickable-row" data-url="/projects/{{ project.id }}/ks3/{{ row.document.id }}">
|
||||
<td>{{ row.document.number }}</td>
|
||||
<td>{{ row.document.date.strftime('%d.%m.%Y') }}</td>
|
||||
<td>{% if row.document.reporting_period_from and row.document.reporting_period_to %}{{ row.document.reporting_period_from.strftime('%d.%m.%Y') }} — {{ row.document.reporting_period_to.strftime('%d.%m.%Y') }}{% endif %}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ 'success' if row.document.status == 'issued' else 'secondary' }}">
|
||||
{{ 'Проведён' if row.document.status == 'issued' else 'Черновик' }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ row.ks2_count }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.amount | money }}</td>
|
||||
<td>
|
||||
<a href="/projects/{{ project.id }}/ks3/{{ row.document.id }}" class="btn btn-sm btn-outline-primary">Просмотр</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="7" class="text-center text-muted py-4">КС-3 пока нет.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,100 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}КС-3 №{{ document.number }} от {{ document.date.strftime('%d.%m.%Y') }}{% 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 №{{ document.number }} от {{ document.date.strftime('%d.%m.%Y') }}</h2>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<p><strong>Статус:</strong>
|
||||
{% if document.status == 'cancelled' %}
|
||||
<span class="badge bg-danger">Сторнирован</span>
|
||||
{% elif document.status == 'issued' %}
|
||||
<span class="badge bg-success">Проведён</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Черновик</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if document.reporting_period_from and document.reporting_period_to %}
|
||||
<p><strong>Период:</strong> {{ document.reporting_period_from.strftime('%d.%m.%Y') }} — {{ document.reporting_period_to.strftime('%d.%m.%Y') }}</p>
|
||||
{% endif %}
|
||||
{% if document.comment %}
|
||||
<p><strong>Комментарий:</strong> {{ document.comment }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if document.status == 'cancelled' %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
КС-3 сторнировано. Документ неизменяем, исключён из финансовых агрегатов. Связанные КС-2 сохранены.
|
||||
</div>
|
||||
<a href="/projects/{{ project.id }}/ks3" class="btn btn-secondary">Назад к списку</a>
|
||||
{% else %}
|
||||
|
||||
<h4>Включённые КС-2</h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>№ КС-2</th>
|
||||
<th>Дата</th>
|
||||
<th>Период</th>
|
||||
<th class="text-end text-nowrap">Сумма</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in ks2_rows %}
|
||||
<tr>
|
||||
<td>{{ row.ks2.number }}</td>
|
||||
<td>{{ row.ks2.date.strftime('%d.%m.%Y') }}</td>
|
||||
<td>{% if row.ks2.reporting_period_from and row.ks2.reporting_period_to %}{{ row.ks2.reporting_period_from.strftime('%d.%m.%Y') }} — {{ row.ks2.reporting_period_to.strftime('%d.%m.%Y') }}{% endif %}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.total | money }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4" class="text-center text-muted">Нет включённых КС-2.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3" class="text-end">Итого</th>
|
||||
<th class="text-end text-nowrap money-value">{{ total | money }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if document.status == 'draft' %}
|
||||
<div class="d-flex gap-2 align-items-center">
|
||||
<a href="/projects/{{ project.id }}/ks3/{{ document.id }}/edit" class="btn btn-primary">Редактировать</a>
|
||||
<form method="post" action="/projects/{{ project.id }}/ks3/{{ document.id }}/issue" class="d-inline">
|
||||
<button type="submit" class="btn btn-success"
|
||||
onclick="return confirm('После проведения КС-3 изменить его будет нельзя. Продолжить?')">Провести КС-3</button>
|
||||
</form>
|
||||
<a href="/projects/{{ project.id }}/ks3" class="btn btn-secondary">Назад к списку</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
КС-3 проведено. Документ не может быть изменён.
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<form method="post" action="/projects/{{ project.id }}/ks3/{{ document.id }}/cancel" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger"
|
||||
onclick="return confirm('ВНИМАНИЕ: Сторнировать КС-3? Документ будет исключён из финансовых агрегатов. Действие необратимо.')">Сторнировать</button>
|
||||
</form>
|
||||
</div>
|
||||
<a href="/projects/{{ project.id }}/ks3" class="btn btn-secondary">Назад к списку</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,97 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}КС-6а — {{ 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">← К проекту</a>
|
||||
</nav>
|
||||
|
||||
<h2>КС-6а — Журнал выполненных работ</h2>
|
||||
<p class="text-muted">{{ project.name }}</p>
|
||||
|
||||
<form method="get" action="/projects/{{ project.id }}/ks6a" class="card card-body mb-3">
|
||||
<div class="row g-3 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<label for="date_from" class="form-label">Дата с</label>
|
||||
<input type="date" class="form-control" id="date_from" name="date_from" required
|
||||
value="{{ date_from }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="date_to" class="form-label">Дата по</label>
|
||||
<input type="date" class="form-control" id="date_to" name="date_to" required
|
||||
value="{{ date_to }}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="system_id" class="form-label">Система</label>
|
||||
<select class="form-select" id="system_id" name="system_id">
|
||||
<option value="all" {% if not system_id or system_id == 'all' %}selected{% endif %}>Все системы</option>
|
||||
{% for system in systems %}
|
||||
<option value="{{ system.id }}" {% if system_id|string == system.id|string %}selected{% endif %}>{{ system.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary w-100">Сформировать</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if date_from and date_to and not error %}
|
||||
<div class="mb-2 text-muted">
|
||||
Период: {{ date_from }} — {{ date_to }}
|
||||
{% if system_id and system_id != 'all' %}
|
||||
{% for system in systems %}{% if system_id|string == system.id|string %} · Система: {{ system.name }}{% endif %}{% endfor %}
|
||||
{% else %} · Все системы{% endif %}
|
||||
· Строк: {{ total_count }}
|
||||
</div>
|
||||
|
||||
{% if rows %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm" style="table-layout: fixed;">
|
||||
<colgroup>
|
||||
<col style="width: 88px">
|
||||
<col style="width: 120px">
|
||||
<col style="width: 120px">
|
||||
<col style="width: 70px">
|
||||
<col>
|
||||
<col style="width: 50px">
|
||||
<col style="width: 80px">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Система</th>
|
||||
<th>Раздел</th>
|
||||
<th>№ поз.</th>
|
||||
<th>Наименование</th>
|
||||
<th>Ед.</th>
|
||||
<th class="text-end text-nowrap">Кол-во</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td class="text-nowrap">{{ row.report.report_date.strftime('%d.%m.%Y') }}</td>
|
||||
<td style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ row.work_item.system.name if row.work_item.system else '—' }}</td>
|
||||
<td style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ row.work_item.section.name if row.work_item.section else '—' }}</td>
|
||||
<td>{{ row.work_item.source_number or '' }}</td>
|
||||
<td style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ row.work_item.name }}</td>
|
||||
<td>{{ row.work_item.unit or '' }}</td>
|
||||
<td class="text-end text-nowrap">{{ row.completed_quantity|quantity2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">За выбранный период работ не найдено.</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,92 @@
|
||||
{% 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">← К проекту</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 %}
|
||||
@@ -0,0 +1,59 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Платежи — {{ 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">← К проекту</a>
|
||||
</nav>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Платежи проекта {{ project.name }}</h2>
|
||||
<a href="/projects/{{ project.id }}/payments/new" class="btn btn-primary mb-3">Новый платёж</a>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Номер документа</th>
|
||||
<th class="text-end text-nowrap">Сумма</th>
|
||||
<th>Валюта</th>
|
||||
<th class="text-end text-nowrap">Распределено</th>
|
||||
<th class="text-end text-nowrap">Не распределено</th>
|
||||
<th>КС-3</th>
|
||||
<th>Комментарий</th>
|
||||
<th>Действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr class="clickable-row" data-url="/projects/{{ project.id }}/payments/{{ row.payment.id }}">
|
||||
<td>{{ row.payment.date.strftime('%d.%m.%Y') }}</td>
|
||||
<td>{{ row.payment.document_number or '—' }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.payment.amount | money(row.payment.currency) }}</td>
|
||||
<td>{{ row.payment.currency }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.allocated | money(row.payment.currency) }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ row.unallocated | money(row.payment.currency) }}</td>
|
||||
<td>{{ row.ks3_count }}</td>
|
||||
<td>{{ row.payment.comment or '' }}</td>
|
||||
<td>
|
||||
<a href="/projects/{{ project.id }}/payments/{{ row.payment.id }}" class="btn btn-sm btn-outline-primary">Просмотр</a>
|
||||
<a href="/projects/{{ project.id }}/payments/{{ row.payment.id }}/edit" class="btn btn-sm btn-outline-secondary">Редактировать</a>
|
||||
<form method="post" action="/projects/{{ project.id }}/payments/{{ row.payment.id }}/delete" class="d-inline">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Удалить платёж?')">Удалить</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="9" class="text-center text-muted py-4">Платежей пока нет.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,87 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Платёж — {{ 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">← К проекту</a>
|
||||
</nav>
|
||||
|
||||
<h2>Платёж{% if payment.document_number %} №{{ payment.document_number }}{% endif %} от {{ payment.date.strftime('%d.%m.%Y') }}</h2>
|
||||
|
||||
{% if payment.status == 'cancelled' %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Платёж сторнирован. Сумма не считается полученными деньгами, распределения исключены из агрегатов.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<p><strong>Статус:</strong>
|
||||
{% if payment.status == 'cancelled' %}
|
||||
<span class="badge bg-danger">Сторнирован</span>
|
||||
{% else %}
|
||||
<span class="badge bg-success">Активен</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<p><strong>Сумма:</strong> <span class="money-value">{{ payment.amount | money(payment.currency) }}</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Распределено:</strong> <span class="money-value">{{ allocated | money(payment.currency) }}</span></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p><strong>Не распределено:</strong> <span class="money-value">{{ unallocated | money(payment.currency) }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{% if payment.comment %}
|
||||
<p><strong>Комментарий:</strong> {{ payment.comment }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if payment.status != 'cancelled' %}
|
||||
<h4>Распределение по КС-3</h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>№ КС-3</th>
|
||||
<th>Дата КС-3</th>
|
||||
<th class="text-end text-nowrap">Сумма</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for alloc in payment.allocations %}
|
||||
<tr>
|
||||
<td>{{ alloc.ks3.number if alloc.ks3 else alloc.ks3_id }}</td>
|
||||
<td>{{ alloc.ks3.date.strftime('%d.%m.%Y') if alloc.ks3 and alloc.ks3.date else '—' }}</td>
|
||||
<td class="text-end text-nowrap money-value">{{ alloc.amount | money(payment.currency) }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3" class="text-center text-muted">Платёж не распределён.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
{% if payment.status != 'cancelled' %}
|
||||
<a href="/projects/{{ project.id }}/payments/{{ payment.id }}/edit" class="btn btn-primary">Редактировать</a>
|
||||
<form method="post" action="/projects/{{ project.id }}/payments/{{ payment.id }}/cancel" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger"
|
||||
onclick="return confirm('ВНИМАНИЕ: Сторнировать платёж? Сумма перестанет считаться полученной. Действие необратимо.')">Сторнировать платёж</button>
|
||||
</form>
|
||||
<form method="post" action="/projects/{{ project.id }}/payments/{{ payment.id }}/delete" class="d-inline">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Удалить платёж?')">Удалить</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<a href="/projects/{{ project.id }}/payments" class="btn btn-secondary">Назад к списку</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -5,8 +5,21 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ document_title }} — {{ project.name }}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.money-value { transition: filter 0.15s; }
|
||||
.money-hidden .money-value { filter: blur(6px); user-select: none; pointer-events: none; }
|
||||
.microstat-bar { min-width: 6rem; height: 0.5rem; }
|
||||
.microstat-label { font-size: 0.75rem; white-space: nowrap; }
|
||||
.boq-table { table-layout: fixed; width: 100%; }
|
||||
.boq-table td, .boq-table th { overflow-wrap: anywhere; }
|
||||
.boq-table .money-value { white-space: nowrap; overflow-wrap: normal; }
|
||||
.boq-table thead th { position: sticky; top: 0; z-index: 10; background: #f8f9fa; }
|
||||
.toggle-row { cursor: pointer; user-select: none; }
|
||||
.toggle-row .toggle-icon { display: inline-block; width: 1.2em; transition: transform 0.15s; }
|
||||
.toggle-row.collapsed .toggle-icon { transform: rotate(-90deg); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body class="money-hidden">
|
||||
<main class="container my-4">
|
||||
<nav aria-label="Навигация" class="mb-3">
|
||||
<ol class="breadcrumb">
|
||||
@@ -21,47 +34,94 @@
|
||||
<h1>{{ document_title }}</h1>
|
||||
<p class="text-muted mb-0">{{ project.name }}{% if document.source_file %} · {{ document.source_file }}{% endif %}</p>
|
||||
</div>
|
||||
<a class="btn btn-outline-secondary" href="/projects/{{ project.id }}">К проекту</a>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" id="expandAll">Развернуть всё</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" id="collapseAll">Свернуть всё</button>
|
||||
<button type="button" class="btn btn-outline-secondary" id="toggleMoney" title="Показать/скрыть финансовые суммы" aria-label="Показать или скрыть финансовые суммы">👁</button>
|
||||
{% if not has_history %}
|
||||
<form method="post" action="/boq/{{ project.id }}/documents/{{ document.id }}/delete" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger" onclick="return confirm('Удалить ведомость и все её позиции? Это действие необратимо.')">Удалить ведомость</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="/boq/{{ project.id }}/documents/{{ document.id }}/archive" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-warning" onclick="return confirm('Архивировать ведомость? Данные будут сохранены.')">Архивировать</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<a class="btn btn-outline-secondary" href="/projects/{{ project.id }}">К проекту</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-sm align-middle">
|
||||
<table class="table table-bordered table-sm align-middle boq-table">
|
||||
<colgroup>
|
||||
<col style="width: 3.5rem">
|
||||
<col>
|
||||
<col style="width: 9rem">
|
||||
<col style="width: 9rem">
|
||||
<col style="width: 4.5rem">
|
||||
<col style="width: 5.5rem">
|
||||
<col style="width: 7.5rem">
|
||||
<col style="width: 8.5rem">
|
||||
<col style="width: 11rem">
|
||||
</colgroup>
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>№</th><th>Наименование</th><th>Модель / артикул</th><th>Производитель</th>
|
||||
<th>Ед. изм.</th><th class="text-end">Кол-во</th><th class="text-end">Цена за ед.</th><th class="text-end">Сумма</th>
|
||||
<th>Выполнение</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for system_node in systems %}
|
||||
<tr class="table-primary">
|
||||
<th colspan="7">Система: {{ system_node.system.name }}</th>
|
||||
<th class="text-end">{{ system_node.total|money(project.currency) }}</th>
|
||||
<tr class="table-primary toggle-row" data-toggle="system-{{ system_node.system.id }}">
|
||||
<th colspan="8"><span class="toggle-icon">▼</span> Система: {{ system_node.system.name }}</th>
|
||||
<th class="text-end money-value">{{ system_node.total|money(project.currency) }}</th>
|
||||
</tr>
|
||||
{% for section_node in system_node.sections %}
|
||||
<tr class="table-success">
|
||||
<th colspan="7">Раздел: {{ section_node.section.name }}</th>
|
||||
<th class="text-end">{{ section_node.total|money(project.currency) }}</th>
|
||||
<tr class="table-success toggle-row" data-toggle="section-{{ section_node.section.id }}" data-parent="system-{{ system_node.system.id }}">
|
||||
<th colspan="8"><span class="toggle-icon">▼</span> Раздел: {{ section_node.section.name }}</th>
|
||||
<th class="text-end money-value">{{ section_node.total|money(project.currency) }}</th>
|
||||
</tr>
|
||||
{% for item in section_node["items"] %}
|
||||
<tr>
|
||||
{% set done = completed_by_item.get(item.id, 0) %}
|
||||
{% set planned = item.quantity if item.quantity is not none else 0 %}
|
||||
{% set pct = (done / planned * 100) if planned else 0 %}
|
||||
<tr data-parent="section-{{ section_node.section.id }}">
|
||||
<td>{{ item.source_number or '' }}</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.model or '' }}</td>
|
||||
<td>{{ item.manufacturer or '' }}</td>
|
||||
<td>{{ item.unit or '' }}</td>
|
||||
<td class="text-end">{{ item.quantity if item.quantity is not none else '' }}</td>
|
||||
<td class="text-end">{{ item.unit_price|money(project.currency) if item.unit_price is not none else '' }}</td>
|
||||
<td class="text-end">{{ item.amount|money(project.currency) if item.amount is not none else '' }}</td>
|
||||
<td class="text-end money-value">{{ item.unit_price|money(project.currency) if item.unit_price is not none else '' }}</td>
|
||||
<td class="text-end money-value">{{ item.amount|money(project.currency) if item.amount is not none else '' }}</td>
|
||||
<td>
|
||||
{% if planned %}
|
||||
<div class="microstat-label text-muted mb-1">Выполнено: {{ done|round(2) }} / {{ planned }}</div>
|
||||
<div class="progress microstat-bar">
|
||||
{% if pct == 0 %}
|
||||
<div class="progress-bar bg-secondary" style="width: 100%"></div>
|
||||
{% elif pct < 50 %}
|
||||
<div class="progress-bar bg-warning" style="width: {{ pct }}%"></div>
|
||||
{% elif pct < 100 %}
|
||||
<div class="progress-bar bg-primary" style="width: {{ pct }}%"></div>
|
||||
{% elif pct == 100 %}
|
||||
<div class="progress-bar bg-success" style="width: 100%"></div>
|
||||
{% else %}
|
||||
<div class="progress-bar bg-danger" style="width: 100%"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr><td colspan="8" class="text-center text-muted py-4">В документе нет рабочих позиций.</td></tr>
|
||||
<tr><td colspan="9" class="text-center text-muted py-4">В документе нет рабочих позиций.</td></tr>
|
||||
{% endfor %}
|
||||
<tr class="table-dark fw-bold">
|
||||
<td colspan="7">Итого по ведомости</td>
|
||||
<td class="text-end">{{ total|money(project.currency) }}</td>
|
||||
<td colspan="8">Итого по ведомости</td>
|
||||
<td class="text-end money-value">{{ total|money(project.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -71,5 +131,42 @@
|
||||
<div class="alert alert-warning mt-3">В документе есть {{ unassigned_items|length }} позиций без полной привязки к системе и разделу.</div>
|
||||
{% endif %}
|
||||
</main>
|
||||
<script>
|
||||
(function() {
|
||||
var moneyBtn = document.getElementById('toggleMoney');
|
||||
if (moneyBtn) moneyBtn.addEventListener('click', function() {
|
||||
document.body.classList.toggle('money-hidden');
|
||||
});
|
||||
|
||||
function toggleGroup(id, collapsed) {
|
||||
document.querySelectorAll('[data-parent="' + id + '"]').forEach(function(el) {
|
||||
el.style.display = collapsed ? 'none' : '';
|
||||
if (el.dataset.toggle) toggleGroup(el.dataset.toggle, collapsed);
|
||||
});
|
||||
var header = document.querySelector('[data-toggle="' + id + '"]');
|
||||
if (header) header.classList.toggle('collapsed', collapsed);
|
||||
}
|
||||
|
||||
document.querySelectorAll('.toggle-row').forEach(function(row) {
|
||||
row.addEventListener('click', function() {
|
||||
var id = row.dataset.toggle;
|
||||
if (!id) return;
|
||||
var isCollapsed = row.classList.contains('collapsed');
|
||||
toggleGroup(id, !isCollapsed);
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('expandAll').addEventListener('click', function() {
|
||||
document.querySelectorAll('.toggle-row').forEach(function(row) {
|
||||
if (row.dataset.toggle) toggleGroup(row.dataset.toggle, false);
|
||||
});
|
||||
});
|
||||
document.getElementById('collapseAll').addEventListener('click', function() {
|
||||
document.querySelectorAll('.toggle-row').forEach(function(row) {
|
||||
if (row.dataset.toggle) toggleGroup(row.dataset.toggle, true);
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
.system-progress-table .progress-cell { min-width: 14rem; }
|
||||
.system-progress-table .progress-summary { flex-wrap: nowrap; gap: .5rem; }
|
||||
.system-progress-table .progress-summary > * { white-space: nowrap; }
|
||||
.money-value { transition: filter 0.15s; }
|
||||
.money-hidden .money-value { filter: blur(6px); user-select: none; pointer-events: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<body class="bg-light money-hidden">
|
||||
<main class="container-fluid container-xxl py-4">
|
||||
<nav class="mb-3"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="/projects/">Проекты</a></li><li class="breadcrumb-item active">{{ project.name }}</li></ol></nav>
|
||||
|
||||
@@ -30,15 +32,32 @@
|
||||
{% if base_boq_documents|length == 1 %}<div class="small text-muted mt-2">Ведомость проекта: {{ base_boq_documents[0].name.replace('BOQ Import - ', 'Импорт ведомости — ').replace('BOQ Import — ', 'Импорт ведомости — ') }}</div>{% elif base_boq_documents|length > 1 %}<div class="small text-muted mt-2">Ведомостей проекта: {{ base_boq_documents|length }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<a class="btn btn-primary" href="/projects/{{ project.id }}/daily-reports/new">Создать Daily Report</a>
|
||||
<button type="button" class="btn btn-outline-secondary" id="toggleMoney" title="Показать/скрыть финансовые суммы" aria-label="Показать или скрыть финансовые суммы">👁</button>
|
||||
<a class="btn btn-outline-secondary" href="/projects/{{ project.id }}/edit">Редактировать</a>
|
||||
<a class="btn btn-outline-primary" href="/boq/{{ project.id }}">Ведомости</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/agreements">Дополнительные соглашения</a>
|
||||
<a class="btn btn-outline-primary" href="/boq/{{ project.id }}">Ведомости{% if base_boq_documents %} ({{ base_boq_documents|length }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/agreements">Дополнительные соглашения{% if agreements_count %} ({{ agreements_count }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/daily-reports">Daily Reports{% if daily_reports_count %} ({{ daily_reports_count }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/ks2">КС-2{% if ks2_count %} ({{ ks2_count }}){% endif %}</a>
|
||||
<a class="btn btn-primary" href="/projects/{{ project.id }}/daily-reports/new">Создать Daily Report</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/ks3">КС-3{% if ks3_count %} ({{ ks3_count }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/ks6a">КС-6а</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/payments">Платежи{% if payments_count %} ({{ payments_count }}){% endif %}</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if project.status != 'archived' %}
|
||||
<div class="mb-3 d-flex gap-2">
|
||||
<form method="post" action="/projects/{{ project.id }}/archive" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-warning btn-sm" onclick="return confirm('Архивировать проект? Данные будут сохранены.')">Архивировать</button>
|
||||
</form>
|
||||
<form method="post" action="/projects/{{ project.id }}/delete" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('ВНИМАНИЕ: Проект будет физически удалён вместе со связанными данными. Это действие необратимо. Продолжить?')">Удалить проект</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-warning mb-3">Проект архивирован. Данные сохранены, проект не считается активным.</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="mt-3" aria-live="polite">
|
||||
{% if over_plan_count %}
|
||||
<div class="alert alert-warning py-2 mb-0">⚠ Проверка плана: {{ over_plan_count }} позиции превышают план · <button type="button" class="btn btn-link p-0 align-baseline" data-bs-toggle="modal" data-bs-target="#planWarningsModal">Подробнее</button></div>
|
||||
@@ -48,14 +67,26 @@
|
||||
<section class="mb-4" aria-labelledby="kpi-heading">
|
||||
<h2 id="kpi-heading" class="h5 mb-3">План и выполнение</h2>
|
||||
<div class="row g-3">
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Плановая стоимость</div><div class="fs-3 fw-semibold">{{ planned_cost|money(project.currency) }}</div><div class="small text-muted">по ведомостям проекта</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Выполнено по Daily Reports</div><div class="fs-3 fw-semibold text-success">{{ performed_cost|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Остаток</div><div class="fs-3 fw-semibold {% if remaining_cost < 0 %}text-danger{% endif %}">{{ remaining_cost|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Плановая стоимость</div><div class="fs-3 fw-semibold money-value">{{ planned_cost|money(project.currency) }}</div><div class="small text-muted">по ведомостям проекта</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Выполнено по Daily Reports</div><div class="fs-3 fw-semibold text-success money-value">{{ performed_cost|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Остаток</div><div class="fs-3 fw-semibold money-value {% if remaining_cost < 0 %}text-danger{% endif %}">{{ remaining_cost|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-3"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Выполнение</div><div class="fs-3 fw-semibold">{{ '%.4f'|format(completion_percent) }}%</div><div class="progress mt-2" role="progressbar" aria-valuenow="{{ '%.4f'|format(completion_percent) }}" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar {% if completion_percent > 100 %}bg-warning{% endif %}" style="width: {{ 100 if completion_percent > 100 else completion_percent }}%"></div></div></div></article></div>
|
||||
</div>
|
||||
{% if not base_boq_documents %}<div class="alert alert-info mt-3 mb-0">Сначала импортируйте ведомость, чтобы сформировать план.</div>{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="mb-4" aria-labelledby="payment-heading">
|
||||
<h2 id="payment-heading" class="h5 mb-3">Оплата по КС-3</h2>
|
||||
<div class="row g-3">
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Всего КС-3</div><div class="fs-3 fw-semibold">{{ payment_summary.ks3_count }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Сумма КС-3</div><div class="fs-3 fw-semibold money-value">{{ payment_summary.ks3_total|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Получено</div><div class="fs-3 fw-semibold money-value">{{ payment_summary.received|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Распределено</div><div class="fs-3 fw-semibold text-success money-value">{{ payment_summary.distributed|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Нераспределено</div><div class="fs-3 fw-semibold money-value">{{ payment_summary.unallocated|money(project.currency) }}</div></div></article></div>
|
||||
<div class="col-6 col-xl-2"><article class="card h-100 border-0 shadow-sm"><div class="card-body"><div class="text-muted small">Задолженность</div><div class="fs-3 fw-semibold money-value {% if payment_summary.outstanding > 0 %}text-danger{% endif %}">{{ payment_summary.outstanding|money(project.currency) }}</div></div></article></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-8">
|
||||
<section class="card border-0 shadow-sm h-100">
|
||||
@@ -67,8 +98,8 @@
|
||||
<tbody>{% for row in system_progress %}
|
||||
<tr>
|
||||
<td class="system-name-cell">{{ row.system.name }}</td>
|
||||
<td class="text-end money-cell">{{ row.planned_cost|money(project.currency) }}</td>
|
||||
<td class="text-end money-cell">{{ row.performed_cost|money(project.currency) }}</td>
|
||||
<td class="text-end money-cell money-value">{{ row.planned_cost|money(project.currency) }}</td>
|
||||
<td class="text-end money-cell money-value">{{ row.performed_cost|money(project.currency) }}</td>
|
||||
<td class="progress-cell"><div class="d-flex justify-content-between small mb-1 progress-summary"><span>{{ '%.4f'|format(row.completion_percent) }}%</span>{% if not row.planned_cost %}<span class="text-muted">нет плана</span>{% endif %}</div><div class="progress" role="progressbar" aria-valuenow="{{ '%.4f'|format(row.completion_percent) }}" aria-valuemin="0" aria-valuemax="100"><div class="progress-bar {% if row.completion_percent > 100 %}bg-warning{% endif %}" style="width: {{ 100 if row.completion_percent > 100 else row.completion_percent }}%"></div></div></td>
|
||||
</tr>{% endfor %}</tbody>
|
||||
</table></div>
|
||||
@@ -119,15 +150,49 @@
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center"><h2 class="h5 mb-0">Последние Daily Reports</h2><a href="/projects/{{ project.id }}/daily-reports" class="btn btn-sm btn-outline-primary">Все отчёты</a></div>
|
||||
{% if recent_reports %}
|
||||
<div class="table-responsive"><table class="table table-hover mb-0"><thead><tr><th>Дата</th><th>Система</th><th class="text-end">Позиций</th><th class="text-end">Объём отчёта</th><th></th></tr></thead>
|
||||
<tbody>{% for row in recent_reports %}<tr><td>{{ row.report.report_date.strftime('%d.%m.%Y') }}</td><td>{{ row.systems|join(', ') }}</td><td class="text-end">{{ row.item_count }}</td><td class="text-end">{{ row.volume|money(project.currency) }}</td><td class="text-end"><a href="/projects/{{ project.id }}/daily-reports/{{ row.report.id }}" class="btn btn-sm btn-outline-primary">Просмотр</a></td></tr>{% endfor %}</tbody>
|
||||
<tbody>{% for row in recent_reports %}<tr><td>{{ row.report.report_date.strftime('%d.%m.%Y') }}</td><td>{{ row.systems|join(', ') }}</td><td class="text-end">{{ row.item_count }}</td><td class="text-end money-value">{{ row.volume|money(project.currency) }}</td><td class="text-end"><a href="/projects/{{ project.id }}/daily-reports/{{ row.report.id }}" class="btn btn-sm btn-outline-primary">Просмотр</a></td></tr>{% endfor %}</tbody>
|
||||
</table></div>
|
||||
{% else %}<div class="card-body text-muted">Daily Reports ещё не создавались. Выполненные объёмы пока равны нулю.</div>{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="card border-0 shadow-sm mt-4">
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center"><h2 class="h5 mb-0">Документы ведомости</h2><a href="/boq/{{ project.id }}" class="btn btn-sm btn-outline-primary">Список ведомостей</a></div>
|
||||
{% if boq_docs %}<ul class="list-group list-group-flush">{% for doc in boq_docs %}<li class="list-group-item d-flex justify-content-between align-items-center"><span>{{ doc.name.replace('BOQ Import - ', 'Импорт ведомости — ').replace('BOQ Import — ', 'Импорт ведомости — ') }} <small class="text-muted">{{ doc.source_file or '' }}</small></span><a class="btn btn-sm btn-outline-primary" href="/boq/{{ project.id }}/documents/{{ doc.id }}">Открыть ведомость</a></li>{% endfor %}</ul>
|
||||
{% else %}<div class="card-body"><span class="text-muted">Ведомость не импортирована.</span> <a href="/projects/{{ project.id }}/import">Импортировать ведомость</a></div>{% endif %}
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center"><h2 class="h5 mb-0">Дерево документов</h2><a href="/boq/{{ project.id }}" class="btn btn-sm btn-outline-primary">Ведомости</a></div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2 fw-semibold">План и ведомости</div>
|
||||
{% for node in doc_tree %}
|
||||
<div class="ms-3 mb-2">
|
||||
<a href="/boq/{{ project.id }}/documents/{{ node.doc.id }}" class="text-decoration-none">
|
||||
📄 {{ node.doc.name.replace('BOQ Import - ', 'Импорт ведомости — ').replace('BOQ Import — ', 'Импорт ведомости — ') }}
|
||||
</a>
|
||||
{% if node.agreements %}
|
||||
<div class="ms-4 mt-1">
|
||||
{% for agr in node.agreements %}
|
||||
<div class="small">
|
||||
<a href="/projects/{{ project.id }}/agreements/{{ agr.id }}" class="text-decoration-none">
|
||||
📋 ДС №{{ agr.number or agr.id }} — {{ agr.name or '' }}
|
||||
<span class="badge bg-{{ 'success' if agr.status == 'approved' else 'secondary' }} ms-1">{{ 'Утверждено' if agr.status == 'approved' else 'Черновик' }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if project_wide_agreements %}
|
||||
<div class="mt-3 mb-2 fw-semibold">Дополнительные работы проекта</div>
|
||||
{% for agr in project_wide_agreements %}
|
||||
<div class="ms-3 small">
|
||||
<a href="/projects/{{ project.id }}/agreements/{{ agr.id }}" class="text-decoration-none">
|
||||
📋 ДС №{{ agr.number or agr.id }} — {{ agr.name or '' }}
|
||||
<span class="badge bg-{{ 'success' if agr.status == 'approved' else 'secondary' }} ms-1">{{ 'Утверждено' if agr.status == 'approved' else 'Черновик' }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if not doc_tree and not project_wide_agreements %}
|
||||
<div class="text-muted">Документы ещё не добавлены. <a href="/projects/{{ project.id }}/import">Импортировать ведомость</a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="journalModal" tabindex="-1" aria-labelledby="journalModalTitle" aria-hidden="true">
|
||||
<div class="modal-dialog"><form class="modal-content" id="journal-form" method="post">
|
||||
@@ -232,6 +297,9 @@
|
||||
button.disabled = false;
|
||||
}
|
||||
}));
|
||||
document.getElementById('toggleMoney').addEventListener('click', () => {
|
||||
document.body.classList.toggle('money-hidden');
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user