Browse Source

Refinamentos nos relatórios de custos de eventos. Gertiq #169984

pull/169/head
Sesóstris Vieira 1 year ago
parent
commit
13a41b5cc7
  1. 35
      sigi/apps/eventos/admin.py
  2. 40
      sigi/apps/eventos/templates/admin/eventos/custos_eventos_report.html
  3. 45
      sigi/apps/eventos/templates/admin/eventos/custos_servidor_report.html

35
sigi/apps/eventos/admin.py

@ -1597,11 +1597,26 @@ class EventoAdmin(AsciifyQParameter, CartExportReportMixin, admin.ModelAdmin):
for sigla, nome in UnidadeFederativa.REGIAO_CHOICES
]
data_inicio = (
self.get_queryset(request)
.order_by("data_inicio")
.first()
.data_inicio
)
data_fim = (
self.get_queryset(request)
.order_by("data_termino")
.last()
.data_termino
)
context = {
"eventos": eventos,
"eventos": eventos.order_by("data_inicio"),
"resumo": resumo,
"custos_regiao": custos_regiao,
"title": _("Custos por eventos"),
"data_inicio": data_inicio,
"data_fim": data_fim,
}
return WeasyTemplateResponse(
filename=f"custos_eventos-{timezone.localdate()}.pdf",
@ -1666,10 +1681,26 @@ class EventoAdmin(AsciifyQParameter, CartExportReportMixin, admin.ModelAdmin):
),
)
)
data_inicio = (
self.get_queryset(request)
.order_by("data_inicio")
.first()
.data_inicio
)
data_fim = (
self.get_queryset(request)
.order_by("data_termino")
.last()
.data_termino
)
context = {
"servidores": servidores,
"servidores": servidores.order_by("nome_completo"),
"totais": totais,
"title": _("Custos por servidor"),
"data_inicio": data_inicio,
"data_fim": data_fim,
}
return WeasyTemplateResponse(
filename=f"custos_servidor-{timezone.localdate()}.pdf",

40
sigi/apps/eventos/templates/admin/eventos/custos_eventos_report.html

@ -52,9 +52,49 @@
.label-resumo {
min-width: 30em;
}
.timestamp-container {
width: 100%;
margin: 24px 10px;
border-left: 5px solid #ee6e73;
font-size: 1.3em;
}
.timestamp-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 6px;
}
.timestamp-col {
position: relative;
padding-left: 15px;
padding-right: 15px;
}
.timestamp-label {
flex: 0 0 12%;
max-width: 12%;
font-weight: bold;
}
{% endblock %}
{% block main_content %}
<div class="timestamp-container">
<div class="timestamp-row">
<div class="timestamp-col timestamp-label">
{% trans "Data inicial" %}:
</div>
<div class="timestamp-col timestamp-data">
{{ data_inicio|date:"SHORT_DATE_FORMAT" }}<br/>
</div>
</div>
<div class="timestamp-row">
<div class="timestamp-col timestamp-label">
{% trans "Data final" %}:
</div>
<div class="timestamp-col timestamp-data">
{{ data_fim|date:"SHORT_DATE_FORMAT" }}
</div>
</div>
</div>
<table repeat="2">
<thead>
<tr>

45
sigi/apps/eventos/templates/admin/eventos/custos_servidor_report.html

@ -23,7 +23,6 @@
.even-row {
background-color: #d2d2d2 !important;
}
.sessao-resumo {
align-items: stretch;
display: flex;
@ -52,13 +51,52 @@
.label-resumo {
min-width: 30em;
}
.timestamp-container {
width: 100%;
margin: 24px 10px;
border-left: 5px solid #ee6e73;
font-size: 1.3em;
}
.timestamp-row {
display: flex;
flex-wrap: wrap;
margin-bottom: 6px;
}
.timestamp-col {
position: relative;
padding-left: 15px;
padding-right: 15px;
}
.timestamp-label {
flex: 0 0 12%;
max-width: 12%;
font-weight: bold;
}
{% endblock %}
{% block main_content %}
<div class="timestamp-container">
<div class="timestamp-row">
<div class="timestamp-col timestamp-label">
{% trans "Data inicial" %}:
</div>
<div class="timestamp-col timestamp-data">
{{ data_inicio|date:"SHORT_DATE_FORMAT" }}<br/>
</div>
</div>
<div class="timestamp-row">
<div class="timestamp-col timestamp-label">
{% trans "Data final" %}:
</div>
<div class="timestamp-col timestamp-data">
{{ data_fim|date:"SHORT_DATE_FORMAT" }}
</div>
</div>
</div>
<table repeat="2">
<thead>
<tr>
<th>{% trans "ID saberes" %}</th>
<th>{% trans "Membro da equipe" %}</th>
<th>{% trans "Qtde eventos" %}</th>
<th>{% trans "Qtde diárias" %}</th>
@ -71,7 +109,6 @@
<tbody>
{% for servidor in servidores %}
<tr>
<td>{{ servidor.moodle_id }}</td>
<td>{{ servidor.nome_completo }}</td>
<td class="right-align">{{ servidor.qtde_eventos|default:"-" }}</td>
<td class="right-align">{{ servidor.qtde_diarias|default:"-" }}</td>
@ -82,7 +119,7 @@
</tr>
{% endfor %}
<tr>
<th colspan="2" class="right-align">{% trans "Totais" %}</th>
<th class="right-align">{% trans "Totais" %}</th>
<th class="right-align">{{ totais.qtde_eventos|default:"-" }}</th>
<th class="right-align">{{ totais.qtde_diarias|default:"-" }}</th>
<th class="right-align">{{ totais.media_diarias|default:"-" }}</th>

Loading…
Cancel
Save