|
|
@ -56,9 +56,9 @@ from sapl.protocoloadm.models import (Anexado, DocumentoAdministrativo, Protocol |
|
|
TipoDocumentoAdministrativo) |
|
|
TipoDocumentoAdministrativo) |
|
|
from sapl.sessao.models import (Bancada, PresencaOrdemDia, SessaoPlenaria, |
|
|
from sapl.sessao.models import (Bancada, PresencaOrdemDia, SessaoPlenaria, |
|
|
SessaoPlenariaPresenca, TipoSessaoPlenaria) |
|
|
SessaoPlenariaPresenca, TipoSessaoPlenaria) |
|
|
from sapl.utils import (gerar_hash_arquivo, intervalos_tem_intersecao, |
|
|
from sapl.utils import (from_date_to_datetime_utc, gerar_hash_arquivo, intervalos_tem_intersecao, |
|
|
mail_service_configured, parlamentares_ativos, |
|
|
mail_service_configured, parlamentares_ativos, SEPARADOR_HASH_PROPOSICAO, |
|
|
SEPARADOR_HASH_PROPOSICAO, show_results_filter_set, num_materias_por_tipo) |
|
|
show_results_filter_set, num_materias_por_tipo) |
|
|
|
|
|
|
|
|
from .forms import (AlterarSenhaForm, CasaLegislativaForm, |
|
|
from .forms import (AlterarSenhaForm, CasaLegislativaForm, |
|
|
ConfiguracoesAppForm, RelatorioAtasFilterSet, |
|
|
ConfiguracoesAppForm, RelatorioAtasFilterSet, |
|
|
@ -2062,12 +2062,23 @@ class AppConfigCrud(CrudAux): |
|
|
data_inicio__year__lte=timezone.now().year, |
|
|
data_inicio__year__lte=timezone.now().year, |
|
|
data_fim__year__gte=timezone.now().year |
|
|
data_fim__year__gte=timezone.now().year |
|
|
).first() |
|
|
).first() |
|
|
|
|
|
|
|
|
data_inicio = legislatura.data_inicio |
|
|
data_inicio = legislatura.data_inicio |
|
|
data_fim = legislatura.data_fim |
|
|
data_fim = legislatura.data_fim |
|
|
|
|
|
|
|
|
|
|
|
data_inicio_utc = from_date_to_datetime_utc(data_inicio) |
|
|
|
|
|
data_fim_utc = from_date_to_datetime_utc(data_fim) |
|
|
|
|
|
|
|
|
numero_max = Protocolo.objects.filter( |
|
|
numero_max = Protocolo.objects.filter( |
|
|
data__gte=data_inicio, data_lte=data_fim |
|
|
Q(data__isnull=False, data__gte=data_inicio, data__lte=data_fim) | |
|
|
|
|
|
Q( |
|
|
|
|
|
timestamp__isnull=False, timestamp__gte=data_inicio_utc, |
|
|
|
|
|
timestamp__lte=data_fim_utc |
|
|
|
|
|
) | Q( |
|
|
|
|
|
timestamp_data_hora_manual__isnull=False, |
|
|
|
|
|
timestamp_data_hora_manual__gte=data_inicio_utc, |
|
|
|
|
|
timestamp_data_hora_manual__lte=data_fim_utc, |
|
|
|
|
|
) |
|
|
).aggregate(Max('numero'))['numero__max'] |
|
|
).aggregate(Max('numero'))['numero__max'] |
|
|
elif numeracao == 'U': |
|
|
elif numeracao == 'U': |
|
|
numero_max = Protocolo.objects.all().aggregate( |
|
|
numero_max = Protocolo.objects.all().aggregate( |
|
|
|