Skip to content

Commit

Permalink
Merge pull request #2439 from prefeiturasp/hotfix/8.11.1
Browse files Browse the repository at this point in the history
Hotfix/8.11.1
  • Loading branch information
alcfernandes authored Oct 26, 2023
2 parents b504ac4 + 38d6544 commit ce3ac8f
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sme_ptrf_apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "8.11.0"
__version__ = "8.11.1"

__version_info__ = tuple(
[
Expand Down
2 changes: 1 addition & 1 deletion sme_ptrf_apps/core/api/views/associacoes_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def contas(self, request, uuid=None):
contas_criadas_nesse_periodo_ou_anteriores.append(conta)
contas = contas_criadas_nesse_periodo_ou_anteriores
else:
contas = ContaAssociacao.ativas_com_solicitacao_em_aberto.filter(associacao=associacao).all()
contas = ContaAssociacao.ativas_com_solicitacao_em_aberto.filter(associacao=associacao, data_inicio__isnull=False).all()

contas_data = ContaAssociacaoDadosSerializer(contas, many=True).data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TipoContaFactory(DjangoModelFactory):
class Meta:
model = TipoConta

nome = Sequence(lambda n: fake.unique.word())
banco_nome = Sequence(lambda n: f"Banco {fake.unique.name()}")
agencia = Sequence(lambda n: f"{str(fake.unique.random_int(min=1000, max=9999))}-{fake.random_number(digits=1)}")
numero_conta = Sequence(lambda n: f"{str(fake.unique.random_int(min=10, max=99))}.{str(fake.unique.random_int(min=100, max=999))}-{fake.random_number(digits=1)}")
Expand Down
Empty file.
19 changes: 19 additions & 0 deletions sme_ptrf_apps/core/tests/test_api_contas/test_get_contas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest
import json
from rest_framework import status

pytestmark = pytest.mark.django_db

def test_api_resgata_apenas_contas_com_data_inicial(jwt_authenticated_client_a, conta_associacao_factory):

conta_com_data_inicial = conta_associacao_factory.create()

conta_sem_data_inicial = conta_associacao_factory.create(associacao=conta_com_data_inicial.associacao, data_inicio=None)

url = f'/api/associacoes/{conta_com_data_inicial.associacao.uuid}/contas/'

response = jwt_authenticated_client_a.get(url, content_type='application/json')
result = json.loads(response.content)

assert response.status_code == status.HTTP_200_OK
assert len(result) == 1
4 changes: 2 additions & 2 deletions sme_ptrf_apps/despesas/api/views/despesas_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def get_queryset(self):
# Caso nenhum argumento de ordenação seja passado, ordenamos por -data_documento
if not ordenar_por_imposto == 'true': # Caso tenha sido solicitado ordenar por imposto já é retornada ordenada por todos os argumentos, além do imposto
if not lista_argumentos_ordenacao:
qs = qs.order_by('-data_documento')
qs = qs.order_by('-data_documento', 'id')
else:
qs = qs.order_by(*lista_argumentos_ordenacao)
qs = qs.order_by(*lista_argumentos_ordenacao, 'id')

return qs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def monta_estrutura_valores_reprogramados(associacao):
lista_contas = []

for conta_associacao in associacao.contas.all():
if not conta_associacao.ativa_no_periodo(associacao.periodo_inicial):
continue

acoes = []

for acao_associacao in associacao.acoes.exclude(acao__e_recursos_proprios=True):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% load static %}

<p class="font-14 border-bottom pb-3 titulo"><strong>Bloco 5 - AUTENTICAÇÃO</strong></p>

<div class="col-12 border mt-4">
<div class="row">
<div class="col d-flex align-items-center justify-content-start">
<p class="pt-2 pb-2 mb-1 font-10">Declaramos, sob as penas da lei, que as informações prestadas são verdadeiras.</p>
</div>
</div>

<div class="row">
<div class="col d-flex align-items-center justify-content-start">
<p class="pt-2 pb-2 mb-1 font-10">Data: <strong>{{ dados.assinatura_dre.data_assinatura }}</strong></p>
</div>
</div>
</div>

<div class="col-12 border-right border-left border-bottom pt-4">
<table class="table table-bordered tabela-assinaturas">
<thead class="thead-light">
<tr>
<th scope="col" class="fundo-th-cinza" style="width: 40%">Nome</th>
<th scope="col" class="fundo-th-cinza" style="width: 40%">Cargo</th>
<th scope="col" class="fundo-th-cinza" style="width: 20%">RF</th>
</tr>
</thead>

<tbody>
{% for membro in dados.assinatura_dre.membros %}
<tr>
<td>{{ membro.nome }}</td>
<td>{{ membro.cargo }}</td>
<td>{{ membro.rf }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
</article>
</section>

{% if dados.previa == False %}
<section class="mt-4">
<article id="bloco-5" class="">
{% include "./partials/tabela-autenticacao.html" with dados=dados %}
</article>
</section>
{% endif %}



</section>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
Expand Down

0 comments on commit ce3ac8f

Please sign in to comment.