Compare commits
10 Commits
efc-nuevos
...
69d07f2713
| Author | SHA1 | Date | |
|---|---|---|---|
| 69d07f2713 | |||
|
|
27c8d24a56 | ||
| 627d78f4b8 | |||
|
|
4c7eb22b28 | ||
| 30b6d73567 | |||
|
|
460da47571 | ||
| 32aff7649e | |||
|
|
d115cdd072 | ||
| 28d2eaedda | |||
| 271c562654 |
@@ -182,6 +182,7 @@ def procesar_archivo_asc_task(datastage_id, user_organizacion_id, asc_name):
|
|||||||
else:
|
else:
|
||||||
fecha_pago = fecha_pago_raw
|
fecha_pago = fecha_pago_raw
|
||||||
aduana = data.get('seccion_aduanera')
|
aduana = data.get('seccion_aduanera')
|
||||||
|
# logger.info(f"aduana >>>> {aduana}")
|
||||||
patente = data.get('patente')
|
patente = data.get('patente')
|
||||||
pedimento_num = data.get('pedimento')
|
pedimento_num = data.get('pedimento')
|
||||||
pedimento_app = ""
|
pedimento_app = ""
|
||||||
@@ -191,7 +192,11 @@ def procesar_archivo_asc_task(datastage_id, user_organizacion_id, asc_name):
|
|||||||
year = fecha_pago[:4]
|
year = fecha_pago[:4]
|
||||||
else:
|
else:
|
||||||
year = str(fecha_pago.year)
|
year = str(fecha_pago.year)
|
||||||
pedimento_app = f"{year[-2:]}-{str(aduana).zfill(2)[-2:]}-{str(patente).zfill(4)[-4:]}-{str(pedimento_num).zfill(7)[-7:]}"
|
# mantener aduana con sus digitos intactos
|
||||||
|
# pedimento_app = f"{year[-2:]}-{str(aduana).zfill(2)[-2:]}-{str(patente).zfill(4)[-4:]}-{str(pedimento_num).zfill(7)[-7:]}"
|
||||||
|
# pedimento_app = f"{year[-2:]}-{str(aduana)}-{str(patente).zfill(4)[-4:]}-{str(pedimento_num).zfill(7)[-7:]}"
|
||||||
|
pedimento_app = f"{year[-2:]}-{str(aduana).zfill(2)[:2]}-{str(patente).zfill(4)[-4:]}-{str(pedimento_num).zfill(7)[-7:]}"
|
||||||
|
# logger.info(f"pedimento_app >>>> {pedimento_app}")
|
||||||
except Exception as ped_app_exc:
|
except Exception as ped_app_exc:
|
||||||
logger.warning(f"No se pudo generar pedimento_app: {ped_app_exc}")
|
logger.warning(f"No se pudo generar pedimento_app: {ped_app_exc}")
|
||||||
tipo_operacion_val = data.get('tipo_operacion')
|
tipo_operacion_val = data.get('tipo_operacion')
|
||||||
|
|||||||
@@ -1919,19 +1919,14 @@ 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_{pedimento.pedimento_app}.xml')
|
|
||||||
elif tipo_documento == '3':
|
|
||||||
queryset = queryset.filter(archivo__startswith=f'documents/vu_RM_{pedimento.pedimento_app}.xml')
|
|
||||||
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_{pedimento.pedimento_app}.xml') |
|
Q(archivo__istartswith=f'documents/vu_PC_')
|
||||||
Q(archivo__startswith=f'documents/vu_RM_{pedimento.pedimento_app}.xml')
|
# Q(archivo__startswith=f'documents/vu_RM_')
|
||||||
)
|
)
|
||||||
|
|
||||||
buscar_archivo = self.request.query_params.get('archivo__icontains')
|
buscar_archivo = self.request.query_params.get('archivo__icontains')
|
||||||
@@ -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