feat: complete KS-2 foundation and regression coverage
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}КС-2 №{{ document.number }} от {{ document.date.strftime('%d.%m.%Y') }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>КС-2 №{{ document.number }} от {{ document.date.strftime('%d.%m.%Y') }}</h2>
|
||||
|
||||
<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>
|
||||
</p>
|
||||
{% if document.comment %}
|
||||
<p><strong>Комментарий:</strong> {{ document.comment }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Позиции</h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование</th>
|
||||
<th>Количество</th>
|
||||
<th>Цена</th>
|
||||
<th>Сумма</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in document.items %}
|
||||
<tr>
|
||||
<td>{{ line.work_item.name }}</td>
|
||||
<td>{{ line.quantity }}</td>
|
||||
<td>{{ line.unit_price | money }}</td>
|
||||
<td>{{ line.amount | money }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Итого</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>{{ total | money }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if document.status == 'draft' %}
|
||||
<h4>Источники</h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование</th>
|
||||
<th>Даты</th>
|
||||
<th>Количество</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for line in document.items %}
|
||||
<tr>
|
||||
<td colspan="3"><strong>{{ line.work_item.name }}</strong></td>
|
||||
</tr>
|
||||
{% for source in line.sources %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ source.daily_report_item.report.report_date.strftime('%d.%m.%Y') }} ({{ source.daily_report_item.report.id }})</td>
|
||||
<td>{{ source.quantity }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="/projects/{{ project.id }}/ks2/{{ document.id }}/edit" class="btn btn-primary">Редактировать</a>
|
||||
<form method="post" action="/projects/{{ project.id }}/ks2/{{ document.id }}/issue" class="d-inline">
|
||||
<button type="submit" class="btn btn-success"
|
||||
onclick="return confirm('Вы уверены, что хотите провести КС-2?')">Провести</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
КС-2 проведено
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a href="/projects/{{ project.id }}/ks2" class="btn btn-secondary">Назад к списку</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user