filtros de pedimento completo
This commit is contained in:
@@ -1919,18 +1919,13 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
|||||||
TIPOS_PERMITIDOS = ['2', '3'] # <-- Ajusta aquí tus tipos
|
TIPOS_PERMITIDOS = ['2', '3'] # <-- Ajusta aquí tus tipos
|
||||||
tipo_documento = self.request.query_params.get('document_type')
|
tipo_documento = self.request.query_params.get('document_type')
|
||||||
if tipo_documento:
|
if tipo_documento:
|
||||||
if tipo_documento == '2':
|
queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
||||||
queryset = queryset.filter(archivo__startswith=f'documents/vu_PC_')
|
|
||||||
# elif tipo_documento == '3':
|
|
||||||
# queryset = queryset.filter(archivo__startswith=f'documents/vu_RM_')
|
|
||||||
else:
|
|
||||||
queryset = queryset.filter(archivo__startswith=f'documents/NOTFOUND_{pedimento.pedimento_app}.xml')
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Filtrar por tipos permitidos
|
# Filtrar por tipos permitidos
|
||||||
# queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
# queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
||||||
queryset = queryset.filter(
|
queryset = queryset.filter(
|
||||||
Q(archivo__startswith=f'documents/vu_PC_')
|
Q(archivo__istartswith=f'documents/vu_PC_')
|
||||||
# Q(archivo__startswith=f'documents/vu_RM_')
|
# Q(archivo__startswith=f'documents/vu_RM_')
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1948,6 +1943,7 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
|||||||
queryset = queryset.filter(pedimento__pedimento_app=pedimento_numero)
|
queryset = queryset.filter(pedimento__pedimento_app=pedimento_numero)
|
||||||
|
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
class TriggerPedimentoCompletoView(APIView):
|
class TriggerPedimentoCompletoView(APIView):
|
||||||
"""
|
"""
|
||||||
Endpoint interno para disparar la descarga de pedimento completo
|
Endpoint interno para disparar la descarga de pedimento completo
|
||||||
|
|||||||
Reference in New Issue
Block a user