Compare commits
7 Commits
efc-nuevos
...
formato-pe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c7eb22b28 | ||
| 30b6d73567 | |||
|
|
460da47571 | ||
| 32aff7649e | |||
|
|
d115cdd072 | ||
| 28d2eaedda | |||
| 271c562654 |
@@ -182,6 +182,7 @@ def procesar_archivo_asc_task(datastage_id, user_organizacion_id, asc_name):
|
||||
else:
|
||||
fecha_pago = fecha_pago_raw
|
||||
aduana = data.get('seccion_aduanera')
|
||||
# logger.info(f"aduana >>>> {aduana}")
|
||||
patente = data.get('patente')
|
||||
pedimento_num = data.get('pedimento')
|
||||
pedimento_app = ""
|
||||
@@ -191,7 +192,11 @@ def procesar_archivo_asc_task(datastage_id, user_organizacion_id, asc_name):
|
||||
year = fecha_pago[:4]
|
||||
else:
|
||||
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:
|
||||
logger.warning(f"No se pudo generar pedimento_app: {ped_app_exc}")
|
||||
tipo_operacion_val = data.get('tipo_operacion')
|
||||
|
||||
@@ -1920,9 +1920,9 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
||||
tipo_documento = self.request.query_params.get('document_type')
|
||||
if tipo_documento:
|
||||
if tipo_documento == '2':
|
||||
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')
|
||||
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')
|
||||
|
||||
@@ -1930,8 +1930,8 @@ class PedimentoDocumentViewSet(viewsets.ModelViewSet, DocumentosFiltradosMixin):
|
||||
# Filtrar por tipos permitidos
|
||||
# queryset = queryset.filter(document_type_id__in=TIPOS_PERMITIDOS)
|
||||
queryset = queryset.filter(
|
||||
Q(archivo__startswith=f'documents/vu_PC_{pedimento.pedimento_app}.xml') |
|
||||
Q(archivo__startswith=f'documents/vu_RM_{pedimento.pedimento_app}.xml')
|
||||
Q(archivo__startswith=f'documents/vu_PC_')
|
||||
# Q(archivo__startswith=f'documents/vu_RM_')
|
||||
)
|
||||
|
||||
buscar_archivo = self.request.query_params.get('archivo__icontains')
|
||||
|
||||
Reference in New Issue
Block a user