Compare commits
10
Commits
fcc80d3c6e
..
v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee64e5f773 | ||
|
|
c532170ac2 | ||
|
|
d023f14ad9 | ||
|
|
911bd2da34 | ||
|
|
3c2bb2b714 | ||
|
|
0f17284020 | ||
|
|
603243b7e0 | ||
|
|
8cdd075d15 | ||
|
|
a29a44e361 | ||
|
|
c08554e775 |
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# Copiar este archivo como ".env" (en la misma carpeta que main.py) y completar
|
||||
# con los valores reales. ".env" nunca debe subirse a git (ya está en .gitignore).
|
||||
|
||||
# --- Correo / carpetas del pipeline ---
|
||||
EMAIL = correo@dominio.com
|
||||
DOWNLOAD_FOLDER = adjuntos
|
||||
OUTPUT_FOLDER = resultado
|
||||
|
||||
# --- Ruta de red de Facturación Electrónica (ver pipeline._copiar_a_red) ---
|
||||
RUTA_RED_FACTURACION = \\servidor\ruta\a\Facturacion Electronica\PRODUCCION
|
||||
RUC_EMPRESA = 00000000000
|
||||
|
||||
# --- SAP Business One Service Layer ---
|
||||
SAP_B1_URL = https://servidor:50000/b1s/v1
|
||||
SAP_B1_COMPANY =
|
||||
SAP_B1_USER =
|
||||
SAP_B1_PASSWORD =
|
||||
SAP_B1_VERIFY_SSL = false
|
||||
SAP_B1_TIMEOUT = 15
|
||||
|
||||
# --- SAP HANA (fallback de consultas, ver hana_manager.py) ---
|
||||
HANA_SERVER =
|
||||
HANA_PORT = 30015
|
||||
HANA_USER =
|
||||
HANA_PASSWORD =
|
||||
HANA_SCHEMA =
|
||||
|
||||
# --- Microsoft Graph / Outlook (MSAL, app registration en Azure AD) ---
|
||||
CLIENT_ID =
|
||||
CLIENT_SECRET =
|
||||
TENANT_ID =
|
||||
VERIFY_SSL = false
|
||||
|
||||
# --- Logging (ver logger_manager.py). Opcional, por defecto INFO ---
|
||||
LOG_LEVEL = INFO
|
||||
Executable → Regular
+6
-6
@@ -11,7 +11,7 @@ from datetime import datetime, timedelta
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import database_utilities
|
||||
import logger_utilities
|
||||
import logger_manager
|
||||
from pipeline import _procesar_un_correo, step_authenticate
|
||||
|
||||
|
||||
@@ -45,13 +45,14 @@ def get_email_by_id(user_email: str, token: str, message_id: str) -> dict | None
|
||||
# PIPELINE PARA IDS
|
||||
# ============================================================================
|
||||
def run_pipeline_for_ids(ids: list[str]) -> None:
|
||||
load_dotenv(dotenv_path=".env.dev")
|
||||
# Ruta absoluta: no depende del directorio de trabajo desde el que se lance el proceso
|
||||
load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
|
||||
email_addr = os.getenv("EMAIL", "")
|
||||
download_folder = os.getenv("DOWNLOAD_FOLDER", "adjuntos")
|
||||
output_folder = os.getenv("OUTPUT_FOLDER", "resultado")
|
||||
|
||||
if not email_addr:
|
||||
print("❌ EMAIL no configurado en .env.dev")
|
||||
print("❌ EMAIL no configurado en .env")
|
||||
return
|
||||
|
||||
database_utilities.init_db()
|
||||
@@ -96,13 +97,12 @@ if __name__ == "__main__":
|
||||
print(f"\n📋 Set: {args.set} — {descripcion}")
|
||||
print(f" IDs a procesar: {len(ids)}")
|
||||
|
||||
log_path = logger_utilities.setup_logger()
|
||||
logger_utilities.limpiar_logs_antiguos(dias=30)
|
||||
logger_manager.setup_logging()
|
||||
|
||||
inicio = datetime.now()
|
||||
print("\n" + "=" * 60)
|
||||
print(f"🚀 INICIO DE EJECUCIÓN: {inicio.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
print(f"📄 Log guardado en: {log_path}")
|
||||
print(f"📄 Log guardado en: {logger_manager.LOG_FILE}")
|
||||
print("=" * 60)
|
||||
|
||||
run_pipeline_for_ids(ids)
|
||||
|
||||
+11
-8
@@ -12,6 +12,7 @@ def init_db() -> None:
|
||||
Inicializa la base de datos SQLite y crea la tabla de correos si no existe.
|
||||
"""
|
||||
conn = sqlite3.connect(DB_NAME)
|
||||
try:
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Crear tabla con id como llave primaria para evitar duplicados
|
||||
@@ -27,6 +28,7 @@ def init_db() -> None:
|
||||
''')
|
||||
|
||||
conn.commit()
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
# ============================================================================
|
||||
@@ -39,6 +41,7 @@ def save_emails(emails_list: list[dict]) -> int:
|
||||
return 0
|
||||
|
||||
conn = sqlite3.connect(DB_NAME)
|
||||
try:
|
||||
cursor = conn.cursor()
|
||||
|
||||
from datetime import datetime
|
||||
@@ -65,9 +68,9 @@ def save_emails(emails_list: list[dict]) -> int:
|
||||
''', data)
|
||||
|
||||
conn.commit()
|
||||
rows_affected = cursor.rowcount
|
||||
return cursor.rowcount
|
||||
finally:
|
||||
conn.close()
|
||||
return rows_affected
|
||||
|
||||
# ============================================================================
|
||||
def get_existing_ids(ids_list: list[str]) -> list[str]:
|
||||
@@ -78,6 +81,7 @@ def get_existing_ids(ids_list: list[str]) -> list[str]:
|
||||
return []
|
||||
|
||||
conn = sqlite3.connect(DB_NAME)
|
||||
try:
|
||||
cursor = conn.cursor()
|
||||
|
||||
existing_ids = []
|
||||
@@ -89,8 +93,9 @@ def get_existing_ids(ids_list: list[str]) -> list[str]:
|
||||
cursor.execute(query, chunk)
|
||||
existing_ids.extend([row[0] for row in cursor.fetchall()])
|
||||
|
||||
conn.close()
|
||||
return existing_ids
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
# ============================================================================
|
||||
def delete_email_by_id(email_id: str) -> bool:
|
||||
@@ -102,13 +107,11 @@ def delete_email_by_id(email_id: str) -> bool:
|
||||
return False
|
||||
|
||||
conn = sqlite3.connect(DB_NAME)
|
||||
try:
|
||||
cursor = conn.cursor()
|
||||
|
||||
cursor.execute("DELETE FROM emails WHERE id = ?", (email_id,))
|
||||
|
||||
conn.commit()
|
||||
rows_affected = cursor.rowcount
|
||||
return cursor.rowcount > 0
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
return rows_affected > 0
|
||||
# ============================================================================
|
||||
@@ -3,7 +3,9 @@
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["factura + resultados_val"] --> B["Determinar ItemCode<br>C103002-A (mes anterior)<br>C103002 (mes actual)"]
|
||||
B --> C["Calcular cuotas<br>DocumentInstallments"]
|
||||
B --> B2["CardCode = PL + ruc_emisor<br>sapb1_manager.obtener_condicion_pago(CardCode)<br>(BusinessPartners.PayTermsGrpCode → PaymentTermsTypes)"]
|
||||
B2 --> B3["fecha_vencimiento = fecha_contabilizacion +<br>NumberOfAdditionalDays<br>(si es 0, usar NumberOfAdditionalMonths * 30)"]
|
||||
B3 --> C["Calcular cuotas<br>DocumentInstallments"]
|
||||
|
||||
C --> D{"¿Tiene detracción?"}
|
||||
D -->|Sí| E["Cuota 1: monto detracción<br>U_VS_TIPOCUOTA = D"]
|
||||
@@ -27,7 +29,7 @@ flowchart TD
|
||||
K --> P["U_IDC_VALREF =<br>round((total_weight / 1000) *<br>CUADRO_VALOR_REFERENCIAL[zona], 2)"]
|
||||
|
||||
P --> Q["Armar payload completo"]
|
||||
Q --> R["Cabecera:<br>DocType, CardCode, NumAtCard,<br>DocDate, DocDueDate,<br>U_IDC_NUMGR, Comments"]
|
||||
Q --> R["Cabecera:<br>DocType, CardCode, NumAtCard,<br>DocDate = fecha_contabilizacion,<br>DocDueDate = fecha_vencimiento,<br>U_IDC_NUMGR, Comments"]
|
||||
R --> S["DocumentLines[] +<br>DocumentInstallments[]"]
|
||||
S --> T["← Retornar dict para<br>POST /Drafts"]
|
||||
```
|
||||
@@ -0,0 +1,135 @@
|
||||
# Inventario del código
|
||||
|
||||
## Archivos
|
||||
|
||||
| Archivo | Líneas | Rol |
|
||||
|---------|--------|-----|
|
||||
| `main.py` | 134 | Demonio orquestador (loop de horarios) |
|
||||
| `pipeline.py` | 1284 | Pipeline core (procesar un correo completo) |
|
||||
| `sunat_schema.py` | 720 | Parseo de XML SUNAT (Invoice, DespatchAdvice) |
|
||||
| `pdf_utilities.py` | 464 | Parseo de PDFs (factura, guías) |
|
||||
| `sapb1_manager.py` | 321 | Comunicación con SAP B1 Service Layer |
|
||||
| `outlook_utilities.py` | 234 | Comunicación con Microsoft Graph |
|
||||
| `hana_manager.py` | 123 | Comunicación con SAP HANA directa (fallback de `sapb1_manager` y valor referencial) |
|
||||
| `database_utilities.py` | 116 | SQLite local (cache de correos) |
|
||||
| `consulta_rapida.py` | 113 | Script auxiliar para reprocesar correos por ID |
|
||||
| `email_utilities.py` | 52 | Utilitarios de adjuntos (ZIP, filtrado) |
|
||||
| `logger_manager.py` | 149 | Logging a archivo rotado (30 días) + consola + captura de `print()` |
|
||||
|
||||
---
|
||||
|
||||
## Dependencias entre archivos
|
||||
|
||||
```
|
||||
main.py
|
||||
├── logger_manager.py
|
||||
└── pipeline.py
|
||||
├── sunat_schema.py
|
||||
├── pdf_utilities.py
|
||||
├── sapb1_manager.py
|
||||
│ └── hana_manager.py
|
||||
├── hana_manager.py (valor referencial, Sp_ObtenerValorReferencial)
|
||||
├── outlook_utilities.py
|
||||
├── email_utilities.py
|
||||
└── database_utilities.py
|
||||
|
||||
consulta_rapida.py
|
||||
├── logger_manager.py
|
||||
├── database_utilities.py
|
||||
└── pipeline.py (_procesar_un_correo, step_authenticate)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Flujo de datos
|
||||
|
||||
```
|
||||
main()
|
||||
└── run_pipeline()
|
||||
├── step_authenticate() → token MS Graph
|
||||
├── step_fetch_emails() → emails[]
|
||||
└── _procesar_un_correo() (por cada email)
|
||||
├── BD: verificar duplicado
|
||||
├── _descargar_adjuntos() → archivos
|
||||
├── _descomprimir() ZIPs
|
||||
├── _filtrar_y_limpiar() → solo PDF/XML
|
||||
├── _procesar_pdfs() → pdf_cache
|
||||
│ └── pdf_utilities.extraer_datos_pdf()
|
||||
├── _procesar_xmls(pdf_cache) → documentos[]
|
||||
│ ├── sunat_schema.extraer_datos_xml()
|
||||
│ └── _copiar_a_red() → copia PDF/XML a ruta de red (RUTA_RED_FACTURACION)
|
||||
├── _completar_guias(documentos, pdf_cache) → completa guías faltantes desde PDF
|
||||
├── _validar_guias(documentos) → advierte guías con datos incompletos
|
||||
├── _guardar_resultado(documentos)
|
||||
├── _validate_prices(factura) → (ok, resultados)
|
||||
│ └── sapb1_manager.get_delivery_notes()
|
||||
│ ├── SL (Service Layer) GET /DeliveryNotes
|
||||
│ ├── HANA fallback (get_delivery: ODLN, luego OWTR)
|
||||
│ └── si vino de OWTR: GET StockTransfers(DocEntry)
|
||||
│ → U_IDC_NUMOV → GET Orders(U_IDC_NUMOV)
|
||||
├── _obtener_valor_referencial_sap(factura) → guias_valor_ref
|
||||
│ └── hana_manager.obtener_valor_referencial() (Sp_ObtenerValorReferencial)
|
||||
├── _build_sap_draft(factura, resultados) → draft (incluye U_VS_ANEXO_PDF/XML)
|
||||
│ └── sapb1_manager.obtener_condicion_pago(CardCode) → DocDueDate
|
||||
├── _guardar_draft_json(draft)
|
||||
├── sapb1_manager.create_draft(draft)
|
||||
└── outlook_utilities.send_email(notificación)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Problemas conocidos hasta ahora
|
||||
|
||||
| # | Problema | Archivo | Estado |
|
||||
|---|----------|---------|--------|
|
||||
| 1 | `_extraer_serie_numero_desde_texto` no limpiaba leading zeros | `sunat_schema.py` | ✅ Corregido |
|
||||
| 2 | Al asignar guías por línea, si hay +refs que líneas, las sobrantes se perdían | `pipeline.py` | ✅ Corregido |
|
||||
| 3 | SL sin fallback a HANA | `sapb1_manager.py` | ✅ Corregido |
|
||||
| 4 | Ctrl+C mostraba traceback | `main.py` | ✅ Corregido |
|
||||
| 5 | `.env.dev` vs `.env` inconsistente | `sapb1_manager.py` | ✅ Corregido |
|
||||
| 6 | `HANA_HOST` vs `HANA_SERVER` en `.env` | `hana_manager.py` | ✅ Corregido |
|
||||
| 7 | Columna `Cancelled` vs `CANCELED` en HANA | `hana_manager.py` | ✅ Corregido |
|
||||
| 8 | Bloque `if __name__ == "__main__"` borraba un correo real de la BD al ejecutar el módulo directo | `database_utilities.py` | ✅ Corregido |
|
||||
| 9 | `extraer_datos_xml` solo procesaba guías tipo `31`; tipo `09` (remitente) se descartaba pese a estar documentado | `sunat_schema.py` | ✅ Corregido |
|
||||
| 10 | `DatosComprobante.__str__` usaba `ref.id` (campo que ya no existe en `DocumentoReferencia`) | `sunat_schema.py` | ✅ Corregido |
|
||||
| 11 | Log de error HTTP con `print("%s", ...)` no interpolaba el mensaje | `sapb1_manager.py` | ✅ Corregido |
|
||||
| 12 | Fuga de conexión HANA si `cursor()` fallaba (quedaba fuera del `try`) | `hana_manager.py` | ✅ Corregido |
|
||||
| 13 | `razon_social_emisor` se llenaba con el nombre del receptor en el JSON de depuración del PDF | `pipeline.py` | ✅ Corregido |
|
||||
| 14 | Typo `VERIFI_SSL` en vez de `VERIFY_SSL` | `outlook_utilities.py` / `.env` | ✅ Corregido |
|
||||
| 15 | Conexiones SQLite sin `try/finally` (fuga si fallaba una consulta a mitad de camino) | `database_utilities.py` | ✅ Corregido |
|
||||
| 16 | Código muerto sin llamadores (`quitar_correos_ya_registrados_en_base_de_datos`, `procesar_adjuntos_email`) | `email_utilities.py` | ✅ Corregido (eliminado) |
|
||||
| 17 | `logger_utilities.py` (redirección global de stdout, sin niveles ni rotación real) reemplazado por `logger_manager.py` (logging estándar, rotación diaria 30 días, captura de `print()`) | `logger_manager.py` | ✅ Corregido |
|
||||
| 18 | `task()`/`last_task()` de `logger_manager.py` no devolvían el sub-logger (`with ... as sub` daba siempre `None`) | `logger_manager.py` | ✅ Corregido |
|
||||
| 19 | `DOWNLOAD_FOLDER` duplicado en `.env` | `.env` | ✅ Corregido |
|
||||
| 20 | Guías tipo `09` no se encontraban si el documento estaba en `OWTR` (Traslado de Inventario) en vez de `ODLN` | `hana_manager.py` | ✅ Corregido (fallback ODLN → OWTR) |
|
||||
| 21 | Parámetros `tipo`/`serie` cruzados al llamar `get_delivery`/`get_delivery_notes` (mapeaban al revés a `U_BPP_MDSD`/`U_BPP_MDTD`) | `hana_manager.py`, `sapb1_manager.py`, `pipeline.py` | ✅ Corregido (orden natural `tipo, serie, numero`) |
|
||||
| 22 | `StockTransfers` (OWTR) no tiene líneas `FL*`, por lo que la validación de precios fallaba siempre para esas guías | `sapb1_manager.py` | ✅ Corregido (resuelve la Orden de Venta vía `U_IDC_NUMOV` y valida contra `Orders(DocEntry)`) |
|
||||
| 23 | `DocDueDate` del draft usaba `fecha_emision` del XML, sin considerar la condición de pago del proveedor | `pipeline.py`, `sapb1_manager.py` | ✅ Corregido (`DocDueDate` = fecha de contabilización + días de `PaymentTermsTypes`) |
|
||||
| 24 | Patrón regex de valor referencial no reconocía la variante truncada "VALOR REFER" (ej. "VALOR REFER:S/ 1431.16") | `sunat_schema.py` | ✅ Corregido |
|
||||
|
||||
---
|
||||
|
||||
## Funciones internas en `_procesar_un_correo` (pipeline.py)
|
||||
|
||||
> Nota: `_ruta_carpeta` y `_copiar_a_red` son helpers a nivel de módulo (no anidados en `_procesar_un_correo`); el resto son funciones anidadas dentro de `_procesar_un_correo` (líneas 142-1304).
|
||||
|
||||
| Función | Líneas | Propósito |
|
||||
|---------|--------|-----------|
|
||||
| `_ruta_carpeta` (módulo) | 33-34 | Resuelve una ruta relativa al directorio del script |
|
||||
| `_copiar_a_red` (módulo) | 37-94 | Copia PDF/XML a la ruta de red de Facturación Electrónica (`RUTA_RED_FACTURACION`) |
|
||||
| `_descargar_adjuntos` | 169-196 | Descarga adjuntos vía Graph API |
|
||||
| `_descomprimir` | 198-211 | Descomprime ZIPs |
|
||||
| `_filtrar_y_limpiar` | 213-253 | Filtra PDF/XML, elimina el resto |
|
||||
| `_procesar_pdfs` | 255-308 | Extrae datos de PDFs, renombra, genera cache |
|
||||
| `_procesar_xmls` | 310-463 | Procesa XMLs, cruza con PDF, asigna guías, copia a red |
|
||||
| `_completar_guias` | 465-522 | Completa guías faltantes en líneas XML desde el PDF cache |
|
||||
| `_validar_guias` | 524-532 | Advierte (log) guías con datos incompletos |
|
||||
| `_guardar_resultado` | 534-653 | Guarda JSON con datos extraídos (XML y PDF) |
|
||||
| `_calcular_fecha_vencimiento` | 665-692 | Calcula `DocDueDate` = fecha de contabilización + días de la condición de pago (`PaymentTermsTypes`) |
|
||||
| `_build_sap_draft` | 694-855 | Construye payload del draft SAP B1 |
|
||||
| `_validate_prices` | 856-1030 | Valida precios contra DeliveryNotes / Orders (SAP) |
|
||||
| `_build_validation_html` | 1032-1061 | Genera tabla HTML de validación de precios |
|
||||
| `_obtener_valor_referencial_sap` | 1062-1090 | Consulta `Sp_ObtenerValorReferencial` en HANA por guía |
|
||||
| `_build_valor_referencial_html` | 1091-1126 | Genera tabla HTML comparando valor referencial XML vs SAP |
|
||||
| `_build_notification_body` | 1127-1168 | Arma cuerpo del email de notificación |
|
||||
| `_guardar_draft_json` | 1169-1195 | Guarda draft JSON para depuración |
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
# main.py — Mapa del flujo
|
||||
|
||||
## Estructura general
|
||||
|
||||
```
|
||||
main.py
|
||||
├── Constantes: HORARIOS (5 bloques horarios)
|
||||
├── obtener_intervalo(dt) → (intervalo, modo) | None
|
||||
├── segundos_hasta_proximo_inicio(dt) → int
|
||||
├── non_negative_int(value) → int (validador argparse)
|
||||
└── main() → None (bucle infinito envuelto en try/except KeyboardInterrupt)
|
||||
```
|
||||
|
||||
## Proceso de `main()`
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Inicio main] --> B[Parsear args --dias]
|
||||
B --> C[Cargar .env → EMAIL, DOWNLOAD_FOLDER, OUTPUT_FOLDER]
|
||||
C --> Z[try:]
|
||||
Z --> D{Bucle infinito}
|
||||
|
||||
D --> E[inicio_ciclo = datetime.now]
|
||||
E --> F[obtener_intervalo inicio_ciclo]
|
||||
|
||||
F -- Sí, está en horario --> G[Extraer intervalo, modo]
|
||||
G --> H[run_pipeline]:::highlight
|
||||
H --> I[Calcular duración real]
|
||||
I --> J{Duración > intervalo?}
|
||||
J -- Sí --> K[⚠️ Warning]
|
||||
J -- No --> L[dormir = intervalo - duración]
|
||||
K --> L
|
||||
L --> M[💤 Próximo ciclo en dormir seg]
|
||||
M --> N[time.sleep dormir]
|
||||
N --> E
|
||||
|
||||
F -- No, fuera de horario --> O[dormir = segundos_hasta_proximo_inicio]
|
||||
O --> P[Log próxima ejecución]
|
||||
P --> N
|
||||
|
||||
D -. KeyboardInterrupt .-> Q[🛑 Demonio detenido por el usuario]
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
### Paso a paso
|
||||
|
||||
```
|
||||
main()
|
||||
│
|
||||
├── 1. Parsear args (--dias, default=2)
|
||||
│
|
||||
├── 2. Cargar .env → EMAIL, DOWNLOAD_FOLDER, OUTPUT_FOLDER
|
||||
│
|
||||
├── 3. try:
|
||||
│ └── LOOP INFINITO (while True):
|
||||
│ │
|
||||
│ ├── 3.1. inicio_ciclo = datetime.now()
|
||||
│ │
|
||||
│ ├── 3.2. resultado = obtener_intervalo(inicio_ciclo)
|
||||
│ │ │
|
||||
│ ├── ¿Sí está en horario?
|
||||
│ │ │
|
||||
│ │ ├── Extraer (intervalo, modo)
|
||||
│ │ ├── run_pipeline(dias, EMAIL, DOWNLOAD_FOLDER, OUTPUT_FOLDER)
|
||||
│ │ ├── Calcular duración real del ciclo
|
||||
│ │ ├── ⚠️ Si duración > intervalo → warning
|
||||
│ │ └── dormir = max(0, intervalo - duración)
|
||||
│ │
|
||||
│ └── ¿No está en horario?
|
||||
│ │
|
||||
│ ├── dormir = segundos_hasta_proximo_inicio() (06:30 del día siguiente)
|
||||
│ └── Log "Fuera del horario, próxima ejecución en..."
|
||||
│ │
|
||||
│ └── 3.3. time.sleep(dormir) → vuelve a 3.1
|
||||
│
|
||||
└── except KeyboardInterrupt: 🛑 "Demonio detenido por el usuario" (sin traceback)
|
||||
```
|
||||
|
||||
## Bloques horarios definidos
|
||||
|
||||
| Desde | Hasta | Intervalo | Modo |
|
||||
|---------|---------|-----------|----------|
|
||||
| 06:30 | 13:15 | 300s | rápido |
|
||||
| 13:15 | 14:00 | 1800s | full |
|
||||
| 14:00 | 18:30 | 300s | rápido |
|
||||
| 18:30 | 21:30 | 3600s | full |
|
||||
| 00:00 | 05:00 | 60s | rápido |
|
||||
|
||||
Nota: entre las 21:30 y las 00:00, y entre las 05:00 y las 06:30, ningún bloque cubre esos minutos. En esos huecos `obtener_intervalo()` devuelve `None` y `segundos_hasta_proximo_inicio()` calcula el tiempo de espera hasta las 06:30 del día siguiente (no hasta el bloque de las 00:00), por lo que el demonio se queda dormido hasta las 06:30 aunque exista un bloque configurado a las 00:00.
|
||||
|
||||
## Entry point (línea 126-134)
|
||||
|
||||
```
|
||||
if __name__ == "__main__":
|
||||
1. logger_manager.setup_logging()
|
||||
└── Configura logging a archivo rotado (logs/descarga_factura_transporte.log,
|
||||
rotación diaria, 30 días de historial) + consola, y redirige print()/stderr
|
||||
al mismo log (no hace falta migrar cada print a logger.info).
|
||||
2. print(...) banner de inicio, incluyendo logger_manager.LOG_FILE
|
||||
3. main()
|
||||
```
|
||||
@@ -0,0 +1,172 @@
|
||||
# pipeline.py — run_pipeline
|
||||
|
||||
## Estructura general
|
||||
|
||||
```
|
||||
pipeline.py
|
||||
├── CONFIG: RUTA_RED_FACTURACION, RUC_EMPRESA (desde .env)
|
||||
├── HELPERS: _ruta_carpeta(), _copiar_a_red(data, _log)
|
||||
├── PASO 1: step_authenticate() → token | None
|
||||
├── PASO 2: step_fetch_emails() → list[dict]
|
||||
├── _procesar_un_correo() → None (core, funciones anidadas)
|
||||
└── run_pipeline() → None
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Proceso de `run_pipeline()`
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[run_pipeline] --> B[init_db]
|
||||
B --> C[Calcular rango fechas: ayer-dias → hoy]
|
||||
C --> D[step_authenticate]
|
||||
D --> E{Token obtenido?}
|
||||
E -- No --> F[❌ Abortar]
|
||||
E -- Sí --> G[step_fetch_emails]
|
||||
G --> H{Hay correos?}
|
||||
H -- No --> I[Fin]
|
||||
H -- Sí --> J[Bucle: por cada email]
|
||||
J --> K[_procesar_un_correo]:::highlight
|
||||
K --> J
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Proceso de `_procesar_un_correo()`
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[_procesar_un_correo] --> B[1-2. BD: ¿ya procesado?]
|
||||
B -- Sí --> C[⏭️ Saltar]
|
||||
B -- No --> D[Guardar en BD]
|
||||
D --> E[3. _descargar_adjuntos]
|
||||
E --> F{Hay adjuntos?}
|
||||
F -- No --> C
|
||||
F -- Sí --> G[4. _descomprimir ZIPs]
|
||||
G --> H[5. _filtrar_y_limpiar]
|
||||
H --> I{Hay PDF/XML?}
|
||||
I -- No --> C
|
||||
I -- Sí --> J[6. _procesar_pdfs]:::highlight
|
||||
J --> K[7. _procesar_xmls]:::highlight
|
||||
K --> K2[8. _completar_guias]
|
||||
K2 --> K3[9. _validar_guias]
|
||||
K3 --> L{Hay documentos?}
|
||||
L -- No --> C
|
||||
L -- Sí --> M[10. _guardar_resultado]
|
||||
M --> N[11. Filtrar facturas tipo 01]
|
||||
N --> O{Hay facturas?}
|
||||
O -- No --> C
|
||||
O -- Sí --> P[Bucle: por cada factura]
|
||||
|
||||
P --> Q[12. _validate_prices]:::highlight
|
||||
Q --> Q2[12.5 _obtener_valor_referencial_sap]
|
||||
Q2 --> R[13. _build_sap_draft]:::highlight
|
||||
R --> S[14. _guardar_draft_json]
|
||||
S --> T{Todas coinciden?}
|
||||
T -- Sí --> U[15. sapb1_manager.create_draft]
|
||||
T -- No --> V[⏭️ Draft NO creado]
|
||||
U --> W[16. outlook_utilities.send_email]
|
||||
V --> W
|
||||
W --> P
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
`_procesar_xmls` (paso 7) incluye internamente la copia de PDF/XML a la ruta de red (`_copiar_a_red`, ver más abajo) por cada comprobante procesado.
|
||||
|
||||
---
|
||||
|
||||
## Funciones internas de `_procesar_un_correo`
|
||||
|
||||
> `_ruta_carpeta` y `_copiar_a_red` están definidas a nivel de módulo (no anidadas); el resto son funciones anidadas dentro de `_procesar_un_correo`.
|
||||
|
||||
| Función | Línea | Propósito |
|
||||
|---------|-------|-----------|
|
||||
| `_ruta_carpeta()` (módulo) | 33 | Resuelve una ruta relativa al directorio del script |
|
||||
| `_copiar_a_red(data, _log)` (módulo) | 37 | Copia PDF/XML de un comprobante a la ruta de red configurable |
|
||||
| `_descargar_adjuntos()` | 169 | Descarga adjuntos vía Microsoft Graph |
|
||||
| `_descomprimir()` | 198 | Descomprime archivos ZIP |
|
||||
| `_filtrar_y_limpiar()` | 213 | Filtra solo PDF/XML, elimina el resto |
|
||||
| **`_procesar_pdfs()`** | **255** | **Extrae datos de PDFs, renombra, genera cache** |
|
||||
| **`_procesar_xmls(pdf_cache)`** | **310** | **Procesa XMLs, cruza con PDF, asigna guías, copia a red** |
|
||||
| `_completar_guias(documentos, pdf_cache)` | 465 | Completa guías faltantes en líneas XML desde el PDF cache |
|
||||
| `_validar_guias(documentos)` | 524 | Advierte (log) guías con datos incompletos (falta tipo/serie/numero) |
|
||||
| `_guardar_resultado(documentos, datos_pdf)` | 534 | Guarda JSON con datos extraídos (XML y PDF) |
|
||||
| `_calcular_fecha_vencimiento(fecha_base, condicion_pago)` | 665 | Calcula `DocDueDate` = fecha de contabilización + días de `PaymentTermsTypes` |
|
||||
| **`_build_sap_draft(factura, resultados_val)`** | **694** | **Construye payload del draft SAP B1 (incluye `U_VS_ANEXO_PDF`/`U_VS_ANEXO_XML`, `DocDueDate` por condición de pago)** |
|
||||
| **`_validate_prices(factura)`** | **856** | **Valida precios contra DeliveryNotes/Orders SAP** |
|
||||
| `_build_validation_html(resultados)` | 1032 | Genera tabla HTML de validación de precios |
|
||||
| `_obtener_valor_referencial_sap(factura)` | 1062 | Consulta `Sp_ObtenerValorReferencial` en HANA por cada guía única |
|
||||
| `_build_valor_referencial_html(factura, guias_valor_ref)` | 1091 | Genera tabla HTML comparando valor referencial XML vs SAP |
|
||||
| `_build_notification_body(status, factura, validation_table, valor_referencial_table, **kwargs)` | 1127 | Arma cuerpo del email de notificación |
|
||||
| `_guardar_draft_json(draft, serie, numero)` | 1169 | Guarda draft JSON para depuración |
|
||||
|
||||
---
|
||||
|
||||
## `_copiar_a_red(data, _log)` — Copia a ruta de red
|
||||
|
||||
Copia el PDF y el XML de cada comprobante procesado a una ruta de red UNC configurable, en paralelo al guardado local existente (no lo reemplaza). No falla el pipeline si la ruta no está configurada o no está disponible: solo registra una advertencia.
|
||||
|
||||
- **Configuración** (`.env`): `RUTA_RED_FACTURACION` (ruta base UNC) y `RUC_EMPRESA` (RUC fijo de Aberio).
|
||||
- **Estructura de destino**:
|
||||
```
|
||||
{RUTA_RED_FACTURACION}\{año}\{mes}\{día}\{tipo}\{RUC_EMPRESA}\{ruc_emisor}\
|
||||
{RUC_EMPRESA}-{tipo}-{serie}-{numero}_FormatoImpreso.pdf
|
||||
{RUC_EMPRESA}-{tipo}-{serie}-{numero}.xml
|
||||
```
|
||||
`RUC_EMPRESA` es el RUC de Aberio (fijo); `ruc_emisor` es el RUC del proveedor que emitió la factura (varía por comprobante). Año/mes/día salen de `fecha_emision`, sin ceros a la izquierda en mes/día.
|
||||
- Guarda las rutas resultantes en `data["ruta_red_pdf"]` / `data["ruta_red_xml"]`, que luego usa `_build_sap_draft` para llenar `U_VS_ANEXO_PDF` / `U_VS_ANEXO_XML` en el draft SAP B1.
|
||||
- Se invoca desde `_procesar_xmls`, justo después de resolver `data["ruta_pdf"]`.
|
||||
|
||||
---
|
||||
|
||||
## Flujo de llamadas
|
||||
|
||||
```
|
||||
run_pipeline
|
||||
├── database_utilities.init_db
|
||||
├── step_authenticate
|
||||
│ └── outlook_utilities.get_access_token
|
||||
├── step_fetch_emails
|
||||
│ └── outlook_utilities.get_emails
|
||||
└── _procesar_un_correo (por cada email)
|
||||
├── database_utilities.get_existing_ids / save_emails
|
||||
├── _descargar_adjuntos
|
||||
│ └── outlook_utilities.download_attachments
|
||||
├── _descomprimir
|
||||
│ └── email_utilities.descomprimir_adjuntos
|
||||
├── _filtrar_y_limpiar
|
||||
├── _procesar_pdfs
|
||||
│ └── pdf_utilities.extraer_datos_pdf / renombrar_pdf
|
||||
├── _procesar_xmls
|
||||
│ ├── sunat_schema.extraer_datos_xml
|
||||
│ ├── pdf_utilities.extraer_referencias
|
||||
│ └── _copiar_a_red
|
||||
├── _completar_guias
|
||||
├── _validar_guias
|
||||
├── _guardar_resultado
|
||||
│ └── sunat_schema.split_serie_numero, pdf_utilities.TIPO_MAP
|
||||
├── (por cada factura tipo 01)
|
||||
│ ├── _validate_prices
|
||||
│ │ ├── sapb1_manager.get_zonas
|
||||
│ │ └── sapb1_manager.get_delivery_notes
|
||||
│ │ ├── hana_manager.get_delivery (fallback si SL no responde;
|
||||
│ │ │ busca en ODLN y, si no hay, en OWTR)
|
||||
│ │ └── si el DocEntry vino de OWTR (StockTransfers), resuelve
|
||||
│ │ además la Orden de Venta asociada (Orders vía
|
||||
│ │ U_IDC_NUMOV) para poder validar las líneas FL*
|
||||
│ ├── _build_validation_html
|
||||
│ ├── _obtener_valor_referencial_sap
|
||||
│ │ └── hana_manager.obtener_valor_referencial
|
||||
│ ├── _build_valor_referencial_html
|
||||
│ ├── _build_sap_draft
|
||||
│ │ └── sapb1_manager.obtener_condicion_pago (BusinessPartners +
|
||||
│ │ PaymentTermsTypes, para calcular DocDueDate)
|
||||
│ ├── _guardar_draft_json
|
||||
│ ├── sapb1_manager.create_draft (si todas las líneas coinciden)
|
||||
│ ├── _build_notification_body
|
||||
│ └── outlook_utilities.send_email
|
||||
```
|
||||
@@ -1,29 +0,0 @@
|
||||
# Pipeline Completo
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["📬 Correo recibido"] --> B{"1-2. BD check<br>¿Ya procesado?"}
|
||||
B -->|"Sí"| C["⏭️ Saltar correo"]
|
||||
B -->|"No"| D["3. Descargar adjuntos<br>Microsoft Graph"]
|
||||
D --> E{"¿Hay adjuntos?"}
|
||||
E -->|No| C
|
||||
E -->|Sí| F["4. Descomprimir ZIPs"]
|
||||
F --> G["5. Filtrar solo PDF/XML"]
|
||||
G --> H{"¿Quedan válidos?"}
|
||||
H -->|No| C
|
||||
H -->|Sí| I["6. Procesar PDFs<br>extraer datos + renombrar"]
|
||||
I --> J["7. Procesar XMLs<br>cruzar con PDF cache"]
|
||||
J --> K["8. Guardar resultado JSON"]
|
||||
K --> L["9. Filtrar facturas tipo 01"]
|
||||
L --> M{"¿Hay facturas?"}
|
||||
M -->|No| N["⏭️ Sin facturas para SAP"]
|
||||
M -->|Sí| O["10. Validar precios<br>_validate_prices()"]
|
||||
O --> P["11. Construir draft SAP<br>_build_sap_draft()"]
|
||||
P --> Q["12. Guardar draft JSON"]
|
||||
Q --> R{"13. ¿Precios coinciden?"}
|
||||
R -->|Sí| S["Crear Draft en SAP B1<br>POST /Drafts"]
|
||||
R -->|No| T["Notificar: validación falló"]
|
||||
S --> U["14. Enviar email notificación"]
|
||||
T --> U
|
||||
N --> U
|
||||
```
|
||||
@@ -0,0 +1,262 @@
|
||||
# _procesar_pdfs — Extracción de datos desde PDFs
|
||||
|
||||
## Ubicación
|
||||
|
||||
- **Archivo:** `pipeline.py` (línea 255-308, función anidada en `_procesar_un_correo`)
|
||||
- **Librería:** `pdf_utilities.py` (línea 1-464)
|
||||
|
||||
---
|
||||
|
||||
## Flujo general
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[_procesar_pdfs] --> B[Iterar adjuntos del email]
|
||||
B --> C{Es .pdf?}
|
||||
C -- No --> B
|
||||
C -- Sí --> D[extraer_datos_pdf]:::highlight
|
||||
D --> E{Hay datos sin error?}
|
||||
E -- No --> F[⚠️ Log error]
|
||||
F --> B
|
||||
E -- Sí --> G[renombrar_pdf]:::highlight
|
||||
G --> H[Actualizar email.adjuntos]
|
||||
H --> I[Acumular en datos_pdf]
|
||||
I --> J[Guardar en pdf_cache]
|
||||
J --> B
|
||||
|
||||
B -- Fin --> K{datos_pdf vacío?}
|
||||
K -- No --> L[email.datos_pdf = datos_pdf]
|
||||
K -- Sí --> M[return pdf_cache]
|
||||
L --> M
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Paso a paso
|
||||
|
||||
```
|
||||
_procesar_pdfs() → dict (pdf_cache)
|
||||
│
|
||||
├── carpeta = _ruta_carpeta(download_folder)
|
||||
│
|
||||
├── Por cada adjunto en email["adjuntos"]:
|
||||
│ │
|
||||
│ ├── ¿No termina en ".pdf"? → continue
|
||||
│ │
|
||||
│ ├── pdf_path = carpeta + adjunto
|
||||
│ │
|
||||
│ ├── extraer_datos_pdf(pdf_path) → data
|
||||
│ │ └── (ver detalle abajo)
|
||||
│ │
|
||||
│ ├── ¿data válido y sin error?
|
||||
│ │ │
|
||||
│ │ ├── renombrar_pdf(pdf_path, data) → nuevo_path
|
||||
│ │ │ └── formato: {ruc}-{tipo}-{serie}-{numero}.pdf
|
||||
│ │ │
|
||||
│ │ ├── Si cambió el nombre:
|
||||
│ │ │ ├── email["adjuntos"][idx] = nuevo_nombre
|
||||
│ │ │ └── data["archivo"] = nuevo_nombre
|
||||
│ │ │
|
||||
│ │ ├── datos_pdf.append(data)
|
||||
│ │ ├── pdf_cache[canonical] = data
|
||||
│ │ └── 📄 PDF procesado: {canonical}
|
||||
│ │
|
||||
│ └── ¿Error? → ⚠️ PDF no procesado: {error}
|
||||
│
|
||||
├── Si hay datos → email["datos_pdf"] = datos_pdf
|
||||
│
|
||||
└── return pdf_cache
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## `extraer_datos_pdf(pdf_path)` `:highlight` — Detalle
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[extraer_datos_pdf] --> B[pdfplumber.open]
|
||||
B --> C[Extraer texto de todas las páginas]
|
||||
C --> D[_extract_base_data]:::highlight
|
||||
D --> E{Qué tipo de documento?}
|
||||
|
||||
E -- FACTURA --> F[_extract_factura_details]:::highlight
|
||||
F --> G[_extract_detraccion_spatial]
|
||||
|
||||
E -- GUIA DE REMISION --> H[_extract_guia_remision_details]:::highlight
|
||||
|
||||
E -- GUIA DE REMISION TRANSPORTISTA --> I[_extract_guia_transportista_details]:::highlight
|
||||
|
||||
E -- BOLETA / otro --> J[return data]
|
||||
|
||||
G --> J
|
||||
H --> J
|
||||
I --> J
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
### `_extract_base_data(text, path)` — Datos base
|
||||
|
||||
Extrae del texto plano del PDF mediante regex:
|
||||
|
||||
| Campo | Fuente |
|
||||
|-------|--------|
|
||||
| `ruc_emisor` | `R.U.C. {11 dígitos}` o nombre del archivo o primer RUC en el texto |
|
||||
| `tipo_documento` | "FACTURA ELECTRÓNICA" / "BOLETA DE VENTA" / "GUÍA DE REMISIÓN" / "GUÍA DE REMISIÓN TRANSPORTISTA" |
|
||||
| `serie_numero` | `{4 caracteres} - {números}` ej: `F002-486` |
|
||||
| `fecha_emision` | `dd/mm/yyyy` |
|
||||
| `ruc_receptor` | Segundo RUC de 11 dígitos encontrado |
|
||||
| `nombre_receptor` | Línea con `SEÑOR(ES) / CLIENTE / RAZÓN SOCIAL / ADQUIRIENTE` |
|
||||
| `monto_total` | `TOTAL / IMPORTE TOTAL / NETO A PAGAR` |
|
||||
|
||||
---
|
||||
|
||||
### `_extract_factura_details(text, data)` `:highlight` — Factura
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[_extract_factura_details] --> B[Buscar monto_total]
|
||||
B --> C[Inicializar items[] y detraccion]
|
||||
C --> D[Buscar cabecera de tabla]
|
||||
D --> E[Parsear filas de items]
|
||||
E --> F[Por cada item extraer:]
|
||||
F --> G[guias_remision]
|
||||
F --> H[guia_transportista]
|
||||
F --> I[bolsas]
|
||||
F --> J[peso / unidad_peso]
|
||||
J --> K[Buscar detraccion]
|
||||
K --> L[return]
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
**Items de tabla** (detecta ≥3 headers entre: CANT, DESCRIP, PRECIO, TOTAL, UNIT, VALOR, CÓDIGO, ITEM):
|
||||
|
||||
| Campo | Descripción |
|
||||
|-------|-------------|
|
||||
| `codigo` | Código alfanumérico del producto (opcional) |
|
||||
| `cantidad` | Cantidad numérica |
|
||||
| `descripcion` | Descripción del ítem |
|
||||
| `precio_unitario` | Precio unitario |
|
||||
| `total` | Total por línea |
|
||||
|
||||
**Por cada item**, parsea desde la descripción:
|
||||
|
||||
| Campo | Regex |
|
||||
|-------|-------|
|
||||
| `guias_remision[]` | `GRR / GR / G.R.R. / GUIA REMISION: {serie}-{num}` |
|
||||
| `guia_transportista` | `GRT / G.R.T. / GUIA TRANSPORTISTA: {serie}-{num}` |
|
||||
| `bolsas` | `{n} BOLSAS / BLS / SACOS` |
|
||||
| `peso` / `unidad_peso` | `PESO: {valor} {TN/KG}` |
|
||||
|
||||
**Detracción**: Detecta si tiene detracción, porcentaje y monto.
|
||||
|
||||
---
|
||||
|
||||
### `_extract_guia_remision_details(text, data)` `:highlight` — Guía de Remisión
|
||||
|
||||
Extrae del texto:
|
||||
|
||||
| Campo | Descripción |
|
||||
|-------|-------------|
|
||||
| `peso_total` | Peso Total |
|
||||
| `punto_partida` | Punto de Partida |
|
||||
| `punto_llegada` | Punto de Llegada |
|
||||
| `placa` | Placa del vehículo |
|
||||
| `marca` | Marca del vehículo |
|
||||
| `chofer` | Nombre del chofer |
|
||||
| `brevete` | N° de brevete |
|
||||
| `configuracion_vehicular` | Configuración vehicular |
|
||||
| `items[]` | Lista de {cantidad, unidad, descripcion} |
|
||||
|
||||
---
|
||||
|
||||
### `_extract_guia_transportista_details(text, data)` `:highlight` — Guía de Remisión Transportista
|
||||
|
||||
Extrae del texto:
|
||||
|
||||
| Campo | Descripción |
|
||||
|-------|-------------|
|
||||
| `punto_partida` | Punto de Partida |
|
||||
| `punto_llegada` | Punto de Llegada |
|
||||
| `nombre_remitente` / `ruc_remitente` | Datos del remitente |
|
||||
| `nombre_destinatario` / `ruc_destinatario` | Datos del destinatario |
|
||||
| `documentos_relacionados[]` | Documentos relacionados |
|
||||
| `peso_bruto_total_carga` | Peso bruto total |
|
||||
| `unidad_medida_peso_bruto` | Unidad de medida |
|
||||
| `indicador_pagador_flete` | Indicador del pagador |
|
||||
| `nombre_pagador` / `ruc_pagador` | Datos del pagador |
|
||||
| `datos_vehiculos[]` | Lista de {placa} |
|
||||
| `datos_conductores[]` | Lista de {nombre, brevete} |
|
||||
| `observaciones` | Observaciones |
|
||||
|
||||
---
|
||||
|
||||
## `renombrar_pdf(pdf_path, data)` `:highlight`
|
||||
|
||||
```
|
||||
renombrar_pdf(pdf_path, data) → nuevo_path
|
||||
│
|
||||
└── generar_nombre_pdf(data) → nombre canónico
|
||||
│
|
||||
├── ruc = data["ruc_emisor"]
|
||||
├── abrev = TIPO_MAP[data["tipo_documento"]]
|
||||
│ └── FACTURA → "01", BOLETA → "03",
|
||||
│ GUIA DE REMISION → "09", GUIA DE REMISION TRANSPORTISTA → "31"
|
||||
├── serie, numero = data["serie_numero"].split("-")
|
||||
│ └── numero = numero.lstrip("0") → elimina ceros a la izquierda
|
||||
│
|
||||
└── "{ruc}-{abrev}-{serie}-{numero}.pdf"
|
||||
ej: "20537929520-01-F002-486.pdf"
|
||||
|
||||
└── os.rename(origen, destino)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Tipos de documento detectados
|
||||
|
||||
| Tipo detectado | Código | Sección extraída |
|
||||
|----------------|--------|------------------|
|
||||
| FACTURA ELECTRÓNICA | 01 | Items, detracción, guías de remisión |
|
||||
| BOLETA DE VENTA | 03 | Solo datos base |
|
||||
| GUÍA DE REMISIÓN | 09 | Peso, destino, vehículo, items |
|
||||
| GUÍA DE REMISIÓN TRANSPORTISTA | 31 | Remitente, destinatario, vehículos, conductores |
|
||||
|
||||
---
|
||||
|
||||
## Salida
|
||||
|
||||
```python
|
||||
# pdf_cache → dict
|
||||
{
|
||||
"20537929520-01-F002-486.pdf": {
|
||||
"archivo": "20537929520-01-F002-486.pdf",
|
||||
"ruc_emisor": "20537929520",
|
||||
"tipo_documento": "FACTURA",
|
||||
"serie_numero": "F002-486",
|
||||
"fecha_emision": "08/07/2026",
|
||||
"ruc_receptor": "20123456789",
|
||||
"nombre_receptor": "EMPRESA SAC",
|
||||
"monto_total": "4680.00",
|
||||
"items": [
|
||||
{
|
||||
"cantidad": "350",
|
||||
"descripcion": "FLETE T001-127773 PESO: 23.26 TN GRR: T001-127773",
|
||||
"precio_unitario": "1.3396",
|
||||
"total": "468.86",
|
||||
"guias_remision": ["T001-127773"],
|
||||
"guia_transportista": None,
|
||||
"bolsas": None,
|
||||
"peso": "23.26",
|
||||
"unidad_peso": "TN"
|
||||
}
|
||||
],
|
||||
"detraccion": {"tiene": True, "porcentaje": "4.00", "monto": "187.20"}
|
||||
}
|
||||
}
|
||||
|
||||
# email["datos_pdf"] → list[dict] (misma estructura)
|
||||
```
|
||||
@@ -0,0 +1,279 @@
|
||||
# _procesar_xmls — Extracción y cruce de datos desde XML
|
||||
|
||||
## Ubicación
|
||||
|
||||
- **Archivo:** `pipeline.py` (línea 310-463, función anidada en `_procesar_un_correo`)
|
||||
- **Librería:** `sunat_schema.py` (línea 1-720)
|
||||
|
||||
---
|
||||
|
||||
## Flujo general
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[_procesar_xmls] --> B[Iterar adjuntos del email]
|
||||
B --> C{Es .xml?}
|
||||
C -- No --> B
|
||||
C -- Sí --> D[extraer_datos_xml]:::highlight
|
||||
D --> E{Hay datos?}
|
||||
E -- No --> F[ℹ️ XML sin datos]
|
||||
F --> B
|
||||
E -- Sí --> CDR{Es CDR?}
|
||||
CDR -- Sí --> CDR2[Solo renombrar, continue]
|
||||
CDR2 --> B
|
||||
CDR -- No --> G[Renombrar XML a nombre canónico]
|
||||
G --> H[Construir nombre PDF canónico y buscarlo]
|
||||
H --> RED[_copiar_a_red]:::highlight
|
||||
RED --> I[Cruzar documentos_referencia desde PDF si faltan]:::highlight
|
||||
I --> J[Asignar guías de remisión por línea]:::highlight
|
||||
J --> K[Agregar a lista de documentos]
|
||||
K --> B
|
||||
|
||||
B -- Fin --> L[Post-proceso: resolver GRE desde guía transportista referenciada]:::highlight
|
||||
L --> M[return documentos]
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Paso a paso
|
||||
|
||||
```
|
||||
_procesar_xmls(pdf_cache) → list[dict]
|
||||
│
|
||||
├── carpeta = _ruta_carpeta(download_folder)
|
||||
│
|
||||
├── Por cada adjunto en email["adjuntos"]:
|
||||
│ │
|
||||
│ ├── ¿No termina en ".xml"? → continue
|
||||
│ │
|
||||
│ ├── xml_path = carpeta + adjunto
|
||||
│ │
|
||||
│ ├── sunat_schema.extraer_datos_xml(xml_path) → data | None
|
||||
│ │ └── Procesa Invoice tipo 01, DespatchAdvice tipo 09 y 31, y CDR (ApplicationResponse)
|
||||
│ │
|
||||
│ ├── ¿data es None? → ℹ️ XML sin datos, continue
|
||||
│ │
|
||||
│ ├── ¿data["es_cdr"]? → solo renombrar a "CDR-{ruc}-{tipo}-{serie}-{numero}.xml", continue
|
||||
│ │
|
||||
│ ├── data["ruta_xml"] = xml_path
|
||||
│ │
|
||||
│ ├── Renombrar XML a nombre canónico:
|
||||
│ │ └── "{ruc_emisor}-{tipo}-{serie}-{numero}.xml"
|
||||
│ │
|
||||
│ ├── Construir nombre PDF canónico y buscar el PDF asociado:
|
||||
│ │ ├── 1. Mismo nombre canónico con extensión .pdf
|
||||
│ │ └── 2. Fallback: mismo nombre que el XML renombrado, con extensión .pdf
|
||||
│ │ └── data["ruta_pdf"] = ruta encontrada o None
|
||||
│ │
|
||||
│ ├── _copiar_a_red(data, _log)
|
||||
│ │ └── Copia PDF/XML a la ruta de red (RUTA_RED_FACTURACION), si está configurada.
|
||||
│ │ Guarda data["ruta_red_pdf"] / data["ruta_red_xml"] (ver docs/pipeline.md).
|
||||
│ │
|
||||
│ ├── ¿data sin documentos_referencia?
|
||||
│ │ ├── Buscar en pdf_cache por nombre canónico
|
||||
│ │ │ └── pdf_utilities.extraer_referencias(items) → refs
|
||||
│ │ ├── Si no → fallback: buscar en email["datos_pdf"]
|
||||
│ │ └── Si encuentra → data["documentos_referencia"] = refs
|
||||
│ │
|
||||
│ ├── Asignar guías de remisión y transportista por línea (ver prioridad abajo)
|
||||
│ │
|
||||
│ └── ✅ Agregar data a documentos[]
|
||||
│
|
||||
├── Post-procesamiento — resolver GRE desde guía de transporte referenciada:
|
||||
│ ├── guia_lookup = {(tipo, serie, numero): doc} para cada documento tipo 09/31 del correo
|
||||
│ └── Por cada factura (tipo 01), por cada documento_referencia tipo 31:
|
||||
│ ├── Buscar la guía transportista en guia_lookup
|
||||
│ ├── Tomar sus documentos_referencia tipo 09 (GRE) propios
|
||||
│ └── Asignarlos a las líneas de la factura que aún no tengan guias_remision
|
||||
│
|
||||
└── return documentos
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## `extraer_datos_xml(xml_path)` `:highlight`
|
||||
|
||||
### Flujo de decisión
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[extraer_datos_xml] --> B[ET.parse xml]
|
||||
B --> C{Tag raíz?}
|
||||
|
||||
C -- ApplicationResponse --> CDR[_parse_application_response]:::highlight
|
||||
CDR --> I2[return dict con es_cdr=True]
|
||||
|
||||
C -- Invoice --> D{tipo == 01?}
|
||||
D -- Sí --> E[_parse_invoice]:::highlight
|
||||
D -- No --> F[return None]
|
||||
|
||||
C -- DespatchAdvice --> G{tipo en 09, 31?}
|
||||
G -- Sí --> H[_parse_despatch_advice]:::highlight
|
||||
G -- No --> F
|
||||
|
||||
C -- Otro --> F
|
||||
|
||||
E --> I[return datos.to_dict]
|
||||
H --> I
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
Procesa **Facturas tipo 01**, **Guías de Remisión Remitente tipo 09**, **Guías de Remisión Transportista tipo 31**, y **CDR** (`ApplicationResponse`, solo para renombrar el archivo, no se agrega a `documentos[]`).
|
||||
|
||||
---
|
||||
|
||||
### `_parse_invoice(root)` — Factura tipo 01
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[_parse_invoice] --> B[ID → serie, numero]
|
||||
B --> C[IssueDate → fecha_emision]
|
||||
C --> D[InvoiceTypeCode → tipo]
|
||||
D --> E[AccountingSupplierParty → ruc_emisor, razon_social]
|
||||
E --> F[AccountingCustomerParty → ruc_receptor, razon_social]
|
||||
F --> G[LegalMonetaryTotal → total_factura]
|
||||
G --> H[DespatchDocumentReference → documentos_referencia]
|
||||
H --> I{¿Hay refs?}
|
||||
I -- No --> J[Buscar en descripción de 1ra línea]
|
||||
I -- Sí --> K{Solo si tipo == 01}
|
||||
J --> K
|
||||
K --> L[PaymentTerms → detracción]
|
||||
L --> M[InvoiceLine → líneas de detalle]
|
||||
M --> N[return DatosComprobante]
|
||||
|
||||
classDef highlight fill:#fff3e0,stroke:#e65100,stroke-width:3px;
|
||||
```
|
||||
|
||||
**Documentos de referencia** se obtienen de dos formas:
|
||||
|
||||
| Origen | Cómo |
|
||||
|--------|------|
|
||||
| `DespatchDocumentReference` | Tags XML estándar SUNAT (`cbc:ID`, `cbc:DocumentTypeCode`) |
|
||||
| Fallback en descripción | Si no hay refs, busca en `cbc:Description` de la primera línea con regex `{serie}-{numero}` |
|
||||
|
||||
**Detracción** se extrae de `PaymentTerms` con `ID = "Detraccion"`:
|
||||
|
||||
| Campo | Tag |
|
||||
|-------|-----|
|
||||
| `codigo_detraccion` | `cbc:PaymentMeansID` |
|
||||
| `porcentaje_detraccion` | `cbc:PaymentPercent` |
|
||||
| `monto_detraccion` | `cbc:Amount` |
|
||||
|
||||
**Líneas de detalle** (`InvoiceLine`):
|
||||
|
||||
| Campo | Tag |
|
||||
|-------|-----|
|
||||
| `descripcion` | `cac:Item/cbc:Description` |
|
||||
| `cantidad` | `cbc:InvoicedQuantity` |
|
||||
| `precio_unitario` | `cac:PricingReference/cac:AlternativeConditionPrice/cbc:PriceAmount` o `cac:Price/cbc:PriceAmount` |
|
||||
| `total_linea` | `cbc:LineExtensionAmount` |
|
||||
| `guias_remision[]` / `guia_transportista` | Parseadas desde `cbc:Note` de la línea (`extraer_guias_desde_notes`) — ver prioridad de asignación más abajo |
|
||||
| `valor_referencial` | Extraído de la descripción del ítem, del `Note` de la línea, o de los `Note` a nivel de documento (`extraer_valor_referencial`) |
|
||||
|
||||
---
|
||||
|
||||
### `_parse_despatch_advice(root)` — Guías tipo 09 y 31
|
||||
|
||||
La misma función procesa tanto la Guía de Remisión Remitente (09) como la Guía de Remisión Transportista (31); el `tipo` viene de `DespatchAdviceTypeCode`.
|
||||
|
||||
| Campo | Tag |
|
||||
|-------|-----|
|
||||
| `ruc_emisor` | `DespatchSupplierParty/Party/PartyIdentification/ID` |
|
||||
| `razon_social_emisor` | `PartyName/Name` o `PartyLegalEntity/RegistrationName` |
|
||||
| `ruc_receptor` | `DeliveryCustomerParty/Party/PartyIdentification/ID` |
|
||||
| `razon_social_receptor` | `PartyLegalEntity/RegistrationName` |
|
||||
| `punto_partida` | `Delivery/Despatch/DespatchAddress/AddressLine/Line` |
|
||||
| `punto_llegada` | `Delivery/DeliveryAddress/AddressLine/Line` |
|
||||
| `peso_bruto` | `GrossWeightMeasure` |
|
||||
| `unidad_peso_bruto` | `GrossWeightMeasure` (atributo `unitCode`) |
|
||||
| `fecha_traslado` | `ShipmentStage/TransitPeriod/StartDate` |
|
||||
| `vehiculo_principal` | `TransportHandlingUnit/TransportEquipment/ID` |
|
||||
| `vehiculo_secundario` | `TransportHandlingUnit/TransportEquipment/AttachedTransportEquipment/ID` |
|
||||
| `licencia_conductor` | `ShipmentStage/DriverPerson/IdentityDocumentReference/ID` |
|
||||
| `nombre_conductor` | `ShipmentStage/DriverPerson/FirstName` |
|
||||
| `documento_conductor` | `ShipmentStage/DriverPerson/ID` |
|
||||
| `ubigeo_partida` | `Delivery/Despatch/DespatchAddress/ID` |
|
||||
| `lineas[]` | `DespatchLine` con `DeliveredQuantity` y `Item/Description` |
|
||||
|
||||
Documentos de referencia desde `AdditionalDocumentReference` (para la guía transportista, típicamente referencian la GRE — guía remitente — asociada).
|
||||
|
||||
---
|
||||
|
||||
## Cruce de referencias `:highlight`
|
||||
|
||||
### 1. Completar `documentos_referencia` desde PDF
|
||||
|
||||
Si el XML no trae documentos de referencia, se buscan en el PDF cache:
|
||||
|
||||
```
|
||||
pdf_cache[nombre_canonico].items[] → extraer_referencias()
|
||||
└── Por cada item:
|
||||
├── guias_remision[] → ref tipo 09
|
||||
└── guia_transportista → ref tipo 31
|
||||
```
|
||||
|
||||
### 2. Asignar guías por línea (dentro de `_procesar_xmls`)
|
||||
|
||||
Prioridad para asignar `guias_remision` y `guia_transportista` a cada línea de la factura, en el orden en que realmente se aplican en el código:
|
||||
|
||||
| Prioridad | Origen | Descripción |
|
||||
|-----------|--------|-------------|
|
||||
| 1ª | `notes_text` (ya resuelto en `sunat_schema._parse_invoice`) | Si la línea ya trae `guias_remision`/`guia_transportista` extraídos del `cbc:Note` del XML (vía `extraer_guias_desde_notes`), se conservan tal cual. |
|
||||
| 2ª | `documentos_referencia` (`refs_09`/`refs_31`) | Si la línea no trajo guías desde `notes_text`, se asigna posicionalmente desde `documentos_referencia` (`refs_09[i]`, `refs_31[i]`; la última línea recibe todas las refs restantes). |
|
||||
|
||||
### 3. Post-procesamiento — resolver GRE desde guía de transporte referenciada
|
||||
|
||||
Después de procesar todos los XML del correo, si una factura referencia una **guía transportista (31)** y esa guía (presente como documento independiente en el mismo correo) referencia a su vez una o más **GRE (09)**, esas GRE se propagan a las líneas de la factura que aún no tengan `guias_remision` asignadas.
|
||||
|
||||
### 4. `_completar_guias` (paso posterior, fuera de `_procesar_xmls`)
|
||||
|
||||
Si tras los pasos anteriores alguna línea sigue sin `guias_remision`, `_completar_guias` (ver `docs/pipeline.md`) las copia desde los `items[]` del PDF cache, parseando el texto con regex (`{T/V/E}{serie}-{numero}`).
|
||||
|
||||
---
|
||||
|
||||
## Datos que produce
|
||||
|
||||
```python
|
||||
# documentos → list[dict]
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20537929520",
|
||||
"razon_social_emisor": "TRANSPORTES S.A.C.",
|
||||
"fecha_emision": "2026-07-08",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "486",
|
||||
"ruc_receptor": "20123456789",
|
||||
"razon_social_receptor": "CLIENTE S.A.",
|
||||
"total_factura": 4680.0,
|
||||
"tiene_detraccion": True,
|
||||
"codigo_detraccion": "014",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 187.20,
|
||||
"documentos_referencia": [
|
||||
{"tipo": "09", "serie": "T001", "numero": "127773"}
|
||||
],
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "FLETE T001-127773",
|
||||
"cantidad": 350.0,
|
||||
"precio_unitario": 1.3396,
|
||||
"total_linea": 468.86,
|
||||
"guias_remision": [{"tipo": "09", "serie": "T001", "numero": "127773"}],
|
||||
"guia_transportista": None,
|
||||
"valor_referencial": 468.86
|
||||
}
|
||||
],
|
||||
"ruta_xml": "/path/to/20537929520-01-F002-486.xml",
|
||||
"ruta_pdf": "/path/to/20537929520-01-F002-486.pdf",
|
||||
"ruta_red_pdf": "\\\\192.168.9.66\\b1_shf\\Facturacion Electronica\\PRODUCCION\\2026\\7\\8\\01\\20100029741\\20537929520\\20100029741-01-F002-486_FormatoImpreso.pdf",
|
||||
"ruta_red_xml": "\\\\192.168.9.66\\b1_shf\\Facturacion Electronica\\PRODUCCION\\2026\\7\\8\\01\\20100029741\\20537929520\\20100029741-01-F002-486.xml",
|
||||
"tipo_descripcion": "Factura"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
`ruta_red_pdf`/`ruta_red_xml` solo aparecen si `RUTA_RED_FACTURACION` está configurada en `.env` y la copia fue exitosa; se usan luego en `_build_sap_draft` para llenar `U_VS_ANEXO_PDF`/`U_VS_ANEXO_XML` (ver `docs/pipeline.md`).
|
||||
@@ -12,7 +12,11 @@ flowchart TD
|
||||
|
||||
F -->|Sí| H["Por cada guía en guias[]"]
|
||||
H --> I["Consultar SAP B1<br>get_delivery_notes()"]
|
||||
I --> J["Por cada DeliveryNote"]
|
||||
I --> I2{"¿Guía encontrada en<br>ODLN o en OWTR?"}
|
||||
I2 -->|ODLN| I3["Documento = DeliveryNotes(DocEntry)"]
|
||||
I2 -->|OWTR| I4["Documento = StockTransfers(DocEntry)<br>→ leer U_IDC_NUMOV<br>→ Documento = Orders(U_IDC_NUMOV)"]
|
||||
I3 --> J["Por cada documento<br>(DeliveryNote u Orden de Venta)"]
|
||||
I4 --> J
|
||||
|
||||
J --> K["Obtener zona desde<br>U_IDC_DESTINO"]
|
||||
K --> L["Extraer WarehouseCode<br>de DocumentLines[0]"]
|
||||
|
||||
@@ -1,29 +1,5 @@
|
||||
import os
|
||||
import zipfile
|
||||
import database_utilities
|
||||
|
||||
# ============================================================================
|
||||
def quitar_correos_ya_registrados_en_base_de_datos(emails: list[dict]) -> list[dict]:
|
||||
"""
|
||||
Verifica cuáles correos son nuevos (no están en la BD), los guarda
|
||||
y retorna la lista filtrada de los que tienen adjuntos.
|
||||
"""
|
||||
if not emails:
|
||||
return []
|
||||
|
||||
# 1. Verificar cuáles ya existen en la BD
|
||||
ids = [e['id'] for e in emails]
|
||||
existentes = database_utilities.get_existing_ids(ids)
|
||||
|
||||
# Solo nos quedamos con los que NO están en la BD
|
||||
correos_no_registrados = [e for e in emails if e['id'] not in existentes]
|
||||
print(f"Correos nuevos detectados: {len(correos_no_registrados)}")
|
||||
|
||||
if correos_no_registrados:
|
||||
print("Guardando nuevos correos en la base de datos...")
|
||||
database_utilities.save_emails(correos_no_registrados)
|
||||
|
||||
return correos_no_registrados
|
||||
|
||||
# ============================================================================
|
||||
def descomprimir_adjuntos(emails: list[dict], ruta: str) -> list[dict]:
|
||||
@@ -73,21 +49,4 @@ def filtrar_archivos_validos(archivos: list[str]) -> list[str]:
|
||||
return [a for a in archivos if a.lower().endswith(extensiones_validas)]
|
||||
|
||||
# ============================================================================
|
||||
def procesar_adjuntos_email(e: dict, archivos: list[str], ruta_descarga: str) -> list[str]:
|
||||
"""
|
||||
Descomprime y filtra los archivos de un correo.
|
||||
Retorna la lista de archivos válidos si existen, de lo contrario lista vacía.
|
||||
"""
|
||||
# 1. Descomprimir archivos ZIP si existen
|
||||
archivos_procesados = descomprimir_adjuntos(archivos, ruta_descarga)
|
||||
|
||||
# 2. Filtrar solo PDF y XML
|
||||
archivos_validos = filtrar_archivos_validos(archivos_procesados)
|
||||
|
||||
if archivos_validos:
|
||||
e['archivos'] = archivos_validos
|
||||
return archivos_validos
|
||||
return []
|
||||
|
||||
# ============================================================================
|
||||
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
from datetime import datetime, date
|
||||
from hdbcli import dbapi
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# ============================================================================
|
||||
# CONFIGURACIÓN
|
||||
# ============================================================================
|
||||
|
||||
# Cargar variables de entorno desde .env (ruta absoluta: no depende del
|
||||
# directorio de trabajo desde el que se lance el proceso)
|
||||
load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
|
||||
|
||||
# Configuración de la API
|
||||
HANA_HOST = os.getenv("HANA_SERVER", "")
|
||||
HANA_PORT = int(os.getenv("HANA_PORT", 30015))
|
||||
HANA_USER = os.getenv("HANA_USER", "")
|
||||
HANA_PASSWORD = os.getenv("HANA_PASSWORD", "")
|
||||
HANA_SCHEMA = os.getenv("HANA_SCHEMA", "")
|
||||
|
||||
# ============================================================================
|
||||
def get_connection():
|
||||
"""Crea y retorna una conexión a SAP HANA."""
|
||||
try:
|
||||
conn = dbapi.connect(
|
||||
address=HANA_HOST,
|
||||
port=HANA_PORT,
|
||||
user=HANA_USER,
|
||||
password=HANA_PASSWORD
|
||||
)
|
||||
return conn
|
||||
except Exception as e:
|
||||
print(f" ❌ Error conectando a HANA: {e}")
|
||||
return None
|
||||
|
||||
# ============================================================================
|
||||
def get_delivery(tipo: str, serie: str, numero: str) -> list:
|
||||
"""
|
||||
Consulta la tabla ODLN en SAP HANA para obtener DeliveryNotes.
|
||||
Si no encuentra el tipo, serie y número en ODLN, busca en OWTR
|
||||
(Traslados de Inventario) como fallback.
|
||||
|
||||
Args:
|
||||
tipo: Código de tipo de documento SUNAT, ej. "09"/"31" (U_BPP_MDTD).
|
||||
serie: Serie del documento, ej. "T001" (U_BPP_MDSD).
|
||||
numero: Número del documento (se busca con LIKE).
|
||||
|
||||
Returns:
|
||||
list[dict] — Lista con DocEntry, DocNum, CardCode, CardName, Tabla.
|
||||
"Tabla" indica en qué tabla se encontró el registro ("ODLN" u
|
||||
"OWTR"), para que el llamador sepa qué endpoint de Service Layer
|
||||
usar (DeliveryNotes o StockTransfers).
|
||||
"""
|
||||
connection = get_connection()
|
||||
if not connection:
|
||||
return []
|
||||
|
||||
try:
|
||||
results = _query_delivery_table(connection, "ODLN", tipo, serie, numero)
|
||||
if results:
|
||||
return results
|
||||
return _query_delivery_table(connection, "OWTR", tipo, serie, numero)
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
# ============================================================================
|
||||
def _query_delivery_table(connection, tabla: str, tipo: str, serie: str, numero: str) -> list:
|
||||
"""Ejecuta la consulta de tipo/serie/número contra la tabla indicada (ODLN u OWTR)."""
|
||||
schema = HANA_SCHEMA
|
||||
query = f'''SELECT "DocEntry", "DocNum", "CardCode", "CardName"
|
||||
FROM "{schema}"."{tabla}"
|
||||
WHERE "CANCELED" = 'N'
|
||||
AND "U_BPP_MDTD" = ?
|
||||
AND "U_BPP_MDSD" = ?
|
||||
AND "U_BPP_MDCD" LIKE ?'''
|
||||
|
||||
pattern = f"%{numero}%"
|
||||
|
||||
cursor = None
|
||||
try:
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(query, (tipo, serie, pattern))
|
||||
columns = [column[0] for column in cursor.description]
|
||||
results = []
|
||||
for row in cursor.fetchall():
|
||||
registro = dict(zip(columns, row))
|
||||
registro["Tabla"] = tabla
|
||||
results.append(registro)
|
||||
return results
|
||||
except Exception as e:
|
||||
print(f" ❌ Error en consulta HANA get_delivery ({tabla}): {e}")
|
||||
return []
|
||||
finally:
|
||||
if cursor:
|
||||
cursor.close()
|
||||
|
||||
# ============================================================================
|
||||
def obtener_valor_referencial(serie: str, numero: str) -> float:
|
||||
"""
|
||||
Ejecuta el stored procedure Sp_ObtenerValorReferencial en SAP HANA para
|
||||
obtener el valor referencial de una guía de remisión (tipo 09).
|
||||
|
||||
Args:
|
||||
serie: Serie de la guía de remisión (ej. "T001").
|
||||
numero: Número de la guía de remisión (ej. "132800").
|
||||
|
||||
Returns:
|
||||
float — Columna ``ValorReferencial`` del primer registro devuelto
|
||||
por el SP, o 0.0 si no hay resultados o si ocurre un error.
|
||||
"""
|
||||
schema = HANA_SCHEMA
|
||||
query = f'CALL "{schema}"."Sp_ObtenerValorReferencial"(?, ?)'
|
||||
|
||||
connection = get_connection()
|
||||
if not connection:
|
||||
return 0.0
|
||||
|
||||
cursor = None
|
||||
try:
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(query, (serie, numero))
|
||||
columns = [column[0] for column in cursor.description]
|
||||
row = cursor.fetchone()
|
||||
if not row:
|
||||
return 0.0
|
||||
valor = dict(zip(columns, row)).get("ValorReferencial")
|
||||
return float(valor) if valor is not None else 0.0
|
||||
except Exception as e:
|
||||
print(f" ❌ Error en consulta HANA obtener_valor_referencial: {e}")
|
||||
return 0.0
|
||||
finally:
|
||||
if cursor:
|
||||
cursor.close()
|
||||
if connection:
|
||||
connection.close()
|
||||
|
||||
# ============================================================================
|
||||
@@ -0,0 +1,150 @@
|
||||
import logging
|
||||
import contextvars
|
||||
import os
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
from pathlib import Path
|
||||
|
||||
LOG_DIR = Path(__file__).parent / "logs"
|
||||
LOG_FILE = LOG_DIR / "descarga_factura_transporte.log"
|
||||
_LOG_CONFIGURED = False
|
||||
|
||||
_stack: contextvars.ContextVar[list] = contextvars.ContextVar("log_stack", default=[])
|
||||
# ============================================================================
|
||||
|
||||
class TreeFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
return f"{self.formatTime(record)} ─── {record.getMessage()}"
|
||||
|
||||
def formatTime(self, record, datefmt=None):
|
||||
import datetime
|
||||
return datetime.datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
# ============================================================================
|
||||
def _build_prefix(stack, is_last):
|
||||
if not stack:
|
||||
return ""
|
||||
parts = []
|
||||
for sib_is_last in stack[:-1]:
|
||||
parts.append(" " if sib_is_last else "│ ")
|
||||
parts.append("└── " if is_last else "├── ")
|
||||
return "".join(parts)
|
||||
|
||||
# ============================================================================
|
||||
class _TaskContext:
|
||||
def __init__(self, logger, msg, emoji, is_last):
|
||||
self._logger = logger
|
||||
self._msg = msg
|
||||
self._emoji = emoji
|
||||
self._is_last = is_last
|
||||
|
||||
def __enter__(self):
|
||||
stack = _stack.get()
|
||||
prefix = _build_prefix(stack, self._is_last)
|
||||
emoji_str = f"{self._emoji} " if self._emoji else ""
|
||||
self._logger._logger.info(f"{prefix}{emoji_str}{self._msg}")
|
||||
_stack.set(stack + [self._is_last])
|
||||
return TaskLogger(self._logger._logger)
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
_stack.set(_stack.get()[:-1])
|
||||
|
||||
# ============================================================================
|
||||
class TaskLogger:
|
||||
def __init__(self, logger):
|
||||
self._logger = logger
|
||||
|
||||
@contextmanager
|
||||
def task(self, msg, emoji=""):
|
||||
with _TaskContext(self, msg, emoji, is_last=False) as sub:
|
||||
yield sub
|
||||
|
||||
@contextmanager
|
||||
def last_task(self, msg, emoji=""):
|
||||
with _TaskContext(self, msg, emoji, is_last=True) as sub:
|
||||
yield sub
|
||||
|
||||
def info(self, msg, *args, _last=False, **kwargs):
|
||||
self._log(logging.INFO, msg, args, kwargs, _last)
|
||||
|
||||
def warning(self, msg, *args, _last=False, **kwargs):
|
||||
self._log(logging.WARNING, msg, args, kwargs, _last)
|
||||
|
||||
def error(self, msg, *args, _last=False, **kwargs):
|
||||
self._log(logging.ERROR, msg, args, kwargs, _last)
|
||||
|
||||
def _log(self, level, msg, args, kwargs, is_last):
|
||||
stack = _stack.get()
|
||||
prefix = _build_prefix(stack, is_last)
|
||||
self._logger.log(level, f"{prefix}{msg}", *args, **kwargs)
|
||||
|
||||
class _StreamToLogger:
|
||||
"""Redirige escrituras de un stream (stdout/stderr) al logger, línea por línea."""
|
||||
|
||||
def __init__(self, logger: logging.Logger, level: int) -> None:
|
||||
self._logger = logger
|
||||
self._level = level
|
||||
self._buffer = ""
|
||||
|
||||
def write(self, message: str) -> None:
|
||||
self._buffer += message
|
||||
while "\n" in self._buffer:
|
||||
line, self._buffer = self._buffer.split("\n", 1)
|
||||
if line:
|
||||
self._logger.log(self._level, line)
|
||||
|
||||
def flush(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
# ============================================================================
|
||||
def setup_logging(level=None, console=True, capture_print=True):
|
||||
"""
|
||||
Configura el logging del proceso: archivo rotado a medianoche (30 días
|
||||
de historial) y, opcionalmente, consola. Si ``capture_print`` es True
|
||||
(por defecto), también redirige ``print()`` (stdout/stderr) al log, de
|
||||
forma que cualquier salida existente en el proyecto quede registrada
|
||||
en archivo sin tener que migrar cada ``print`` a ``logger.info``.
|
||||
"""
|
||||
global _LOG_CONFIGURED
|
||||
if _LOG_CONFIGURED:
|
||||
return
|
||||
|
||||
if level is None:
|
||||
level_name = os.getenv("LOG_LEVEL", "INFO").upper()
|
||||
level = getattr(logging, level_name, logging.INFO)
|
||||
|
||||
LOG_DIR.mkdir(exist_ok=True)
|
||||
|
||||
formatter = TreeFormatter()
|
||||
|
||||
file_handler = TimedRotatingFileHandler(
|
||||
LOG_FILE,
|
||||
when="midnight",
|
||||
interval=1,
|
||||
backupCount=30,
|
||||
encoding="utf-8",
|
||||
)
|
||||
file_handler.setFormatter(formatter)
|
||||
|
||||
handlers: list[logging.Handler] = [file_handler]
|
||||
if console:
|
||||
console_handler = logging.StreamHandler(sys.stdout)
|
||||
console_handler.setFormatter(formatter)
|
||||
handlers.append(console_handler)
|
||||
|
||||
logging.basicConfig(level=level, handlers=handlers, force=True)
|
||||
|
||||
if capture_print:
|
||||
stdout_logger = logging.getLogger("stdout")
|
||||
stderr_logger = logging.getLogger("stderr")
|
||||
sys.stdout = _StreamToLogger(stdout_logger, logging.INFO)
|
||||
sys.stderr = _StreamToLogger(stderr_logger, logging.ERROR)
|
||||
|
||||
_LOG_CONFIGURED = True
|
||||
|
||||
# ============================================================================
|
||||
def get_logger(name="descarga_factura_transporte"):
|
||||
setup_logging()
|
||||
return TaskLogger(logging.getLogger(name))
|
||||
@@ -1,72 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
from typing import TextIO
|
||||
|
||||
# ============================================================================
|
||||
class MultiStream:
|
||||
"""
|
||||
Clase para redirigir la salida a múltiples flujos (consola y archivo).
|
||||
"""
|
||||
def __init__(self, *streams: TextIO) -> None:
|
||||
self.streams: tuple[TextIO, ...] = streams
|
||||
|
||||
def write(self, data: str) -> None:
|
||||
for stream in self.streams:
|
||||
stream.write(data)
|
||||
stream.flush()
|
||||
|
||||
def flush(self) -> None:
|
||||
for stream in self.streams:
|
||||
stream.flush()
|
||||
|
||||
# ============================================================================
|
||||
def setup_logger() -> str:
|
||||
"""
|
||||
Configura la redirección de stdout y stderr a un archivo de log y a la consola.
|
||||
Retorna la ruta del archivo de log creado.
|
||||
"""
|
||||
log_dir = "logs"
|
||||
if not os.path.exists(log_dir):
|
||||
os.makedirs(log_dir)
|
||||
|
||||
# Nombre del archivo: YYYY-MM-DD_HH-MM-SS.log
|
||||
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
log_filename = f"{timestamp}.log"
|
||||
log_path = os.path.join(log_dir, log_filename)
|
||||
|
||||
# Abrir archivo en modo append con encoding utf-8 para soportar iconos
|
||||
log_file = open(log_path, "a", encoding="utf-8")
|
||||
|
||||
# Redirigir stdout y stderr
|
||||
sys.stdout = MultiStream(sys.stdout, log_file)
|
||||
sys.stderr = MultiStream(sys.stderr, log_file)
|
||||
|
||||
return log_path
|
||||
|
||||
# ============================================================================
|
||||
def limpiar_logs_antiguos(dias: int = 7) -> None:
|
||||
"""
|
||||
Elimina archivos de log con más de 'n' días de antigüedad.
|
||||
"""
|
||||
log_dir = "logs"
|
||||
if not os.path.exists(log_dir):
|
||||
return
|
||||
|
||||
limite = datetime.now() - timedelta(days=dias)
|
||||
count = 0
|
||||
|
||||
for archivo in os.listdir(log_dir):
|
||||
ruta_archivo = os.path.join(log_dir, archivo)
|
||||
if os.path.isfile(ruta_archivo) and archivo.endswith(".log"):
|
||||
fecha_archivo = datetime.fromtimestamp(os.path.getmtime(ruta_archivo))
|
||||
if fecha_archivo < limite:
|
||||
try:
|
||||
os.remove(ruta_archivo)
|
||||
count += 1
|
||||
except Exception as e:
|
||||
print(f"⚠️ Error al eliminar log {archivo}: {e}")
|
||||
|
||||
if count > 0:
|
||||
print(f"🧹 Se eliminaron {count} archivos de log antiguos (más de {dias} días).")
|
||||
# ============================================================================
|
||||
@@ -4,7 +4,7 @@ import argparse
|
||||
from datetime import datetime, timedelta
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import logger_utilities
|
||||
import logger_manager
|
||||
from pipeline import run_pipeline
|
||||
|
||||
# ============================================================================
|
||||
@@ -14,6 +14,7 @@ HORARIOS = [
|
||||
(13, 15, 14, 0, 1800, "full"), # 13:15 - 14:00 -> cada 30 minutos
|
||||
(14, 0, 18, 30, 300, "rapido"), # 14:00 - 17:30 -> cada 5 minutos
|
||||
(18, 30, 21, 30, 3600, "full"), # 17:30 - 21:30 -> cada 60 minutos
|
||||
(0, 0, 5, 0, 60, "rapido"), # 00:00 - 05:00 -> cada 5 minutos
|
||||
]
|
||||
# ============================================================================
|
||||
def obtener_intervalo(dt: datetime) -> tuple[int, str] | None:
|
||||
@@ -64,7 +65,8 @@ def main() -> None:
|
||||
|
||||
dias = args.dias
|
||||
|
||||
load_dotenv(dotenv_path=".env.dev")
|
||||
# Ruta absoluta: no depende del directorio de trabajo desde el que se lance el proceso
|
||||
load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
|
||||
|
||||
EMAIL = os.getenv("EMAIL", "")
|
||||
DOWNLOAD_FOLDER = os.getenv("DOWNLOAD_FOLDER", "")
|
||||
@@ -73,6 +75,7 @@ def main() -> None:
|
||||
print("🚀 Demonio iniciado")
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
while True:
|
||||
|
||||
inicio_ciclo = datetime.now()
|
||||
@@ -116,15 +119,17 @@ def main() -> None:
|
||||
|
||||
time.sleep(dormir)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n\n🛑 Demonio detenido por el usuario.")
|
||||
|
||||
# ============================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
log_path = logger_utilities.setup_logger()
|
||||
logger_utilities.limpiar_logs_antiguos(dias=30)
|
||||
logger_manager.setup_logging()
|
||||
|
||||
print("=" * 60)
|
||||
print(f"🚀 Demonio iniciado: {datetime.now():%Y-%m-%d %H:%M:%S}")
|
||||
print(f"📄 Log guardado en: {log_path}")
|
||||
print(f"📄 Log guardado en: {logger_manager.LOG_FILE}")
|
||||
print("=" * 60)
|
||||
|
||||
main()
|
||||
+23
-5
@@ -11,15 +11,16 @@ warnings.filterwarnings("ignore")
|
||||
# CONFIGURACIÓN
|
||||
# ============================================================================
|
||||
|
||||
# Cargar variables de entorno desde .env
|
||||
load_dotenv(dotenv_path=".env.dev")
|
||||
# Cargar variables de entorno desde .env (ruta absoluta: no depende del
|
||||
# directorio de trabajo desde el que se lance el proceso)
|
||||
load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
|
||||
|
||||
# Configuración de la API
|
||||
CLIENT_ID = os.getenv("CLIENT_ID", "")
|
||||
CLIENT_SECRET = os.getenv("CLIENT_SECRET", "")
|
||||
TENANT_ID = os.getenv("TENANT_ID", "")
|
||||
DOWNLOAD_FOLDER = os.getenv("DOWNLOAD_FOLDER","")
|
||||
VERIFY_SSL = os.getenv("VERIFI_SSL", "False").lower() == "true"
|
||||
VERIFY_SSL = os.getenv("VERIFY_SSL", "False").lower() == "true"
|
||||
|
||||
# ============================================================================
|
||||
def get_access_token() -> str:
|
||||
@@ -149,7 +150,7 @@ def download_attachments(user_email: str, message_id: str, token: str, download_
|
||||
return downloaded_files
|
||||
|
||||
# ============================================================================
|
||||
def send_email(access_token: str, from_email: str, to_recipients: list[str], subject: str, html_body: str, attachment_paths: list[str] | None = None) -> bool:
|
||||
def send_email(access_token: str, from_email: str, to_recipients: list[str], subject: str, html_body: str, attachment_paths: list[str] | None = None, cc_recipients: list[str] | None = None) -> bool:
|
||||
"""
|
||||
Envía un correo electrónico con cuerpo HTML y múltiples adjuntos PDF.
|
||||
|
||||
@@ -159,6 +160,7 @@ def send_email(access_token: str, from_email: str, to_recipients: list[str], sub
|
||||
:param subject: Asunto del correo.
|
||||
:param html_body: Contenido del correo en formato HTML.
|
||||
:param attachment_paths: Lista de rutas a los archivos PDF que se adjuntarán.
|
||||
:param cc_recipients: Lista de correos electrónicos en copia (CC).
|
||||
:return: True si se envió correctamente, False en caso contrario.
|
||||
"""
|
||||
url = f"https://graph.microsoft.com/v1.0/users/{from_email}/sendMail"
|
||||
@@ -178,6 +180,15 @@ def send_email(access_token: str, from_email: str, to_recipients: list[str], sub
|
||||
}
|
||||
})
|
||||
|
||||
# Construir lista de destinatarios en copia (CC) para Graph API
|
||||
cc_payload = []
|
||||
for email in (cc_recipients or []):
|
||||
cc_payload.append({
|
||||
"emailAddress": {
|
||||
"address": email
|
||||
}
|
||||
})
|
||||
|
||||
# Construir lista de adjuntos
|
||||
attachments_payload = []
|
||||
if attachment_paths:
|
||||
@@ -190,10 +201,16 @@ def send_email(access_token: str, from_email: str, to_recipients: list[str], sub
|
||||
encoded_content = base64.b64encode(content_bytes).decode('utf-8')
|
||||
filename = os.path.basename(path)
|
||||
|
||||
ext = os.path.splitext(filename)[1].lower()
|
||||
content_type = {
|
||||
".pdf": "application/pdf",
|
||||
".xml": "application/xml",
|
||||
".json": "application/json",
|
||||
}.get(ext, "application/octet-stream")
|
||||
attachments_payload.append({
|
||||
"@odata.type": "#microsoft.graph.fileAttachment",
|
||||
"name": filename,
|
||||
"contentType": "application/pdf",
|
||||
"contentType": content_type,
|
||||
"contentBytes": encoded_content
|
||||
})
|
||||
else:
|
||||
@@ -208,6 +225,7 @@ def send_email(access_token: str, from_email: str, to_recipients: list[str], sub
|
||||
"content": html_body
|
||||
},
|
||||
"toRecipients": recipients_payload,
|
||||
"ccRecipients": cc_payload,
|
||||
"attachments": attachments_payload
|
||||
},
|
||||
"saveToSentItems": "true"
|
||||
|
||||
+44
-23
@@ -1,6 +1,12 @@
|
||||
import pdfplumber
|
||||
import os
|
||||
import re
|
||||
import unicodedata
|
||||
|
||||
|
||||
def _sin_tildes(texto: str) -> str:
|
||||
"""Quita tildes/diacríticos para comparaciones tolerantes a variaciones de formato."""
|
||||
return "".join(c for c in unicodedata.normalize("NFKD", texto) if not unicodedata.combining(c))
|
||||
|
||||
|
||||
TIPO_MAP = {
|
||||
@@ -53,13 +59,14 @@ def _extract_base_data(text: str, pdf_path: str) -> dict:
|
||||
if standalone_ruc:
|
||||
data["ruc_emisor"] = standalone_ruc.group(1)
|
||||
|
||||
if "FACTURA ELECTRÓNICA" in text.upper():
|
||||
text_norm = _sin_tildes(text.upper())
|
||||
if "FACTURA ELECTRONICA" in text_norm:
|
||||
data["tipo_documento"] = "FACTURA"
|
||||
elif "BOLETA DE VENTA" in text.upper():
|
||||
elif "BOLETA DE VENTA" in text_norm:
|
||||
data["tipo_documento"] = "BOLETA"
|
||||
elif "TRANSPORTISTA" in text.upper() and "GUÍA DE REMISIÓN" in text.upper():
|
||||
elif "TRANSPORTISTA" in text_norm and "GUIA DE REMISION" in text_norm:
|
||||
data["tipo_documento"] = "GUIA DE REMISION TRANSPORTISTA"
|
||||
elif "GUÍA DE REMISIÓN" in text.upper() or "GRRE:" in text.upper():
|
||||
elif "GUIA DE REMISION" in text_norm or "GRRE:" in text_norm:
|
||||
data["tipo_documento"] = "GUIA DE REMISION"
|
||||
|
||||
serie_numero_match = re.search(r"(?:N°\s*)?([A-Z0-9]{4})\s*-\s*(\d+)", text)
|
||||
@@ -134,55 +141,69 @@ def _extract_factura_details(text: str, data: dict) -> None:
|
||||
if table_start_index != -1:
|
||||
items_lines = lines[table_start_index + 1:]
|
||||
current_item = None
|
||||
pre_item_buffer = []
|
||||
for line in items_lines:
|
||||
line = line.strip()
|
||||
if not line: continue
|
||||
if re.search(r"^(?:SUB|TOTAL|IGV|SON:|OP\.|RES|CUO|DET|BANCO|Representación|Podrá|Autorizado|FORMA|CUOTA|GRAVADO|I\.G\.V\.|DESEMBOLSO|OBSERVACION)", line, re.IGNORECASE):
|
||||
break
|
||||
amounts = re.findall(r"(?<![A-Z0-9-])(\d+(?:,\d{3})*(?:\.\d{2,}))(?![A-Z0-9-])", line)
|
||||
amounts = re.findall(r"(?<![A-Z0-9-])(\d+(?:,\d{3})*(?:\.\d{2,}))(?:(?=\s)|(?=$)|(?=[A-Z][a-z]))", line)
|
||||
if len(amounts) >= 2:
|
||||
if current_item: data["items"].append(current_item)
|
||||
qty = amounts[0]
|
||||
total = amounts[-1]
|
||||
p_unit = amounts[-2]
|
||||
if len(amounts) >= 4:
|
||||
p_unit = amounts[1]
|
||||
p_unit = amounts[-2].replace(",", "")
|
||||
total = amounts[-1].replace(",", "")
|
||||
desc_line = line
|
||||
for amt in [qty, p_unit, total]:
|
||||
seen = set()
|
||||
for amt in amounts:
|
||||
if amt not in seen:
|
||||
desc_line = desc_line.replace(amt, "", 1)
|
||||
seen.add(amt)
|
||||
desc_parts = [p.strip() for p in desc_line.split() if p.strip()]
|
||||
codigo = None
|
||||
for i in range(min(3, len(desc_parts))):
|
||||
if re.search(r"[A-Z].*\d|\d.*[A-Z]|[A-Z]{2,}-\d+", desc_parts[i]):
|
||||
codigo = desc_parts[i]
|
||||
desc_parts.pop(i)
|
||||
cod = None
|
||||
for j in range(min(3, len(desc_parts))):
|
||||
if re.search(r"[A-Z].*\d|\d.*[A-Z]|[A-Z]{2,}-\d+", desc_parts[j]):
|
||||
cod = desc_parts[j]
|
||||
desc_parts.pop(j)
|
||||
break
|
||||
if desc_parts and desc_parts[0].isdigit() and len(desc_parts[0]) <= 2:
|
||||
desc_parts.pop(0)
|
||||
descripcion = " ".join(desc_parts)
|
||||
current_item = {
|
||||
"codigo": codigo,
|
||||
"codigo": cod,
|
||||
"cantidad": qty,
|
||||
"descripcion": descripcion,
|
||||
"precio_unitario": p_unit.replace(",", ""),
|
||||
"total": total.replace(",", ""),
|
||||
"precio_unitario": p_unit,
|
||||
"total": total,
|
||||
"guias_remision": [],
|
||||
"guia_transportista": None,
|
||||
"bolsas": None,
|
||||
"peso": None,
|
||||
"unidad_peso": None,
|
||||
}
|
||||
if pre_item_buffer:
|
||||
current_item["descripcion"] = " ".join(pre_item_buffer) + " " + descripcion
|
||||
pre_item_buffer = []
|
||||
elif current_item and len(line) > 5:
|
||||
current_item["descripcion"] += " " + line
|
||||
elif not current_item and len(line) > 5:
|
||||
pre_item_buffer.append(line)
|
||||
if current_item: data["items"].append(current_item)
|
||||
|
||||
# Extraer guías de cada ítem usando los mismos patrones que sunat_schema
|
||||
GUIAS_PDF_PATTERNS = [
|
||||
(r"(?:GRE\s+REMITENTE|GRR|G\.R\.R)\s*[:.]?\s*([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", "09"),
|
||||
(r"\b(?:GRT|G\.R\.T)\s*[:.]?\s*([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", "31"),
|
||||
]
|
||||
for item in data["items"]:
|
||||
desc = item["descripcion"]
|
||||
guias_remision_matches = re.findall(r"\b(?:GRR\w*|GR\b|G\.R\.R\.?|GUIA REMISI.N)\s*[:/\s]*((?:[TVE][A-Z0-9]{3})-\d+)", desc, re.IGNORECASE)
|
||||
item["guias_remision"] = [m.strip() for m in guias_remision_matches] if guias_remision_matches else []
|
||||
guia_transportista_match = re.search(r"\b(?:GRT\w*|GR\b|G\.R\.T\.?|GUIA TRANSPORTISTA)\s*[:/\s]*((?:[TVE][A-Z0-9]{3})-\d+)", desc, re.IGNORECASE)
|
||||
if guia_transportista_match:
|
||||
item["guia_transportista"] = guia_transportista_match.group(1).strip()
|
||||
for patron, tipo in GUIAS_PDF_PATTERNS:
|
||||
for m in re.finditer(patron, desc, re.IGNORECASE):
|
||||
numero = m.group(2).lstrip("0") or "0"
|
||||
if tipo == "09":
|
||||
item["guias_remision"].append(f"{m.group(1).upper()}-{numero}")
|
||||
else:
|
||||
item["guia_transportista"] = f"{m.group(1).upper()}-{numero}"
|
||||
bolsas_match = re.search(r"(\d+)\s*(?:BOLSAS|BLS|BOLS|SACOS)\b", desc, re.IGNORECASE)
|
||||
if bolsas_match:
|
||||
item["bolsas"] = bolsas_match.group(1)
|
||||
|
||||
+513
-132
@@ -12,6 +12,8 @@ import os
|
||||
import re
|
||||
import json
|
||||
import math
|
||||
import shutil
|
||||
import ntpath
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import email_utilities
|
||||
@@ -20,14 +22,10 @@ import database_utilities
|
||||
import sunat_schema
|
||||
import sapb1_manager
|
||||
import pdf_utilities
|
||||
import hana_manager
|
||||
|
||||
CUADRO_VALOR_REFERENCIAL = {
|
||||
"CHINCHA": 89.09,
|
||||
"PISCO": 101.7,
|
||||
"CAÑETE": 79.81,
|
||||
"TARMA": 106.54,
|
||||
"SAN CLEMENTE": 94.27,
|
||||
}
|
||||
RUTA_RED_FACTURACION = os.getenv("RUTA_RED_FACTURACION", "")
|
||||
RUC_EMPRESA = os.getenv("RUC_EMPRESA", "")
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -37,6 +35,75 @@ def _ruta_carpeta(subcarpeta: str) -> str:
|
||||
return os.path.join(os.path.dirname(__file__), subcarpeta)
|
||||
|
||||
|
||||
def _copiar_a_red(data: dict, _log) -> None:
|
||||
"""
|
||||
Copia el PDF y el XML de un comprobante ya procesado a la ruta de red
|
||||
de Facturación Electrónica, organizada como::
|
||||
|
||||
{RUTA_RED_FACTURACION}\\{año}\\{mes}\\{día}\\{tipo}\\{RUC_EMPRESA}\\{ruc_emisor}\\
|
||||
{RUC_EMPRESA}-{tipo}-{serie}-{numero}_FormatoImpreso.pdf
|
||||
{RUC_EMPRESA}-{tipo}-{serie}-{numero}.xml
|
||||
|
||||
``RUC_EMPRESA`` es el RUC de Aberio (fijo, por ahora); ``ruc_emisor``
|
||||
es el RUC del proveedor que emitió la factura (varía por comprobante).
|
||||
Año/mes/día se toman de ``fecha_emision`` (mes y día sin ceros a la
|
||||
izquierda). No falla el pipeline si la ruta de red no está configurada
|
||||
o no está disponible: solo registra una advertencia.
|
||||
|
||||
Guarda las rutas resultantes en ``data["ruta_red_pdf"]`` y
|
||||
``data["ruta_red_xml"]`` para que ``_build_sap_draft`` las incluya en
|
||||
el draft (``U_VS_ANEXO_PDF`` / ``U_VS_ANEXO_XML``).
|
||||
"""
|
||||
if not RUTA_RED_FACTURACION:
|
||||
return
|
||||
|
||||
ruc_emisor = data.get("ruc_emisor", "")
|
||||
tipo = data.get("tipo", "")
|
||||
serie = data.get("serie", "")
|
||||
numero = data.get("numero", "")
|
||||
xml_path = data.get("ruta_xml")
|
||||
pdf_path = data.get("ruta_pdf")
|
||||
|
||||
try:
|
||||
fecha = datetime.strptime(data.get("fecha_emision", ""), "%Y-%m-%d")
|
||||
except (ValueError, TypeError):
|
||||
_log(f"⚠️ No se pudo copiar a red: fecha_emision inválida ({data.get('fecha_emision')})", 3)
|
||||
return
|
||||
|
||||
carpeta_destino = os.path.join(
|
||||
RUTA_RED_FACTURACION,
|
||||
str(fecha.year), str(fecha.month), str(fecha.day),
|
||||
tipo, RUC_EMPRESA, ruc_emisor,
|
||||
)
|
||||
# Ruta guardada en el draft SAP (U_VS_ANEXO_PDF/XML): siempre estilo
|
||||
# Windows/UNC con backslash, sin importar el separador del SO donde
|
||||
# corre el script (evita mezclar "\\" y "/" al usar os.path.join en
|
||||
# un host no-Windows).
|
||||
carpeta_destino_unc = ntpath.join(
|
||||
RUTA_RED_FACTURACION,
|
||||
str(fecha.year), str(fecha.month), str(fecha.day),
|
||||
tipo, RUC_EMPRESA, ruc_emisor,
|
||||
)
|
||||
nombre_base = f"{RUC_EMPRESA}-{tipo}-{serie}-{numero}"
|
||||
|
||||
try:
|
||||
os.makedirs(carpeta_destino, exist_ok=True)
|
||||
|
||||
if pdf_path and os.path.exists(pdf_path):
|
||||
ruta_red_pdf = os.path.join(carpeta_destino, f"{nombre_base}_FormatoImpreso.pdf")
|
||||
shutil.copy2(pdf_path, ruta_red_pdf)
|
||||
data["ruta_red_pdf"] = ntpath.join(carpeta_destino_unc, f"{nombre_base}_FormatoImpreso.pdf")
|
||||
|
||||
if xml_path and os.path.exists(xml_path):
|
||||
ruta_red_xml = os.path.join(carpeta_destino, f"{nombre_base}.xml")
|
||||
shutil.copy2(xml_path, ruta_red_xml)
|
||||
data["ruta_red_xml"] = ntpath.join(carpeta_destino_unc, f"{nombre_base}.xml")
|
||||
|
||||
_log(f"📁 Copiado a red: {carpeta_destino}", 3)
|
||||
except OSError as e:
|
||||
_log(f"⚠️ Error copiando a ruta de red: {e}", 3)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# PASO 1: Autenticación Microsoft Graph
|
||||
# ============================================================================
|
||||
@@ -104,6 +171,11 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
notificaciones por email.
|
||||
"""
|
||||
|
||||
def _log(msg: str, level: int = 1, last: bool = False) -> None:
|
||||
branch = " └── " if last else " ├── "
|
||||
pfx = {1: branch, 2: f" │ {branch}", 3: f" │ │ {branch}", 4: f" │ │ │ {branch}"}.get(level, branch)
|
||||
print(f"{pfx}{msg}")
|
||||
|
||||
def _descargar_adjuntos() -> list[str] | None:
|
||||
"""
|
||||
Descarga todos los adjuntos del correo usando Microsoft Graph.
|
||||
@@ -130,7 +202,7 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
return adjuntos
|
||||
return None
|
||||
except Exception as ex:
|
||||
print(f" ❌ Error descargando adjuntos: {ex}")
|
||||
_log(f"❌ Error descargando adjuntos: {ex}")
|
||||
return None
|
||||
|
||||
def _descomprimir() -> None:
|
||||
@@ -179,7 +251,7 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
ruta = os.path.join(carpeta, a)
|
||||
if os.path.exists(ruta):
|
||||
os.remove(ruta)
|
||||
print(f" ├── 🗑️ Correo sin PDF/XML válidos, adjuntos eliminados")
|
||||
_log("🗑️ Correo sin PDF/XML válidos, adjuntos eliminados")
|
||||
return False
|
||||
|
||||
for a in no_validos:
|
||||
@@ -236,9 +308,9 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
|
||||
canonical = os.path.basename(nuevo_path)
|
||||
pdf_cache[canonical] = data
|
||||
print(f" │ 📄 PDF procesado: {canonical} ({data.get('tipo_documento', '?')})")
|
||||
_log(f"📄 PDF procesado: {canonical} ({data.get('tipo_documento', '?')})", 3)
|
||||
else:
|
||||
print(f" │ ⚠️ PDF no procesado: {adjunto} - {data.get('error', 'error desconocido')}")
|
||||
_log(f"⚠️ PDF no procesado: {adjunto} - {data.get('error', 'error desconocido')}", 2)
|
||||
|
||||
if datos_pdf:
|
||||
email["datos_pdf"] = datos_pdf
|
||||
@@ -256,7 +328,8 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
3. Si el XML no trae ``documentos_referencia``, los completa desde
|
||||
el PDF cache (usando ``pdf_utilities.extraer_referencias``).
|
||||
4. Asigna las guías de remisión (``guias_remision[]``) y
|
||||
transportista (``guia_transportista``) a cada línea de detalle.
|
||||
transportista (``guia_transportista``) a cada línea de detalle desde
|
||||
``notes_text`` o ``documentos_referencia``.
|
||||
|
||||
Returns:
|
||||
list[dict] — Lista de documentos extraídos listos para
|
||||
@@ -277,26 +350,49 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
carpeta = _ruta_carpeta(download_folder)
|
||||
documentos = []
|
||||
|
||||
last_idx = len(email["adjuntos"]) - 1
|
||||
for idx, a in enumerate(email["adjuntos"]):
|
||||
prefijo = " │ └── " if idx == len(email["adjuntos"]) - 1 else " │ ├── "
|
||||
print(f"{prefijo}{a}")
|
||||
_log(a, 2, last=(idx == last_idx))
|
||||
|
||||
if not a.lower().endswith(".xml"):
|
||||
continue
|
||||
|
||||
xml_path = os.path.join(carpeta, a)
|
||||
print(f" │ 📄 Procesando XML: {a}")
|
||||
_log(f"📄 Procesando XML: {a}", 3)
|
||||
data = sunat_schema.extraer_datos_xml(xml_path)
|
||||
|
||||
if not data:
|
||||
print(f" │ ℹ️ XML sin datos (no es factura tipo 01 o guía 31)")
|
||||
_log("ℹ️ XML sin datos (no es factura tipo 01 o guía 31)", 3)
|
||||
continue
|
||||
|
||||
# CDR solo se renombra, no se procesa como documento
|
||||
if data.get("es_cdr"):
|
||||
prefijo = "CDR-"
|
||||
cdr_name = f"{prefijo}{data['ruc_emisor']}-{data['tipo']}-{data['serie']}-{data['numero']}.xml"
|
||||
cdr_dest = os.path.join(carpeta, cdr_name)
|
||||
if cdr_dest != xml_path:
|
||||
if os.path.exists(cdr_dest):
|
||||
os.remove(cdr_dest)
|
||||
os.rename(xml_path, cdr_dest)
|
||||
email["adjuntos"][idx] = cdr_name
|
||||
_log(f"ℹ️ {data.get('serie','?')}-{data.get('numero','?')} (CDR) — solo renombrado", 3)
|
||||
continue
|
||||
|
||||
data["ruta_xml"] = xml_path
|
||||
|
||||
# Renombrar XML a {prefijo}{ruc}-{tipo}-{serie}-{numero}.xml
|
||||
prefijo = ""
|
||||
xml_canonical = f"{prefijo}{data.get('ruc_emisor', '')}-{data.get('tipo', '')}-{data.get('serie', '')}-{data.get('numero', '')}.xml"
|
||||
xml_destino = os.path.join(carpeta, xml_canonical)
|
||||
if xml_destino != xml_path:
|
||||
if os.path.exists(xml_destino):
|
||||
os.remove(xml_destino)
|
||||
os.rename(xml_path, xml_destino)
|
||||
email["adjuntos"][idx] = xml_canonical
|
||||
data["ruta_xml"] = xml_destino
|
||||
xml_path = xml_destino
|
||||
|
||||
# ruta_pdf: construir nombre canónico {ruc}-{tipo}-{serie}-{numero}.pdf
|
||||
# El número ya viene con lstrip("0") desde _split_serie_numero en sunat_schema
|
||||
# y generar_nombre_pdf ahora también aplica lstrip("0") para que coincidan
|
||||
pdf_canonical = f"{data.get('ruc_emisor', '')}-{data.get('tipo', '')}-{data.get('serie', '')}-{data.get('numero', '')}.pdf"
|
||||
pdf_path = os.path.join(carpeta, pdf_canonical)
|
||||
if not os.path.exists(pdf_path):
|
||||
@@ -305,6 +401,8 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
pdf_path = pdf_path if os.path.exists(pdf_path) else None
|
||||
data["ruta_pdf"] = pdf_path
|
||||
|
||||
_copiar_a_red(data, _log)
|
||||
|
||||
# Cruzar documentos_referencia desde el PDF renombrado (pdf_cache por nombre canónico)
|
||||
if not data.get("documentos_referencia"):
|
||||
pdf_data = pdf_cache.get(pdf_canonical)
|
||||
@@ -312,93 +410,286 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
refs = pdf_utilities.extraer_referencias(pdf_data.get("items", []))
|
||||
if refs:
|
||||
data["documentos_referencia"] = refs
|
||||
print(f" │ 🔄 documentos_referencia completados desde PDF ({len(refs)} refs)")
|
||||
_log(f"🔄 documentos_referencia completados desde PDF ({len(refs)} refs)", 3)
|
||||
if not data.get("documentos_referencia"):
|
||||
for pdf_data in email.get("datos_pdf", []):
|
||||
refs = pdf_utilities.extraer_referencias(pdf_data.get("items", []))
|
||||
if refs:
|
||||
data["documentos_referencia"] = refs
|
||||
print(f" │ 🔄 documentos_referencia completados desde PDF (fallback, {len(refs)} refs)")
|
||||
_log(f"🔄 documentos_referencia completados desde PDF (fallback, {len(refs)} refs)", 3)
|
||||
break
|
||||
|
||||
# Asignar guias_remision[] y guia_transportista a cada línea
|
||||
# Primero: todas las refs tipo 09 y 31 desde documentos_referencia
|
||||
# Asignar guias_remision[] y guia_transportista por línea
|
||||
# Prioridad: notes_text (ya parseado) > documentos_referencia
|
||||
refs_09 = [r for r in data.get("documentos_referencia", []) if r.get("tipo") == "09"]
|
||||
refs_31 = [r for r in data.get("documentos_referencia", []) if r.get("tipo") == "31"]
|
||||
# Segundo: si hay datos del PDF, usar agrupación por ítem (respeta multi-guía)
|
||||
pdf_items = (pdf_cache.get(pdf_canonical) or {}).get("items", [])
|
||||
for i, linea in enumerate(data.get("lineas", [])):
|
||||
if i < len(pdf_items):
|
||||
pi = pdf_items[i]
|
||||
linea["guias_remision"] = []
|
||||
for g_str in pi.get("guias_remision", []):
|
||||
m = re.search(r"\b([TVE][A-Z0-9]{3})\s*-\s*(\d+)\b", g_str)
|
||||
if m:
|
||||
linea["guias_remision"].append({
|
||||
"tipo": "09", "serie": m.group(1).upper(), "numero": m.group(2),
|
||||
})
|
||||
else:
|
||||
partes = g_str.split("-", 1)
|
||||
if len(partes) == 2:
|
||||
linea["guias_remision"].append({
|
||||
"tipo": "09", "serie": partes[0].strip(), "numero": partes[1].strip(),
|
||||
})
|
||||
guia_transportista = pi.get("guia_transportista")
|
||||
if guia_transportista:
|
||||
m = re.search(r"\b([TVE][A-Z0-9]{3})\s*-\s*(\d+)\b", guia_transportista)
|
||||
if m:
|
||||
pi["guia_transportista_serie"] = m.group(1)
|
||||
pi["guia_transportista_numero"] = m.group(2)
|
||||
elif "-" in guia_transportista:
|
||||
partes_list = guia_transportista.split("-", 1)
|
||||
linea["guia_transportista"] = {"tipo": "31", "serie": partes_list[0].strip(), "numero": partes_list[1].strip()}
|
||||
else:
|
||||
linea["guia_transportista"] = None
|
||||
else:
|
||||
linea["guia_transportista"] = None
|
||||
elif i < len(refs_09):
|
||||
r = refs_09[i]
|
||||
linea["guias_remision"] = [{"tipo": "09", "serie": r["serie"].strip(), "numero": r["numero"].strip()}]
|
||||
linea["guia_transportista"] = refs_31[i] if i < len(refs_31) else None
|
||||
else:
|
||||
linea["guias_remision"] = []
|
||||
linea["guia_transportista"] = None
|
||||
|
||||
print(f" │ ✅ Datos extraídos: {data.get('serie')}-{data.get('numero')} ({data.get('tipo_descripcion', '?')})")
|
||||
for i, linea in enumerate(data.get("lineas", [])):
|
||||
gr = linea.get("guias_remision") or []
|
||||
gt = linea.get("guia_transportista")
|
||||
|
||||
if not gr and i < len(refs_09):
|
||||
es_ultima = i == len(data["lineas"]) - 1
|
||||
if es_ultima:
|
||||
gr = list(refs_09[i:])
|
||||
else:
|
||||
gr = [dict(refs_09[i])]
|
||||
if not gt and i < len(refs_31):
|
||||
gt = dict(refs_31[i])
|
||||
|
||||
linea["guias_remision"] = gr
|
||||
if gt:
|
||||
linea["guia_transportista"] = gt
|
||||
|
||||
_log(f"✅ Datos extraídos: {data.get('serie')}-{data.get('numero')} ({data.get('tipo_descripcion', '?')})", 3)
|
||||
documentos.append(data)
|
||||
|
||||
# Post-procesamiento: resolver GREs desde guías de transporte referenciadas
|
||||
guia_lookup = {}
|
||||
for doc in documentos:
|
||||
if doc.get("tipo") in ("31", "09"):
|
||||
guia_lookup[(doc["tipo"], doc["serie"], doc["numero"])] = doc
|
||||
|
||||
for doc in documentos:
|
||||
if doc.get("tipo") != "01":
|
||||
continue
|
||||
for ref in doc.get("documentos_referencia", []):
|
||||
if ref["tipo"] == "31":
|
||||
guia_doc = guia_lookup.get(("31", ref["serie"], ref["numero"]))
|
||||
if guia_doc:
|
||||
gre_list = [g for g in guia_doc.get("documentos_referencia", []) if g.get("tipo") == "09"]
|
||||
if gre_list:
|
||||
_log(f"🔗 Resueltas {len(gre_list)} GRE(s) desde guía {ref['serie']}-{ref['numero']}", 3)
|
||||
for i, linea in enumerate(doc.get("lineas", [])):
|
||||
if not linea.get("guias_remision"):
|
||||
es_ultima = i == len(doc["lineas"]) - 1
|
||||
if es_ultima:
|
||||
linea["guias_remision"] = gre_list[i:]
|
||||
elif i < len(gre_list):
|
||||
linea["guias_remision"] = [gre_list[i]]
|
||||
if not linea.get("guia_transportista"):
|
||||
linea["guia_transportista"] = dict(ref)
|
||||
|
||||
return documentos
|
||||
|
||||
def _guardar_resultado(documentos: list[dict]) -> None:
|
||||
def _completar_guias(documentos: list[dict], pdf_cache: dict) -> int:
|
||||
"""
|
||||
Guarda la lista de documentos extraídos en un archivo JSON.
|
||||
Completa guías faltantes en XML desde datos del PDF.
|
||||
|
||||
Para cada documento en ``documentos``, verifica si todas las líneas
|
||||
tienen ``guias_remision``. Si faltan, busca el PDF correspondiente en
|
||||
el cache y copia las guías de las líneas del PDF.
|
||||
|
||||
Args:
|
||||
documentos: Lista de documentos extraídos de XML.
|
||||
pdf_cache: Cache de datos PDF (canonical_name → datos).
|
||||
|
||||
Returns:
|
||||
int — Número de guías copiadas.
|
||||
"""
|
||||
total = 0
|
||||
for xd in documentos:
|
||||
has_all = all(
|
||||
len(linea.get("guias_remision") or []) > 0
|
||||
for linea in xd.get("lineas", [])
|
||||
)
|
||||
if has_all:
|
||||
continue
|
||||
|
||||
pdf_canonical = f"{xd.get('ruc_emisor', '')}-{xd.get('tipo', '')}-{xd.get('serie', '')}-{xd.get('numero', '')}.pdf"
|
||||
pd = pdf_cache.get(pdf_canonical)
|
||||
if not pd:
|
||||
continue
|
||||
|
||||
for i, xl in enumerate(xd.get("lineas", [])):
|
||||
if xl.get("guias_remision"):
|
||||
continue
|
||||
pl = pd["items"][i] if i < len(pd.get("items", [])) else {}
|
||||
p_gr = pl.get("guias_remision") or []
|
||||
if isinstance(p_gr[0], str) if p_gr else False:
|
||||
# Normalizar formato string → dict
|
||||
p_gr = [
|
||||
{"tipo": "09", "serie": m.group(1).upper(), "numero": m.group(2).lstrip("0") or "0"}
|
||||
for g in p_gr
|
||||
for m in [re.search(r"\b([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", g)]
|
||||
if m
|
||||
]
|
||||
if p_gr:
|
||||
xl["guias_remision"] = list(p_gr)
|
||||
total += len(p_gr)
|
||||
if not xl.get("guia_transportista") and pl.get("guia_transportista"):
|
||||
gt = pl["guia_transportista"]
|
||||
if isinstance(gt, str):
|
||||
m = re.search(r"\b([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", gt)
|
||||
if m:
|
||||
xl["guia_transportista"] = {
|
||||
"tipo": "31",
|
||||
"serie": m.group(1).upper(),
|
||||
"numero": m.group(2).lstrip("0") or "0",
|
||||
}
|
||||
elif isinstance(gt, dict):
|
||||
xl["guia_transportista"] = dict(gt)
|
||||
return total
|
||||
|
||||
def _validar_guias(documentos: list[dict]) -> None:
|
||||
for doc in documentos:
|
||||
for i, linea in enumerate(doc.get("lineas", [])):
|
||||
for j, g in enumerate(linea.get("guias_remision") or []):
|
||||
if not isinstance(g, dict) or not all(k in g and g[k] for k in ("tipo", "serie", "numero")):
|
||||
_log(f"⚠️ guias_remision[{j}] inválida en {doc.get('serie','?')}-{doc.get('numero','?')} línea {i}: {g}", 2)
|
||||
gt = linea.get("guia_transportista")
|
||||
if gt and (not isinstance(gt, dict) or not all(k in gt and gt[k] for k in ("tipo", "serie", "numero"))):
|
||||
_log(f"⚠️ guia_transportista inválida en {doc.get('serie','?')}-{doc.get('numero','?')} línea {i}: {gt}", 2)
|
||||
|
||||
def _guardar_resultado(documentos: list[dict], datos_pdf: list[dict]) -> list[str]:
|
||||
"""
|
||||
Guarda los resultados XML y PDF en archivos JSON separados.
|
||||
|
||||
El nombre del archivo sigue el patrón
|
||||
``resultado_{serie}-{numero}_{timestamp}.json`` y se escribe en
|
||||
``{tipo}_resultado_{serie}-{numero}_{timestamp}.json`` y se escribe en
|
||||
``output_folder``.
|
||||
|
||||
Args:
|
||||
documentos: Lista de diccionarios con datos extraídos de XML
|
||||
(producida por ``_procesar_xmls``).
|
||||
datos_pdf: Lista de diccionarios con datos extraídos de PDF
|
||||
(producida por ``_procesar_pdfs``).
|
||||
|
||||
Example:
|
||||
Si ``documentos[0]`` tiene ``serie="F002", numero="486"``::
|
||||
|
||||
_guardar_resultado(documentos)
|
||||
# → Crea resultado_F002-486_2026-07-08_12-00-00.json
|
||||
_guardar_resultado(documentos, pdf_datos)
|
||||
# → Crea xml_resultado_F002-486_2026-07-08_12-00-00.json
|
||||
# → Crea pdf_resultado_F002-486_2026-07-08_12-00-00.json
|
||||
"""
|
||||
if not documentos:
|
||||
return
|
||||
return []
|
||||
if not os.path.exists(output_folder):
|
||||
os.makedirs(output_folder, exist_ok=True)
|
||||
ts = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
serie = documentos[0].get("serie", "unknown")
|
||||
numero = documentos[0].get("numero", "unknown")
|
||||
filename = f"resultado_{serie}-{numero}_{ts}.json"
|
||||
filepath = os.path.join(output_folder, filename)
|
||||
with open(filepath, "w", encoding="utf-8") as f:
|
||||
base = f"{serie}-{numero}_{ts}"
|
||||
|
||||
saved: list[str] = []
|
||||
|
||||
# XML result
|
||||
xml_name = f"xml_resultado_{base}.json"
|
||||
xml_path = os.path.join(output_folder, xml_name)
|
||||
with open(xml_path, "w", encoding="utf-8") as f:
|
||||
json.dump(documentos, f, ensure_ascii=False, indent=4)
|
||||
print(f" 💾 Resultado guardado: {filename}")
|
||||
_log(f"💾 XML guardado: {xml_name}")
|
||||
saved.append(xml_path)
|
||||
|
||||
# PDF result (normalizado al mismo schema que XML)
|
||||
pdf_docs = []
|
||||
for raw in datos_pdf:
|
||||
if raw.get("error"):
|
||||
continue
|
||||
td = (raw.get("tipo_documento") or "").upper()
|
||||
tipo = pdf_utilities.TIPO_MAP.get(td)
|
||||
if not tipo:
|
||||
continue
|
||||
sn = raw.get("serie_numero") or ""
|
||||
serie_p, num_p = sunat_schema.split_serie_numero(sn)
|
||||
if not serie_p:
|
||||
continue
|
||||
doc = {
|
||||
"ruc_emisor": raw.get("ruc_emisor"),
|
||||
"razon_social_emisor": None, # el PDF no extrae la razón social del emisor
|
||||
"fecha_emision": raw.get("fecha_emision"),
|
||||
"tipo": tipo,
|
||||
"serie": serie_p,
|
||||
"numero": num_p,
|
||||
"ruc_receptor": raw.get("ruc_receptor"),
|
||||
"razon_social_receptor": raw.get("nombre_receptor"),
|
||||
"total_factura": raw.get("monto_total"),
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": False,
|
||||
"codigo_detraccion": None,
|
||||
"porcentaje_detraccion": None,
|
||||
"monto_detraccion": None,
|
||||
"lineas": [],
|
||||
"ruta_pdf": raw.get("archivo"),
|
||||
}
|
||||
det = raw.get("detraccion") or {}
|
||||
if det.get("tiene"):
|
||||
doc["tiene_detraccion"] = True
|
||||
doc["porcentaje_detraccion"] = det.get("porcentaje")
|
||||
doc["monto_detraccion"] = det.get("monto")
|
||||
for item in raw.get("items") or []:
|
||||
linea = {
|
||||
"descripcion": item.get("descripcion", ""),
|
||||
"cantidad": item.get("cantidad"),
|
||||
"precio_unitario": item.get("precio_unitario"),
|
||||
"total_linea": item.get("total"),
|
||||
"guias_remision": [],
|
||||
"guia_transportista": None,
|
||||
}
|
||||
for g in item.get("guias_remision") or []:
|
||||
if isinstance(g, str):
|
||||
m = re.search(r"\b([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", g)
|
||||
if m:
|
||||
linea["guias_remision"].append({
|
||||
"tipo": "09",
|
||||
"serie": m.group(1).upper(),
|
||||
"numero": m.group(2).lstrip("0") or "0",
|
||||
})
|
||||
elif isinstance(g, dict):
|
||||
linea["guias_remision"].append(dict(g))
|
||||
gt = item.get("guia_transportista")
|
||||
if gt:
|
||||
if isinstance(gt, str):
|
||||
m = re.search(r"\b([TVE][A-Z0-9]{3,4})\s*-?\s*(\d+)", gt)
|
||||
if m:
|
||||
linea["guia_transportista"] = {
|
||||
"tipo": "31",
|
||||
"serie": m.group(1).upper(),
|
||||
"numero": m.group(2).lstrip("0") or "0",
|
||||
}
|
||||
elif isinstance(gt, dict):
|
||||
linea["guia_transportista"] = dict(gt)
|
||||
doc["lineas"].append(linea)
|
||||
pdf_docs.append(doc)
|
||||
|
||||
if pdf_docs:
|
||||
pdf_name = f"pdf_resultado_{base}.json"
|
||||
pdf_path = os.path.join(output_folder, pdf_name)
|
||||
with open(pdf_path, "w", encoding="utf-8") as f:
|
||||
json.dump(pdf_docs, f, ensure_ascii=False, indent=4)
|
||||
_log(f"💾 PDF guardado: {pdf_name}")
|
||||
saved.append(pdf_path)
|
||||
|
||||
return saved
|
||||
|
||||
def _calcular_fecha_vencimiento(fecha_base: str, condicion_pago: dict | None) -> str:
|
||||
"""
|
||||
Calcula la fecha de vencimiento sumando a ``fecha_base`` los días de
|
||||
la condición de pago (PaymentTermsTypes) del proveedor.
|
||||
|
||||
Usa ``NumberOfAdditionalDays`` como días a sumar; si ese valor es 0,
|
||||
usa ``NumberOfAdditionalMonths * 30`` en su lugar.
|
||||
|
||||
Args:
|
||||
fecha_base: Fecha de contabilización, formato "YYYY-MM-DD".
|
||||
condicion_pago: Resultado de ``sapb1_manager.obtener_condicion_pago``
|
||||
(campos ``NumberOfAdditionalDays``, ``NumberOfAdditionalMonths``),
|
||||
o None si el proveedor no tiene condición de pago configurada.
|
||||
|
||||
Returns:
|
||||
str — Fecha de vencimiento, formato "YYYY-MM-DD". Si
|
||||
``condicion_pago`` es None, retorna ``fecha_base`` sin cambios.
|
||||
"""
|
||||
fecha = datetime.strptime(fecha_base, "%Y-%m-%d")
|
||||
if not condicion_pago:
|
||||
return fecha.strftime("%Y-%m-%d")
|
||||
|
||||
dias = int(condicion_pago.get("NumberOfAdditionalDays") or 0)
|
||||
if dias == 0:
|
||||
dias = int(condicion_pago.get("NumberOfAdditionalMonths") or 0) * 30
|
||||
fecha += timedelta(days=dias)
|
||||
|
||||
return fecha.strftime("%Y-%m-%d")
|
||||
|
||||
def _build_sap_draft(factura: dict, resultados_val: list[dict]) -> dict:
|
||||
"""
|
||||
@@ -420,12 +711,9 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
- ``WarehouseCode``, ``U_IDC_GRFLETE`` y campos fijos.
|
||||
Cuando la validación es ``ok=True`` usa los valores de SAP
|
||||
(``draft_quantity``, ``draft_price``); cuando no, usa los del XML.
|
||||
5. Calcula ``U_IDC_VALREF`` como:
|
||||
``total_weight × CUADRO_VALOR_REFERENCIAL[zona]``
|
||||
donde ``total_weight`` es la suma de ``Weight1`` de todos los
|
||||
DeliveryNotes de la guía, y ``zona`` se obtiene del campo ``U_IDC_DESTINO`` del primer
|
||||
DeliveryNote de la primera guía, mapeado contra el maestro de
|
||||
zonas SAP (``U_IDC_ZONAS``).
|
||||
5. Calcula ``U_IDC_VALREF`` como la suma de ``valor_referencial``
|
||||
(extraído del XML SUNAT por ``sunat_schema``) de todas las
|
||||
líneas de la factura.
|
||||
|
||||
Args:
|
||||
factura: Diccionario con los datos de la factura extraídos del
|
||||
@@ -471,24 +759,30 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
ruc_emisor = factura.get("ruc_emisor", "")
|
||||
razon_social_emisor = factura.get("razon_social_emisor", "")
|
||||
|
||||
card_code = f"PL{ruc_emisor}"
|
||||
|
||||
fecha_contabilizacion = datetime.now().strftime("%Y-%m-%d")
|
||||
emision = datetime.strptime(fecha_emision, "%Y-%m-%d")
|
||||
item_code = "C103002-A" if (emision.year, emision.month) < (datetime.now().year, datetime.now().month) else "C103002"
|
||||
|
||||
neto = round(total - monto_detraccion, 2)
|
||||
condicion_pago = sapb1_manager.obtener_condicion_pago(card_code)
|
||||
fecha_vencimiento = _calcular_fecha_vencimiento(fecha_contabilizacion, condicion_pago)
|
||||
|
||||
|
||||
if tiene_detraccion:
|
||||
# neto = round(total - monto_detraccion, 2)
|
||||
monto_detraccion = math.ceil(monto_detraccion)
|
||||
neto = total - monto_detraccion
|
||||
installments = [
|
||||
{"DueDate": fecha_emision, "Total": round(monto_detraccion, 2), "InstallmentId": 1, "U_VS_TIPOCUOTA": "D", "U_VS_TIPOSERVICIO": f"{codigo_detraccion}02"},
|
||||
{"DueDate": fecha_emision, "Total": neto, "InstallmentId": 2, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
|
||||
{"DueDate": fecha_vencimiento, "Total": monto_detraccion, "InstallmentId": 1, "U_VS_TIPOCUOTA": "D", "U_VS_TIPOSERVICIO": f"{codigo_detraccion}02"},
|
||||
{"DueDate": fecha_vencimiento, "Total": round(neto,2), "InstallmentId": 2, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
|
||||
]
|
||||
else:
|
||||
installments = [
|
||||
{"DueDate": fecha_emision, "Total": round(total, 2), "InstallmentId": 1, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
|
||||
{"DueDate": fecha_vencimiento, "Total": round(total, 2), "InstallmentId": 1, "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""},
|
||||
]
|
||||
|
||||
doc_lines = []
|
||||
total_weight = 0
|
||||
zona_guia = ""
|
||||
guia_referencia = ""
|
||||
|
||||
for i, linea in enumerate(factura.get("lineas", [])):
|
||||
@@ -497,9 +791,6 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
if not guias_lt:
|
||||
continue
|
||||
|
||||
|
||||
zona_guia = guias_lt[0].get("zona","")
|
||||
|
||||
guia_referencia = f"{guias_lt[0]['guia']['tipo']}{guias_lt[0]['guia']['serie']}-{guias_lt[0]['guia']['numero']}"
|
||||
|
||||
for item in guias_lt:
|
||||
@@ -507,11 +798,8 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
lt_val = math.trunc(item["draft_price"] * 1_000_000) / 1_000_000
|
||||
qty = item.get("draft_quantity", int(item.get("quantity", 1)))
|
||||
|
||||
total_weight += item.get("weight1", 0)
|
||||
|
||||
doc_lines.append({
|
||||
"ItemCode": item_code,
|
||||
#"ItemDescription": linea.get("descripcion", "TRANSPORTE DE CARGA MERCADERIA")[:200],
|
||||
"Quantity": qty,
|
||||
"PriceAfterVAT": lt_val,
|
||||
"WarehouseCode": item.get("warehouse_code", "A-CENTRA"),
|
||||
@@ -529,14 +817,14 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
})
|
||||
|
||||
|
||||
valor_referencial = round((total_weight / 1000 )* (CUADRO_VALOR_REFERENCIAL.get(zona_guia, 0)),2)
|
||||
valor_referencial = sum(l.get("valor_referencial") or 0 for l in factura.get("lineas", []))
|
||||
|
||||
return {
|
||||
"DocType": "dDocument_Items",
|
||||
"DocDate": fecha_contabilizacion,
|
||||
"DocDueDate": fecha_emision,
|
||||
"DocDueDate": fecha_vencimiento,
|
||||
"TaxDate": fecha_emision,
|
||||
"CardCode": f"PL{ruc_emisor}",
|
||||
"CardCode": card_code,
|
||||
"NumAtCard": f"{tipo}{serie}-{numero}",
|
||||
"U_IDC_NUMGR": "" if not guia_referencia else guia_referencia,
|
||||
"DocCurrency": "SOL",
|
||||
@@ -544,6 +832,7 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
"JournalMemo": razon_social_emisor[:254],
|
||||
"DocObjectCode": "oPurchaseInvoices",
|
||||
"U_BPV_SERI": f"{serie}-01",
|
||||
"U_VS_NATNUM": "T",
|
||||
"U_BPV_NCON2": numero,
|
||||
"U_BPP_MDTD": tipo,
|
||||
"U_BPP_MDBI": "A",
|
||||
@@ -557,6 +846,8 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
"U_IDC_FLETE": "02",
|
||||
"U_IDC_LINEANE": "01",
|
||||
"U_IDC_VALREF": valor_referencial,
|
||||
"U_VS_ANEXO_PDF": factura.get("ruta_red_pdf", ""),
|
||||
"U_VS_ANEXO_XML": factura.get("ruta_red_xml", ""),
|
||||
"DocumentLines": doc_lines,
|
||||
"DocumentInstallments": installments,
|
||||
}
|
||||
@@ -649,14 +940,9 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
for guia in guias:
|
||||
codigo_guia = f"{guia['tipo']}{guia['serie']}-{guia['numero']}"
|
||||
try:
|
||||
# consulta a sap por cada guia de remision
|
||||
# esto nos puede retornar 0, 1 o mas documentos
|
||||
# lo ideal es que nos retorne 0 o 1 documento
|
||||
delivery_notes = sapb1_manager.get_delivery_notes(
|
||||
tipo=guia["serie"], serie=guia["tipo"], numero=guia["numero"]
|
||||
tipo=guia["tipo"], serie=guia["serie"], numero=guia["numero"]
|
||||
)
|
||||
# cantidad de documentos encontrados en sap
|
||||
print(f" │ 🔍 Guía {codigo_guia}: {len(delivery_notes)} documento(s) encontrado(s) en SAP")
|
||||
|
||||
wh_set = set()
|
||||
suma_line_total = 0.0
|
||||
@@ -665,7 +951,6 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
weight1 = 0.0
|
||||
zona = ""
|
||||
|
||||
# recorremos cada documento encontrado
|
||||
for dn in delivery_notes:
|
||||
# obtenemos la zona de destino del documento
|
||||
zona = zonas.get(dn.get("U_IDC_DESTINO",""),"")
|
||||
@@ -697,17 +982,19 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
max_qty = max(max_qty, quantity)
|
||||
|
||||
sum_pav += price_after_vat
|
||||
print(f" │ └─ {dn.get('Series', '?')}-{dn.get('DocNum', '?')} | ItemCode: {linea_detalle_dict.get('ItemCode', '')} | PriceAfterVAT: {price_after_vat:.6f} | Quantity: {quantity:.6f} | LineTotal: {line_total:.6f}")
|
||||
_log(f"└─ {dn.get('Series', '?')}-{dn.get('DocNum', '?')} | ItemCode: {linea_detalle_dict.get('ItemCode', '')} | PriceAfterVAT: {price_after_vat:.6f} | Quantity: {quantity:.6f} | LineTotal: {line_total:.6f}", 4)
|
||||
|
||||
guias_lt.append({"guia": guia, "line_total": suma_line_total, "warehouse_code": ", ".join(sorted(wh_set)) if wh_set else "A-CENTRA", "quantity": max_qty, "price_after_vat_sum": sum_pav, "zona":zona, "weight1": weight1, "draft_quantity": 0, "draft_price": 0.0})
|
||||
all_wh.update(wh_set)
|
||||
except Exception as ex:
|
||||
print(f" │ ⚠️ Guía {codigo_guia}: error al consultar SAP - {ex}")
|
||||
_log(f"⚠️ Guía {codigo_guia}: error al consultar SAP - {ex}", 2)
|
||||
guias_lt.append({"guia": guia, "line_total": 0.0, "warehouse_code": "A-CENTRA", "weight1": 0.0, "quantity": 0.0, "price_after_vat_sum": 0.0, "zona": "", "draft_quantity": 0, "draft_price": 0.0})
|
||||
all_ok = False
|
||||
|
||||
sap_total = sum(item["line_total"] for item in guias_lt)
|
||||
sin_sap = all(item["line_total"] == 0.0 and item["quantity"] == 0.0 for item in guias_lt)
|
||||
ok = all_ok and abs(total_linea - sap_total) < 0.01
|
||||
label = "Sin guías SAP" if sin_sap else "LineTotal (FL*) vs total_linea"
|
||||
grflete_str = "; ".join(f"{item['guia']['tipo']}{item['guia']['serie']}-{item['guia']['numero']}" for item in guias_lt)
|
||||
wh_str = ", ".join(sorted(all_wh)) if all_wh else "A-CENTRA"
|
||||
|
||||
@@ -724,16 +1011,19 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
"ok": ok,
|
||||
"draft_price": total_linea,
|
||||
"sap_price": sap_total,
|
||||
"label": "LineTotal (FL*) vs total_linea",
|
||||
"label": label,
|
||||
"warehouse_code": wh_str,
|
||||
"guias_lt": guias_lt,
|
||||
})
|
||||
|
||||
print(f" │ Cantidad: {cantidad} | Total LineTotal (SAP): {sap_total:.6f} vs total_linea (XML): {total_linea:.6f}")
|
||||
if ok:
|
||||
print(f" │ ✅ Coincide: {total_linea:.6f} ≈ {sap_total:.6f}")
|
||||
if sin_sap:
|
||||
_log("⏭️ Sin guías en SAP — línea saltada", 3)
|
||||
else:
|
||||
print(f" │ ❌ NO coincide — XML: {total_linea:.6f} vs SAP: {sap_total:.6f}")
|
||||
_log(f"Cantidad: {cantidad} | Total LineTotal (SAP): {sap_total:.6f} vs total_linea (XML): {total_linea:.6f}", 3)
|
||||
if ok:
|
||||
_log(f"✅ Coincide: {total_linea:.6f} ≈ {sap_total:.6f}", 3)
|
||||
else:
|
||||
_log(f"❌ NO coincide — XML: {total_linea:.6f} vs SAP: {sap_total:.6f}", 3)
|
||||
|
||||
todas_coinciden = all(r["ok"] for r in resultados)
|
||||
return todas_coinciden, resultados
|
||||
@@ -768,7 +1058,72 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
f"{rows}</table>"
|
||||
)
|
||||
|
||||
def _build_notification_body(status: str, factura: dict, validation_table: str, **kwargs) -> str:
|
||||
def _obtener_valor_referencial_sap(factura: dict) -> list[dict]:
|
||||
"""
|
||||
Ejecuta ``Sp_ObtenerValorReferencial`` en SAP HANA por cada guía de
|
||||
remisión (tipo 09) única de la factura y acumula el resultado.
|
||||
|
||||
Una factura puede referenciar la misma guía desde más de una línea;
|
||||
en ese caso solo se consulta una vez por guía.
|
||||
|
||||
Args:
|
||||
factura: Diccionario de la factura, con ``lineas[]`` y cada
|
||||
línea con ``guias_remision[]`` (tipo 09).
|
||||
|
||||
Returns:
|
||||
list[dict] — uno por guía única, con ``serie``, ``numero`` y
|
||||
``valor_sap``.
|
||||
"""
|
||||
vistos = set()
|
||||
resultados = []
|
||||
for linea in factura.get("lineas", []):
|
||||
for guia in linea.get("guias_remision", []):
|
||||
clave = (guia.get("serie"), guia.get("numero"))
|
||||
if clave in vistos:
|
||||
continue
|
||||
vistos.add(clave)
|
||||
valor_sap = hana_manager.obtener_valor_referencial(guia.get("serie", ""), guia.get("numero", ""))
|
||||
resultados.append({"serie": guia.get("serie", ""), "numero": guia.get("numero", ""), "valor_sap": valor_sap})
|
||||
_log(f"└─ Guía 09{guia.get('serie')}-{guia.get('numero')} | Valor Referencial SAP: {valor_sap:.2f}", 3)
|
||||
return resultados
|
||||
|
||||
def _build_valor_referencial_html(factura: dict, guias_valor_ref: list[dict]) -> str:
|
||||
"""
|
||||
Genera una tabla HTML comparando el valor referencial del XML de la
|
||||
factura contra el valor referencial obtenido en SAP
|
||||
(``Sp_ObtenerValorReferencial``) por cada guía de remisión, y el
|
||||
total acumulado.
|
||||
|
||||
Args:
|
||||
factura: Diccionario de la factura (usa ``lineas[]`` para sumar
|
||||
``valor_referencial`` extraído del XML).
|
||||
guias_valor_ref: Resultado de ``_obtener_valor_referencial_sap``.
|
||||
|
||||
Returns:
|
||||
str — Tabla HTML con una fila por guía, el total SAP, el valor
|
||||
del XML y un ícono de coincidencia.
|
||||
"""
|
||||
valor_xml = sum(l.get("valor_referencial") or 0 for l in factura.get("lineas", []))
|
||||
total_sap = sum(g["valor_sap"] for g in guias_valor_ref)
|
||||
|
||||
rows = "".join(
|
||||
f"<tr><td>09{g['serie']}-{g['numero']}</td><td>{g['valor_sap']:.2f}</td></tr>"
|
||||
for g in guias_valor_ref
|
||||
)
|
||||
coincide = abs(valor_xml - total_sap) < 0.01
|
||||
icono = "✅" if coincide else "❌"
|
||||
|
||||
return (
|
||||
"<table border='1' cellpadding='6' cellspacing='0' style='border-collapse:collapse;'>"
|
||||
"<tr><th>Guía de Remisión</th><th>Valor Referencial SAP</th></tr>"
|
||||
f"{rows}"
|
||||
f"<tr><td><b>Total SAP</b></td><td><b>{total_sap:.2f}</b></td></tr>"
|
||||
f"<tr><td><b>Valor Referencial XML</b></td><td><b>{valor_xml:.2f}</b></td></tr>"
|
||||
f"<tr><td colspan='2'>{icono} {'Coincide' if coincide else 'No coincide'}</td></tr>"
|
||||
"</table>"
|
||||
)
|
||||
|
||||
def _build_notification_body(status: str, factura: dict, validation_table: str, valor_referencial_table: str, **kwargs) -> str:
|
||||
"""
|
||||
Construye el cuerpo HTML del email de notificación del resultado
|
||||
del proceso SAP.
|
||||
@@ -781,6 +1136,8 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
``numero``, ``razon_social_emisor``).
|
||||
validation_table: Tabla HTML generada por
|
||||
``_build_validation_html``.
|
||||
valor_referencial_table: Tabla HTML generada por
|
||||
``_build_valor_referencial_html``.
|
||||
**kwargs: Argumentos adicionales:
|
||||
- ``doc_entry`` (int): DocEntry del draft creado.
|
||||
- ``error`` (str): Mensaje de error si ocurrió.
|
||||
@@ -792,7 +1149,7 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
Draft creado exitosamente::
|
||||
|
||||
body = _build_notification_body(
|
||||
"created", factura, tabla_html, doc_entry=2021
|
||||
"created", factura, tabla_html, valref_html, doc_entry=2021
|
||||
)
|
||||
# → "<p>✅ Draft SAP B1 creado exitosamente.</p>..."
|
||||
"""
|
||||
@@ -800,12 +1157,13 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
f"<p><b>Factura:</b> {factura.get('serie')}-{factura.get('numero')}</p>"
|
||||
f"<p><b>Emisor:</b> {factura.get('razon_social_emisor', '')}</p>"
|
||||
)
|
||||
valref_section = f"<h3>Valor Referencial (XML vs SAP)</h3>{valor_referencial_table}"
|
||||
if status == "created":
|
||||
return f"<p>✅ Draft SAP B1 creado exitosamente.</p><p><b>DocEntry:</b> {kwargs.get('doc_entry')}</p>{base}<h3>Validación de precios</h3>{validation_table}"
|
||||
return f"<p>✅ Draft SAP B1 creado exitosamente.</p><p><b>DocEntry:</b> {kwargs.get('doc_entry')}</p>{base}<h3>Validación de precios</h3>{validation_table}{valref_section}"
|
||||
elif status == "error":
|
||||
return f"<p>❌ Error al crear Draft SAP B1.</p>{base}<p><b>Error:</b> {kwargs.get('error')}</p><h3>Validación de precios</h3>{validation_table}"
|
||||
return f"<p>❌ Error al crear Draft SAP B1.</p>{base}<p><b>Error:</b> {kwargs.get('error')}</p><h3>Validación de precios</h3>{validation_table}{valref_section}"
|
||||
else:
|
||||
return f"<p>⏭️ Draft NO creado. Los precios de las guías no coinciden con SAP.</p>{base}<h3>Validación de precios</h3>{validation_table}"
|
||||
return f"<p>⏭️ Draft NO creado. Los precios de las guías no coinciden con SAP.</p>{base}<h3>Validación de precios</h3>{validation_table}{valref_section}"
|
||||
|
||||
def _guardar_draft_json(draft: dict, serie: str, numero: str) -> None:
|
||||
"""
|
||||
@@ -833,26 +1191,26 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
filename = f"draft_sapb1_{serie}-{numero}_{ts}.json"
|
||||
with open(os.path.join(output_folder, filename), "w", encoding="utf-8") as f:
|
||||
json.dump(draft, f, ensure_ascii=False, indent=4)
|
||||
print(f" 💾 Draft guardado: {filename}")
|
||||
_log(f"💾 Draft guardado: {filename}")
|
||||
|
||||
# ========================================================================
|
||||
# FLUJO DEL CORREO
|
||||
# ========================================================================
|
||||
|
||||
print(f"\n📬 [{email['fecha']}] {email['subject'][:80]}...")
|
||||
print(f" ├── 📂 Adjuntos:")
|
||||
_log("📂 Adjuntos:")
|
||||
|
||||
# 1-2. BD: verificar existencia y guardar
|
||||
exists = database_utilities.get_existing_ids([email["id"]])
|
||||
if email["id"] in exists:
|
||||
print(f" ├── ⏭️ Correo ya procesado, saltando")
|
||||
_log("⏭️ Correo ya procesado, saltando")
|
||||
return
|
||||
database_utilities.save_emails([email])
|
||||
|
||||
# 3. Descargar adjuntos
|
||||
adjuntos = _descargar_adjuntos()
|
||||
if not adjuntos:
|
||||
print(f" ├── ⏭️ Correo sin adjuntos")
|
||||
_log("⏭️ Correo sin adjuntos")
|
||||
return
|
||||
|
||||
# 4. Descomprimir ZIPs
|
||||
@@ -868,56 +1226,79 @@ def _procesar_un_correo(email: dict, token: str, email_addr: str, download_folde
|
||||
# 7. Procesar XMLs
|
||||
documentos = _procesar_xmls(pdf_cache)
|
||||
if not documentos:
|
||||
print(f" ├── ⏭️ No se extrajeron documentos XML")
|
||||
_log("⏭️ No se extrajeron documentos XML")
|
||||
return
|
||||
|
||||
# 8. Guardar resultado con todos los documentos
|
||||
_guardar_resultado(documentos)
|
||||
# 8. Completar guías faltantes desde PDF
|
||||
n_guias = _completar_guias(documentos, pdf_cache)
|
||||
if n_guias:
|
||||
_log(f"🔄 {n_guias} guías completadas desde PDF")
|
||||
|
||||
# 9. Filtrar solo facturas para SAP
|
||||
# 9. Validar que toda guía tenga tipo, serie y número
|
||||
_validar_guias(documentos)
|
||||
|
||||
# 10. Guardar resultado con todos los documentos
|
||||
paths_resultado = _guardar_resultado(documentos, email.get("datos_pdf", []))
|
||||
email["resultado_paths"] = paths_resultado
|
||||
|
||||
# 11. Filtrar solo facturas para SAP
|
||||
facturas = [d for d in documentos if d.get("tipo") == "01"]
|
||||
if not facturas:
|
||||
print(f" ├── ⏭️ No hay facturas (tipo 01) para SAP")
|
||||
_log("⏭️ No hay facturas (tipo 01) para SAP")
|
||||
return
|
||||
|
||||
for factura in facturas:
|
||||
serie = factura.get("serie", "?")
|
||||
numero = factura.get("numero", "?")
|
||||
|
||||
# 10. Validar precios (consulta SAP DNs, NO requiere draft)
|
||||
_log(f"📄 Factura: {serie}-{numero}")
|
||||
|
||||
# 12. Validar precios (consulta SAP DNs, NO requiere draft)
|
||||
todas_coinciden, resultados_val = _validate_prices(factura)
|
||||
validation_table = _build_validation_html(resultados_val)
|
||||
|
||||
# 11. Construir draft (usa LineTotal de los DNs, no del XML)
|
||||
# 12.5 Comparar valor referencial del XML vs SAP (Sp_ObtenerValorReferencial)
|
||||
guias_valor_ref = _obtener_valor_referencial_sap(factura)
|
||||
valor_referencial_table = _build_valor_referencial_html(factura, guias_valor_ref)
|
||||
|
||||
# 13. Construir draft (usa LineTotal de los DNs, no del XML)
|
||||
draft = _build_sap_draft(factura, resultados_val)
|
||||
|
||||
adjuntos_email = [p for p in [factura.get("ruta_xml"), factura.get("ruta_pdf")] if p]
|
||||
for p in email.get("resultado_paths", []):
|
||||
if p and os.path.exists(p) and p not in adjuntos_email:
|
||||
adjuntos_email.append(p)
|
||||
|
||||
# 12. Guardar draft JSON (siempre, para depuración)
|
||||
# 14. Guardar draft JSON (siempre, para depuración)
|
||||
_guardar_draft_json(draft, serie, numero)
|
||||
|
||||
# 13. Crear draft en SAP o generar HTML
|
||||
# 15. Crear draft en SAP o generar HTML
|
||||
if todas_coinciden:
|
||||
try:
|
||||
sap_result = sapb1_manager.create_draft(draft)
|
||||
doc_entry = sap_result.get("DocEntry")
|
||||
print(f" ✅ Draft SAP B1 creado: {serie}-{numero} → DocEntry {doc_entry}")
|
||||
html_body = _build_notification_body("created", factura, validation_table, doc_entry=doc_entry)
|
||||
_log(f"✅ Draft SAP B1 creado: {serie}-{numero} → DocEntry {doc_entry}")
|
||||
html_body = _build_notification_body("created", factura, validation_table, valor_referencial_table, doc_entry=doc_entry)
|
||||
except Exception as ex:
|
||||
print(f" ❌ Error creando draft {serie}-{numero}: {ex}")
|
||||
html_body = _build_notification_body("error", factura, validation_table, error=ex)
|
||||
_log(f"❌ Error creando draft {serie}-{numero}: {ex}")
|
||||
html_body = _build_notification_body("error", factura, validation_table, valor_referencial_table, error=ex)
|
||||
else:
|
||||
print(f" ⏭️ Draft NO creado: {serie}-{numero} — validación falló")
|
||||
html_body = _build_notification_body("skipped", factura, validation_table)
|
||||
_log(f"⏭️ Draft NO creado: {serie}-{numero} — validación falló")
|
||||
html_body = _build_notification_body("skipped", factura, validation_table, valor_referencial_table)
|
||||
|
||||
# 14. Enviar notificación
|
||||
# 16. Enviar notificación al remitente original, con copia al equipo
|
||||
if token:
|
||||
destinatario = email.get("sender")
|
||||
if destinatario and destinatario != "Desconocido":
|
||||
outlook_utilities.send_email(
|
||||
token, email_addr,
|
||||
["jlopez@aberio.com.pe", "gcalle@pucp.pe"],
|
||||
[destinatario],
|
||||
f"Draft SAP B1 - {serie}-{numero}",
|
||||
html_body, adjuntos_email,
|
||||
cc_recipients=["jlopez@aberio.com.pe", "gcalle@pucp.pe"],
|
||||
)
|
||||
else:
|
||||
_log("⚠️ No se pudo determinar el remitente, notificación no enviada")
|
||||
|
||||
|
||||
# ============================================================================
|
||||
|
||||
+6
-16
@@ -1,16 +1,6 @@
|
||||
certifi==2026.6.17
|
||||
cffi==2.1.0
|
||||
charset-normalizer==3.4.9
|
||||
cryptography==49.0.0
|
||||
dotenv==0.9.9
|
||||
idna==3.18
|
||||
msal==1.37.0
|
||||
pdfminer.six==20260107
|
||||
pdfplumber==0.11.10
|
||||
pillow==12.3.0
|
||||
pycparser==3.0
|
||||
PyJWT==2.13.0
|
||||
pypdfium2==5.11.0
|
||||
python-dotenv==1.2.2
|
||||
requests==2.34.2
|
||||
urllib3==2.7.0
|
||||
hdbcli
|
||||
msal
|
||||
pdfplumber
|
||||
python-dotenv
|
||||
requests
|
||||
urllib3
|
||||
+156
-10
@@ -5,6 +5,7 @@ import os
|
||||
import json
|
||||
from typing import Optional, Dict, Any
|
||||
from dotenv import load_dotenv
|
||||
import hana_manager
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -13,7 +14,8 @@ from dotenv import load_dotenv
|
||||
|
||||
urllib3.disable_warnings()
|
||||
|
||||
load_dotenv(dotenv_path=".env.dev")
|
||||
# Ruta absoluta: no depende del directorio de trabajo desde el que se lance el proceso
|
||||
load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), ".env"))
|
||||
|
||||
SAPB1_URL = os.getenv("SAP_B1_URL", "")
|
||||
SAPB1_USER = os.getenv("SAP_B1_USER", "")
|
||||
@@ -100,7 +102,7 @@ def _log_response(method: str, endpoint: str, response: requests.Response, paylo
|
||||
f" ({len(response.content)} bytes)"
|
||||
)
|
||||
if response.status_code >= 400:
|
||||
print("⚠️ %s - %s", log_line, response.text[:300])
|
||||
print(f"⚠️ {log_line} - {response.text[:300]}")
|
||||
else:
|
||||
print(log_line)
|
||||
|
||||
@@ -203,20 +205,164 @@ def get_purchase_invoice(doc_entry: int) -> dict:
|
||||
return result
|
||||
|
||||
# ============================================================================
|
||||
# OBTENER GUIA (GET /DeliveryNotes)
|
||||
# Tabla HANA de origen → entidad de Service Layer que hay que consultar.
|
||||
# ODLN (Entregas) se expone en SL como DeliveryNotes; OWTR (Traslados de
|
||||
# Inventario) se expone como StockTransfers.
|
||||
# ============================================================================
|
||||
_TABLA_A_ENTIDAD_SL = {
|
||||
"ODLN": "DeliveryNotes",
|
||||
"OWTR": "StockTransfers",
|
||||
}
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# OBTENER GUIA (GET /DeliveryNotes o /StockTransfers)
|
||||
# ============================================================================
|
||||
def get_delivery_notes(tipo: str, serie: str, numero: str) -> list:
|
||||
"""
|
||||
Obtiene el documento completo de SAP B1 a partir del cual se validan los
|
||||
precios de flete (líneas ``FL*`` en ``DocumentLines``).
|
||||
|
||||
Fase 1 — Busca DocEntry/DocNum/CardCode/CardName/Entidad:
|
||||
- Primero intenta Service Layer con $select (entidad DeliveryNotes).
|
||||
- Si no hay resultados, fallback a HANA (consulta ODLN y, si no
|
||||
encuentra nada, OWTR).
|
||||
|
||||
Fase 2 — Por cada DocEntry obtenido, hace GET a la entidad indicada en
|
||||
"Entidad" (DeliveryNotes o StockTransfers).
|
||||
- Si es DeliveryNotes, ese documento ya trae ``DocumentLines`` con
|
||||
las líneas FL* y se retorna tal cual.
|
||||
- Si es StockTransfers, ese documento es un traslado de inventario
|
||||
y NO tiene líneas FL* ni precios. En ese caso se lee el campo
|
||||
``U_IDC_NUMOV`` (DocEntry de la Orden de Venta asociada) y se
|
||||
hace GET a ``Orders(U_IDC_NUMOV)``, devolviendo ese documento en
|
||||
su lugar para que la validación de precios funcione igual que
|
||||
con DeliveryNotes.
|
||||
|
||||
Returns:
|
||||
list[dict] — Documentos completos, o [] si no se encontró nada en
|
||||
ninguna fuente.
|
||||
"""
|
||||
codigo = f"{tipo}{serie}-{numero}"
|
||||
|
||||
# ── Fase 1: Obtener DocEntries ──────────────────────────────────────
|
||||
entries = _get_delivery_entries(tipo, serie, numero)
|
||||
|
||||
if not entries:
|
||||
print(f" │ ⚠️ Guía {codigo}: sin registros en SAP (SL + HANA)")
|
||||
return []
|
||||
|
||||
# ── Fase 2: Obtener documento completo por cada DocEntry ─────────────
|
||||
docs = []
|
||||
for entry in entries:
|
||||
doc_entry = entry["DocEntry"]
|
||||
entidad = entry["Entidad"]
|
||||
try:
|
||||
resp = forward_to_sapb1("GET", f"{entidad}({doc_entry})")
|
||||
doc = resp.json()
|
||||
print(f" │ └─ {entidad}({doc_entry}) obtenido")
|
||||
|
||||
if entidad == "StockTransfers":
|
||||
num_ov = doc.get("U_IDC_NUMOV")
|
||||
if not num_ov:
|
||||
print(f" │ ⚠️ StockTransfers({doc_entry}) sin U_IDC_NUMOV: no se puede validar precios")
|
||||
continue
|
||||
resp_ov = forward_to_sapb1("GET", f"Orders({num_ov})")
|
||||
doc = resp_ov.json()
|
||||
print(f" │ └─ Orders({num_ov}) obtenido (Orden de Venta de StockTransfers({doc_entry}))")
|
||||
|
||||
docs.append(doc)
|
||||
except Exception as e:
|
||||
print(f" │ ⚠️ Error obteniendo {entidad}({doc_entry}): {e}")
|
||||
|
||||
return docs
|
||||
|
||||
|
||||
def _get_delivery_entries(tipo: str, serie: str, numero: str) -> list:
|
||||
"""Fase 1: intenta SL, fallback a HANA. Retorna [{DocEntry, DocNum, CardCode, CardName, Entidad}, ...]."""
|
||||
codigo = f"{tipo}{serie}-{numero}"
|
||||
|
||||
# ── Intentar Service Layer ───────────────────────────────────────────
|
||||
try:
|
||||
filter_str = (
|
||||
f"Cancelled eq 'tNO'"
|
||||
f" and U_BPP_MDSD eq '{tipo}'"
|
||||
f" and U_BPP_MDTD eq '{serie}'"
|
||||
f" and U_BPP_MDTD eq '{tipo}'"
|
||||
f" and U_BPP_MDSD eq '{serie}'"
|
||||
f" and contains(U_BPP_MDCD,'{numero}')"
|
||||
)
|
||||
resp = forward_to_sapb1("GET", "DeliveryNotes", params={"$filter": filter_str})
|
||||
result = resp.json()
|
||||
value = result.get("value", [])
|
||||
print(f" ├── ✅ DeliveryNotes obtenida ({len(value)} registros)")
|
||||
return value
|
||||
resp = forward_to_sapb1(
|
||||
"GET", "DeliveryNotes",
|
||||
params={
|
||||
"$filter": filter_str,
|
||||
"$select": "DocEntry,DocNum,CardCode,CardName",
|
||||
"$top": "10",
|
||||
},
|
||||
)
|
||||
sl_entries = resp.json().get("value", [])
|
||||
if sl_entries:
|
||||
for sl_entry in sl_entries:
|
||||
sl_entry["Entidad"] = "DeliveryNotes"
|
||||
print(f" │ 🔍 Guía {codigo}: SL → {len(sl_entries)} DocEntry encontrados")
|
||||
return sl_entries
|
||||
|
||||
print(f" │ 🔍 Guía {codigo}: SL → 0 resultados. Consultando HANA...")
|
||||
|
||||
except Exception as e:
|
||||
print(f" │ ⚠️ Guía {codigo}: SL falló ({e}). Consultando HANA...")
|
||||
|
||||
# ── Fallback a HANA ──────────────────────────────────────────────────
|
||||
try:
|
||||
hana_entries = hana_manager.get_delivery(tipo, serie, numero)
|
||||
if hana_entries:
|
||||
for hana_entry in hana_entries:
|
||||
hana_entry["Entidad"] = _TABLA_A_ENTIDAD_SL.get(
|
||||
hana_entry.get("Tabla"), "DeliveryNotes"
|
||||
)
|
||||
print(f" │ 🔍 Guía {codigo}: HANA → {len(hana_entries)} DocEntry encontrados")
|
||||
return hana_entries
|
||||
print(f" │ 🔍 Guía {codigo}: HANA → 0 registros")
|
||||
except Exception as e:
|
||||
print(f" │ ⚠️ Guía {codigo}: HANA falló ({e})")
|
||||
|
||||
return []
|
||||
|
||||
# ============================================================================
|
||||
# OBTENER CONDICIÓN DE PAGO (GET /BusinessPartners + /PaymentTermsTypes)
|
||||
# ============================================================================
|
||||
def obtener_condicion_pago(card_code: str) -> dict | None:
|
||||
"""
|
||||
Obtiene la condición de pago (PaymentTermsTypes) de un Business Partner,
|
||||
para calcular la fecha de vencimiento de un documento.
|
||||
|
||||
Args:
|
||||
card_code: Código del Business Partner (ej. "PL20555929006").
|
||||
|
||||
Returns:
|
||||
dict | None — {"GroupNumber", "PaymentTermsGroupName",
|
||||
"NumberOfAdditionalMonths", "NumberOfAdditionalDays"}, o None si el
|
||||
CardCode no existe, no tiene condición de pago asociada, o falló la
|
||||
consulta a Service Layer.
|
||||
"""
|
||||
try:
|
||||
resp_bp = forward_to_sapb1(
|
||||
"GET", f"BusinessPartners('{card_code}')",
|
||||
params={"$select": "CardCode,PayTermsGrpCode"},
|
||||
)
|
||||
group_num = resp_bp.json().get("PayTermsGrpCode")
|
||||
if group_num is None:
|
||||
return None
|
||||
|
||||
resp_terms = forward_to_sapb1("GET", f"PaymentTermsTypes({group_num})")
|
||||
terms = resp_terms.json()
|
||||
return {
|
||||
"GroupNumber": terms.get("GroupNumber"),
|
||||
"PaymentTermsGroupName": terms.get("PaymentTermsGroupName"),
|
||||
"NumberOfAdditionalMonths": terms.get("NumberOfAdditionalMonths") or 0,
|
||||
"NumberOfAdditionalDays": terms.get("NumberOfAdditionalDays") or 0,
|
||||
}
|
||||
except Exception as e:
|
||||
print(f" │ ⚠️ Error obteniendo condición de pago de {card_code}: {e}")
|
||||
return None
|
||||
|
||||
# ============================================================================
|
||||
# OBTENER ZONAS (GET /U_IDC_ZONAS)
|
||||
|
||||
+218
-16
@@ -11,11 +11,40 @@ import xml.etree.ElementTree as ET
|
||||
from dataclasses import dataclass, asdict, field
|
||||
from typing import Optional, List
|
||||
|
||||
# ============================================================================
|
||||
# Patrones regex organizados por tipo de extracción
|
||||
# ============================================================================
|
||||
# Serie-Número: busca cualquier patrón T001-123456, V001-789, etc.
|
||||
SERIE_NUMERO_PATTERNS = [
|
||||
r'\b([TVE][A-Z0-9]{3})\s*-\s*(\d+)\b',
|
||||
]
|
||||
|
||||
# Guías desde Notes de InvoiceLine: cada entrada es (patron, tipo_documento)
|
||||
GUIAS_NOTES_PATTERNS = [
|
||||
# GRE: "GRE REMITENTE: T001-128912", "GRR.T001-129352", "G.R.R:T001-132131"
|
||||
(r"(?:GRE\s+REMITENTE|GRR|G\.R\.R)\s*[:.]?\s*([TVE][A-Z0-9]{3,4})\s*-\s*(\d+)", "09"),
|
||||
# GRT: "GRT:V001-194", "GRT.V001-227", "G.R.T: EG03-4643"
|
||||
(r"\b(?:GRT|G\.R\.T)\s*[:.]?\s*([TVE][A-Z0-9]{3,4})\s*-\s*(\d+)", "31"),
|
||||
]
|
||||
|
||||
# Valor referencial desde la descripción del Item: cada cliente lo redacta distinto,
|
||||
# por lo que se prueba una lista de patrones en orden hasta encontrar el primero que calce.
|
||||
# Agregar aquí nuevas variantes a medida que aparezcan en facturas de otros clientes.
|
||||
VALOR_REFERENCIAL_PATTERNS = [
|
||||
r"VALOR\s+REFERENCIAL\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "VALOR REFERENCIAL: S/ 2,345.00" / "VALOR REFERENCIAL: 468.86"
|
||||
r"VALOR\s+REFER\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "VALOR REFER\t:S/ 1431.16"
|
||||
r"VALOR\s+REF\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "VALOR REF:S/ 1,139.75"
|
||||
r"VAL\.?\s*REF\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "VAL.REF.:S/700.25"
|
||||
r"V\.?\s*REF\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "V.REF: S/ 2940.80 TN: 36.85"
|
||||
r"\bV\.\s*R\.?\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "V.R. S/964.51" / "V.R.: 1045.20"
|
||||
r"\bVR\s*:?\s*(?:S/\.?\s*)?([\d,]+\.\d+)", # "VR:S/300.10"
|
||||
]
|
||||
# ============================================================================
|
||||
# Namespaces UBL 2.1 utilizados en los XML de SUNAT
|
||||
NAMESPACES = {
|
||||
"inv": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",
|
||||
"desp": "urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2",
|
||||
"ar": "urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2",
|
||||
"cac": "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2",
|
||||
"cbc": "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",
|
||||
"ext": "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2",
|
||||
@@ -47,6 +76,10 @@ class DetalleLinea:
|
||||
cantidad: float
|
||||
precio_unitario: float
|
||||
total_linea: float = 0.0
|
||||
notes_text: str = ""
|
||||
guias_remision: List[dict] = field(default_factory=list)
|
||||
guia_transportista: Optional[dict] = None
|
||||
valor_referencial: Optional[float] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -96,7 +129,7 @@ class DatosComprobante:
|
||||
refs_str = ""
|
||||
if self.documentos_referencia:
|
||||
refs_str = "\n Documentos Ref: " + ", ".join(
|
||||
f"{ref.id} (Tipo {ref.tipo})" for ref in self.documentos_referencia
|
||||
f"{ref.serie}-{ref.numero} (Tipo {ref.tipo})" for ref in self.documentos_referencia
|
||||
)
|
||||
detraccion_str = ""
|
||||
if self.tiene_detraccion:
|
||||
@@ -123,6 +156,26 @@ class DatosComprobante:
|
||||
|
||||
|
||||
# ============================================================================
|
||||
def _inferir_tipo_desde_serie(serie: str) -> str:
|
||||
"""
|
||||
Infiere el tipo de documento SUNAT desde el prefijo de la serie.
|
||||
|
||||
- Serie que empieza con 'T' → tipo 09 (Guía de Remisión Remitente)
|
||||
- Serie que empieza con 'V' o 'E' → tipo 31 (Guía de Remisión Transportista)
|
||||
- Otros → tipo 09 por defecto
|
||||
"""
|
||||
if serie and serie[0] == "T":
|
||||
return "09"
|
||||
if serie and serie[0] in ("V", "E"):
|
||||
return "31"
|
||||
return "09"
|
||||
|
||||
|
||||
def _es_referencia_valida(serie: str, numero: str) -> bool:
|
||||
"""Valida que una referencia tenga serie no vacía y número > 0."""
|
||||
return bool(serie) and numero not in ("", "0")
|
||||
|
||||
|
||||
def _find_text(element: ET.Element, xpath: str, namespaces: dict) -> Optional[str]:
|
||||
"""Busca un elemento por XPath y devuelve su texto, o None si no existe."""
|
||||
node = element.find(xpath, namespaces)
|
||||
@@ -131,39 +184,103 @@ def _find_text(element: ET.Element, xpath: str, namespaces: dict) -> Optional[st
|
||||
return None
|
||||
|
||||
# ============================================================================
|
||||
def split_serie_numero(comprobante_id: str) -> tuple[str, str]:
|
||||
"""Public alias for _split_serie_numero."""
|
||||
return _split_serie_numero(comprobante_id)
|
||||
|
||||
|
||||
def _split_serie_numero(comprobante_id: str) -> tuple[str, str]:
|
||||
"""
|
||||
Separa el ID del comprobante en serie y número, removiendo ceros a la izquierda del número.
|
||||
Ejemplo: 'F002-3091' -> ('F002', '3091')
|
||||
'T001-00128143' -> ('T001', '128143')
|
||||
'EG03-1752' -> ('EG03', '1752')
|
||||
'T001 - 00130229' -> ('T001', '130229')
|
||||
'0002 - 000608' -> ('0002', '608')
|
||||
"""
|
||||
if "-" in comprobante_id:
|
||||
partes = comprobante_id.split("-", 1)
|
||||
# Remueve ceros a la izquierda, si queda vacío (ej: '000') se mantiene '0'
|
||||
numero = partes[1].lstrip("0") or "0"
|
||||
return partes[0], numero
|
||||
return comprobante_id, ""
|
||||
serie = partes[0].strip()
|
||||
# Remueve espacios y ceros a la izquierda, si queda vacío (ej: '000') se mantiene '0'
|
||||
numero = partes[1].strip().lstrip("0") or "0"
|
||||
return serie, numero
|
||||
return comprobante_id.strip(), ""
|
||||
|
||||
# ============================================================================
|
||||
def _extraer_serie_numero_desde_texto(texto: str) -> tuple[str, str] | None:
|
||||
texto = re.sub(r'[–—−]', '-', texto)
|
||||
patron = r'\b([TVE][A-Z0-9]{3})\s*-\s*(\d+)\b'
|
||||
for patron in SERIE_NUMERO_PATTERNS:
|
||||
m = re.search(patron, texto)
|
||||
if m:
|
||||
return m.group(1).upper(), m.group(2)
|
||||
numero = m.group(2).lstrip("0") or "0"
|
||||
return m.group(1).upper(), numero
|
||||
return None
|
||||
|
||||
|
||||
def _numeros_extra_guia(texto: str, pos: int) -> list[str]:
|
||||
"""
|
||||
Desde una posición devuelve números adicionales que comparten la misma serie
|
||||
de una guía ya capturada, separados por `,`, `/`, `\\` o `;`.
|
||||
|
||||
Ejemplo: ``"T001-133023,133024"`` con ``pos`` tras ``133023`` → ``["133024"]``
|
||||
"""
|
||||
numeros = []
|
||||
resto = texto[pos:]
|
||||
while True:
|
||||
m = re.match(r'\s*[,;\\/]\s*(\d+)', resto)
|
||||
if not m:
|
||||
break
|
||||
numeros.append(m.group(1).lstrip("0") or "0")
|
||||
resto = resto[m.end():]
|
||||
return numeros
|
||||
|
||||
|
||||
def extraer_guias_desde_notes(notes_text: str) -> list[dict]:
|
||||
"""
|
||||
Extrae guías de remisión (GRE/GRT) desde el texto de Notes de una InvoiceLine.
|
||||
|
||||
Retorna lista de dicts con ``tipo``, ``serie``, ``numero``.
|
||||
"""
|
||||
resultados = []
|
||||
for patron, tipo in GUIAS_NOTES_PATTERNS:
|
||||
for m in re.finditer(patron, notes_text, re.IGNORECASE):
|
||||
serie = m.group(1).upper()
|
||||
numero = m.group(2).lstrip("0") or "0"
|
||||
resultados.append({"tipo": tipo, "serie": serie, "numero": numero})
|
||||
for extra in _numeros_extra_guia(notes_text, m.end()):
|
||||
resultados.append({"tipo": tipo, "serie": serie, "numero": extra})
|
||||
return resultados
|
||||
|
||||
|
||||
def extraer_valor_referencial(texto: str) -> Optional[float]:
|
||||
"""
|
||||
Extrae el valor referencial (importe) desde el texto de descripción de un Item.
|
||||
|
||||
Prueba cada patrón de ``VALOR_REFERENCIAL_PATTERNS`` en orden y devuelve el
|
||||
primer importe encontrado.
|
||||
|
||||
Ejemplos: ``"...VALOR REF:S/ 1,139.75"`` -> ``1139.75``
|
||||
``"...V.R. S/964.51"`` -> ``964.51``
|
||||
"""
|
||||
for patron in VALOR_REFERENCIAL_PATTERNS:
|
||||
m = re.search(patron, texto, re.IGNORECASE)
|
||||
if m:
|
||||
return float(m.group(1).replace(",", ""))
|
||||
return None
|
||||
|
||||
|
||||
def obtener_documentos_referencia_detalle_factura(texto: str) -> list[str]:
|
||||
texto = re.sub(r'[–—−]', '-', texto)
|
||||
|
||||
patron = r'\b([TVE][A-Z0-9]{3})\s*-\s*(\d+)\b'
|
||||
|
||||
return list(dict.fromkeys(
|
||||
f"{serie.upper()}-{numero}"
|
||||
for serie, numero in re.findall(patron, texto, flags=re.IGNORECASE)
|
||||
))
|
||||
resultados = []
|
||||
for patron in SERIE_NUMERO_PATTERNS:
|
||||
for m in re.finditer(patron, texto, flags=re.IGNORECASE):
|
||||
serie = m.group(1).upper()
|
||||
numero = m.group(2)
|
||||
resultados.append(f"{serie}-{numero}")
|
||||
for extra in _numeros_extra_guia(texto, m.end()):
|
||||
resultados.append(f"{serie}-{extra}")
|
||||
return list(dict.fromkeys(resultados))
|
||||
# ============================================================================
|
||||
def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
"""Extrae datos de un documento Invoice (Factura/Boleta)."""
|
||||
@@ -228,7 +345,9 @@ def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
ref_serie, ref_numero = parsed
|
||||
else:
|
||||
ref_serie, ref_numero = _split_serie_numero(ref_id)
|
||||
documentos_referencia.append(DocumentoReferencia(tipo=ref_tipo, serie=ref_serie, numero=ref_numero))
|
||||
if _es_referencia_valida(ref_serie, ref_numero):
|
||||
tipo_ref = ref_tipo if ref_tipo else _inferir_tipo_desde_serie(ref_serie)
|
||||
documentos_referencia.append(DocumentoReferencia(tipo=tipo_ref, serie=ref_serie, numero=ref_numero))
|
||||
|
||||
# si los documentos de referencia non estan en los tags de SUNAT
|
||||
# buscamos estos documentos en el cuerpo de la factura
|
||||
@@ -242,7 +361,9 @@ def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
guias = obtener_documentos_referencia_detalle_factura(description.text)
|
||||
if guias:
|
||||
for guia in guias:
|
||||
documentos_referencia.append(DocumentoReferencia(tipo="09" if guia[:1] in ("T", "V", "E") else "31", serie=_split_serie_numero(guia)[0], numero=_split_serie_numero(guia)[1]))
|
||||
serie_parsed, numero_parsed = _split_serie_numero(guia)
|
||||
if _es_referencia_valida(serie_parsed, numero_parsed):
|
||||
documentos_referencia.append(DocumentoReferencia(tipo=_inferir_tipo_desde_serie(serie_parsed), serie=serie_parsed, numero=numero_parsed))
|
||||
|
||||
# Inicializar campos de detracción y líneas
|
||||
tiene_detraccion = False
|
||||
@@ -253,6 +374,12 @@ def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
|
||||
# Solo si el tipo es Factura (01) se extraen detracciones y líneas detalladas
|
||||
if tipo == "01":
|
||||
# Notas a nivel de documento (cbc:Note en la raíz): algunos clientes ponen
|
||||
# el valor referencial aquí en vez de en la descripción del Item, ej:
|
||||
# "V.REF: S/ 2940.80 TN: 36.85"
|
||||
root_notes = root.findall("cbc:Note", ns)
|
||||
root_notes_text = " | ".join(n.text.strip() for n in root_notes if n.text) if root_notes else ""
|
||||
|
||||
# Buscar detracción en PaymentTerms
|
||||
for pt_node in root.findall("cac:PaymentTerms", ns):
|
||||
pt_id = _find_text(pt_node, "cbc:ID", ns)
|
||||
@@ -271,6 +398,9 @@ def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
for line_node in root.findall("cac:InvoiceLine", ns):
|
||||
descripcion = _find_text(line_node, "cac:Item/cbc:Description", ns) or ""
|
||||
|
||||
notes = line_node.findall("cbc:Note", ns)
|
||||
notes_text = " | ".join(n.text.strip() for n in notes if n.text) if notes else ""
|
||||
|
||||
qty_str = _find_text(line_node, "cbc:InvoicedQuantity", ns)
|
||||
cantidad = float(qty_str) if qty_str else 0.0
|
||||
|
||||
@@ -284,12 +414,26 @@ def _parse_invoice(root: ET.Element) -> DatosComprobante:
|
||||
total_linea_str = _find_text(line_node, "cbc:LineExtensionAmount", ns)
|
||||
total_linea = float(total_linea_str) if total_linea_str else 0.0
|
||||
|
||||
guias = extraer_guias_desde_notes(notes_text)
|
||||
guias_remision = [g for g in guias if g["tipo"] == "09"]
|
||||
gt = [g for g in guias if g["tipo"] == "31"]
|
||||
|
||||
valor_referencial = (
|
||||
extraer_valor_referencial(descripcion)
|
||||
or extraer_valor_referencial(notes_text)
|
||||
or extraer_valor_referencial(root_notes_text)
|
||||
)
|
||||
|
||||
lineas.append(
|
||||
DetalleLinea(
|
||||
descripcion=descripcion,
|
||||
cantidad=cantidad,
|
||||
precio_unitario=precio_unitario,
|
||||
total_linea=total_linea,
|
||||
notes_text=notes_text,
|
||||
guias_remision=guias_remision,
|
||||
guia_transportista=gt[0] if gt else None,
|
||||
valor_referencial=valor_referencial,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -455,6 +599,62 @@ def _parse_despatch_advice(root: ET.Element) -> DatosComprobante:
|
||||
)
|
||||
|
||||
# ============================================================================
|
||||
def _parse_application_response(root: ET.Element) -> dict:
|
||||
"""Extrae datos de un ApplicationResponse (CDR de SUNAT)."""
|
||||
ns = NAMESPACES
|
||||
|
||||
ruc_emisor = ""
|
||||
tipo = ""
|
||||
serie = ""
|
||||
numero = ""
|
||||
|
||||
# RUC del emisor original desde ReceiverParty
|
||||
ruc_emisor = (
|
||||
_find_text(root, "cac:ReceiverParty/cac:PartyIdentification/cbc:ID", ns)
|
||||
or ""
|
||||
)
|
||||
|
||||
# Tipo, serie y número desde DocumentResponse/DocumentReference
|
||||
for doc_resp in root.findall(".//cac:DocumentResponse", ns):
|
||||
# DocumentTypeCode del documento original
|
||||
if not tipo:
|
||||
tipo = (
|
||||
_find_text(doc_resp, "cac:DocumentReference/cbc:DocumentTypeCode", ns)
|
||||
or ""
|
||||
)
|
||||
|
||||
# ID del documento original (ej: FF01-3308, F002-20851)
|
||||
ref_id = (
|
||||
_find_text(doc_resp, "cac:DocumentReference/cbc:ID", ns)
|
||||
or ""
|
||||
)
|
||||
if ref_id:
|
||||
serie, numero = _split_serie_numero(ref_id)
|
||||
|
||||
# Si no hay tipo, intentar inferir desde el texto de la descripción
|
||||
if not tipo:
|
||||
desc = _find_text(doc_resp, "cac:Response/cbc:Description", ns) or ""
|
||||
m = re.search(r"\b(?:FACTURA|Factura)\b", desc)
|
||||
if m:
|
||||
tipo = "01"
|
||||
|
||||
# Si no hay RUC, intentar extraer desde la descripción
|
||||
if not ruc_emisor:
|
||||
desc = _find_text(doc_resp, "cac:Response/cbc:Description", ns) or ""
|
||||
m = re.search(r"\b(\d{11})-\d{2}-", desc)
|
||||
if m:
|
||||
ruc_emisor = m.group(1)
|
||||
|
||||
return {
|
||||
"ruc_emisor": ruc_emisor,
|
||||
"tipo": tipo,
|
||||
"serie": serie,
|
||||
"numero": numero,
|
||||
"es_cdr": True,
|
||||
"tipo_descripcion": "CDR",
|
||||
}
|
||||
|
||||
|
||||
def extraer_datos_xml(ruta_xml: str) -> Optional[dict]:
|
||||
"""
|
||||
Recibe la ruta de un archivo XML de comprobante electrónico SUNAT.
|
||||
@@ -478,6 +678,8 @@ def extraer_datos_xml(ruta_xml: str) -> Optional[dict]:
|
||||
|
||||
tag = root.tag
|
||||
|
||||
if "ApplicationResponse" in tag:
|
||||
return _parse_application_response(root)
|
||||
if "Invoice" in tag:
|
||||
tipo = _find_text(root, "inv:InvoiceTypeCode", NAMESPACES) or _find_text(root, "cbc:InvoiceTypeCode", NAMESPACES) or ""
|
||||
if tipo == "01":
|
||||
@@ -485,7 +687,7 @@ def extraer_datos_xml(ruta_xml: str) -> Optional[dict]:
|
||||
return datos.to_dict()
|
||||
if "DespatchAdvice" in tag:
|
||||
tipo = _find_text(root, "desp:DespatchAdviceTypeCode", NAMESPACES) or _find_text(root, "cbc:DespatchAdviceTypeCode", NAMESPACES) or ""
|
||||
if tipo in ["31"]:
|
||||
if tipo in ("09", "31"):
|
||||
datos = _parse_despatch_advice(root)
|
||||
return datos.to_dict()
|
||||
return None
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
info:
|
||||
name: BusinessPartners
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: https://192.168.9.3:50000/b1s/v1/BusinessPartners('PL10040532043')
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
@@ -1,14 +0,0 @@
|
||||
info:
|
||||
name: EmployeesInfo
|
||||
type: http
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: https://192.168.9.3:50000/b1s/v1/EmployeesInfo
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
@@ -1,23 +0,0 @@
|
||||
info:
|
||||
name: Login
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: https://192.168.9.3:50000/b1s/v1/Login
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"CompanyDB" :"PRUEBA_20260609",
|
||||
"UserName": "manager",
|
||||
"Password":"s1st3m4s"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
@@ -1,19 +0,0 @@
|
||||
info:
|
||||
name: PurchaseInvoices
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: https://192.168.9.3:50000/b1s/v1/PurchaseInvoices?$filter=DocDate eq '2026-06-10'
|
||||
params:
|
||||
- name: $filter
|
||||
value: DocDate eq '2026-06-10'
|
||||
type: query
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
@@ -1,10 +0,0 @@
|
||||
opencollection: 1.0.0
|
||||
|
||||
info:
|
||||
name: aberio
|
||||
bundled: false
|
||||
extensions:
|
||||
bruno:
|
||||
ignore:
|
||||
- node_modules
|
||||
- .git
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"ngrok":"2L3lPgEfu0YX5O0xPeqm4FKgPwP_PwxXGpJn3Uow7JwiS12h"
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import json
|
||||
import os
|
||||
from glob import glob
|
||||
|
||||
CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba")
|
||||
|
||||
|
||||
def _doc_key(d):
|
||||
return (d.get("tipo"), d.get("serie"), d.get("numero"))
|
||||
|
||||
|
||||
def completar_guias_desde_pdf(xml_path: str, pdf_path: str) -> int:
|
||||
with open(xml_path, encoding="utf-8") as f:
|
||||
xml_data = json.load(f)
|
||||
try:
|
||||
with open(pdf_path, encoding="utf-8") as f:
|
||||
pdf_data = json.load(f)
|
||||
except FileNotFoundError:
|
||||
return 0
|
||||
|
||||
pdf_by_key = {_doc_key(d): d for d in pdf_data}
|
||||
total_copiadas = 0
|
||||
|
||||
for xd in xml_data:
|
||||
k = _doc_key(xd)
|
||||
|
||||
has_all_guias = all(
|
||||
len(linea.get("guias_remision") or []) > 0
|
||||
for linea in xd.get("lineas", [])
|
||||
)
|
||||
if has_all_guias:
|
||||
continue
|
||||
|
||||
pd = pdf_by_key.get(k)
|
||||
if not pd:
|
||||
continue
|
||||
|
||||
for li, xl in enumerate(xd.get("lineas", [])):
|
||||
if len(xl.get("guias_remision") or []) > 0:
|
||||
continue
|
||||
pl = pd["lineas"][li] if li < len(pd.get("lineas", [])) else {}
|
||||
p_gr = pl.get("guias_remision") or []
|
||||
if p_gr:
|
||||
xl["guias_remision"] = list(p_gr)
|
||||
total_copiadas += len(p_gr)
|
||||
# También copiar guia_transportista si XML no tiene
|
||||
if not xl.get("guia_transportista") and pl.get("guia_transportista"):
|
||||
xl["guia_transportista"] = dict(pl["guia_transportista"])
|
||||
|
||||
if total_copiadas > 0:
|
||||
with open(xml_path, "w", encoding="utf-8") as f:
|
||||
json.dump(xml_data, f, ensure_ascii=False, indent=2)
|
||||
|
||||
return total_copiadas
|
||||
|
||||
|
||||
def main():
|
||||
carpetas = sorted(glob(os.path.join(CARPETA_BASE, "[0-9][0-9][0-9]_correo")))
|
||||
total_global = 0
|
||||
for fp in carpetas:
|
||||
folder = os.path.basename(fp)
|
||||
idx = folder[:3]
|
||||
xml_path = os.path.join(fp, f"xml_resultado_{idx}.json")
|
||||
pdf_path = os.path.join(fp, f"pdf_resultado_{idx}.json")
|
||||
if not os.path.exists(xml_path):
|
||||
continue
|
||||
n = completar_guias_desde_pdf(xml_path, pdf_path)
|
||||
if n > 0:
|
||||
print(f" {folder}: {n} guías copiadas")
|
||||
total_global += n
|
||||
|
||||
print(f"\nTotal guías copiadas: {total_global}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:biz="urn:bizlinks:names:specification:ubl:peru:schema:xsd:BizlinksAggregateComponents-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1"><ext:UBLExtensions><ext:UBLExtension><cbc:ID>EBIZ</cbc:ID><ext:ExtensionContent><biz:AdditionalInformation><biz:AdditionalProperty><cbc:ID>8025</cbc:ID><cbc:Value><![CDATA[473-4883 473-2554 323-3702]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8024</cbc:ID><cbc:Value><![CDATA[ventas@dansa.com.pe]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8023</cbc:ID><cbc:Value><![CDATA[www.grupodansa.com.pe]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9670</cbc:ID><cbc:Value><![CDATA[MATERIALES DE CONSTRUCCION]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9673</cbc:ID><cbc:Value><![CDATA[Nro.Cuota = 1 Fecha de Vencimiento = 2026-06-15 Tipo de Moneda = PEN Monto de Cuota = 707.31]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8185</cbc:ID><cbc:Value><![CDATA[CREDITO A 20 DIAS]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9043</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9049</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9218</cbc:ID><cbc:Value><![CDATA[CABELLO HUARCAYA CRISTY JOICE]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9130</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9099</cbc:ID><cbc:Value><![CDATA[26/05/2026]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9925</cbc:ID><cbc:Value><![CDATA[20100029741]]></cbc:Value></biz:AdditionalProperty></biz:AdditionalInformation></ext:ExtensionContent></ext:UBLExtension><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="signatureKG"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>bCmAYPIFk/DmyDKNUBWpbxlZbWw=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>g8i0bVVbwVuKrs56/vuS4paPFSKrp5jAq3mTf6kF31LDU48wOWVOIpn2/B2Y06Tvze3DFqowxlhod76lGXWd4mEQ1HiFZoITESGbh7ddNlUh/VAIgBxtZdvxUolFanuZzOYqqVGXCnAtd+ADTU/6UVz/bsJ0ONdsbOzqu4xtDU8HJm3fd7KpVabELgOQHKTNP690vGAP/+Jm9/eFMZURHPeoPO/9wYQyy+YFgTSnX5+kSKVFwicnP00hBPE08/E/WbJ6BAKB9eO/LzY+sjG8HQODp9zdAfuY3TjM/6Yy5tz+04fBE/E+mDsimHZ4FKd0/K84X1zE79Rmep6eUL0HvQ==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIGJTCCBQ2gAwIBAgITMwAAab3LtCvmGjz0EQAAAABpvTANBgkqhkiG9w0BAQsFADCBkjELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxJjAkBgNVBAsTHUNvcHlyaWdodCAoYykgMjAxNiBXSVNlS2V5IFNBMRYwFAYDVQQLEw1JbnRlcm5hdGlvbmFsMTEwLwYDVQQDEyhXSVNlS2V5IENlcnRpZnlJRCBBZHZhbmNlZCBTZXJ2aWNlcyBDQSA0MB4XDTIzMDQyNDE2MTEzNFoXDTI2MDQyMzE2MTEzNFowgesxCzAJBgNVBAYTAlBFMQ0wCwYDVQQHEwRMSU1BMRgwFgYDVQQKEw9CSVpMSU5LUyBTLkEuQy4xLzAtBgNVBAsMJlZhbGlkYXRlZCBieSBaeVRydXN0IFNvY2llZGFkIEFuw7NuaW1hMRQwEgYDVQQLEwsyMDQ3ODAwNTAxNzEVMBMGA1UECxMMRE5JIDA3ODYxNDU2MSwwKgYDVQQDEyNKQVZJRVIgRkVSTkFORE8gRFJBWEwgR0FSQ0lBIFJPU0VMTDEnMCUGCSqGSIb3DQEJARYYamF2aWVyLmRyYXhsQGJpemxpbmtzLmxhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv4O4GDlvAP4xTbCAjfQAFKjqPJX6wrJ439SvsYbEDHE1QBw191JJiUCA8diVqyJC3f9q5zPMR84+Gpscf1njSPOpxqBK+hU28mR/0lbV31fVKTOeZ0OWVepKTlbmdxf3c4GFVWQownyrD6rzdWC1fpFi3+g3ibkDLXbTVzMACwp5SG8AEmalY/aDEEReDhJjK9ljl3s/v2YnF2Rdv03A9zdRmQ3UT/xYfAAnWp7G7b0G2Fa5QirH7WVxcV0UKuef8ajl7hqdHJy7CBBIAX0OllbqET8rwnu19MzjN7hu1mwqEk6sQeRb3EJIs0GH1fLVS7s0O162s/fSAgwfJwyNVQIDAQABo4ICFzCCAhMwHQYDVR0OBBYEFJnLNJRPWOgtMEdxj/pfn/8eJ+6TMA4GA1UdDwEB/wQEAwIGwDAfBgNVHSMEGDAWgBT05JtX0q7CnohNALorr2XJY6mHmzA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vcHVibGljLndpc2VrZXkuY29tL2NybC93Y2lkYXNjYTQuY3JsMG0GCCsGAQUFBwEBBGEwXzA3BggrBgEFBQcwAoYraHR0cDovL3B1YmxpYy53aXNla2V5LmNvbS9jcnQvd2NpZGFzY2E0LmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Aud2lzZWtleS5jb20vMCkGA1UdJQQiMCAGCCsGAQUFBwMCBgorBgEEAYI3CgMMBggrBgEFBQcDBDA1BgkrBgEEAYI3FQoEKDAmMAoGCCsGAQUFBwMCMAwGCisGAQQBgjcKAwwwCgYIKwYBBQUHAwQwIwYDVR0RBBwwGoEYamF2aWVyLmRyYXhsQGJpemxpbmtzLmxhMEQGCSqGSIb3DQEJDwQ3MDUwDgYIKoZIhvcNAwICAgCAMA4GCCqGSIb3DQMEAgIAgDAHBgUrDgMCBzAKBggqhkiG9w0DBzBHBLine truncated
|
||||
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<DespatchAdvice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><ds:Signature Id="signatureFACTURALOPERU">
|
||||
<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
|
||||
<ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>jh2FnXCc6mcZFOLNh4yidKCBNOE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>QkBKgCtC1pMy8xW4kF227KpiRiTSqwS9rmx4Ja1NHcnyh+2CYOLoeWRX1CsfGZe2Twayxe79XojFYvFiDsl7uM6PUySq7BB1OdBj6ZAR4TJYLUQXuBBXRFL2DI4j6Btuu/q8AIPHmrJepk/2tWJqb/oiBo2FhoGdEXCmkyZgHNAIIiRYQD7l00GhDVolirDrkii6zo/grWNFUGZC95SRFxgeQF23gED2PwakIzzMOqQrb/7IWh0er+ZF+Vk8QB8Y1CGHtRVytKMX+sT4K+G4O/tTT5GCQizs9HZjN5kxB1VMtM4GlUy4dpWuVblZKLREpZ9RFP2glThrohebgTGq1g==</ds:SignatureValue>
|
||||
<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIFbDCCBFSgAwIBAgIIFUldkkH9yjEwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMjAyMTM1OTU0WhcNMjcwMjAyMTM1OTAwWjCCARMxMTAvBgNVBAkMKExULiAyMCBNWi4gQiBVUkIuIFJFU0lELiBIT05PUiBZIExFQUxUQUQxITAfBgkqhkiG9w0BCQEWEm1hbGlhZ2FAbWlnYWZpLmNvbTEsMCoGA1UEAwwjU09GVFdBUkUgREUgRkFDVFVSQUNJT04gRUxFQ1RST05JQ0ExLDAqBgNVBAsMI0ZBQ1RVUkEgRUxFQ1RST05JQ0EgUlVDIDIwNTA2Njg5MzI2MSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxIDAeBgNVBAoMF01BVEVSSUFMRVMgRC9DQVNBIFMuQS5DMQ0wCwYDVQQHDARMSU1BMQswCQYDVQQGEwJQRTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOej26BfjO7htv3e1lPaj6I4rzJanTTGMUkD2fkEt4PLMnb7AWrht9cDj0SvqofT8w56jrlqLjV2GpsVgxMTUe+c5Eir2IO+IL8pQva1TFRwpzWCseyb5by1igpCdNKTeJH34DkoRLogc4c2pqIKtWYsPX3QsjEy0rjW6+7sX/JNAQcgrzgJWw4WZwIIjK3PkF7s1O0VqLjTaZhHhbP9bPkMO8u+0RogjKZvBGfKY6ftEMjaPqTtB6k6zbZx7pPk+bRNMjSOncIFBehbaHYt63CeDlJHDNf5u+4jSWgp5I4nxHggfMYmeHOZGiOGYh6hClITOq+/Mg67g5FUl9416/UCAwEAAaOCAY0wggGJMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUXYhbretl+/5oouTZbz1XcqLvK5kwZwYIKwYBBQUHAQEEWzBZMDUGCCsGAQUFBzAChilodHRwOi8vY3J0LmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNlcjAgBggrBgEFBQcwAYYUaHR0cDovL29jc3AubGxhbWEucGUwHQYDVR0RBBYwFIESbWFsaWFnYUBtaWdhZmkuY29tMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUTtWOjRJrY+hai0Np8dEDrqh3tIcwDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQCIe0oUU2YJTZY0jULGUgE09eyyE+qh+V6MZLGPyeieuM+sS7U2uqoctQLS2VVIbx+pPoJ/ubmDS4zxMgxejcyJwiW0u9cn1bUS7XxQ4W5lSdRY5vi1MOTB2PXE3h1ESB6T6EJcY4P+azSNXgxOtnUzeXRxGSOR2RcoSiBocfJWKWjcOrVyJ4hksLKhjjm7hwi4zWD4chiJfaaHx2an9vpx8/gZKy4zz4+q1kDSoXL4FqY7DWGtyxWJVW/J2nbTj8PdV6YDwkboLPPwFhDtN0OE7VBqpXIItxqXLGPWupL7PSnhYDAB1uDxWbfkBx7WtIpKMxT7zvmwzaTTlvEOgqnH</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>V002-11</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-11</cbc:IssueDate>
|
||||
<cbc:IssueTime>13:05:50</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT">31</cbc:DespatchAdviceTypeCode>
|
||||
<!-- DOCUMENTOS ADICIONALES (Catalogo D41) -->
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-128662</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de remisión remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-128661</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de remisión remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>signatureFACTURALOPERU</cbc:ID>
|
||||
<cbc:Note>FACTURALO</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#signatureFACTURALOPERU</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<!-- DATOS DEL EMISOR (TRANSPORTISTA) -->
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<!-- DATOS DEL RECEPTOR (DESTINATARIO) -->
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<!-- DATOS DE QUIEN PAGA EL SERVICIO -->
|
||||
<!-- DATOS DEL TRASLADO -->
|
||||
<cac:Shipment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<!-- PESO BRUTO TOTAL DE LA CARGA-->
|
||||
<cbc:GrossWeightMeasure unitCode="KGM">31875.00</cbc:GrossWeightMeasure>
|
||||
<!-- INDICADORES -->
|
||||
<cac:ShipmentStage>
|
||||
<!-- FECHA DE INICIO DEL TRASLADO -->
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-11</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
<!-- CONDUCTOR PRINCIPAL -->
|
||||
<cac:DriverPerson>
|
||||
<!-- TIPO Y NUMERO DE DOCUMENTO DE IDENTIDAD -->
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="1">09715404</cbc:ID>
|
||||
<!-- NOMBRES -->
|
||||
<cbc:FirstName>HUAMAN ÑAHUE, JUAN</cbc:FirstName>
|
||||
<!-- APELLIDOS -->
|
||||
<cbc:FamilyName>DE DIOS</cbc:FamilyName>
|
||||
<!-- TIPO DE CONDUCTOR: PRINCIPAL -->
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<!-- LICENCIA DE CONDUCIR -->
|
||||
<cbc:ID>Q09715404</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
<!-- CONDUCTOR SECUNDARIO -->
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<!-- DIRECCION DEL PUNTO DE LLEGADA -->
|
||||
<cac:DeliveryAddress>
|
||||
<!-- UBIGEO DE LLEGADA -->
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150502</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[CA. PANAMERICANA SUR KM 98 SANTA CRUZ]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<!-- DIRECCION DEL PUNTO DE PARTIDA -->
|
||||
<cac:DespatchAddress>
|
||||
<!-- UBIGEO DE PARTIDA -->
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE PARTIDA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. ATOCONGO 1860]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<!-- DATOS DEL REMITENTE -->
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<!-- NUMERO DE CONTENEDOR -->
|
||||
<cbc:ID>-</cbc:ID>
|
||||
<cac:TransportEquipment>
|
||||
<!-- VEHICULO PRINCIPAL -->
|
||||
<!-- PLACA - VEHICULO PRINCIPAL -->
|
||||
<cbc:ID>F6P722</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>15M24026972E</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
<!-- VEHICULOS SECUNDARIOS -->
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<!-- DETALLES DE BIENES A TRASLADAR -->
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">550.0000</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[BOLSA CEMENTO APU]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[10000540]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">200.0000</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>2</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[BOLSA CEMENTO ANDINO ULTRA HS]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[10003615]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,114 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10060028686",
|
||||
"razon_social_emisor": "DANSA",
|
||||
"fecha_emision": "2026-05-26",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "2450",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 736.78,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 29.47,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERV.TRANS.550 BLS ULTRA HSX1.3396",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 736.78,
|
||||
"total_linea": 624.38,
|
||||
"notes_text": "DE VEHICULO DE PLACA D8U934/D1L982 | P.PARTIDA:AV. ATOCONGO 1860-VMT | P.LLEGADA:MZ.P.LT 20 URB.NUEVO LURIN LT 21 | GRE REMITENTE: T001-00128912 | GRT:V001-00000194 | CONF.VEH T3S3 CARGA 23,375TN | VALOR REFERENCIAL S/736.78 | UND | -",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128912"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "194"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/001_correo/10060028686-01-F002-2450.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20506689326",
|
||||
"razon_social_emisor": "MATERIALES D`CASA S.A.C",
|
||||
"fecha_emision": "2026-05-11",
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11",
|
||||
"ruc_receptor": "20506689326",
|
||||
"razon_social_receptor": "MATERIALES D`CASA S.A.C",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128662"
|
||||
},
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128661"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860",
|
||||
"punto_llegada": "CA. PANAMERICANA SUR KM 98 SANTA CRUZ",
|
||||
"peso_bruto": "31875.00",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-11",
|
||||
"vehiculo_principal": "F6P722",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q09715404",
|
||||
"nombre_conductor": "HUAMAN ÑAHUE, JUAN",
|
||||
"documento_conductor": "09715404",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "BOLSA CEMENTO APU",
|
||||
"cantidad": 550.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
},
|
||||
{
|
||||
"descripcion": "BOLSA CEMENTO ANDINO ULTRA HS",
|
||||
"cantidad": 200.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/001_correo/20506689326-31-V002-11.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:biz="urn:bizlinks:names:specification:ubl:peru:schema:xsd:BizlinksAggregateComponents-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1"><ext:UBLExtensions><ext:UBLExtension><cbc:ID>EBIZ</cbc:ID><ext:ExtensionContent><biz:AdditionalInformation><biz:AdditionalProperty><cbc:ID>8025</cbc:ID><cbc:Value><![CDATA[278-0021 278-0026 278-0017]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8024</cbc:ID><cbc:Value><![CDATA[ventas@cemfisur.com.pe]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8023</cbc:ID><cbc:Value><![CDATA[www.grupodansa.com.pe]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9670</cbc:ID><cbc:Value><![CDATA[MATERIALES DE CONSTRUCCION]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9673</cbc:ID><cbc:Value><![CDATA[Nro.Cuota = 1 Fecha de Vencimiento = 2026-06-05 Tipo de Moneda = PEN Monto de Cuota = 938.79]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9611</cbc:ID><cbc:Value><![CDATA[OPERACION SUJETA A SPOT 027]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>8185</cbc:ID><cbc:Value><![CDATA[CREDITO A 08 DIAS]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9043</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9049</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9218</cbc:ID><cbc:Value><![CDATA[BUITRON BEDON LILA LAURA]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9130</cbc:ID><cbc:Value><![CDATA[---]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9099</cbc:ID><cbc:Value><![CDATA[28/05/2026]]></cbc:Value></biz:AdditionalProperty><biz:AdditionalProperty><cbc:ID>9925</cbc:ID><cbc:Value><![CDATA[20100029741]]></cbc:Value></biz:AdditionalProperty></biz:AdditionalInformation></ext:ExtensionContent></ext:UBLExtension><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="signatureKG"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>Jwf047g91naqJakpWbK9LIu1bvo=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>IQWmZ3xeIBe3U7UxB267Zpzr0fL4CC8NQtvcgpOiHxVw97vHXS+WA/ADBDUKxQLcmraEGxnozItQBHJ067Fsy1YXAP0AyByOlCJKQl/gxfVTKg+hyIIZbizVQlX8vahRydEalLioTP3aNyWUF5jkKrCatQYYLIyUtkzMB6DUzOEvYR5WcDiAd54Q1fu5Vxps9gZXtWgu+aWA7TXdO/vRg3qKsBAkgr4WNNEp5YXB1piY5aMl4v6/7qDtmGgz3dwaTMERH9aWOtdeP5ZiaWG81hDtdp9/z6er/28pBC4Bw5Sq85B3aiEu/nUfeEMzgJhBjPaGfjgC7KJLOS611r7sWA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIGJTCCBQ2gAwIBAgITMwAAab3LtCvmGjz0EQAAAABpvTANBgkqhkiG9w0BAQsFADCBkjELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxJjAkBgNVBAsTHUNvcHlyaWdodCAoYykgMjAxNiBXSVNlS2V5IFNBMRYwFAYDVQQLEw1JbnRlcm5hdGlvbmFsMTEwLwYDVQQDEyhXSVNlS2V5IENlcnRpZnlJRCBBZHZhbmNlZCBTZXJ2aWNlcyBDQSA0MB4XDTIzMDQyNDE2MTEzNFoXDTI2MDQyMzE2MTEzNFowgesxCzAJBgNVBAYTAlBFMQ0wCwYDVQQHEwRMSU1BMRgwFgYDVQQKEw9CSVpMSU5LUyBTLkEuQy4xLzAtBgNVBAsMJlZhbGlkYXRlZCBieSBaeVRydXN0IFNvY2llZGFkIEFuw7NuaW1hMRQwEgYDVQQLEwsyMDQ3ODAwNTAxNzEVMBMGA1UECxMMRE5JIDA3ODYxNDU2MSwwKgYDVQQDEyNKQVZJRVIgRkVSTkFORE8gRFJBWEwgR0FSQ0lBIFJPU0VMTDEnMCUGCSqGSIb3DQEJARYYamF2aWVyLmRyYXhsQGJpemxpbmtzLmxhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv4O4GDlvAP4xTbCAjfQAFKjqPJX6wrJ439SvsYbEDHE1QBw191JJiUCA8diVqyJC3f9q5zPMR84+Gpscf1njSPOpxqBK+hU28mR/0lbV31fVKTOeZ0OWVepKTlbmdxf3c4GFVWQownyrD6rzdWC1fpFi3+g3ibkDLXbTVzMACwp5SG8AEmalY/aDEEReDhJjK9ljl3s/v2YnF2Rdv03A9zdRmQ3UT/xYfAAnWp7G7b0G2Fa5QirH7WVxcV0UKuef8ajl7hqdHJy7CBBIAX0OllbqET8rwnu19MzjN7hu1mwqEk6sQeRb3EJIs0GH1fLVS7s0O162s/fSAgwfJwyNVQIDAQABo4ICFzCCAhMwHQYDVR0OBBYEFJnLNJRPWOgtMEdxj/pfn/8eJ+6TMA4GA1UdDwEB/wQEAwIGwDAfBgNVHSMEGDAWgBT05JtX0q7CnohNALorr2XJY6mHmzA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vcHVibGljLndpc2VrZXkuY29tL2NybC93Y2lkYXNjYTQuY3JsMG0GCCsGAQUFBwEBBGEwXzA3BggrBgEFBQcwAoYraHR0cDovL3B1YmxpYy53aXNla2V5LmNvbS9jcnQvd2NpZGFzY2E0LmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Aud2lzZWtleS5jb20vMCkGA1UdJQQiMCAGCCsGAQUFBwMCBgorBgEEAYI3CgMMBggrBgEFBQcDBDA1BgkrBgEEAYI3FQoEKDAmMAoGCCsGAQUFBwMCMAwGCisGAQQBgjcKAwwwCgYIKwYBBQUHAwQwIwYDVR0RBBwwGoELine truncated
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" xmlns:biz="urn:bizlinks:names:specification:ubl:peru:schema:xsd:BizlinksAggregateComponents-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="signatureKG"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>LJbqWnNTP13375hfdWAHuk/S37w=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>i33WV09veYIM/veAa0S0LjO6PU5N3McU9BehPTKvSvjNEmUTWX/1dusHtoJBPeX3LKj6KS8VvelYnLVI2FlMVnOv08MEIYNxhuyMso9AtY29Wcbb1DKL8ZSaN0YK5l6kZEl02glxqSIKd3NA0TbT5PgivOczQuShaGu0f7MicogEhfe7Z3BA+/1orU7YQa/ZCComhQk+E2wx0NtzBqP9bDsxHSUJ0JmKXULOUE9ertAYjxY0ZW31q5LxJzTHoozDzWLzxBFtnHX7LOmbvSIuv50VQHRaBAz08ApY/UjunEiJraaSIXfBA3z3GIbFJh3ocRK5WdaDDtoIuz4PhdAcSQ==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIGJTCCBQ2gAwIBAgITMwAAab3LtCvmGjz0EQAAAABpvTANBgkqhkiG9w0BAQsFADCBkjELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxJjAkBgNVBAsTHUNvcHlyaWdodCAoYykgMjAxNiBXSVNlS2V5IFNBMRYwFAYDVQQLEw1JbnRlcm5hdGlvbmFsMTEwLwYDVQQDEyhXSVNlS2V5IENlcnRpZnlJRCBBZHZhbmNlZCBTZXJ2aWNlcyBDQSA0MB4XDTIzMDQyNDE2MTEzNFoXDTI2MDQyMzE2MTEzNFowgesxCzAJBgNVBAYTAlBFMQ0wCwYDVQQHEwRMSU1BMRgwFgYDVQQKEw9CSVpMSU5LUyBTLkEuQy4xLzAtBgNVBAsMJlZhbGlkYXRlZCBieSBaeVRydXN0IFNvY2llZGFkIEFuw7NuaW1hMRQwEgYDVQQLEwsyMDQ3ODAwNTAxNzEVMBMGA1UECxMMRE5JIDA3ODYxNDU2MSwwKgYDVQQDEyNKQVZJRVIgRkVSTkFORE8gRFJBWEwgR0FSQ0lBIFJPU0VMTDEnMCUGCSqGSIb3DQEJARYYamF2aWVyLmRyYXhsQGJpemxpbmtzLmxhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv4O4GDlvAP4xTbCAjfQAFKjqPJX6wrJ439SvsYbEDHE1QBw191JJiUCA8diVqyJC3f9q5zPMR84+Gpscf1njSPOpxqBK+hU28mR/0lbV31fVKTOeZ0OWVepKTlbmdxf3c4GFVWQownyrD6rzdWC1fpFi3+g3ibkDLXbTVzMACwp5SG8AEmalY/aDEEReDhJjK9ljl3s/v2YnF2Rdv03A9zdRmQ3UT/xYfAAnWp7G7b0G2Fa5QirH7WVxcV0UKuef8ajl7hqdHJy7CBBIAX0OllbqET8rwnu19MzjN7hu1mwqEk6sQeRb3EJIs0GH1fLVS7s0O162s/fSAgwfJwyNVQIDAQABo4ICFzCCAhMwHQYDVR0OBBYEFJnLNJRPWOgtMEdxj/pfn/8eJ+6TMA4GA1UdDwEB/wQEAwIGwDAfBgNVHSMEGDAWgBT05JtX0q7CnohNALorr2XJY6mHmzA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vcHVibGljLndpc2VrZXkuY29tL2NybC93Y2lkYXNjYTQuY3JsMG0GCCsGAQUFBwEBBGEwXzA3BggrBgEFBQcwAoYraHR0cDovL3B1YmxpYy53aXNla2V5LmNvbS9jcnQvd2NpZGFzY2E0LmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Aud2lzZWtleS5jb20vMCkGA1UdJQQiMCAGCCsGAQUFBwMCBgorBgEEAYI3CgMMBggrBgEFBQcDBDA1BgkrBgEEAYI3FQoEKDAmMAoGCCsGAQUFBwMCMAwGCisGAQQBgjcKAwwwCgYIKwYBBQUHAwQwIwYDVR0RBBwwGoEYamF2aWVyLmRyYXhsQGJpemxpbmtzLmxhMEQGCSqGSIb3DQEJDwQ3MDUwDgYIKoZIhvcNAwICAgCAMA4GCCqGSIb3DQMEAgIAgDAHBgUrDgMCBzAKBggqhkiG9w0DBzBHBgNVHSAEQDA+MDwGCGCFdAUOCAEBMDAwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cud2lzZWtleS5jb20vcmVwb3NpdG9yeS8wDQYJKoZIhvcNAQELBQADggEBAIwKxehlZoe1kqpoxrHL/uIeCxgMCidylRT19H45oBWonX6Y9KqvzvnkB6qp2Yv/2c0CiciRMtAFBQXi7u09uIJkB+WcPVgKezPKwWpc8AYz7j7IMsskl3g8XtqOZMbBbOaJcaGkZKYeJitYpQi6dPNNFA3ryAh/eVt2VJeRxDgSXpI/qD4Lij8A7vJonfO/ZBMYsuoHp2WK8Vf8bqsqeUhrHbCTPhlCkYf6TXiDNSDihiFHlZfEjGxERKgzopG9tb/+kJdiQSfpIKLG5ONfGoLROtTxWJrOqwcJDuYBphBuLaEgLUEv6UQ7ncH2qripCI7wQivJA3Sqj04xBz7lpWE=</ds:X509Certificate></ds:X509Data><ds:KeyValue><ds:RSAKeyValue><ds:Modulus>v4O4GDlvAP4xTbCAjfQAFKjqPJX6wrJ439SvsYbEDHE1QBw191JJiUCA8diVqyJC3f9q5zPMR84+Gpscf1njSPOpxqBK+hU28mR/0lbV31fVKTOeZ0OWVepKTlbmdxf3c4GFVWQownyrD6rzdWC1fpFi3+g3ibkDLXbTVzMACwp5SG8AEmalY/aDEEReDhJjK9ljl3s/v2YnF2Rdv03A9zdRmQ3UT/xYfAAnWp7G7b0G2Fa5QirH7WVxcV0UKuef8ajl7hqdHJy7CBBIAX0OllbqET8rwnu19MzjN7hu1mwqEk6sQeRb3EJIs0GH1fLVS7s0O162s/fSAgwfJwyNVQ==</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:CustomizationID>2.0</cbc:CustomizationID><cbc:ID>V001-00000227</cbc:ID><cbc:IssueDate>2026-05-22</cbc:IssueDate><cbc:IssueTime>11:54:57</cbc:IssueTime><cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode><cbc:Note>ORR0023116 Placa Secundaria:D1K975</cbc:Note><cac:AdditionalDocumentReference><cbc:ID>T001-0129352</cbc:ID><cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gemLine truncated
|
||||
@@ -0,0 +1,57 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20340843607",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C. RUC: 20100029741",
|
||||
"fecha_emision": "28/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "2188",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C. RUC: 20100029741",
|
||||
"total_factura": "977.91",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": "39.12",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "(afecto al IGV) SERVI. DE TRANSP. 730 BLS. X 1.3396 Marca: - Párametro Legado: CARGA 31.025 TN VAL. REF S/977.91 MTC 151307699 Párametro Legado: GRR.T001-00129352 GRT. V001-227 CONF. VEH.T3S3 000000 ZZ 828.73 Párametro Legado: P.LLEGADA. AV SANTIAGO DE SURCO 4869 SURCO LIMA Párametro Legado: P.PARTI.AV. ATOCONGO 1860 VILLA MARIA DEL TRIUNFO Párametro Legado: PLACA :D7Y800-D1K975 Unidad de Medida: UND NOVECIENTOS SETENTA Y SIETE Y 91/100 SOLES Op. Gravada S/ 828.74 I.G.V S/ 149.17",
|
||||
"cantidad": "1.00",
|
||||
"precio_unitario": "0.00",
|
||||
"total_linea": "828.73",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129352"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "227"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/002_correo/20340843607-01-F002-2188.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20340843607",
|
||||
"razon_social_emisor": "CEMFISUR EIRL RUC: 20340843607",
|
||||
"fecha_emision": "22/05/2026",
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "227",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "CEMFISUR EIRL RUC: 20340843607",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/002_correo/20340843607-31-V001-227.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,100 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20340843607",
|
||||
"razon_social_emisor": "CEMFISUR",
|
||||
"fecha_emision": "2026-05-28",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "2188",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 977.91,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 39.12,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVI. DE TRANSP. 730 BLS. X 1.3396",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 977.91,
|
||||
"total_linea": 828.73,
|
||||
"notes_text": "P.PARTI.AV. ATOCONGO 1860 VILLA MARIA DEL TRIUNFO | P.LLEGADA. AV SANTIAGO DE SURCO 4869 SURCO LIMA | GRR.T001-00129352 GRT.V001-227 CONF. VEH.T3S3 | CARGA 31.025 TN VAL. REF S/977.91 MTC 151307699 | PLACA :D7Y800-D1K975 | UND | -",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129352"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "227"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/002_correo/20340843607-01-F002-2188.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20340843607",
|
||||
"razon_social_emisor": "CEMFISUR E.I.R.L.",
|
||||
"fecha_emision": "2026-05-22",
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "227",
|
||||
"ruc_receptor": "20340843607",
|
||||
"razon_social_receptor": "CEMFISUR EIRL",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129352"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860",
|
||||
"punto_llegada": "AV.SANTIAGO DE SURCO 4869 (EX-T.MARSANO) - SANTIAGO DE SURCO",
|
||||
"peso_bruto": "31025.000",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-22",
|
||||
"vehiculo_principal": "D7Y800",
|
||||
"vehiculo_secundario": "D1K975",
|
||||
"licencia_conductor": "D42857370",
|
||||
"nombre_conductor": "YOMAR ERIKSON",
|
||||
"documento_conductor": "42857370",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO SOL TIPO I - SOL",
|
||||
"cantidad": 730.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/002_correo/20340843607-31-V001-227.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,208 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><ds:Signature Id="signatureFACTURALOPERU">
|
||||
<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
|
||||
<ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>Dkql0/yqrvnT3UZtGx52HnfykMY=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>fYa724o1T+XD0Pw0cLjRNEq98qPnEsQI+0q8+opTcHRS+J0WoxhZGMwBhBD2gMUj7LMe1yoQ8SY2X88mCMK9bRkfD+Rezj9KETRmgvM7HmdNyJnpRfRZnO9G9ZJwtVAInjZRXv1JKb26e8g0nY9ebUkLOgHBru8sQzKxNKqdoSX4lxLHc0ewgPsQKsce0jwwQRm0wpMN2JaYrpyydSg+HjXjswHfterYaYOeL3rO/7Xt1N/c6S+xqRgBmrRJqE46B402T7B5J/CTW1BZrSCSSy3WFCwMcJAj59FkH6f8sEPjShlJ5OzA81nmEudt/80nCpry2bs7QO7h4L9zSQALRw==</ds:SignatureValue>
|
||||
<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIFbDCCBFSgAwIBAgIIFUldkkH9yjEwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMjAyMTM1OTU0WhcNMjcwMjAyMTM1OTAwWjCCARMxMTAvBgNVBAkMKExULiAyMCBNWi4gQiBVUkIuIFJFU0lELiBIT05PUiBZIExFQUxUQUQxITAfBgkqhkiG9w0BCQEWEm1hbGlhZ2FAbWlnYWZpLmNvbTEsMCoGA1UEAwwjU09GVFdBUkUgREUgRkFDVFVSQUNJT04gRUxFQ1RST05JQ0ExLDAqBgNVBAsMI0ZBQ1RVUkEgRUxFQ1RST05JQ0EgUlVDIDIwNTA2Njg5MzI2MSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxIDAeBgNVBAoMF01BVEVSSUFMRVMgRC9DQVNBIFMuQS5DMQ0wCwYDVQQHDARMSU1BMQswCQYDVQQGEwJQRTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOej26BfjO7htv3e1lPaj6I4rzJanTTGMUkD2fkEt4PLMnb7AWrht9cDj0SvqofT8w56jrlqLjV2GpsVgxMTUe+c5Eir2IO+IL8pQva1TFRwpzWCseyb5by1igpCdNKTeJH34DkoRLogc4c2pqIKtWYsPX3QsjEy0rjW6+7sX/JNAQcgrzgJWw4WZwIIjK3PkF7s1O0VqLjTaZhHhbP9bPkMO8u+0RogjKZvBGfKY6ftEMjaPqTtB6k6zbZx7pPk+bRNMjSOncIFBehbaHYt63CeDlJHDNf5u+4jSWgp5I4nxHggfMYmeHOZGiOGYh6hClITOq+/Mg67g5FUl9416/UCAwEAAaOCAY0wggGJMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUXYhbretl+/5oouTZbz1XcqLvK5kwZwYIKwYBBQUHAQEEWzBZMDUGCCsGAQUFBzAChilodHRwOi8vY3J0LmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNlcjAgBggrBgEFBQcwAYYUaHR0cDovL29jc3AubGxhbWEucGUwHQYDVR0RBBYwFIESbWFsaWFnYUBtaWdhZmkuY29tMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUTtWOjRJrY+hai0Np8dEDrqh3tIcwDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQCIe0oUU2YJTZY0jULGUgE09eyyE+qh+V6MZLGPyeieuM+sS7U2uqoctQLS2VVIbx+pPoJ/ubmDS4zxMgxejcyJwiW0u9cn1bUS7XxQ4W5lSdRY5vi1MOTB2PXE3h1ESB6T6EJcY4P+azSNXgxOtnUzeXRxGSOR2RcoSiBocfJWKWjcOrVyJ4hksLKhjjm7hwi4zWD4chiJfaaHx2an9vpx8/gZKy4zz4+q1kDSoXL4FqY7DWGtyxWJVW/J2nbTj8PdV6YDwkboLPPwFhDtN0OE7VBqpXIItxqXLGPWupL7PSnhYDAB1uDxWbfkBx7WtIpKMxT7zvmwzaTTlvEOgqnH</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>FE07-1559</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-13</cbc:IssueDate>
|
||||
<cbc:IssueTime>17:20:00</cbc:IssueTime>
|
||||
<cbc:DueDate>2026-05-27</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode listID="0101">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000"><![CDATA[Mil cuatrocientos veinte con 65/100 ]]></cbc:Note>
|
||||
<cbc:DocumentCurrencyCode>PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:DespatchDocumentReference>
|
||||
<cbc:ID>V002-11</cbc:ID>
|
||||
<cbc:DocumentTypeCode>31</cbc:DocumentTypeCode>
|
||||
</cac:DespatchDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>signatureFACTURALOPERU</cbc:ID>
|
||||
<cbc:Note>FACTURALO</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#signatureFACTURALOPERU</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6">20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[{MATERIALES D`CASA S.A.C}]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID>150115</cbc:ID>
|
||||
<cbc:AddressTypeCode>0000</cbc:AddressTypeCode>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>LA VICTORIA</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. Parinacochas 1060]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Telephone>994 295 061</cbc:Telephone>
|
||||
<cbc:ElectronicMail>materialesdcasa@gmail.com</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID>150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. 26 DE NOVIEMBRE NRO. 2473 A.H. VIRGEN DE LOURDES]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:ElectronicMail>recepcion@aberio.com.pe</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">1420.65</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">56.83</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-05-27</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota002</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">1363.82</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-05-27</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">216.71</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">1203.94</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">216.71</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">1203.94</cbc:LineExtensionAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">1420.65</cbc:TaxInclusiveAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">1420.65</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="ZZ">550</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">882.89</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">1.894200</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode>01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">158.92</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">882.89</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">158.92</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode>10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[SERVICIO TRANSPORTE CEMENTO APU 027 SUNAT]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>10000541</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:CommodityClassification>
|
||||
<cbc:ItemClassificationCode>51122201</cbc:ItemClassificationCode>
|
||||
</cac:CommodityClassification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">1.605254</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="ZZ">200</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">321.05</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">1.894200</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode>01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">57.79</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">321.05</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">57.79</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode>10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[SERVICIO TRANSPORTE CEMTO ANDINO/ULTRA 027 SUNAT]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>10000539</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:CommodityClassification>
|
||||
<cbc:ItemClassificationCode>51122199</cbc:ItemClassificationCode>
|
||||
</cac:CommodityClassification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">1.605254</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<DespatchAdvice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><ds:Signature Id="signatureFACTURALOPERU">
|
||||
<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
|
||||
<ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>jh2FnXCc6mcZFOLNh4yidKCBNOE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>QkBKgCtC1pMy8xW4kF227KpiRiTSqwS9rmx4Ja1NHcnyh+2CYOLoeWRX1CsfGZe2Twayxe79XojFYvFiDsl7uM6PUySq7BB1OdBj6ZAR4TJYLUQXuBBXRFL2DI4j6Btuu/q8AIPHmrJepk/2tWJqb/oiBo2FhoGdEXCmkyZgHNAIIiRYQD7l00GhDVolirDrkii6zo/grWNFUGZC95SRFxgeQF23gED2PwakIzzMOqQrb/7IWh0er+ZF+Vk8QB8Y1CGHtRVytKMX+sT4K+G4O/tTT5GCQizs9HZjN5kxB1VMtM4GlUy4dpWuVblZKLREpZ9RFP2glThrohebgTGq1g==</ds:SignatureValue>
|
||||
<ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIFbDCCBFSgAwIBAgIIFUldkkH9yjEwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMjAyMTM1OTU0WhcNMjcwMjAyMTM1OTAwWjCCARMxMTAvBgNVBAkMKExULiAyMCBNWi4gQiBVUkIuIFJFU0lELiBIT05PUiBZIExFQUxUQUQxITAfBgkqhkiG9w0BCQEWEm1hbGlhZ2FAbWlnYWZpLmNvbTEsMCoGA1UEAwwjU09GVFdBUkUgREUgRkFDVFVSQUNJT04gRUxFQ1RST05JQ0ExLDAqBgNVBAsMI0ZBQ1RVUkEgRUxFQ1RST05JQ0EgUlVDIDIwNTA2Njg5MzI2MSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxIDAeBgNVBAoMF01BVEVSSUFMRVMgRC9DQVNBIFMuQS5DMQ0wCwYDVQQHDARMSU1BMQswCQYDVQQGEwJQRTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOej26BfjO7htv3e1lPaj6I4rzJanTTGMUkD2fkEt4PLMnb7AWrht9cDj0SvqofT8w56jrlqLjV2GpsVgxMTUe+c5Eir2IO+IL8pQva1TFRwpzWCseyb5by1igpCdNKTeJH34DkoRLogc4c2pqIKtWYsPX3QsjEy0rjW6+7sX/JNAQcgrzgJWw4WZwIIjK3PkF7s1O0VqLjTaZhHhbP9bPkMO8u+0RogjKZvBGfKY6ftEMjaPqTtB6k6zbZx7pPk+bRNMjSOncIFBehbaHYt63CeDlJHDNf5u+4jSWgp5I4nxHggfMYmeHOZGiOGYh6hClITOq+/Mg67g5FUl9416/UCAwEAAaOCAY0wggGJMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUXYhbretl+/5oouTZbz1XcqLvK5kwZwYIKwYBBQUHAQEEWzBZMDUGCCsGAQUFBzAChilodHRwOi8vY3J0LmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNlcjAgBggrBgEFBQcwAYYUaHR0cDovL29jc3AubGxhbWEucGUwHQYDVR0RBBYwFIESbWFsaWFnYUBtaWdhZmkuY29tMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUTtWOjRJrY+hai0Np8dEDrqh3tIcwDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQCIe0oUU2YJTZY0jULGUgE09eyyE+qh+V6MZLGPyeieuM+sS7U2uqoctQLS2VVIbx+pPoJ/ubmDS4zxMgxejcyJwiW0u9cn1bUS7XxQ4W5lSdRY5vi1MOTB2PXE3h1ESB6T6EJcY4P+azSNXgxOtnUzeXRxGSOR2RcoSiBocfJWKWjcOrVyJ4hksLKhjjm7hwi4zWD4chiJfaaHx2an9vpx8/gZKy4zz4+q1kDSoXL4FqY7DWGtyxWJVW/J2nbTj8PdV6YDwkboLPPwFhDtN0OE7VBqpXIItxqXLGPWupL7PSnhYDAB1uDxWbfkBx7WtIpKMxT7zvmwzaTTlvEOgqnH</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>V002-11</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-11</cbc:IssueDate>
|
||||
<cbc:IssueTime>13:05:50</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT">31</cbc:DespatchAdviceTypeCode>
|
||||
<!-- DOCUMENTOS ADICIONALES (Catalogo D41) -->
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-128662</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de remisión remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-128661</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de remisión remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>signatureFACTURALOPERU</cbc:ID>
|
||||
<cbc:Note>FACTURALO</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#signatureFACTURALOPERU</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<!-- DATOS DEL EMISOR (TRANSPORTISTA) -->
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<!-- DATOS DEL RECEPTOR (DESTINATARIO) -->
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20506689326</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[MATERIALES D`CASA S.A.C]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<!-- DATOS DE QUIEN PAGA EL SERVICIO -->
|
||||
<!-- DATOS DEL TRASLADO -->
|
||||
<cac:Shipment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<!-- PESO BRUTO TOTAL DE LA CARGA-->
|
||||
<cbc:GrossWeightMeasure unitCode="KGM">31875.00</cbc:GrossWeightMeasure>
|
||||
<!-- INDICADORES -->
|
||||
<cac:ShipmentStage>
|
||||
<!-- FECHA DE INICIO DEL TRASLADO -->
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-11</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
<!-- CONDUCTOR PRINCIPAL -->
|
||||
<cac:DriverPerson>
|
||||
<!-- TIPO Y NUMERO DE DOCUMENTO DE IDENTIDAD -->
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="1">09715404</cbc:ID>
|
||||
<!-- NOMBRES -->
|
||||
<cbc:FirstName>HUAMAN ÑAHUE, JUAN</cbc:FirstName>
|
||||
<!-- APELLIDOS -->
|
||||
<cbc:FamilyName>DE DIOS</cbc:FamilyName>
|
||||
<!-- TIPO DE CONDUCTOR: PRINCIPAL -->
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<!-- LICENCIA DE CONDUCIR -->
|
||||
<cbc:ID>Q09715404</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
<!-- CONDUCTOR SECUNDARIO -->
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<!-- DIRECCION DEL PUNTO DE LLEGADA -->
|
||||
<cac:DeliveryAddress>
|
||||
<!-- UBIGEO DE LLEGADA -->
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150502</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[CA. PANAMERICANA SUR KM 98 SANTA CRUZ]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<!-- DIRECCION DEL PUNTO DE PARTIDA -->
|
||||
<cac:DespatchAddress>
|
||||
<!-- UBIGEO DE PARTIDA -->
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE PARTIDA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. ATOCONGO 1860]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<!-- DATOS DEL REMITENTE -->
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" schemeAgencyName="PE:SUNAT" schemeName="Documento de Identidad" schemeID="6">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<!-- NUMERO DE CONTENEDOR -->
|
||||
<cbc:ID>-</cbc:ID>
|
||||
<cac:TransportEquipment>
|
||||
<!-- VEHICULO PRINCIPAL -->
|
||||
<!-- PLACA - VEHICULO PRINCIPAL -->
|
||||
<cbc:ID>F6P722</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>15M24026972E</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
<!-- VEHICULOS SECUNDARIOS -->
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<!-- DETALLES DE BIENES A TRASLADAR -->
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">550.0000</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[BOLSA CEMENTO APU]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[10000540]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">200.0000</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>2</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[BOLSA CEMENTO ANDINO ULTRA HS]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[10003615]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,55 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20506689326",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C.",
|
||||
"fecha_emision": "27/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "FE07",
|
||||
"numero": "1559",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": "1363.82",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": "4",
|
||||
"monto_detraccion": "56.83",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "550 ZZ SERVICIO TRANSPORTE CEMENTO APU 027 SUNAT 0",
|
||||
"cantidad": "1.89",
|
||||
"precio_unitario": "1.89",
|
||||
"total_linea": "1041.81",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
},
|
||||
{
|
||||
"descripcion": "200 ZZ SERVICIO TRANSPORTE CEMTO ANDINO/ULTRA 027 SUNAT 0",
|
||||
"cantidad": "1.89",
|
||||
"precio_unitario": "1.89",
|
||||
"total_linea": "378.84",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20506689326",
|
||||
"razon_social_emisor": "MATERIALES D`CASA S.A.C",
|
||||
"fecha_emision": null,
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "MATERIALES D`CASA S.A.C",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/003_correo/20506689326-31-V002-11.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,139 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20506689326",
|
||||
"razon_social_emisor": "MATERIALES D`CASA S.A.C",
|
||||
"fecha_emision": "2026-05-13",
|
||||
"tipo": "01",
|
||||
"serie": "FE07",
|
||||
"numero": "1559",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 1420.65,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO TRANSPORTE CEMENTO APU 027 SUNAT",
|
||||
"cantidad": 550.0,
|
||||
"precio_unitario": 1.8942,
|
||||
"total_linea": 882.89,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128662"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"descripcion": "SERVICIO TRANSPORTE CEMTO ANDINO/ULTRA 027 SUNAT",
|
||||
"cantidad": 200.0,
|
||||
"precio_unitario": 1.8942,
|
||||
"total_linea": 321.05,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128661"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/003_correo/20506689326-01-FE07-1559.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20506689326",
|
||||
"razon_social_emisor": "MATERIALES D`CASA S.A.C",
|
||||
"fecha_emision": "2026-05-11",
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "11",
|
||||
"ruc_receptor": "20506689326",
|
||||
"razon_social_receptor": "MATERIALES D`CASA S.A.C",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128662"
|
||||
},
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "128661"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860",
|
||||
"punto_llegada": "CA. PANAMERICANA SUR KM 98 SANTA CRUZ",
|
||||
"peso_bruto": "31875.00",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-11",
|
||||
"vehiculo_principal": "F6P722",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q09715404",
|
||||
"nombre_conductor": "HUAMAN ÑAHUE, JUAN",
|
||||
"documento_conductor": "09715404",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "BOLSA CEMENTO APU",
|
||||
"cantidad": 550.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
},
|
||||
{
|
||||
"descripcion": "BOLSA CEMENTO ANDINO ULTRA HS",
|
||||
"cantidad": 200.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/003_correo/20506689326-31-V002-11.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="SignatureSP"><SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>8LhsuraTHRFahN/X2RKshF/bPLM=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">LVrsrAh9EwLNKiczJjoHiLSjH9JVa47YaKsflcQOlaxmGtmV3jMBVS4IKUVAurgypeSIOdHFQRhPA2FzT0nAB0ROUhqnrAlRKX0nY5/lFb0WZOjSe7IKbV8bDwYhjdYC/oo03/3sgNudJUYW6zErMyooyY0UX4GV4dZfqNxEqdeQvZiz+2QdLGPWUb+Ibq/fGHseignAE8O2cEHmDDvqk6ABGtEkPc9JPpYep14KEzws9LeheVaOAzPsk/Oe4tDM+XmYMk+jE1riHlTDZDPEVUr1Liw5uU1kVdkij3L9+fdmkP5BwbkHgEJFljvRepuI8N66b8xKwqFmyYlBqHdehA==</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data><X509SubjectName>C=PE, L=LIMA, O=R P TRANSFER S.A.C., OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20551006914, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=contabilidad@difenas.com.pe, STREET=AV. LIMA NRO. 2210 P.J. JOSE GALVEZ</X509SubjectName><X509Certificate>MIIFdjCCBF6gAwIBAgIISJfl+vjrcZUwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDI0MTY1NTM2WhcNMjYxMDI0MTY1NTAwWjCCARQxLDAqBgNVBAkMI0FWLiBMSU1BIE5STy4gMjIxMCBQLkouIEpPU0UgR0FMVkVaMSowKAYJKoZIhvcNAQkBFhtjb250YWJpbGlkYWRAZGlmZW5hcy5jb20ucGUxLDAqBgNVBAMMI1NPRlRXQVJFIERFIEZBQ1RVUkFDSU9OIEVMRUNUUk9OSUNBMSwwKgYDVQQLDCNGQUNUVVJBIEVMRUNUUk9OSUNBIFJVQyAyMDU1MTAwNjkxNDEhMB8GA1UECwwYVmFsaWRhZG8gcG9yIExsYW1hLnBlIEVSMR0wGwYDVQQKDBRSICBQIFRSQU5TRkVSIFMuQS5DLjENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC67JWukAAwxXhKV/LTmrjHALY44d1pU9Y3JJE6TSDgjtimIs1h7eZot/OC9d+OGUhy383TMSxqdIM4W77PMDRH5Iefh6H5EKaPI2YsCIc3lT3N15JdK+EQNyPeAh/mC4OWrGuVXDgU3MPD7EbtgjvYG8wLEJUIJBxw9bil4SiTLHPiKpRWySrtWPZeBTYfGdR/7xoRxSRSCOwgi04lp8lEv8Wwfyb2rsrltRrx44RGZFLy0GRjLw0ktzx2OL3VYGK51x0YD91wIKiFUN3co3vgLwyiuLiEr09QXpFm9zUjupxT9V3RtmyWOv2x6cFAWswLGYNVl7JnspVGae8GV23nAgMBAAGjggGWMIIBkjAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCYGA1UdEQQfMB2BG2NvbnRhYmlsaWRhZEBkaWZlbmFzLmNvbS5wZTBGBgNVHSAEPzA9MDsGDSsGAQQBg5d3AAEAAwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9sbGFtYS5wZS9yZXBvc2l0b3J5LzAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jcmwwHQYDVR0OBBYEFAWB+XQmngVqzCM13NVubfDKC12wMA4GA1UdDwEB/wQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAQEAu4Ajzm//yKf4bONcHdDISUaC3P8rh5CW0NSkVS/MsrXBGB3SCJXk2LR7wLVrUco3/DP3wMkel4XVDL6ftTfim+XmLXeAnuoFYTBGVJtuZMvuZAsncGIu3iFOE1K1v8yhzUykh+L7gLgPz60o8zHOXN48G3mHeNtaz3gSPGFSy0q6abiSN1n1A0VH8jj0PNf5Q0kjwdwfv0IhUAImgvLcPYeWXPobN2Ad4EqTkgvwOlLg1J7Tv6GJybjGKFSAHWi1Bbu+hegTS8SgGPDmXTsTe0ZPZZ+YzvupS/zzDEYkC1OV7b/56t4sFn5KVrvpZqsoisqCzMV4NOc0XgbTsMVoJg==</X509Certificate></X509Data></KeyInfo></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:CustomizationID schemeAgencyName="PE:SUNAT">2.0</cbc:CustomizationID><cbc:ID>F004-0005989</cbc:ID><cbc:IssueDate>2026-05-29</cbc:IssueDate><cbc:InvoiceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT" listID="0101">01</cbc:InvoiceTypeCode><cbc:Note languageLocaleID="1000">DOSCIENTOS VEINTISEIS CON 45/100 SOLES</cbc:Note><cbc:DocumentCurrencyCode listName="Currency" listAgencyName="United Nations Economic Commission for Europe" listID="ISO 4217 Alpha">PEN</cbc:DocumentCurrencyCode><cbc:LineCountNumeric>1</cbc:LineCountNumeric><cac:Signature><cbc:ID>signatureCF</cbc:ID><cac:SignatoryParty><cac:PartyIdentification><cbc:ID>20551006914</cbc:ID></cac:PartyIdentification><cac:PartyName><cbc:Name><![CDATA[R & P TRANSFLine truncated
|
||||
G.R.T. : V002-0001427
|
||||
P. PARTIDA : AV. ATOCONGO 1860 VMT LIMA LIMA
|
||||
P. LLEGADA : CAR. PANAMERICANA SUR KM 59 MZA. A LOTE. 1 A.V LA PONDEROSA- LIMA- LIMA -PUCUSANA
|
||||
CONF. VEHIC : T3S3
|
||||
VALOR REFER :S/ 226.45
|
||||
T.N. : 5.312]]></cbc:Description><cac:SellersItemIdentification><cbc:ID><![CDATA[SERV-CEM-SOL-125]]></cbc:ID></cac:SellersItemIdentification></cac:Item><cac:Price><cbc:PriceAmount currencyID="PEN">1.5352540000</cbc:PriceAmount></cac:Price></cac:InvoiceLine></Invoice>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><DespatchAdvice xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="SignatureSP"><SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>NZR3F6AHQuWc6dokcbp/vG99cYQ=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">hkguA93vzLnZCwlhqrSmtqFvMrQlTH17PyOixuXvJFFszq5/90MLblUlBVOOQQJj1MJNdGifBpKB/GJzLFPk5SIY7jYlkmIAuusrcvu2RbKllcCmBENxdXD/rNQ4Zl5N1pPi/Ob8jLDANLNz573c+HZnLP5O0LUq/kbcbAEe59FJjOG36+iPwPu/hDloKlLC+B++HxTWGd8yXlbUeaEV5lLe8Cd4gzmisyUd/HTlgKMf7/rUmL0es8kbSLOm8o2hX2DRwcuern7I44T47eq1TPKh8ePrNMCfKdFZrMEF3fbdwwZBM45MUq8+E11g//rIzjNsnUEd5mSQSKcD59StQA==</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data><X509SubjectName>C=PE, L=LIMA, O=R P TRANSFER S.A.C., OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20551006914, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=contabilidad@difenas.com.pe, STREET=AV. LIMA NRO. 2210 P.J. JOSE GALVEZ</X509SubjectName><X509Certificate>MIIFdjCCBF6gAwIBAgIISJfl+vjrcZUwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDI0MTY1NTM2WhcNMjYxMDI0MTY1NTAwWjCCARQxLDAqBgNVBAkMI0FWLiBMSU1BIE5STy4gMjIxMCBQLkouIEpPU0UgR0FMVkVaMSowKAYJKoZIhvcNAQkBFhtjb250YWJpbGlkYWRAZGlmZW5hcy5jb20ucGUxLDAqBgNVBAMMI1NPRlRXQVJFIERFIEZBQ1RVUkFDSU9OIEVMRUNUUk9OSUNBMSwwKgYDVQQLDCNGQUNUVVJBIEVMRUNUUk9OSUNBIFJVQyAyMDU1MTAwNjkxNDEhMB8GA1UECwwYVmFsaWRhZG8gcG9yIExsYW1hLnBlIEVSMR0wGwYDVQQKDBRSICBQIFRSQU5TRkVSIFMuQS5DLjENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC67JWukAAwxXhKV/LTmrjHALY44d1pU9Y3JJE6TSDgjtimIs1h7eZot/OC9d+OGUhy383TMSxqdIM4W77PMDRH5Iefh6H5EKaPI2YsCIc3lT3N15JdK+EQNyPeAh/mC4OWrGuVXDgU3MPD7EbtgjvYG8wLEJUIJBxw9bil4SiTLHPiKpRWySrtWPZeBTYfGdR/7xoRxSRSCOwgi04lp8lEv8Wwfyb2rsrltRrx44RGZFLy0GRjLw0ktzx2OL3VYGK51x0YD91wIKiFUN3co3vgLwyiuLiEr09QXpFm9zUjupxT9V3RtmyWOv2x6cFAWswLGYNVl7JnspVGae8GV23nAgMBAAGjggGWMIIBkjAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCYGA1UdEQQfMB2BG2NvbnRhYmlsaWRhZEBkaWZlbmFzLmNvbS5wZTBGBgNVHSAEPzA9MDsGDSsGAQQBg5d3AAEAAwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9sbGFtYS5wZS9yZXBvc2l0b3J5LzAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jcmwwHQYDVR0OBBYEFAWB+XQmngVqzCM13NVubfDKC12wMA4GA1UdDwEB/wQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAQEAu4Ajzm//yKf4bONcHdDISUaC3P8rh5CW0NSkVS/MsrXBGB3SCJXk2LR7wLVrUco3/DP3wMkel4XVDL6ftTfim+XmLXeAnuoFYTBGVJtuZMvuZAsncGIu3iFOE1K1v8yhzUykh+L7gLgPz60o8zHOXN48G3mHeNtaz3gSPGFSy0q6abiSN1n1A0VH8jj0PNf5Q0kjwdwfv0IhUAImgvLcPYeWXPobN2Ad4EqTkgvwOlLg1J7Tv6GJybjGKFSAHWi1Bbu+hegTS8SgGPDmXTsTe0ZPZZ+YzvupS/zzDEYkC1OV7b/56t4sFn5KVrvpZqsoisqCzMV4NOc0XgbTsMVoJg==</X509Certificate></X509Data></KeyInfo></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:CustomizationID>2.0</cbc:CustomizationID><cbc:ID>V002-0001427</cbc:ID><cbc:IssueDate>2026-05-29</cbc:IssueDate><cbc:IssueTime>17:25:19</cbc:IssueTime><cbc:DespatchAdviceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT">31</cbc:DespatchAdviceTypeCode><cac:Signature><cbc:ID>V002-0001427</cbc:ID><cac:SignatoryParty><cac:PartyIdentification><cbc:ID>20551006914</cbc:ID></cac:PartyIdentification><cac:PartyName><cbc:Name><![CDATA[R & P TRANSFER S.A.C.]]></cbc:Name></cac:PartyName></cac:SignatoryParty><cac:DigitalSignatureAttachment><cac:ExternalReference><cbc:URI>#SignatureSP</cbc:URI></cac:ExternalReference></cac:DigitalSignatureAttachment></cac:Signature><cac:DespatchSupplierParty><cac:Party><cac:PartyIdentification><cbc:ID schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" sLine truncated
|
||||
@@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20551006914",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C.",
|
||||
"fecha_emision": "29/05/2026",
|
||||
"tipo": "09",
|
||||
"serie": "F004",
|
||||
"numero": "5989",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/004_correo/20551006914-09-F004-5989.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20551006914",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": null,
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1427",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/004_correo/20551006914-31-V002-1427.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,105 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20551006914",
|
||||
"razon_social_emisor": "R & P TRANSFER S.A.C.",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "01",
|
||||
"serie": "F004",
|
||||
"numero": "5989",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 226.45,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129723"
|
||||
},
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1427"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "POR EL SERVICIO DE TRANSPORTE DE 125 BOLSAS DE CEMENTO SOL G.R.R.\t\t: T001-00129723\nG.R.T.\t\t: V002-0001427\nP. PARTIDA \t: AV. ATOCONGO 1860 VMT LIMA LIMA\nP. LLEGADA \t: CAR. PANAMERICANA SUR KM 59 MZA. A LOTE. 1 A.V LA PONDEROSA- LIMA- LIMA -PUCUSANA\nCONF. VEHIC\t: T3S3\nVALOR REFER\t:S/ 226.45\nT.N.\t\t: 5.312",
|
||||
"cantidad": 125.0,
|
||||
"precio_unitario": 1.8116,
|
||||
"total_linea": 191.91,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129723"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1427"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/004_correo/20551006914-01-F004-5989.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20551006914",
|
||||
"razon_social_emisor": "R & P TRANSFER S.A.C.",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1427",
|
||||
"ruc_receptor": "20550744024",
|
||||
"razon_social_receptor": "CONSORCIO UNION FERRETERA S.A.C. - CONSUFER S.A.C.",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV ATOCONGO 1860 LIMA LIMA VMT",
|
||||
"punto_llegada": "CAR.PANAMERICANA SUR KM 59 MZA. A LOTE. 1 A.V. LA PONDEROSA (PUENTE PU",
|
||||
"peso_bruto": "5.313",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-29",
|
||||
"vehiculo_principal": "C6Y857",
|
||||
"vehiculo_secundario": "D2P996",
|
||||
"licencia_conductor": "Q45322098",
|
||||
"nombre_conductor": "LUIS MIGUEL",
|
||||
"documento_conductor": "45322098",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO SOL T1",
|
||||
"cantidad": 125.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/004_correo/20551006914-31-V002-1427.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="SignatureSP"><SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>oydc1/p9NAh68kMvAOT9oAUeGCU=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">zzCw8dLaTJ/r0BiNVSupKYiIujELgg8U2TWXw9mB52BDlKynFAGRalVcHccMit9teSKQMGYKdiLgzVaqhIWwQAxDIwUaaoudE2hSG2eHQdwCKqP0z76CjDiTZEgHj30agvxUjZxXeQbczvc5vKopUaRdLwDLEjFZyr0TftGQBujxuaAzQhU+X5D6yNdhxOXA0GPu00g92EfapGmbh5Wt1kUUFhrI1om+hOkbhXZATCHfQJ7eB5U0cEbfZyLqZw9Zvq6rnq5opWi35SUe3tkZjlN6oE4XvGjuXksD4c9plp/bQvGhZQlxg1D8UHnRerffLdZv7B3ZA1NtruNYJ6kvZw==</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data><X509SubjectName>C=PE, L=LIMA, O=DISTRIBUIDORA FERRETERA NASCA S.A.C. - DIFENAS S.A.C., OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20555929006, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=contabilidad@difenas.com.pe, STREET=AV. LIMA NRO. 2236 P.J. JOSE GALVEZ</X509SubjectName><X509Certificate>MIIFlzCCBH+gAwIBAgIIMW4CA4T7sdQwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDE0MTkxNDEwWhcNMjYxMDE0MTkxNDAwWjCCATUxLDAqBgNVBAkMI0FWLiBMSU1BIE5STy4gMjIzNiBQLkouIEpPU0UgR0FMVkVaMSowKAYJKoZIhvcNAQkBFhtjb250YWJpbGlkYWRAZGlmZW5hcy5jb20ucGUxLDAqBgNVBAMMI1NPRlRXQVJFIERFIEZBQ1RVUkFDSU9OIEVMRUNUUk9OSUNBMSwwKgYDVQQLDCNGQUNUVVJBIEVMRUNUUk9OSUNBIFJVQyAyMDU1NTkyOTAwNjEhMB8GA1UECwwYVmFsaWRhZG8gcG9yIExsYW1hLnBlIEVSMT4wPAYDVQQKDDVESVNUUklCVUlET1JBIEZFUlJFVEVSQSBOQVNDQSBTLkEuQy4gLSBESUZFTkFTIFMuQS5DLjENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrXOQp5XJfVSlT7G/xjPQp25/XlHcTMqzFneRLQB7RBMEoVZMGS08TJOwb7A08F80MemcdHINfKu32W0vH+IkXftM80JzMMwcooM0HPx42rYm0kmYovhOdoDDOGXWEbBInQ7aTIQkW4/UkytdIVP3uk5sRoPVollMeu1FnvBBe0xU2xMCSTpd4gOQXGHittmYhgK2YCNdrKBRn/k/wULS9RsejCPV4FkUAeiZK2JSFphR4YZPddo3XLb/mUXwgoikAovQ4RyN2QqW+PRXI7GEuY9UN/DuEaDsdBNyKEddeYJnMRepZmDQEQr5RMbn4B5ObFaODKmkMe4lg/GE9sb11AgMBAAGjggGWMIIBkjAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCYGA1UdEQQfMB2BG2NvbnRhYmlsaWRhZEBkaWZlbmFzLmNvbS5wZTBGBgNVHSAEPzA9MDsGDSsGAQQBg5d3AAEAAwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9sbGFtYS5wZS9yZXBvc2l0b3J5LzAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jcmwwHQYDVR0OBBYEFOekfrMbj8D7XHBMrINSvd5DMeY9MA4GA1UdDwEB/wQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAQEAfeOGCQjp79Wh+8REraPlhIb7EOjJsbVR7W9eYNnIo2jDZMpBY8yxrQtcukGBjABn63L+N335eviU1hX6saLTXwcCrNrsYNYt4hQ7FQWaHsSp9AckMdRCxDvhIpQVheVKLLT/aSOV1loEa6J8A25wk5n+oS1nEex6x+7k210FcLOREyVbPxqrlCJPX8SCVcJOl84KOHlbrGmPDp2r30IycyM3mx7cJfIwNCbcNOXi46QqI6QINhooysZy4lSj7LqIDItzG3YaXlnauWSGPEsl8ggqcCOp5QdXSAeov+0tkTD9/83OA6/5Qv5dvp0x3Qq5JY4H/QBrh16SHQcHqxIMPw==</X509Certificate></X509Data></KeyInfo></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:CustomizationID schemeAgencyName="PE:SUNAT">2.0</cbc:CustomizationID><cbc:ID>F004-0003544</cbc:ID><cbc:IssueDate>2026-05-29</cbc:IssueDate><cbc:InvoiceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT" listID="1001">01</cbc:InvoiceTypeCode><cbc:Note languageLocaleID="1000">SEISCIENTOS CUARENTA Y CUATRO CON 35/100 SOLES</cbc:Note><cbc:Note languageLocaleID="2006">Operación sujeta a detracción</cbc:Note><cbc:DocumentCurrencyCode listName="Currency" listAgencyName="United Nations Economic Commission for Europe" listID="ISO 4217 Alpha">PEN</cbc:DocumentCurrencyCode><cbc:LineCountNumeric>1</cbc:LineCountNumeric><cac:Signature><cbc:ID>signLine truncated
|
||||
G.R.T. : V002-0001358
|
||||
P. PARTIDA : AV. ATOCONGO 1860 VMT LIMA LIMA
|
||||
P. LLEGADA : AV. PROLONGACION SAENZ PEÑA-LAS PALMAS MZ H LT.7 OTR.UCV 12203 SUBL B SECTOR CODIGO CATASTRAL
|
||||
CONF. VEHIC : T3S3
|
||||
VALOR REFER :S/ 644.35
|
||||
T]]></cbc:Description><cac:SellersItemIdentification><cbc:ID><![CDATA[SERV-CEM-SOL-481]]></cbc:ID></cac:SellersItemIdentification></cac:Item><cac:Price><cbc:PriceAmount currencyID="PEN">1.1352540000</cbc:PriceAmount></cac:Price></cac:InvoiceLine></Invoice>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><DespatchAdvice xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="SignatureSP"><SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>60qTHSXvO/FXkSbic7xmmBjlokk=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">sxQSd3SmESNNOy9vPdeOmSjpgV/EVhLJ/+opTLhshivwvIbU/XRaJ/GSxWB+yFTUu2tFzOJ+bQLxqmOMXl/R6xllxFshQ4tNh1Q73sCt0N1f9WE2LBm+g5Fk/v5sHtJIlJgcnpQiu8EYS0bCtyC2oiaNsLsY22jJvaSB/lISthRji7WAgWPbytQUtTYxZMYwLleh80RvZy05xmDrdjajiDMmSIBQeT89b3gYGv3VdaNNRERc+Yw/t7NxBcsGUfeO73VJo/C6UzDQNyiy9N3gwmjAYs1j2Mn41cEVlGQWPo9+FGewIpKkRdliNWeLXbAyrArV/y1Sy6kMECal1V5mHA==</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><X509Data><X509SubjectName>C=PE, L=LIMA, O=DISTRIBUIDORA FERRETERA NASCA S.A.C. - DIFENAS S.A.C., OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20555929006, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=contabilidad@difenas.com.pe, STREET=AV. LIMA NRO. 2236 P.J. JOSE GALVEZ</X509SubjectName><X509Certificate>MIIFlzCCBH+gAwIBAgIIMW4CA4T7sdQwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDE0MTkxNDEwWhcNMjYxMDE0MTkxNDAwWjCCATUxLDAqBgNVBAkMI0FWLiBMSU1BIE5STy4gMjIzNiBQLkouIEpPU0UgR0FMVkVaMSowKAYJKoZIhvcNAQkBFhtjb250YWJpbGlkYWRAZGlmZW5hcy5jb20ucGUxLDAqBgNVBAMMI1NPRlRXQVJFIERFIEZBQ1RVUkFDSU9OIEVMRUNUUk9OSUNBMSwwKgYDVQQLDCNGQUNUVVJBIEVMRUNUUk9OSUNBIFJVQyAyMDU1NTkyOTAwNjEhMB8GA1UECwwYVmFsaWRhZG8gcG9yIExsYW1hLnBlIEVSMT4wPAYDVQQKDDVESVNUUklCVUlET1JBIEZFUlJFVEVSQSBOQVNDQSBTLkEuQy4gLSBESUZFTkFTIFMuQS5DLjENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrXOQp5XJfVSlT7G/xjPQp25/XlHcTMqzFneRLQB7RBMEoVZMGS08TJOwb7A08F80MemcdHINfKu32W0vH+IkXftM80JzMMwcooM0HPx42rYm0kmYovhOdoDDOGXWEbBInQ7aTIQkW4/UkytdIVP3uk5sRoPVollMeu1FnvBBe0xU2xMCSTpd4gOQXGHittmYhgK2YCNdrKBRn/k/wULS9RsejCPV4FkUAeiZK2JSFphR4YZPddo3XLb/mUXwgoikAovQ4RyN2QqW+PRXI7GEuY9UN/DuEaDsdBNyKEddeYJnMRepZmDQEQr5RMbn4B5ObFaODKmkMe4lg/GE9sb11AgMBAAGjggGWMIIBkjAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCYGA1UdEQQfMB2BG2NvbnRhYmlsaWRhZEBkaWZlbmFzLmNvbS5wZTBGBgNVHSAEPzA9MDsGDSsGAQQBg5d3AAEAAwEwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9sbGFtYS5wZS9yZXBvc2l0b3J5LzAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jcmwwHQYDVR0OBBYEFOekfrMbj8D7XHBMrINSvd5DMeY9MA4GA1UdDwEB/wQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAQEAfeOGCQjp79Wh+8REraPlhIb7EOjJsbVR7W9eYNnIo2jDZMpBY8yxrQtcukGBjABn63L+N335eviU1hX6saLTXwcCrNrsYNYt4hQ7FQWaHsSp9AckMdRCxDvhIpQVheVKLLT/aSOV1loEa6J8A25wk5n+oS1nEex6x+7k210FcLOREyVbPxqrlCJPX8SCVcJOl84KOHlbrGmPDp2r30IycyM3mx7cJfIwNCbcNOXi46QqI6QINhooysZy4lSj7LqIDItzG3YaXlnauWSGPEsl8ggqcCOp5QdXSAeov+0tkTD9/83OA6/5Qv5dvp0x3Qq5JY4H/QBrh16SHQcHqxIMPw==</X509Certificate></X509Data></KeyInfo></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:CustomizationID>2.0</cbc:CustomizationID><cbc:ID>V002-0001358</cbc:ID><cbc:IssueDate>2026-05-29</cbc:IssueDate><cbc:IssueTime>13:11:15</cbc:IssueTime><cbc:DespatchAdviceTypeCode listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" listName="Tipo de Documento" listAgencyName="PE:SUNAT">31</cbc:DespatchAdviceTypeCode><cac:Signature><cbc:ID>V002-0001358</cbc:ID><cac:SignatoryParty><cac:PartyIdentification><cbc:ID>20555929006</cbc:ID></cac:PartyIdentification><cac:PartyName><cbc:Name><![CDATA[DISTRIBUIDORA FERRETERA NASCA S.A.C]]></cbc:Name></cac:PartyName></cac:SignatoryParty><cac:DigitalSignatureAttachment><cac:ExternalReference><cbc:URI>#SignatureSP</cbc:URI></cac:ExternalReference></cac:DigitalSignatureAttachment></cac:Signature><cac:DespatchSupplierParty><cac:Party><cac:Line truncated
|
||||
@@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20555929006",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C.",
|
||||
"fecha_emision": "29/05/2026",
|
||||
"tipo": "09",
|
||||
"serie": "F004",
|
||||
"numero": "3544",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/005_correo/20555929006-09-F004-3544.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20555929006",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": null,
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1358",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/005_correo/20555929006-31-V002-1358.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,105 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20555929006",
|
||||
"razon_social_emisor": "DIFENAS S.A.C.",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "01",
|
||||
"serie": "F004",
|
||||
"numero": "3544",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 644.35,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129721"
|
||||
},
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1358"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 26.0,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "POR EL SERVICIO DE TRANSPORTE DE 481 BOLSAS DE CEMENTO SOL G.R.R.\t\t: T001-00129721\nG.R.T.\t\t: V002-0001358\nP. PARTIDA \t: AV. ATOCONGO 1860 VMT LIMA LIMA\nP. LLEGADA \t: AV. PROLONGACION SAENZ PEÑA-LAS PALMAS MZ H LT.7 OTR.UCV 12203 SUBL B SECTOR CODIGO CATASTRAL\nCONF. VEHIC\t: T3S3\nVALOR REFER\t:S/ 644.35\nT",
|
||||
"cantidad": 481.0,
|
||||
"precio_unitario": 1.3396,
|
||||
"total_linea": 546.06,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129721"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1358"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/005_correo/20555929006-01-F004-3544.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20555929006",
|
||||
"razon_social_emisor": "DISTRIBUIDORA FERRETERA NASCA S.A.C",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "1358",
|
||||
"ruc_receptor": "20550744024",
|
||||
"razon_social_receptor": "CONSORCIO UNION FERRETERA S.A.C. - CONSUFER",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV ATOCONGO 1860 VMT LIMA LIMA",
|
||||
"punto_llegada": "AV. PROLONGACION SAENZ PENA - LAS PALMAS MZA. H LOTE. 7 OTR. UCV 12203 SUBL B SECTOR CODIGO CATAST",
|
||||
"peso_bruto": "20.443",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-29",
|
||||
"vehiculo_principal": "AYI792",
|
||||
"vehiculo_secundario": "D8L996",
|
||||
"licencia_conductor": "Q09251892",
|
||||
"nombre_conductor": "CARLOS",
|
||||
"documento_conductor": "09251892",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO SOL T1",
|
||||
"cantidad": 481.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/005_correo/20555929006-31-V002-1358.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,267 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?><Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 ..\xsd\maindoc\UBLPE-Invoice-2.0.xsd" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="SF011-00002786" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>0bVP8AHmCYXyChygo3XQvXBECu0=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>GF4e84jreud/2MfjRC07GPolo3Stke3dGsFachUWZMmdK3DVwD5eYPYaJ58uKPJCzgTn91ZiNPuz
|
||||
WMCrsW5hllzjD9VXaZVbna34EgzfdsbZml08nKXY2gi0n6cHo7WVfbDSCzx3fkuPfJc2iKnXmh9y
|
||||
owPQG0kFcCnsIVYNaudMNvSrtDptHIcLpEcCCpEL2+cED4RW8goDByzVVEyYMaTbDQ67fvtq9EcM
|
||||
4jqf877A7i4oYqKKJ1dyGG7VYIzTft8XGtV2uJjcjd3HQSvyqzSuGVkKIvbcp2q5/gxw5TvuyH6C
|
||||
tNk3cFIYN7l7gSzUzkbJiw58+Kms8L4neWuaGg==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509SubjectName>C=PE,L=LIMA,O=TREFILADOS EL SALVADOR S R L,OU=Validado por Llama.pe ER,OU=FACTURA ELECTRONICA RUC 20100811571,CN=SOFTWARE DE FACTURACION ELECTRONICA,1.2.840.113549.1.9.1=#161b636f6e746162696c6964616440747265666973612e636f6d2e7065,STREET=AV. PABLO PATRON NRO. 211 URB. SAN PABLO</ds:X509SubjectName><ds:X509Certificate>MIIFgzCCBGugAwIBAgIIWD+k8QQbj9IwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEu
|
||||
cGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcN
|
||||
MjUxMTE5MTk1NTI2WhcNMjcxMTE5MTk1NTAwWjCCASExMTAvBgNVBAkMKEFWLiBQQUJMTyBQQVRS
|
||||
T04gTlJPLiAyMTEgVVJCLiBTQU4gUEFCTE8xKjAoBgkqhkiG9w0BCQEWG2NvbnRhYmlsaWRhZEB0
|
||||
cmVmaXNhLmNvbS5wZTEsMCoGA1UEAwwjU09GVFdBUkUgREUgRkFDVFVSQUNJT04gRUxFQ1RST05J
|
||||
Q0ExLDAqBgNVBAsMI0ZBQ1RVUkEgRUxFQ1RST05JQ0EgUlVDIDIwMTAwODExNTcxMSEwHwYDVQQL
|
||||
DBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxJTAjBgNVBAoMHFRSRUZJTEFET1MgRUwgU0FMVkFE
|
||||
T1IgUyBSIEwxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOC
|
||||
AQ8AMIIBCgKCAQEAyYlT09RvuC+D9hLK0LGN9iOOC72e3Q5UqAPUQDCB+X58MOjuaHsTGyOZ1s9h
|
||||
1jp9Wi2oigztr6YgChuWE7aVyHeMre2uI5t2rug2kuCwAnYQOrFtMZXkWZm1FOvL55mMGdMzryx2
|
||||
E7/NDE1AvIfybsfx1JqH0HwnbHdb3usP67mhElFzgBwljwpfO9y3TmkrID5/o/DRXxlyLm2Up5AL
|
||||
9cTdzDRngGV3eqeDFmrsLz1Ii2TBfDKJSpLKbMAZ0QE3mkfFolAaq/7s0+lLA1jvdw+be+3MF9sr
|
||||
WQexVMlWZ0GUdduJk0+b8/ye85JEjQz/aVn+vQzx7MHXqPlCELDUCQIDAQABo4IBljCCAZIwDAYD
|
||||
VR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRb
|
||||
MFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2Vy
|
||||
MCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAmBgNVHREEHzAdgRtjb250YWJpbGlk
|
||||
YWRAdHJlZmlzYS5jb20ucGUwRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUH
|
||||
AgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsG
|
||||
AQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5k
|
||||
YXJkY2EuY3JsMB0GA1UdDgQWBBSJOvNq/vY9qi0s/jya/Pg3HEoWQDAOBgNVHQ8BAf8EBAMCBsAw
|
||||
DQYJKoZIhvcNAQELBQADggEBAFv2Zeg2ylvyA7dO4hPIJ3e/WSQyqmf1BQUC2YOq4bwIF7z4qU4y
|
||||
qlecjLsRI5NpDAdZHp6YNLRMOr6FxocKqm665RKjk7XTEY9DDW2sWdOhybreY+ikm6/LH3O3whMI
|
||||
uONPgQQmHKUaEZ85oWKlPBCjjDSLwGxb5hyHYfgAh2whOFMBprc0y53DkkYMd7N6FFs+Zgirq91I
|
||||
WxoW1vOkFTqc4RyFQ/KBJqwjsRYZ39g2LFJO4MByYWzjZn3TcJOj8BQAYrC2UzHKSl1BZuDW7r4i
|
||||
+6r92zt5UrhxRE45isPgZuDkryZtRshSE5+i1KoK76IRg9LiCxh7xme7vfwjqdM=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<sac:AdditionalInformation>
|
||||
<sac:AdditionalProperty>
|
||||
<cbc:ID>1000</cbc:ID>
|
||||
<cbc:Value><![CDATA[OCHOCIENTOS SETENTA Y 74/100 SOLES]]></cbc:Value>
|
||||
</sac:AdditionalProperty>
|
||||
<sac:AdditionalProperty>
|
||||
<cbc:ID>2006</cbc:ID>
|
||||
<cbc:Value><![CDATA[Operación sujeta a detracción]]></cbc:Value>
|
||||
</sac:AdditionalProperty>
|
||||
</sac:AdditionalInformation>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>F011-00002786</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-30</cbc:IssueDate>
|
||||
<cbc:InvoiceTypeCode listAgencyName="PE:SUNAT" listID="1001" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000"><![CDATA[OCHOCIENTOS SETENTA Y 74/100 SOLES]]></cbc:Note>
|
||||
<cbc:Note languageLocaleID="2006"><![CDATA[Operación sujeta a detracción]]></cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listAgencyName="United Nations Economic Commission for Europe" listID="ISO 4217 Alpha" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:DespatchDocumentReference>
|
||||
<cbc:ID>-00000000</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">09</cbc:DocumentTypeCode>
|
||||
</cac:DespatchDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>SF011-00002786</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20100811571</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[SUNAT]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>SF011-00002786</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100811571</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[TREFILADOS EL SALVADOR SRL]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[TREFILADOS EL SALVADOR SRL]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID>150115</cbc:ID>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0000</cbc:AddressTypeCode>
|
||||
<cbc:StreetName><![CDATA[AV. PABLO PATRON 211-223 URB.SAN PABLO]]></cbc:StreetName>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>LA VICTORIA</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. PABLO PATRON 211-223 URB.SAN PABLO]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listAgencyName="United Nations Economic Commission for Europe" listID="ISO 3166-1" listName="Country">PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>VILLA MARIA DEL TRIUNFO</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. 26 DE NOVIEMBRE NRO. 2473 A.H. VIRGEN DE LOURDES (PARADERO 14 NUEVA ESPERANZA - PISO 2)]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listAgencyName="United Nations Economic Commission for Europe" listID="ISO 3166-1" listName="Country">PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansCode>001</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>00063008982</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansID schemeAgencyName="PE:SUNAT" schemeName="Codigo de detraccion" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo54">027</cbc:PaymentMeansID>
|
||||
<cbc:PaymentPercent>4.0</cbc:PaymentPercent>
|
||||
<cbc:Amount currencyID="PEN">34.83</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">870.74</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">870.74</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-14</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">132.82</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">737.92</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">132.82</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">737.92</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="PEN">737.92</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">870.74</cbc:TaxInclusiveAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">870.74</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">737.92</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">870.7400000000</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryLocation>
|
||||
<cac:Address>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150142</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[MZ. G LTE 8,9 Z.I. PARQUE INDUSTRIAL]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:Address>
|
||||
</cac:DeliveryLocation>
|
||||
<cac:Despatch>
|
||||
<cbc:Instructions><![CDATA[650 BLS CEMENTO SOL TIPO I X S/1.3396]]></cbc:Instructions>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. ATOCONGO N° 1860]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
</cac:Despatch>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">870.74</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>02</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">870.74</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>03</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">870.74</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
</cac:TransportEquipment>
|
||||
<cac:MeasurementDimension>
|
||||
<cbc:AttributeID>01</cbc:AttributeID>
|
||||
<cbc:Measure unitCode="TNE">870.74</cbc:Measure>
|
||||
</cac:MeasurementDimension>
|
||||
</cac:TransportHandlingUnit>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:SizeTypeCode listAgencyName="PE:MTC" listName="Configuracion Vehicular"><![CDATA[T3 S3]]></cbc:SizeTypeCode>
|
||||
<cbc:ReturnabilityIndicator>false</cbc:ReturnabilityIndicator>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:Amount currencyID="PEN">102.27</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
</cac:Delivery>
|
||||
</cac:TransportEquipment>
|
||||
<cac:MeasurementDimension>
|
||||
<cbc:AttributeID>02</cbc:AttributeID>
|
||||
<cbc:Measure unitCode="TNE">27.63</cbc:Measure>
|
||||
</cac:MeasurementDimension>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
</cac:Delivery>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">132.82</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">737.92</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">132.82</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00000</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode>10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[SERVICIO DE TRANSPORTE]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>SER02</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:AdditionalItemProperty>
|
||||
<cbc:Name>CodigoUnidad</cbc:Name>
|
||||
<cbc:Value>UNIDAD</cbc:Value>
|
||||
</cac:AdditionalItemProperty>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">737.9152540000</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?><DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="SignSUNAT" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>J3fFwys+URZdbF0QevDNGBPJe5E=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>jaTUTseluikf9R3QQRSjdKYvNMa67tuh+heIBuozY2mQicAIhbFEnST+EG9CpsqzGuW3vy58JGaO
|
||||
/MDvBTnF6wBJLftnGRUdC1YL/XVEx2XU5Z6V0xpG78E2fqwR7Wn89/8Nizoiyd4DiFlhPMTXoTBd
|
||||
VXV9tIxl58CMS0QnzNOP+bHB6dvLhAxhWUYx6iknqWTxrudp1QiVv+npUdxIIRxH8+nSEfXsnJvJ
|
||||
908fQ9Wuub0hBX/3Bh6S5LIBuZd4Ty1bsSvihR3MJrR+sVC03t2X3zhBmEPXGc1NpeAQkKhwe9/+
|
||||
o9vvRFUHQiMlFGbA+TrIAxWRCz1ebhSl+P0GaA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509SubjectName>C=PE,L=LIMA,O=TREFILADOS EL SALVADOR S R L,OU=Validado por Llama.pe ER,OU=FACTURA ELECTRONICA RUC 20100811571,CN=SOFTWARE DE FACTURACION ELECTRONICA,1.2.840.113549.1.9.1=#161b636f6e746162696c6964616440747265666973612e636f6d2e7065,STREET=AV. PABLO PATRON NRO. 211 URB. SAN PABLO</ds:X509SubjectName><ds:X509Certificate>MIIFgzCCBGugAwIBAgIIWD+k8QQbj9IwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEu
|
||||
cGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcN
|
||||
MjUxMTE5MTk1NTI2WhcNMjcxMTE5MTk1NTAwWjCCASExMTAvBgNVBAkMKEFWLiBQQUJMTyBQQVRS
|
||||
T04gTlJPLiAyMTEgVVJCLiBTQU4gUEFCTE8xKjAoBgkqhkiG9w0BCQEWG2NvbnRhYmlsaWRhZEB0
|
||||
cmVmaXNhLmNvbS5wZTEsMCoGA1UEAwwjU09GVFdBUkUgREUgRkFDVFVSQUNJT04gRUxFQ1RST05J
|
||||
Q0ExLDAqBgNVBAsMI0ZBQ1RVUkEgRUxFQ1RST05JQ0EgUlVDIDIwMTAwODExNTcxMSEwHwYDVQQL
|
||||
DBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxJTAjBgNVBAoMHFRSRUZJTEFET1MgRUwgU0FMVkFE
|
||||
T1IgUyBSIEwxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOC
|
||||
AQ8AMIIBCgKCAQEAyYlT09RvuC+D9hLK0LGN9iOOC72e3Q5UqAPUQDCB+X58MOjuaHsTGyOZ1s9h
|
||||
1jp9Wi2oigztr6YgChuWE7aVyHeMre2uI5t2rug2kuCwAnYQOrFtMZXkWZm1FOvL55mMGdMzryx2
|
||||
E7/NDE1AvIfybsfx1JqH0HwnbHdb3usP67mhElFzgBwljwpfO9y3TmkrID5/o/DRXxlyLm2Up5AL
|
||||
9cTdzDRngGV3eqeDFmrsLz1Ii2TBfDKJSpLKbMAZ0QE3mkfFolAaq/7s0+lLA1jvdw+be+3MF9sr
|
||||
WQexVMlWZ0GUdduJk0+b8/ye85JEjQz/aVn+vQzx7MHXqPlCELDUCQIDAQABo4IBljCCAZIwDAYD
|
||||
VR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRb
|
||||
MFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2Vy
|
||||
MCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAmBgNVHREEHzAdgRtjb250YWJpbGlk
|
||||
YWRAdHJlZmlzYS5jb20ucGUwRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUH
|
||||
AgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsG
|
||||
AQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5k
|
||||
YXJkY2EuY3JsMB0GA1UdDgQWBBSJOvNq/vY9qi0s/jya/Pg3HEoWQDAOBgNVHQ8BAf8EBAMCBsAw
|
||||
DQYJKoZIhvcNAQELBQADggEBAFv2Zeg2ylvyA7dO4hPIJ3e/WSQyqmf1BQUC2YOq4bwIF7z4qU4y
|
||||
qlecjLsRI5NpDAdZHp6YNLRMOr6FxocKqm665RKjk7XTEY9DDW2sWdOhybreY+ikm6/LH3O3whMI
|
||||
uONPgQQmHKUaEZ85oWKlPBCjjDSLwGxb5hyHYfgAh2whOFMBprc0y53DkkYMd7N6FFs+Zgirq91I
|
||||
WxoW1vOkFTqc4RyFQ/KBJqwjsRYZ39g2LFJO4MByYWzjZn3TcJOj8BQAYrC2UzHKSl1BZuDW7r4i
|
||||
+6r92zt5UrhxRE45isPgZuDkryZtRshSE5+i1KoK76IRg9LiCxh7xme7vfwjqdM=</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>V002-00004575</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-30</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:21:18</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note>CONFIGURACION VEHICULAR T3 S3</cbc:Note>
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-00129813</cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guia de Remision Remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>SV002-00004575</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20100811571</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[SUNAT]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>SignSUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100811571</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[TREFILADOS EL SALVADOR SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100811571</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[TREFILADOS EL SALVADOR SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<cac:OriginatorCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA. S. A. C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:OriginatorCustomerParty>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<cbc:GrossWeightMeasure unitCode="KGM">27625.00</cbc:GrossWeightMeasure>
|
||||
<cbc:SpecialInstructions>SUNAT_Envio_IndicadorPagadorFlete_Remitente</cbc:SpecialInstructions>
|
||||
<cac:ShipmentStage>
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-30</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
<cac:CarrierParty>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:CompanyID>151263CNG</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:CarrierParty>
|
||||
<cac:DriverPerson>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="1" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">09722754</cbc:ID>
|
||||
<cbc:FirstName>EMILIANO</cbc:FirstName>
|
||||
<cbc:FamilyName>CERVANTES TINOCO</cbc:FamilyName>
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<cbc:ID>Q09722754</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150142</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[PQ. IND. MZ. G LTE 8,9 (LIMA-LIMA-VILLA EL SALVADOR)]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. ATOCONGO N° 1860 (LIMA-LIMA-VILLA MARIA DEL TRIUNFO)]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA. S. A. C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:ID>B7C885</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>15M22019210E</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
<cac:ShipmentDocumentReference>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="06" schemeName="Entidad Autorizadora">151263CNG</cbc:ID>
|
||||
</cac:ShipmentDocumentReference>
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<cac:DespatchLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">650</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[$it.Descripcion]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>CEM01</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:AdditionalItemProperty>
|
||||
<cbc:Name>Indicador de bien normalizado</cbc:Name>
|
||||
<cbc:NameCode listAgencyName="PE:SUNAT" listName="Propiedad del item" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo55">7022</cbc:NameCode>
|
||||
<cbc:Value>0</cbc:Value>
|
||||
</cac:AdditionalItemProperty>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,29 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20100811571",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": "30/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "T001",
|
||||
"numero": "129813",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": "870.74",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": "4.0",
|
||||
"monto_detraccion": "34.83",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "Medida SERVICIO DE TRANSPORTE NIU S/",
|
||||
"cantidad": "870.74",
|
||||
"precio_unitario": "870.74",
|
||||
"total_linea": "737.92",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/006_correo/20100811571-01-T001-129813.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,90 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20100811571",
|
||||
"razon_social_emisor": "TREFILADOS EL SALVADOR SRL",
|
||||
"fecha_emision": "2026-05-30",
|
||||
"tipo": "01",
|
||||
"serie": "F011",
|
||||
"numero": "2786",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 870.74,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 34.83,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO DE TRANSPORTE",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 870.74,
|
||||
"total_linea": 737.92,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/006_correo/20100811571-01-F011-2786.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20100811571",
|
||||
"razon_social_emisor": "TREFILADOS EL SALVADOR SRL",
|
||||
"fecha_emision": "2026-05-30",
|
||||
"tipo": "31",
|
||||
"serie": "V002",
|
||||
"numero": "4575",
|
||||
"ruc_receptor": "20100811571",
|
||||
"razon_social_receptor": "TREFILADOS EL SALVADOR SRL",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129813"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO N° 1860 (LIMA-LIMA-VILLA MARIA DEL TRIUNFO)",
|
||||
"punto_llegada": "PQ. IND. MZ. G LTE 8,9 (LIMA-LIMA-VILLA EL SALVADOR)",
|
||||
"peso_bruto": "27625.00",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-30",
|
||||
"vehiculo_principal": "B7C885",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q09722754",
|
||||
"nombre_conductor": "EMILIANO",
|
||||
"documento_conductor": "09722754",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "$it.Descripcion",
|
||||
"cantidad": 650.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/006_correo/20100811571-31-V002-4575.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<DespatchAdvice xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2">
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="NubeFacTSign">
|
||||
<ds:SignedInfo>
|
||||
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<ds:Reference URI="">
|
||||
<ds:Transforms>
|
||||
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
</ds:Transforms>
|
||||
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<ds:DigestValue>pGFus9mok5BsHOvwP9jXVzznwtgwSX8F9LIyJYnikxk=</ds:DigestValue>
|
||||
</ds:Reference>
|
||||
</ds:SignedInfo>
|
||||
<ds:SignatureValue>jJovOUNvc7dTBurWODbsH4GaeGH3N7bFZkPjfHCS3BSNiQH4YR6ykNGLAzZY8M2SgP+y/RNHrUI3ZMfo+WQ6dXjXJYiC95lnYY3zf+KKT9XI/nsPztOUCtm8yyCO5W2zuZQkh9WQRJCg0G8TKwd7mf/gZ5xWurVWSzlMo9tyz+gRIyFsnt+nvSJ0Lx8d0VduUrNVsUBG31ruSdAavU0Dm5r86njdnlPLVnXVy42FMjlCAmgNEedtkFBQ0+ipCfTuCis8gUv5XI6GPBrCuwR3c1nO9Bmh+zVuijc4J1R6jLuPvRT96iMykyB1UXatK0isFcHG209moHUlpfn+C0OEoQ==</ds:SignatureValue>
|
||||
<ds:KeyInfo>
|
||||
<ds:X509Data>
|
||||
<ds:X509SubjectName>street=CAL. LIBERTAD NRO. 176 INT. 211,emailAddress=sistemas@nubefact.com,CN=NUBEFACT WEB,OU=20600695771,OU=Validado por Llama.pe ER,O=NUBEFACT S.A.,L=LIMA,C=PE</ds:X509SubjectName>
|
||||
<ds:X509Certificate>MIIFLzCCBBegAwIBAgIIeqYdzau699YwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMzA1MTgzODI1WhcNMjkwMzA0MTgzODAwWjCB1DEoMCYGA1UECQwfQ0FMLiBMSUJFUlRBRCBOUk8uIDE3NiBJTlQuIDIxMTEkMCIGCSqGSIb3DQEJARYVc2lzdGVtYXNAbnViZWZhY3QuY29tMRUwEwYDVQQDDAxOVUJFRkFDVCBXRUIxFDASBgNVBAsMCzIwNjAwNjk1NzcxMSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxFjAUBgNVBAoMDU5VQkVGQUNUIFMuQS4xDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PnivJidKntheakfk5pA2SOXyG66a1FQtSW1BtXMpN2C953XT9iJLbR9kD/2hUsTs08drxdkSeKJwyMvUL41VpGX54PkSBXg1nqwbNN9dwj+zSd1PsFcmLtpEizyU4r6B8PSo07cdAzisAhnt3F1X/LcpcuJcUT3x88RJt18vSbh903Ihvp6BV7BCkJk/MJSRKeJnVMYJPtrgLvTxH03DUs6mIozR673WmYZAdzXPo1Kv0JpfrP/XTcaZECe2VQ+l7OEQS/s2bSjL7K8VgvTW+PtkCGZu9q6UUYsr3F1UL7TVad9zEFgL7rMQvELT7r+YWCP4AwVfTrXvqAoMednKQIDAQABo4IBkDCCAYwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAgBgNVHREEGTAXgRVzaXN0ZW1hc0BudWJlZmFjdC5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBSZK2idJe/W7w+eTwXNhJ/o8XK6pjAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAIEF6UtQGQ+yLKVVRCdiogInGUGv7IECqg9gMQNZBZ2ZP9SgQOOTFIsDI0psbS3D6u/wJ2vgf78a287ysqJUcGqhW1+plQh4toN3v8bCqwXACTIYW6bUU5bOab0QY//xrLkNZ8Iwa/M/LZstU3dgZjIwXtcMD+ANAIynN4rcNNgeVja8lnbYU3WQ1u9UIjMxtSp1rLf4mwTGSeLI1uuAWgWczkMaFjMF1RJhX9VlKX8qDC+pr/jiu8LTHt8VDeVvDwpZ4qVbI/8qq+VUyXjBffcDdeY5qb75nnlhEMHLey3t/GcEo80nmtjTKmBdroVkooIat7PcSvfQQ+kzrSnV2as=</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</ds:Signature>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>VPP1-516</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-29</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:28:14</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode>31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note>Obs: MARCA VEHICULO: VOLVO N CONF.VEHICULAR: T2 S2</cbc:Note>
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-129749</cbc:ID>
|
||||
<cbc:DocumentTypeCode>09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de Remisión Remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
<cbc:Note>WWW.NUBEFACT.COM</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>ZAPATA ARAPA EUSEBIO</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>10091153136</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:DespatchSupplierParty>
|
||||
<cbc:CustomerAssignedAccountID schemeID="6">10091153136</cbc:CustomerAssignedAccountID>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ZAPATA ARAPA EUSEBIO</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ZAPATA ARAPA EUSEBIO</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<cbc:GrossWeightMeasure unitCode="TNE">22.1</cbc:GrossWeightMeasure>
|
||||
<cac:ShipmentStage>
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-29</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
<cac:CarrierParty>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:CompanyID>1516491CNG</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:CarrierParty>
|
||||
<cac:TransportMeans>
|
||||
<cac:RoadTransport>
|
||||
<cbc:LicensePlateID>ABB758</cbc:LicensePlateID>
|
||||
</cac:RoadTransport>
|
||||
</cac:TransportMeans>
|
||||
<cac:DriverPerson>
|
||||
<cbc:ID schemeID="1">42327525</cbc:ID>
|
||||
<cbc:FirstName>LUIS AUGUSTO</cbc:FirstName>
|
||||
<cbc:FamilyName>YARANGA MARTINEZ</cbc:FamilyName>
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<cbc:ID>Q42327525</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150142</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:ID>ABB758</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151601857</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
<cac:AttachedTransportEquipment>
|
||||
<cbc:ID>A6T980</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151834688</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
</cac:AttachedTransportEquipment>
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cac:DespatchLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">520.0</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>2</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description>CEMENTO SOL 42.50KG</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>CEM01</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,49 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10091153136",
|
||||
"razon_social_emisor": "ZAPATA ARAPA EUSEBIO",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "31",
|
||||
"serie": "VPP1",
|
||||
"numero": "516",
|
||||
"ruc_receptor": "10091153136",
|
||||
"razon_social_receptor": "ZAPATA ARAPA EUSEBIO",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129749"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO",
|
||||
"punto_llegada": "PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA",
|
||||
"peso_bruto": "22.1",
|
||||
"unidad_peso_bruto": "TNE",
|
||||
"fecha_traslado": "2026-05-29",
|
||||
"vehiculo_principal": "ABB758",
|
||||
"vehiculo_secundario": "A6T980",
|
||||
"licencia_conductor": "Q42327525",
|
||||
"nombre_conductor": "LUIS AUGUSTO",
|
||||
"documento_conductor": "42327525",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO SOL 42.50KG",
|
||||
"cantidad": 520.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/007_correo/10091153136-31-VPP1-516.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><Signature Id="SignatureSP" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>6NbSu0QEYb5HGQuf2o/fytmMu+4=</DigestValue></Reference></SignedInfo><SignatureValue>TtpCyWi8axTzZ1OX/x50gQmukTLf9RHEbkAD2f/RoraA4QzJU/LzVHt14Ld1wJaSRpPPrniWaIqz6NOn0PvBWDwJtpNSV01DiO1n9GiJa55jKlZG4DijFie+gbQcrkVepFcbGEb+sC1dqm+Z6Ag7bdXrt0V1PbQ8OTmghh0bKvi3g5rK6Zs+chENStqEzKLJ9lynMpLrFFBEl/2wH4pBCd2cxwphViBH7Vqq6on5k6HvQ0FzqhTjnXKVkdNTfjh3p6hZp4PDuaOmxNYJYtb18cyoWJlJJIboB22ur4ImZ65SLP4iIBdHmTru8HoI3Z0H9Huxel/veW2rnb2OepLywQ==</SignatureValue><KeyInfo><X509Data><X509SubjectName>C=PE, L=LIMA, O=DISTRIBUIDORA SANTA PATRICIA S R L, OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20154645005, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=dis_patricia@yahoo.com, STREET=AV. TOMAS MARSANO NRO. 4330 URB. LA VIRREYNA</X509SubjectName><X509Certificate>MIIFgzCCBGugAwIBAgIIGTcLfd6CAQswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDE0MTgzNDIxWhcNMjYxMDE0MTgzNDAwWjCCASYxNTAzBgNVBAkMLEFWLiBUT01BUyBNQVJTQU5PIE5STy4gNDMzMCBVUkIuIExBIFZJUlJFWU5BMSUwIwYJKoZIhvcNAQkBFhZkaXNfcGF0cmljaWFAeWFob28uY29tMSwwKgYDVQQDDCNTT0ZUV0FSRSBERSBGQUNUVVJBQ0lPTiBFTEVDVFJPTklDQTEsMCoGA1UECwwjRkFDVFVSQSBFTEVDVFJPTklDQSBSVUMgMjAxNTQ2NDUwMDUxITAfBgNVBAsMGFZhbGlkYWRvIHBvciBMbGFtYS5wZSBFUjErMCkGA1UECgwiRElTVFJJQlVJRE9SQSBTQU5UQSBQQVRSSUNJQSBTIFIgTDENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmsa8aNxkqzWWk19zfoD/cIhArrgjNFx0TeKtdN+/m+6y8ucQDeqbjtnTHEcLjyeGiWNzowP+VLI9EJFOhsQBHjDMUxF33BYdRQw4Ii5u72voovryE8EAIsuHUkrGwnI4q+ZYq3s/MF/dDNr1Fq5gQYcWju0Qcw5uR18+LDZPxc7IDwWEA9UY0Qe4G49GJWLIcoOEf2wpzQ1+YolBS8PNny9H4a9LjG3+XkCdkVL676PjEykMF/aMEQkSNPkkjiHzl+ftiQXuzAMT/1IxvCwfjwzXHqmHM91jeLk5POw0PkqxfFAvYIBzodXMNygBihmkpAeuXgBpH4qo1unqfdETDAgMBAAGjggGRMIIBjTAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCEGA1UdEQQaMBiBFmRpc19wYXRyaWNpYUB5YWhvby5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBS5UPPPJNJvf5jr4HwdRfcu37ZOWTAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAGXcN3ocVIpJ/GKOQwlnK3vF49BDGRbXmhrB8wg/VekOUQI6Z4AUMlAcLzi+K2rKJLwbf0bw0psOdLT6Gu2X1DP4bxPaVAqePxjY0t4H2QBmm5MZ8jxJIFgYzf53Bhgu7slJk2bRPsGt8ujAX4EjqyjfhVOnzzLk2QOH/beZK+GsaXduRxvnfBDbknYysdFTDq8J1Hn0lWHjYFhb76doEputR9KYkrTHmqFFyeOyJF2+waJkfDPuVVjWTmYlLLZCzKFKxrjWF/paNE2cJm28QcoVUxBi8o4lq9BHhkBnO54tLZRtnptbMnUkAsmXZg8SmoPpaWzAkCISrGAoTIAXm2M=</X509Certificate></X509Data></KeyInfo></Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>F002-00052385</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-27</cbc:IssueDate>
|
||||
<cbc:IssueTime>13:47:01</cbc:IssueTime>
|
||||
<cbc:InvoiceTypeCode listID="0101" listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000">QUINIENTOS NUEVE Y 05/100</cbc:Note>
|
||||
<cbc:Note languageLocaleID="2006">OPERACION SUJETA A DETRACCION</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:Signature>
|
||||
<cbc:ID>20154645005</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20154645005</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>DISTRIBUIDORA SANTA PATRICIA S R L</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SignatureKG</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20154645005</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>DISTRIBUIDORA SANTA PATRICIA S R L</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>DISTRIBUIDORA SANTA PATRICIA S R L</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:AddressTypeCode>0000</cbc:AddressTypeCode>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>SANTIAGO DE SURCO</cbc:District>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode listAgencyName="PE:SUNAT" listName="Medio de pago" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo59">001</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>00000-451754</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID schemeName="Codigo de detraccion" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:g em:catalogos:catalogo54">027</cbc:ID>
|
||||
<cbc:PaymentPercent>4</cbc:PaymentPercent>
|
||||
<cbc:Amount currencyID="PEN">20</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">489.05</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">489.05</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-06</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">77.65</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">431.40</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">77.65</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UN/ECE 5305" schemeName="Tax Category Identifier" schemeAgencyName="United Nations Economic Commission for Europe">S</cbc:ID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">431.4</cbc:LineExtensionAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">509.05</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="PEN">0</cbc:AllowanceTotalAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">509.05</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">431.40</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">509.050000</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">77.65</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">431.40</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">77.65</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeID="UN/ECE 5305" schemeName="Tax Category Identifier" schemeAgencyName="United Nations Economic Commission for Europe">S</cbc:ID>
|
||||
<cbc:Percent>18</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode listAgencyName="PE:SUNAT" listName="Afectacion del IGV" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo07">10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="UN/ECE 5153" schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description>SERVICIO DE TRANSPORTE</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>SE000001</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:CommodityClassification>
|
||||
<cbc:ItemClassificationCode listID="UNSPSC" listAgencyName="GS1 US" listName="Item Classification">80141623</cbc:ItemClassificationCode>
|
||||
</cac:CommodityClassification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">431.398305</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<DespatchAdvice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><Signature Id="SignatureSP" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>J59YkgHRtOUOgTDb+AsI0L9wUwo=</DigestValue></Reference></SignedInfo><SignatureValue>E9cCCqtUJWIhTHxgOmfjBVVrTj0vvKDOzSnYz+RQPgbQokF95kUVYv/I10d0y5MsgFQy+ivoNd4ULp5B0kI1CsEXRFlxb5ZPhur2LXpbnMzynmccOfmIbpp7ke5OE+5DNeeC/B6fCpoPp3sjBsD9WYDY2JktLcrIpXiRNeQycH3SIkOxsMSnQCfmqH7pn30kqO8nlJEcb0r0bCu8c/AvexYXW0iEWeKPgpkPyVlHjHGE01hVBhGy09oFspYepeu7T2rQEfGXsyYfJxNHzjdUvLmZJBkV5GZcMfAJ4DCXv1jazNydCDQbH4UnnAmQN3mgz0rO3HJDasKD5OQayPZ4cw==</SignatureValue><KeyInfo><X509Data><X509SubjectName>C=PE, L=LIMA, O=DISTRIBUIDORA SANTA PATRICIA S R L, OU=Validado por Llama.pe ER, OU=FACTURA ELECTRONICA RUC 20154645005, CN=SOFTWARE DE FACTURACION ELECTRONICA, E=dis_patricia@yahoo.com, STREET=AV. TOMAS MARSANO NRO. 4330 URB. LA VIRREYNA</X509SubjectName><X509Certificate>MIIFgzCCBGugAwIBAgIIGTcLfd6CAQswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQxMDE0MTgzNDIxWhcNMjYxMDE0MTgzNDAwWjCCASYxNTAzBgNVBAkMLEFWLiBUT01BUyBNQVJTQU5PIE5STy4gNDMzMCBVUkIuIExBIFZJUlJFWU5BMSUwIwYJKoZIhvcNAQkBFhZkaXNfcGF0cmljaWFAeWFob28uY29tMSwwKgYDVQQDDCNTT0ZUV0FSRSBERSBGQUNUVVJBQ0lPTiBFTEVDVFJPTklDQTEsMCoGA1UECwwjRkFDVFVSQSBFTEVDVFJPTklDQSBSVUMgMjAxNTQ2NDUwMDUxITAfBgNVBAsMGFZhbGlkYWRvIHBvciBMbGFtYS5wZSBFUjErMCkGA1UECgwiRElTVFJJQlVJRE9SQSBTQU5UQSBQQVRSSUNJQSBTIFIgTDENMAsGA1UEBwwETElNQTELMAkGA1UEBhMCUEUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmsa8aNxkqzWWk19zfoD/cIhArrgjNFx0TeKtdN+/m+6y8ucQDeqbjtnTHEcLjyeGiWNzowP+VLI9EJFOhsQBHjDMUxF33BYdRQw4Ii5u72voovryE8EAIsuHUkrGwnI4q+ZYq3s/MF/dDNr1Fq5gQYcWju0Qcw5uR18+LDZPxc7IDwWEA9UY0Qe4G49GJWLIcoOEf2wpzQ1+YolBS8PNny9H4a9LjG3+XkCdkVL676PjEykMF/aMEQkSNPkkjiHzl+ftiQXuzAMT/1IxvCwfjwzXHqmHM91jeLk5POw0PkqxfFAvYIBzodXMNygBihmkpAeuXgBpH4qo1unqfdETDAgMBAAGjggGRMIIBjTAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFF2IW63rZfv+aKLk2W89V3Ki7yuZMGcGCCsGAQUFBwEBBFswWTA1BggrBgEFBQcwAoYpaHR0cDovL2NydC5sbGFtYS5wZS9sbGFtYXBlc3RhbmRhcmRjYS5jZXIwIAYIKwYBBQUHMAGGFGh0dHA6Ly9vY3NwLmxsYW1hLnBlMCEGA1UdEQQaMBiBFmRpc19wYXRyaWNpYUB5YWhvby5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBS5UPPPJNJvf5jr4HwdRfcu37ZOWTAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAGXcN3ocVIpJ/GKOQwlnK3vF49BDGRbXmhrB8wg/VekOUQI6Z4AUMlAcLzi+K2rKJLwbf0bw0psOdLT6Gu2X1DP4bxPaVAqePxjY0t4H2QBmm5MZ8jxJIFgYzf53Bhgu7slJk2bRPsGt8ujAX4EjqyjfhVOnzzLk2QOH/beZK+GsaXduRxvnfBDbknYysdFTDq8J1Hn0lWHjYFhb76doEputR9KYkrTHmqFFyeOyJF2+waJkfDPuVVjWTmYlLLZCzKFKxrjWF/paNE2cJm28QcoVUxBi8o4lq9BHhkBnO54tLZRtnptbMnUkAsmXZg8SmoPpaWzAkCISrGAoTIAXm2M=</X509Certificate></X509Data></KeyInfo></Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>V001-00004156</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-25</cbc:IssueDate>
|
||||
<cbc:IssueTime>00:00:00</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note>SEGÚN: GR T001-0129437, CODIGO DE INSCRIPCION : 151903049</cbc:Note>
|
||||
<cac:Signature>
|
||||
<cbc:ID>20154645005</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20154645005</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>DISTRIBUIDORA SANTA PATRICIA S R L</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SignatureKG</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:DespatchSupplierParty>
|
||||
<cbc:CustomerAssignedAccountID schemeID="6">20154645005</cbc:CustomerAssignedAccountID>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20154645005</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>DISTRIBUIDORA SANTA PATRICIA SRL</cbc:RegistrationName>
|
||||
<cbc:CompanyID>1525019CNG</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cbc:CustomerAssignedAccountID schemeID="6">20154645005</cbc:CustomerAssignedAccountID>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20154645005</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>DISTRIBUIDORA SANTA PATRICIA S R L</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<cbc:GrossWeightMeasure unitCode="KGM">16150</cbc:GrossWeightMeasure>
|
||||
<cbc:SpecialInstructions>SUNAT_Envio_IndicadorPagadorFlete_Remitente</cbc:SpecialInstructions>
|
||||
<cac:ShipmentStage>
|
||||
<cac:CarrierParty>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:CompanyID>1525019CNG</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:CarrierParty>
|
||||
</cac:ShipmentStage>
|
||||
<cac:ShipmentStage>
|
||||
<cac:DriverPerson>
|
||||
<cbc:ID schemeID="1" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">42833005</cbc:ID>
|
||||
<cbc:FirstName>RUBEN</cbc:FirstName>
|
||||
<cbc:FamilyName>PEREZ HUACHO</cbc:FamilyName>
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<cbc:ID>Q42833005</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
</cac:ShipmentStage>
|
||||
<cac:ShipmentStage>
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-25</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryAddress>
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI">150140</cbc:ID>
|
||||
<cbc:StreetName>JR. LOMA DE LOS PENSAMIENTOS MZ. W4 LT. 7 URB. PROL. BENAVIDES</cbc:StreetName>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>JR. LOMA DE LOS PENSAMIENTOS MZ. W4 LT. 7 URB. PROL. BENAVIDES</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI">150143</cbc:ID>
|
||||
<cbc:StreetName>AV. ATOCONGO 1860</cbc:StreetName>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. ATOCONGO 1860</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:ID>A1Y872</cbc:ID>
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<cac:DespatchLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:DeliveredQuantity unitCode="BG" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">380</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description>CEMENTO APU</cbc:Description>
|
||||
<cbc:Name>CEMENTO APU</cbc:Name>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>CE000002</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
<cac:CommodityClassification>
|
||||
<cbc:ItemClassificationCode listID="UNSPSC" listAgencyName="GS1 US" listName="Item Classification">30111601</cbc:ItemClassificationCode>
|
||||
</cac:CommodityClassification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,57 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20154645005",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C. MONEDA: SOLES",
|
||||
"fecha_emision": "27/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "52385",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C. MONEDA: SOLES",
|
||||
"total_factura": "20.00",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": "27.00",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO DE TRANSPORTE UND SERVICIO DE TRANSPORTE 380 BL CEMENTO S/ 1.3396 P. PARTIDA : AV. ATOCONGO 1860 LIMA-LIMA-VILLA MARIA DEL TRIUNFO P. LLEGADA : JR.LOMA DE LOS PENSAMIENTOS MZ.W4 LT.7 URB. PROLONG. BENAVIDES -LIMA-LIMA SEGÚN GRR : T001-0129437 SEGÚN GRT : V001-00004156 VALOR REFERENCIAL : S/ 509.05 CONFIG. VEHICULAR : C3 CARGA TM. : 16.150 NO REGISTRO M.T.C. : 1525019 CNG NRO. DE PLACA : A1Y-872",
|
||||
"cantidad": "1.0000",
|
||||
"precio_unitario": "0.00",
|
||||
"total_linea": "509.05",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129437"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "4156"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/008_correo/20154645005-01-F002-52385.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20154645005",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": "05/33/2026",
|
||||
"tipo": "31",
|
||||
"serie": "2605",
|
||||
"numero": "33",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/008_correo/20154645005-31-2605-33.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,94 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20154645005",
|
||||
"razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA S R L",
|
||||
"fecha_emision": "2026-05-27",
|
||||
"tipo": "01",
|
||||
"serie": "F002",
|
||||
"numero": "52385",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 509.05,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO DE TRANSPORTE",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 509.05,
|
||||
"total_linea": 431.4,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129437"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "4156"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/008_correo/20154645005-01-F002-52385.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20154645005",
|
||||
"razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA SRL",
|
||||
"fecha_emision": "2026-05-25",
|
||||
"tipo": "31",
|
||||
"serie": "V001",
|
||||
"numero": "4156",
|
||||
"ruc_receptor": "20154645005",
|
||||
"razon_social_receptor": "DISTRIBUIDORA SANTA PATRICIA S R L",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860",
|
||||
"punto_llegada": "JR. LOMA DE LOS PENSAMIENTOS MZ. W4 LT. 7 URB. PROL. BENAVIDES",
|
||||
"peso_bruto": "16150",
|
||||
"unidad_peso_bruto": "KGM",
|
||||
"fecha_traslado": "2026-05-25",
|
||||
"vehiculo_principal": "A1Y872",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q42833005",
|
||||
"nombre_conductor": "RUBEN",
|
||||
"documento_conductor": "42833005",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO APU",
|
||||
"cantidad": 380.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/008_correo/20154645005-31-V001-4156.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="NubeFacTSign">
|
||||
<ds:SignedInfo>
|
||||
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<ds:Reference URI="">
|
||||
<ds:Transforms>
|
||||
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
</ds:Transforms>
|
||||
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<ds:DigestValue>G7SzTRDnTkSZdOyu+9zgFKHwWnx55GfjPVWrIV1uLx4=</ds:DigestValue>
|
||||
</ds:Reference>
|
||||
</ds:SignedInfo>
|
||||
<ds:SignatureValue>AjOMqnf60Ht+zfmOSy8RcWl2nzXAFSwAiLXKQ6UwumxeXiIuD0oBhRNTPv5AGXHUELJsFAozlPNQOm/NNMvALdTa0JG3OCJuhCD8Bj4CanCfgF4ucl5QbwjZaZDSqeKCseE9iHcOdi/oOSdeI2r6d3OaO1wu4tRNM+DeagQep3RscEHNsLIY5TtXcfHXYXTDmEYywfR6sBWlHGLc+OnzbCrgB3/oa6ZbWUmdMDaRcfa82efT1GFpRJ+x6naq/7WxfheGnyLx/jv1NUx5gleaBKboT2eFTb/bsedGWFhnRFO0IySk0VbsdZlSB0BkCbuADDA7gJ7KpRSSxOk/36YSnA==</ds:SignatureValue>
|
||||
<ds:KeyInfo>
|
||||
<ds:X509Data>
|
||||
<ds:X509SubjectName>street=CAL. LIBERTAD NRO. 176 INT. 211,emailAddress=sistemas@nubefact.com,CN=NUBEFACT WEB,OU=20600695771,OU=Validado por Llama.pe ER,O=NUBEFACT S.A.,L=LIMA,C=PE</ds:X509SubjectName>
|
||||
<ds:X509Certificate>MIIFLzCCBBegAwIBAgIIeqYdzau699YwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMzA1MTgzODI1WhcNMjkwMzA0MTgzODAwWjCB1DEoMCYGA1UECQwfQ0FMLiBMSUJFUlRBRCBOUk8uIDE3NiBJTlQuIDIxMTEkMCIGCSqGSIb3DQEJARYVc2lzdGVtYXNAbnViZWZhY3QuY29tMRUwEwYDVQQDDAxOVUJFRkFDVCBXRUIxFDASBgNVBAsMCzIwNjAwNjk1NzcxMSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxFjAUBgNVBAoMDU5VQkVGQUNUIFMuQS4xDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PnivJidKntheakfk5pA2SOXyG66a1FQtSW1BtXMpN2C953XT9iJLbR9kD/2hUsTs08drxdkSeKJwyMvUL41VpGX54PkSBXg1nqwbNN9dwj+zSd1PsFcmLtpEizyU4r6B8PSo07cdAzisAhnt3F1X/LcpcuJcUT3x88RJt18vSbh903Ihvp6BV7BCkJk/MJSRKeJnVMYJPtrgLvTxH03DUs6mIozR673WmYZAdzXPo1Kv0JpfrP/XTcaZECe2VQ+l7OEQS/s2bSjL7K8VgvTW+PtkCGZu9q6UUYsr3F1UL7TVad9zEFgL7rMQvELT7r+YWCP4AwVfTrXvqAoMednKQIDAQABo4IBkDCCAYwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAgBgNVHREEGTAXgRVzaXN0ZW1hc0BudWJlZmFjdC5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBSZK2idJe/W7w+eTwXNhJ/o8XK6pjAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAIEF6UtQGQ+yLKVVRCdiogInGUGv7IECqg9gMQNZBZ2ZP9SgQOOTFIsDI0psbS3D6u/wJ2vgf78a287ysqJUcGqhW1+plQh4toN3v8bCqwXACTIYW6bUU5bOab0QY//xrLkNZ8Iwa/M/LZstU3dgZjIwXtcMD+ANAIynN4rcNNgeVja8lnbYU3WQ1u9UIjMxtSp1rLf4mwTGSeLI1uuAWgWczkMaFjMF1RJhX9VlKX8qDC+pr/jiu8LTHt8VDeVvDwpZ4qVbI/8qq+VUyXjBffcDdeY5qb75nnlhEMHLey3t/GcEo80nmtjTKmBdroVkooIat7PcSvfQQ+kzrSnV2as=</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</ds:Signature>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>FPP1-15407</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-29</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:32:15</cbc:IssueTime>
|
||||
<cbc:InvoiceTypeCode listID="1001" listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" name="Tipo de Operacion" listSchemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo51">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000">SEISCIENTOS NOVENTA Y SEIS CON 59/100 SOLES</cbc:Note>
|
||||
<cbc:Note languageLocaleID="2006">Operacion sujeta a detraccion</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:Signature>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
<cbc:Note>WWW.NUBEFACT.COM</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>ZAPATA ARAPA EUSEBIO</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>10091153136</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>FERRETERÍA DEPOSITO 1° DE MAYO</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ZAPATA ARAPA EUSEBIO</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI">150142</cbc:ID>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0000</cbc:AddressTypeCode>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>VILLA SALVADOR</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>Av. 1 DE MAYO MZ C LT 17 ADEICOSUR, PARQUE INDUSTRIAL</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO 3166-1" listAgencyName="United Nations Economic Commission for Europe" listName="Country">PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. 26 DE NOVIEMBRE NRO. 2473 A.H. VIRGEN DE LOURDES - LIMA LIMA VILLA MARIA DEL TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansCode listName="Medio de pago" listAgencyName="PE:SUNAT" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo59">001</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>0000000000</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansID schemeName="Codigo de detraccion" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo54">027</cbc:PaymentMeansID>
|
||||
<cbc:PaymentPercent>4.00</cbc:PaymentPercent>
|
||||
<cbc:Amount currencyID="PEN">28.00</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">668.59</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">668.59</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-29</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">106.26</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">590.33</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">106.26</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">590.33</cbc:LineExtensionAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">696.59</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="PEN">0.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="PEN">0.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="PEN">0.00</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">696.59</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="ZZ" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">520.0</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">590.33</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">1.3396</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">106.26</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">590.33</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">106.26</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode listAgencyName="PE:SUNAT" listName="Afectacion del IGV" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo07">10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description>SERVICIO DE TRANSPORTE 520 CEMENTO PTO DE PDA. AV. ATOCONGO 1860 VMT- LIMA PRO DE LLDA. AV. PRIMERO DE MAYO MZA. C LT17 OTRO. PARCELA 1 – ADEICOSUR- VILLA EL SALVADOR – LIMA – LIMA. ADEICOSUR - VES SEGÚN GRR. T001- 129749 SEGÚN GRT. VPP1 – 516 R.E.G.M.T.C. Nº 1516491 C.N.G. C.V. T2S2 CARGA. 22.10 V.R. 696.592 CONCEPTO: 027 – TRANSPORTE DE BIENES PORCENTAJE: 4% MONTO DETRACC.: S/ 28.00 NETO A COBRAR: S/ 668.592 OPERACIÓN SUJETA AL SPOT CON EL GOBIERNO CENTRAL CTA BCO NACIÓN 00-063-049697</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>001</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">1.1352542373</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
</Invoice>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<DespatchAdvice xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2">
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="NubeFacTSign">
|
||||
<ds:SignedInfo>
|
||||
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<ds:Reference URI="">
|
||||
<ds:Transforms>
|
||||
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
</ds:Transforms>
|
||||
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<ds:DigestValue>pGFus9mok5BsHOvwP9jXVzznwtgwSX8F9LIyJYnikxk=</ds:DigestValue>
|
||||
</ds:Reference>
|
||||
</ds:SignedInfo>
|
||||
<ds:SignatureValue>jJovOUNvc7dTBurWODbsH4GaeGH3N7bFZkPjfHCS3BSNiQH4YR6ykNGLAzZY8M2SgP+y/RNHrUI3ZMfo+WQ6dXjXJYiC95lnYY3zf+KKT9XI/nsPztOUCtm8yyCO5W2zuZQkh9WQRJCg0G8TKwd7mf/gZ5xWurVWSzlMo9tyz+gRIyFsnt+nvSJ0Lx8d0VduUrNVsUBG31ruSdAavU0Dm5r86njdnlPLVnXVy42FMjlCAmgNEedtkFBQ0+ipCfTuCis8gUv5XI6GPBrCuwR3c1nO9Bmh+zVuijc4J1R6jLuPvRT96iMykyB1UXatK0isFcHG209moHUlpfn+C0OEoQ==</ds:SignatureValue>
|
||||
<ds:KeyInfo>
|
||||
<ds:X509Data>
|
||||
<ds:X509SubjectName>street=CAL. LIBERTAD NRO. 176 INT. 211,emailAddress=sistemas@nubefact.com,CN=NUBEFACT WEB,OU=20600695771,OU=Validado por Llama.pe ER,O=NUBEFACT S.A.,L=LIMA,C=PE</ds:X509SubjectName>
|
||||
<ds:X509Certificate>MIIFLzCCBBegAwIBAgIIeqYdzau699YwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMzA1MTgzODI1WhcNMjkwMzA0MTgzODAwWjCB1DEoMCYGA1UECQwfQ0FMLiBMSUJFUlRBRCBOUk8uIDE3NiBJTlQuIDIxMTEkMCIGCSqGSIb3DQEJARYVc2lzdGVtYXNAbnViZWZhY3QuY29tMRUwEwYDVQQDDAxOVUJFRkFDVCBXRUIxFDASBgNVBAsMCzIwNjAwNjk1NzcxMSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxFjAUBgNVBAoMDU5VQkVGQUNUIFMuQS4xDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PnivJidKntheakfk5pA2SOXyG66a1FQtSW1BtXMpN2C953XT9iJLbR9kD/2hUsTs08drxdkSeKJwyMvUL41VpGX54PkSBXg1nqwbNN9dwj+zSd1PsFcmLtpEizyU4r6B8PSo07cdAzisAhnt3F1X/LcpcuJcUT3x88RJt18vSbh903Ihvp6BV7BCkJk/MJSRKeJnVMYJPtrgLvTxH03DUs6mIozR673WmYZAdzXPo1Kv0JpfrP/XTcaZECe2VQ+l7OEQS/s2bSjL7K8VgvTW+PtkCGZu9q6UUYsr3F1UL7TVad9zEFgL7rMQvELT7r+YWCP4AwVfTrXvqAoMednKQIDAQABo4IBkDCCAYwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAgBgNVHREEGTAXgRVzaXN0ZW1hc0BudWJlZmFjdC5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBSZK2idJe/W7w+eTwXNhJ/o8XK6pjAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAIEF6UtQGQ+yLKVVRCdiogInGUGv7IECqg9gMQNZBZ2ZP9SgQOOTFIsDI0psbS3D6u/wJ2vgf78a287ysqJUcGqhW1+plQh4toN3v8bCqwXACTIYW6bUU5bOab0QY//xrLkNZ8Iwa/M/LZstU3dgZjIwXtcMD+ANAIynN4rcNNgeVja8lnbYU3WQ1u9UIjMxtSp1rLf4mwTGSeLI1uuAWgWczkMaFjMF1RJhX9VlKX8qDC+pr/jiu8LTHt8VDeVvDwpZ4qVbI/8qq+VUyXjBffcDdeY5qb75nnlhEMHLey3t/GcEo80nmtjTKmBdroVkooIat7PcSvfQQ+kzrSnV2as=</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</ds:Signature>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>VPP1-516</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-29</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:28:14</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode>31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note>Obs: MARCA VEHICULO: VOLVO N CONF.VEHICULAR: T2 S2</cbc:Note>
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID>T001-129749</cbc:ID>
|
||||
<cbc:DocumentTypeCode>09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType>Guía de Remisión Remitente</cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
<cac:Signature>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
<cbc:Note>WWW.NUBEFACT.COM</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>ZAPATA ARAPA EUSEBIO</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>10091153136</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:DespatchSupplierParty>
|
||||
<cbc:CustomerAssignedAccountID schemeID="6">10091153136</cbc:CustomerAssignedAccountID>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ZAPATA ARAPA EUSEBIO</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">10091153136</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>ZAPATA ARAPA EUSEBIO</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>SUNAT_Envio</cbc:ID>
|
||||
<cbc:GrossWeightMeasure unitCode="TNE">22.1</cbc:GrossWeightMeasure>
|
||||
<cac:ShipmentStage>
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-29</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
<cac:CarrierParty>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:CompanyID>1516491CNG</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:CarrierParty>
|
||||
<cac:TransportMeans>
|
||||
<cac:RoadTransport>
|
||||
<cbc:LicensePlateID>ABB758</cbc:LicensePlateID>
|
||||
</cac:RoadTransport>
|
||||
</cac:TransportMeans>
|
||||
<cac:DriverPerson>
|
||||
<cbc:ID schemeID="1">42327525</cbc:ID>
|
||||
<cbc:FirstName>LUIS AUGUSTO</cbc:FirstName>
|
||||
<cbc:FamilyName>YARANGA MARTINEZ</cbc:FamilyName>
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
<cac:IdentityDocumentReference>
|
||||
<cbc:ID>Q42327525</cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
</cac:ShipmentStage>
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150142</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DeliveryAddress>
|
||||
<cac:Despatch>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID schemeAgencyName="PE:INEI" schemeName="Ubigeos">150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:ID>ABB758</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151601857</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
<cac:AttachedTransportEquipment>
|
||||
<cbc:ID>A6T980</cbc:ID>
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151834688</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
</cac:AttachedTransportEquipment>
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Shipment>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cac:DespatchLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">520.0</cbc:DeliveredQuantity>
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>2</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
<cbc:Description>CEMENTO SOL 42.50KG</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>CEM01</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10091153136",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": "29/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "FPP1",
|
||||
"numero": "15407",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": "696.59",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": "4",
|
||||
"monto_detraccion": "28.00",
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,111 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10091153136",
|
||||
"razon_social_emisor": "FERRETERÍA DEPOSITO 1° DE MAYO",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "01",
|
||||
"serie": "FPP1",
|
||||
"numero": "15407",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 696.59,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129749"
|
||||
},
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "VPP1",
|
||||
"numero": "516"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 28.0,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO DE TRANSPORTE 520 CEMENTO PTO DE PDA. AV. ATOCONGO 1860 VMT- LIMA PRO DE LLDA. AV. PRIMERO DE MAYO MZA. C LT17 OTRO. PARCELA 1 – ADEICOSUR- VILLA EL SALVADOR – LIMA – LIMA. ADEICOSUR - VES SEGÚN GRR. T001- 129749 SEGÚN GRT. VPP1 – 516 R.E.G.M.T.C. Nº 1516491 C.N.G. C.V. T2S2 CARGA. 22.10 V.R. 696.592 CONCEPTO: 027 – TRANSPORTE DE BIENES PORCENTAJE: 4% MONTO DETRACC.: S/ 28.00 NETO A COBRAR: S/ 668.592 OPERACIÓN SUJETA AL SPOT CON EL GOBIERNO CENTRAL CTA BCO NACIÓN 00-063-049697",
|
||||
"cantidad": 520.0,
|
||||
"precio_unitario": 1.3396,
|
||||
"total_linea": 590.33,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129749"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "VPP1",
|
||||
"numero": "516"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "10091153136",
|
||||
"razon_social_emisor": "ZAPATA ARAPA EUSEBIO",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "31",
|
||||
"serie": "VPP1",
|
||||
"numero": "516",
|
||||
"ruc_receptor": "10091153136",
|
||||
"razon_social_receptor": "ZAPATA ARAPA EUSEBIO",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129749"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO",
|
||||
"punto_llegada": "PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA",
|
||||
"peso_bruto": "22.1",
|
||||
"unidad_peso_bruto": "TNE",
|
||||
"fecha_traslado": "2026-05-29",
|
||||
"vehiculo_principal": "ABB758",
|
||||
"vehiculo_secundario": "A6T980",
|
||||
"licencia_conductor": "Q42327525",
|
||||
"nombre_conductor": "LUIS AUGUSTO",
|
||||
"documento_conductor": "42327525",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO SOL 42.50KG",
|
||||
"cantidad": 520.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/009_correo/10091153136-31-VPP1-516.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,240 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<DespatchAdvice xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"><ext:UBLExtensions xmlns=""><ext:UBLExtension><ext:ExtensionContent><Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||
<SignedInfo>
|
||||
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
|
||||
<Reference URI="">
|
||||
<Transforms>
|
||||
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
</Transforms>
|
||||
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
|
||||
<DigestValue>LRNvMuKGRIobuArlf74KDR/Lcpg=</DigestValue>
|
||||
</Reference>
|
||||
</SignedInfo>
|
||||
<SignatureValue>eIySJdU3J3ZZxhOLcqLx9BqFBYodYvOTo5bZnLr5Mnh9n9xWPCaax24IWjVVcxCXXyXOe1m/8QJ4Zg9V8YvCnNYLFw1NcDOueLijfa3JxTZ0bU91pziPRcM81l3AK1/fy0A96W5FswvwDOtmJ8FZb3ezEIM9UuYnlh7UkwcfmjEqINE28zQZqWALzRljpCkGDeYPNXU2Z89xdwRqVUyA0bbMB0HvtNYDqRjcOLpp4vv3lyAhcnE5LQQ5au/7Wm6JXPiMgwROumE9RhMpD1OcKr3sRm0ZYn7OQRIHIqHtES0g6E2cxrPIJ71bSW4eCa8s16HjmvIxzILJYHxWmSqw2Q==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIFrjCCBJagAwIBAgIIf9Td7Evg0UswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQwODA5MTYxNTM5WhcNMjcwODA5MTYxNTAwWjCCAVQxKzApBgNVBAkMIkFWLiBHQVJDSUxBU08gREUgTEEgVkVHQSBOUk8uIDE0NzIxIjAgBgkqhkiG9w0BCQEWE3JtZXphZ0BzdW5hdC5nb2IucGUxQTA/BgNVBAMMOFNVUEVSSU5ULiBOQUMuIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRwwGgYDVQQLDBNBR0VOVEUgQVVUT01BVElaQURPMS4wLAYDVQQLDCVWYWxpZGFkbyBwb3IgQUJDIElERU5USURBRCBESUdJVEFMIEVSMVQwUgYDVQQKDEtTVVBFUklOVEVOREVOQ0lBIE5BQ0lPTkFMIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBIC0gU1VOQVQxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1apapJOwMj9tBpgKAgjRwIloUk+xwvQZxc0s/4yl4mDSrc/F/PKZ3QBmKb43fFwivqPUvsr68fQTfyLKM14B+xXwlbQ/yh3+87sMyulLhOPmtSOU0PE8Rw0PsmGVxf1L0HPAPc3Gvuhq4Z9Dx5ByED6s+VppDmncvctlJ/NrzYZCk9H91OinTTPVZrDtbmqnOYra8PaTRoCI9Fmndeo9Oo7esM7KVX9f53NEd/mNQqzAOrgSXthFuBZN7zOsGxJ4ZGrVzHSlCH/jFLgObEizHrqisgL1cxKj8QvbGLUjNtUuTvR5IY6hwRLCxbliTa84BN10E0jC7hhAnnuEIAFJiwIDAQABo4IBjjCCAYowDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAeBgNVHREEFzAVgRNybWV6YWdAc3VuYXQuZ29iLnBlMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUuRkPCyM25gAu5se9GraC/UO07X8wDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQBC8+YM7moZ7bKYCS+VzJ8wzydSboWeNuAs2CfkhI8hRMQr1r5WZg8pDlroCslF/r6SjbkrjuDHcGKJTM2riGEjlOD4CLU9VjOP7Td6CIZyJRLaz63pZYOwE0H0weG/PvYpopDZzJ6AXYzZxwYkJ03/x/vwaCss9ZvmsEn2E1xtGbnMe9MEsg8oF0ul3uRn8Qy5gF37fM7YKuF/r4iBS5uSvBcA5J2FbI/PQls7OgICDyb3W16GeluaT9krY5wQxilJSpGVU++nv5NzmRHkquH3ic2It/KP6MZ9X2tfg6FhpF6JaUz7MSY+J0KnDDcfJlhxgnkgoT5tV3Sr6z5PpQH6</X509Certificate><X509IssuerSerial><X509IssuerName>C=PE, O=LLAMA.PE, CN=Llama.pe SHA256 Standard CA</X509IssuerName><X509SerialNumber>9211231144834552139</X509SerialNumber></X509IssuerSerial></X509Data></KeyInfo><Proposito>Cumple proposito</Proposito><Revocacion>Cumple revocacion</Revocacion><TSL>Cumple tsl</TSL><Expiracion>No ha expirado</Expiracion></Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions>
|
||||
<!--ext:UBLExtensions>
|
||||
</ext:UBLExtensions-->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID><![CDATA[EG03-216]]></cbc:ID>
|
||||
|
||||
<!-- FECHA Y HORA DE EMISION -->
|
||||
<cbc:IssueDate>2026-05-29</cbc:IssueDate>
|
||||
<cbc:IssueTime>01:31:47</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode>
|
||||
|
||||
<!-- DOCUMENTOS ADICIONALES (Catalogo D41)-->
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID><![CDATA[T001-129711]]></cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">09</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType><![CDATA[Guía de Remisión Remitente]]></cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
|
||||
<cac:Signature>
|
||||
<cbc:ID><![CDATA[SUNAT]]></cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID><![CDATA[20131312955]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[SUNAT]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
|
||||
<!-- DATOS DEL EMISOR (TRANSPORTISTA) -->
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[10154500010]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[REMUZGO PISCONTI LIZ GIANNINA]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
|
||||
<!-- DATOS DEL RECEPTOR (DESTINATARIO) -->
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[10154500010]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[REMUZGO PISCONTI LIZ GIANNINA]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
|
||||
<!-- DATOS DE QUIEN PAGA EL SERVICIO -->
|
||||
<cac:OriginatorCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:OriginatorCustomerParty>
|
||||
|
||||
<!-- DATOS DEL TRASLADO -->
|
||||
<cac:Shipment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
<!-- PESO BRUTO TOTAL DE LA CARGA -->
|
||||
<cbc:GrossWeightMeasure unitCode="TNE">31.45</cbc:GrossWeightMeasure>
|
||||
|
||||
<!-- INDICADORES -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Indicador de pagador del flete -->
|
||||
<cbc:SpecialInstructions>SUNAT_Envio_IndicadorPagadorFlete_Remitente</cbc:SpecialInstructions>
|
||||
|
||||
<cac:Consignment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
</cac:Consignment>
|
||||
|
||||
<cac:ShipmentStage>
|
||||
|
||||
<!-- FECHA DE INICIO DEL TRASLADO -->
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-29</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
|
||||
<!-- DATOS DEL TRANSPORTISTA -->
|
||||
<cac:CarrierParty>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES -->
|
||||
<cac:PartyLegalEntity>
|
||||
<!-- NUMERO DE REGISTRO DEL MTC -->
|
||||
<cbc:CompanyID><![CDATA[1562011CNG]]></cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
|
||||
</cac:CarrierParty>
|
||||
<!-- CONDUCTOR PRINCIPAL -->
|
||||
<cac:DriverPerson>
|
||||
<!-- TIPO Y NUMERO DE DOCUMENTO DE IDENTIDAD -->
|
||||
<cbc:ID schemeID="1" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[40190692]]></cbc:ID>
|
||||
|
||||
<!-- NOMBRES -->
|
||||
<cbc:FirstName>QUINTANA QUISPE GERARDO</cbc:FirstName>
|
||||
|
||||
<!-- APELLIDOS -->
|
||||
<cbc:FamilyName>QUINTANA QUISPE GERARDO</cbc:FamilyName>
|
||||
|
||||
<!-- TIPO DE CONDUCTOR: PRINCIPAL -->
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
|
||||
<cac:IdentityDocumentReference>
|
||||
<!-- LICENCIA DE CONDUCIR -->
|
||||
<cbc:ID><![CDATA[Q40190692]]></cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
|
||||
</cac:ShipmentStage>
|
||||
|
||||
<cac:Delivery>
|
||||
<!-- DIRECCION DEL PUNTO DE LLEGADA -->
|
||||
<cac:DeliveryAddress>
|
||||
<!-- UBIGEO DE LLEGADA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150501]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE LLEGADA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[CA. PANAMERICANA SUR MZ. A6 LT. 4 AS. EL TREBOL]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DeliveryAddress>
|
||||
|
||||
<cac:Despatch>
|
||||
<!-- DIRECCION DEL PUNTO DE PARTIDA -->
|
||||
<cac:DespatchAddress>
|
||||
<!-- UBIGEO DE PARTIDA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150143]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE PARTIDA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. ATOCONGO 1860 - LIMA - LIMA - VILLA MARIA DEL TRIUNFO]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DespatchAddress>
|
||||
|
||||
|
||||
<!-- DATOS DEL REMITENTE -->
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
|
||||
<cac:TransportHandlingUnit>
|
||||
<!-- NUMERO DE CONTENEDOR -->
|
||||
<cbc:ID><![CDATA[-]]></cbc:ID>
|
||||
|
||||
<cac:TransportEquipment>
|
||||
<!-- VEHICULO PRINCIPAL -->
|
||||
<!-- PLACA - VEHICULO PRINCIPAL -->
|
||||
<cbc:ID><![CDATA[CFW860]]></cbc:ID>
|
||||
|
||||
<!-- Tarjeta Unica Circulacion / Cerificado Habilitacion Vehicular - Principal -->
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>15M25060472E</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES - VEHICULO PRINCIPAL -->
|
||||
<cac:ShipmentDocumentReference>
|
||||
<cbc:ID schemeID="06" schemeName="Entidad Autorizadora" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogoD37"><![CDATA[1562011cng]]></cbc:ID>
|
||||
</cac:ShipmentDocumentReference>
|
||||
|
||||
|
||||
|
||||
<!-- VEHICULO SECUNDARIO -->
|
||||
<cac:AttachedTransportEquipment>
|
||||
<!-- PLACA - VEHICULO SECUNDARIO -->
|
||||
<cbc:ID><![CDATA[BUI979]]></cbc:ID>
|
||||
|
||||
<!-- TARJETA UNICA CIRCULACION / CERTIFICADO HABILITACION VEHICULAR - SECUNDARIO -->
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>15M25060473E</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES - VEHICULO SECUNDARIO -->
|
||||
<cac:ShipmentDocumentReference>
|
||||
<cbc:ID schemeID="06" schemeName="Entidad Autorizadora" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogoD37"><![CDATA[1562011cng]]></cbc:ID>
|
||||
</cac:ShipmentDocumentReference>
|
||||
</cac:AttachedTransportEquipment>
|
||||
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
|
||||
|
||||
</cac:Shipment>
|
||||
|
||||
<!-- DETALLES DE BIENES A TRASLADAR -->
|
||||
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ar:ApplicationResponse xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope" xmlns:ar="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension><ext:ExtensionContent><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><DigestValue>++vnz3BA+AEgNvaNnn09EAeVPnx8MvxiZFfdr66SKzM=</DigestValue></Reference></SignedInfo><SignatureValue>XshakaqeaE2tLh9WLCy3Yh/hFbp22djvtmq3AxjRL4zIA0VJzL/dePHQopZ89Gd2uRpMfRI33m9zZkNTbyRPvz3JorVZspo7lpKUxqolX5o+EeB4N5XI/5Et5kq/m2ptEpyZvtdB4EwU4AswzYdUAaAEuh9PzDtkRUM8YnzWG4L0CzlGEGwtl6hsSB9WWOWoOAMQ3IMdlyAB1lGmieUmTiDSjhQraGRI2kkQHfDzi2zqX3TglWAoz7avrUlrifOfb3PORh4wmae6HE5ecpG31eFBHazEQOGJaokfrj33E1TQvIG8qAs/qy1g4cnih+IlJjhBcPsmCr4h3Jocr6Wx6Q==</SignatureValue><KeyInfo><X509Data><X509SubjectName>C=PE, O=LLAMA.PE, CN=Llama.pe SHA256 Standard CA</X509SubjectName><X509Certificate>MIIFrjCCBJagAwIBAgIIc2eNOs0y3WswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQwMTI1MTkyMzQxWhcNMjYwMTI0MTkyMzAwWjCCAVQxKzApBgNVBAkMIkFWLiBHQVJDSUxBU08gREUgTEEgVkVHQSBOUk8uIDE0NzIxIjAgBgkqhkiG9w0BCQEWE3JtZXphZ0BzdW5hdC5nb2IucGUxQTA/BgNVBAMMOFNVUEVSSU5ULiBOQUMuIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRwwGgYDVQQLDBNBR0VOVEUgQVVUT01BVElaQURPMS4wLAYDVQQLDCVWYWxpZGFkbyBwb3IgQUJDIElERU5USURBRCBESUdJVEFMIEVSMVQwUgYDVQQKDEtTVVBFUklOVEVOREVOQ0lBIE5BQ0lPTkFMIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBIC0gU1VOQVQxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxiw3ab0PlTQpV4Xw5sFK/+m8y5ZEFqOWDW/Jo2kEd11ICZTomYgo3VCT86RPw0OSRoNwHx6fzRnw9ea/jOCCdNyr0W/aRYGuU0t21QKK+w3hzuV2GBCYIJ3WVSByVxwgMe0oQr8wNnZg7FD25W/3HveIQOIJDGPH6a3gQ7E9uMu26zp3uvG3+sI3uTi+4rYNi618Wrg1YbtqfhprsC/32FXlWsJoB4YX4ei9izJrKpso4fsgsl4q7jcDbE1mmssEYImhZIc523b8BpgSkrHYOfADREXKBpH3imZKLmADzbnY6F2evUIjZrE4YVNO1MSklxCtzcsy91cwcZAaK/UPDQIDAQABo4IBjjCCAYowDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAeBgNVHREEFzAVgRNybWV6YWdAc3VuYXQuZ29iLnBlMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUyqaBmn52E+bZ5nB5i34oE0fcqG4wDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQCwmv7rS+NNsb7O1VmIcKt7ZThv713+NQlt3hS/6cSHkvfXWpFu/qLHCm0S2GTwOBYjHSSNmoGXKKmXBehWcLn2Zx7eE4Te0naghaZ10VkCd4FN/A4yZji3QIJj0s7xMzgrHnGBOXJmWvC9RSEpvvqR6vdgSJBI8+R/Qt/j1KR4gA/bSiIqdSKp4sHmloVUBMOlpgM8kzm74VmcxV9MT2hsv+JwnWXx2OnLetjjZfXnXBC7UJu35EsLSgETF9wEht7fWTAtl/rEEatQt1A1BdvaiBVsIyKl8qakxT6eIMLgwHYfuZYfgpHys3Gy96pspM3aCjHKO2b/ZntyT4V813zj</X509Certificate></X509Data></KeyInfo></Signature></ext:ExtensionContent></ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>1.0</cbc:CustomizationID>
|
||||
<cbc:ID>427906d5-dcc7-4922-bf74-32f599a3e547</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-29</cbc:IssueDate>
|
||||
<cbc:IssueTime>08:25:10.93801</cbc:IssueTime>
|
||||
<cbc:ResponseDate>2026-05-29</cbc:ResponseDate>
|
||||
<cbc:ResponseTime>08:25:10.97135</cbc:ResponseTime>
|
||||
<cac:Signature>
|
||||
<cbc:ID>SignSUNAT</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20131312955</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>SUNAT</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SignSUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:SenderParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20131312955</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:SenderParty>
|
||||
<cac:ReceiverParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>10154500010</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:ReceiverParty>
|
||||
<cac:DocumentResponse>
|
||||
<cac:Response>
|
||||
<cbc:ReferenceID>FF01-3308</cbc:ReferenceID>
|
||||
<cbc:ResponseCode>0</cbc:ResponseCode>
|
||||
<cbc:Description>La Factura numero FF01-3308, ha sido aceptado</cbc:Description>
|
||||
</cac:Response>
|
||||
<cac:DocumentReference>
|
||||
<cbc:ID>FF01-3308</cbc:ID>
|
||||
</cac:DocumentReference>
|
||||
<cac:RecipientParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>6-20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:RecipientParty>
|
||||
</cac:DocumentResponse>
|
||||
</ar:ApplicationResponse>
|
||||
@@ -0,0 +1,63 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10154500010",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C.",
|
||||
"fecha_emision": "29/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "FF01",
|
||||
"numero": "3308",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": "1585.08",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": "4.00",
|
||||
"monto_detraccion": "27.00",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "UNIDADES 20251025120428 SERVICIO DE TRANSPORTE SERVICIO DE TRANSPORTE 740 BL CEMENTO P. PARTIDA: AV. ATOCONGO 1860 VILLA MARIA DEL TRIUNFO - LIMA - LIMA P. LLEGADA: CA. PANAMERICANA SUR MZ. A6 LT. 4 AS. EL TREBOL - SAN VICENTE DE CAÑETE - CAÑETE - LIMA SEGUN GRR: T001-0129711 SEGUN GRT: EG03-00000216 VALOR REFERENCIAL: 2,510.02 CONFIG. VEHICULAR: T3S3 CARGA TM.: 31.45 N° REGISTRO M.T.C: 1562011CNG PLACA VEHICULO: CFW-860/BUI-979 SON MIL QUINIENTOS OCHENTA Y CINCO Y 08/100 SOLES",
|
||||
"cantidad": "740.00",
|
||||
"precio_unitario": "2.14",
|
||||
"total_linea": "1585.08",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129711"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "216"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "10154500010",
|
||||
"razon_social_emisor": "REMUZGO PISCONTI LIZ GIANNINA",
|
||||
"fecha_emision": "05/33/2026",
|
||||
"tipo": "31",
|
||||
"serie": "2605",
|
||||
"numero": "33",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129711"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/010_correo/10154500010-31-2605-33.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,39 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "10154500010",
|
||||
"razon_social_emisor": "REMUZGO PISCONTI LIZ GIANNINA",
|
||||
"fecha_emision": "2026-05-29",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "216",
|
||||
"ruc_receptor": "10154500010",
|
||||
"razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129711"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV. ATOCONGO 1860 - LIMA - LIMA - VILLA MARIA DEL TRIUNFO",
|
||||
"punto_llegada": "CA. PANAMERICANA SUR MZ. A6 LT. 4 AS. EL TREBOL",
|
||||
"peso_bruto": "31.45",
|
||||
"unidad_peso_bruto": "TNE",
|
||||
"fecha_traslado": "2026-05-29",
|
||||
"vehiculo_principal": "CFW860",
|
||||
"vehiculo_secundario": "BUI979",
|
||||
"licencia_conductor": "Q40190692",
|
||||
"nombre_conductor": "QUINTANA QUISPE GERARDO",
|
||||
"documento_conductor": "40190692",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/010_correo/10154500010-31-EG03-216.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="NubeFacTSign">
|
||||
<ds:SignedInfo>
|
||||
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<ds:Reference URI="">
|
||||
<ds:Transforms>
|
||||
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
</ds:Transforms>
|
||||
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<ds:DigestValue>iqqbui/4mECjZwCUF7Pzs/N3icjZktM24HG7wEB4PM4=</ds:DigestValue>
|
||||
</ds:Reference>
|
||||
</ds:SignedInfo>
|
||||
<ds:SignatureValue>W8oT+dnoylFsSrUUc8Wn0o1ly02bKaD95gC3IRnhe/TmtbezqYzPPgpB4/QpgcAUO0o62OH7N7F7n0YY0qBIjBrTQ8dZrUe5MC8EeulFYRRfZg+tWVQC0+xpxUuAmNWio8qakT/dXC1pK/mjFJU3y3v4OoU4u02uCRinNt27NB/TYlOC0pyF5/bM0W3EuQ/p8wDEyelevBnU/rbJkXXaEpMR+OhV+3SPoS5jFED/RW0V1MqWhKZxjU2nv2Vl72T9i9lSY8Sf+bTIpqxRCbEQsrZ0f2k19FiDAkyPxAJOy9+TQjhQgg4cuNVp5Oi8BuMI9hp6Bhkq6T+9DD3IA0sOYQ==</ds:SignatureValue>
|
||||
<ds:KeyInfo>
|
||||
<ds:X509Data>
|
||||
<ds:X509SubjectName>street=CAL. LIBERTAD NRO. 176 INT. 211,emailAddress=sistemas@nubefact.com,CN=NUBEFACT WEB,OU=20600695771,OU=Validado por Llama.pe ER,O=NUBEFACT S.A.,L=LIMA,C=PE</ds:X509SubjectName>
|
||||
<ds:X509Certificate>MIIFLzCCBBegAwIBAgIIeqYdzau699YwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMzA1MTgzODI1WhcNMjkwMzA0MTgzODAwWjCB1DEoMCYGA1UECQwfQ0FMLiBMSUJFUlRBRCBOUk8uIDE3NiBJTlQuIDIxMTEkMCIGCSqGSIb3DQEJARYVc2lzdGVtYXNAbnViZWZhY3QuY29tMRUwEwYDVQQDDAxOVUJFRkFDVCBXRUIxFDASBgNVBAsMCzIwNjAwNjk1NzcxMSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxFjAUBgNVBAoMDU5VQkVGQUNUIFMuQS4xDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PnivJidKntheakfk5pA2SOXyG66a1FQtSW1BtXMpN2C953XT9iJLbR9kD/2hUsTs08drxdkSeKJwyMvUL41VpGX54PkSBXg1nqwbNN9dwj+zSd1PsFcmLtpEizyU4r6B8PSo07cdAzisAhnt3F1X/LcpcuJcUT3x88RJt18vSbh903Ihvp6BV7BCkJk/MJSRKeJnVMYJPtrgLvTxH03DUs6mIozR673WmYZAdzXPo1Kv0JpfrP/XTcaZECe2VQ+l7OEQS/s2bSjL7K8VgvTW+PtkCGZu9q6UUYsr3F1UL7TVad9zEFgL7rMQvELT7r+YWCP4AwVfTrXvqAoMednKQIDAQABo4IBkDCCAYwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAgBgNVHREEGTAXgRVzaXN0ZW1hc0BudWJlZmFjdC5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBSZK2idJe/W7w+eTwXNhJ/o8XK6pjAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAIEF6UtQGQ+yLKVVRCdiogInGUGv7IECqg9gMQNZBZ2ZP9SgQOOTFIsDI0psbS3D6u/wJ2vgf78a287ysqJUcGqhW1+plQh4toN3v8bCqwXACTIYW6bUU5bOab0QY//xrLkNZ8Iwa/M/LZstU3dgZjIwXtcMD+ANAIynN4rcNNgeVja8lnbYU3WQ1u9UIjMxtSp1rLf4mwTGSeLI1uuAWgWczkMaFjMF1RJhX9VlKX8qDC+pr/jiu8LTHt8VDeVvDwpZ4qVbI/8qq+VUyXjBffcDdeY5qb75nnlhEMHLey3t/GcEo80nmtjTKmBdroVkooIat7PcSvfQQ+kzrSnV2as=</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</ds:Signature>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>FF03-1100</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-28</cbc:IssueDate>
|
||||
<cbc:IssueTime>21:01:03</cbc:IssueTime>
|
||||
<cbc:InvoiceTypeCode listID="0101" listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" name="Tipo de Operacion" listSchemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo51">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000">TRESCIENTOS SESENTA Y UNO CON 69/100 SOLES</cbc:Note>
|
||||
<cbc:Note>Obs: OPERACION SUJETA AL SPOT CON EL GOBIERNO CENTRAL CTA CTE 00-058-189227-BANCO DE LA NACION N REG MTC 1548287 CNG</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:Signature>
|
||||
<cbc:ID>20516287641</cbc:ID>
|
||||
<cbc:Note>WWW.NUBEFACT.COM</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20516287641</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>20516287641</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20516287641</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI">150133</cbc:ID>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0000</cbc:AddressTypeCode>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>SAN JUAN DE MIRAFLORES</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>MZA. H2 LOTE. 31 P.J. PAMPLONA ALTA-SEC M. GRAU (AV SOLIDARIDAD CON SALVADOR ALLENDE) LIMA - LIMA - SAN JUAN DE MIRAFLORES</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO 3166-1" listAgencyName="United Nations Economic Commission for Europe" listName="Country">PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. 26 DE NOVIEMBRE NRO. 2473 A.H. VIRGEN DE LOURDES (PARADERO 14 NUEVA ESPERANZA - PISO 2) LIMA - LIMA - VILLA MARIA DEL TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">361.69</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">361.69</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-28</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">306.52</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">306.52</cbc:LineExtensionAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">361.69</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="PEN">0.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="PEN">0.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="PEN">0.00</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">361.69</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">1.0</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">306.52</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">361.6936</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">306.52</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode listAgencyName="PE:SUNAT" listName="Afectacion del IGV" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo07">10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description>Servicio de Transporte ,270 bls de Cemento x s/1.3396, Punto de Partida: Av. Atocongo 1860 – Villa María del Triunfo, Punto de Llegada: Mz H2 Lt 31 Sector Miguel Grau – P. Alta – SJM, Valor referencial s/361.69, GRET: EG03-00000253 y según GRE: T001-0129356 Configuración Vehicular C2// Peso Aprox. 11.475 Tn.</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">306.52</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<DespatchAdvice xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"><ext:UBLExtensions xmlns=""><ext:UBLExtension><ext:ExtensionContent><Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||
<SignedInfo>
|
||||
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
|
||||
<Reference URI="">
|
||||
<Transforms>
|
||||
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
</Transforms>
|
||||
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
|
||||
<DigestValue>sWk7w54B3qSkE66OsIliqVPlC98=</DigestValue>
|
||||
</Reference>
|
||||
</SignedInfo>
|
||||
<SignatureValue>l67MapXzaQ8uhdOQr/x/BdHm+uwEGfloD+/8O9DZzlwBGYbMxMBx+KspDmSUkCRqFeRjjpSg/85bKL/W2Fqg0saS0hm+gIPnP6jfAuD3fhmkBOVumvtsajEJ0tITs6+zWqsAQykKKlmgoF4aNDySBuNRjwB4RBIjsh+EoQuuV9JMFb7IgBw93UFe0BxrWfMxtyWTK3B2xOcUpTxWQnTq02cZl/46k68d+HF8NU9EMtZFeWpYU1bh2DkUPUZ4TM2GDD7bcLj5qkYa/xsjQGUDSJRqw1hJQsOphwQjnUex1cxGRUe4oCQ00fxwH1UMAsUCqDHtyspqGL2ugfOgzx+Fog==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIFrjCCBJagAwIBAgIIf9Td7Evg0UswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQwODA5MTYxNTM5WhcNMjcwODA5MTYxNTAwWjCCAVQxKzApBgNVBAkMIkFWLiBHQVJDSUxBU08gREUgTEEgVkVHQSBOUk8uIDE0NzIxIjAgBgkqhkiG9w0BCQEWE3JtZXphZ0BzdW5hdC5nb2IucGUxQTA/BgNVBAMMOFNVUEVSSU5ULiBOQUMuIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRwwGgYDVQQLDBNBR0VOVEUgQVVUT01BVElaQURPMS4wLAYDVQQLDCVWYWxpZGFkbyBwb3IgQUJDIElERU5USURBRCBESUdJVEFMIEVSMVQwUgYDVQQKDEtTVVBFUklOVEVOREVOQ0lBIE5BQ0lPTkFMIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBIC0gU1VOQVQxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1apapJOwMj9tBpgKAgjRwIloUk+xwvQZxc0s/4yl4mDSrc/F/PKZ3QBmKb43fFwivqPUvsr68fQTfyLKM14B+xXwlbQ/yh3+87sMyulLhOPmtSOU0PE8Rw0PsmGVxf1L0HPAPc3Gvuhq4Z9Dx5ByED6s+VppDmncvctlJ/NrzYZCk9H91OinTTPVZrDtbmqnOYra8PaTRoCI9Fmndeo9Oo7esM7KVX9f53NEd/mNQqzAOrgSXthFuBZN7zOsGxJ4ZGrVzHSlCH/jFLgObEizHrqisgL1cxKj8QvbGLUjNtUuTvR5IY6hwRLCxbliTa84BN10E0jC7hhAnnuEIAFJiwIDAQABo4IBjjCCAYowDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAeBgNVHREEFzAVgRNybWV6YWdAc3VuYXQuZ29iLnBlMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUuRkPCyM25gAu5se9GraC/UO07X8wDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQBC8+YM7moZ7bKYCS+VzJ8wzydSboWeNuAs2CfkhI8hRMQr1r5WZg8pDlroCslF/r6SjbkrjuDHcGKJTM2riGEjlOD4CLU9VjOP7Td6CIZyJRLaz63pZYOwE0H0weG/PvYpopDZzJ6AXYzZxwYkJ03/x/vwaCss9ZvmsEn2E1xtGbnMe9MEsg8oF0ul3uRn8Qy5gF37fM7YKuF/r4iBS5uSvBcA5J2FbI/PQls7OgICDyb3W16GeluaT9krY5wQxilJSpGVU++nv5NzmRHkquH3ic2It/KP6MZ9X2tfg6FhpF6JaUz7MSY+J0KnDDcfJlhxgnkgoT5tV3Sr6z5PpQH6</X509Certificate><X509IssuerSerial><X509IssuerName>C=PE, O=LLAMA.PE, CN=Llama.pe SHA256 Standard CA</X509IssuerName><X509SerialNumber>9211231144834552139</X509SerialNumber></X509IssuerSerial></X509Data></KeyInfo><Proposito>Cumple proposito</Proposito><Revocacion>Cumple revocacion</Revocacion><TSL>Cumple tsl</TSL><Expiracion>No ha expirado</Expiracion></Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions>
|
||||
<!--ext:UBLExtensions>
|
||||
</ext:UBLExtensions-->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID><![CDATA[EG03-253]]></cbc:ID>
|
||||
|
||||
<!-- FECHA Y HORA DE EMISION -->
|
||||
<cbc:IssueDate>2026-05-22</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:26:26</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note><![CDATA[GRE: T001-0129356]]></cbc:Note>
|
||||
|
||||
<!-- DOCUMENTOS ADICIONALES (Catalogo D41)-->
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID><![CDATA[F001-222569]]></cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">01</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType><![CDATA[Factura]]></cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
|
||||
<cac:Signature>
|
||||
<cbc:ID><![CDATA[SUNAT]]></cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID><![CDATA[20131312955]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[SUNAT]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
|
||||
<!-- DATOS DEL EMISOR (TRANSPORTISTA) -->
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20516287641]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
|
||||
<!-- DATOS DEL RECEPTOR (DESTINATARIO) -->
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20516287641]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
|
||||
<!-- DATOS DE QUIEN PAGA EL SERVICIO -->
|
||||
<cac:OriginatorCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:OriginatorCustomerParty>
|
||||
|
||||
<!-- DATOS DEL TRASLADO -->
|
||||
<cac:Shipment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
<!-- PESO BRUTO TOTAL DE LA CARGA -->
|
||||
<cbc:GrossWeightMeasure unitCode="TNE">11.475</cbc:GrossWeightMeasure>
|
||||
|
||||
<!-- INDICADORES -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Indicador de pagador del flete -->
|
||||
<cbc:SpecialInstructions>SUNAT_Envio_IndicadorPagadorFlete_Remitente</cbc:SpecialInstructions>
|
||||
|
||||
<cac:Consignment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
</cac:Consignment>
|
||||
|
||||
<cac:ShipmentStage>
|
||||
|
||||
<!-- FECHA DE INICIO DEL TRASLADO -->
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-22</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
|
||||
<!-- DATOS DEL TRANSPORTISTA -->
|
||||
<cac:CarrierParty>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES -->
|
||||
<cac:PartyLegalEntity>
|
||||
<!-- NUMERO DE REGISTRO DEL MTC -->
|
||||
<cbc:CompanyID><![CDATA[1548287CNG]]></cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
|
||||
</cac:CarrierParty>
|
||||
<!-- CONDUCTOR PRINCIPAL -->
|
||||
<cac:DriverPerson>
|
||||
<!-- TIPO Y NUMERO DE DOCUMENTO DE IDENTIDAD -->
|
||||
<cbc:ID schemeID="1" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[10011751]]></cbc:ID>
|
||||
|
||||
<!-- NOMBRES -->
|
||||
<cbc:FirstName>CUELLAR ALMERCO EDWIN GUIDO</cbc:FirstName>
|
||||
|
||||
<!-- APELLIDOS -->
|
||||
<cbc:FamilyName>CUELLAR ALMERCO EDWIN GUIDO</cbc:FamilyName>
|
||||
|
||||
<!-- TIPO DE CONDUCTOR: PRINCIPAL -->
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
|
||||
<cac:IdentityDocumentReference>
|
||||
<!-- LICENCIA DE CONDUCIR -->
|
||||
<cbc:ID><![CDATA[Q10011751]]></cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
|
||||
</cac:ShipmentStage>
|
||||
|
||||
<cac:Delivery>
|
||||
<!-- DIRECCION DEL PUNTO DE LLEGADA -->
|
||||
<cac:DeliveryAddress>
|
||||
<!-- UBIGEO DE LLEGADA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150133]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE LLEGADA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DeliveryAddress>
|
||||
|
||||
<cac:Despatch>
|
||||
<!-- DIRECCION DEL PUNTO DE PARTIDA -->
|
||||
<cac:DespatchAddress>
|
||||
<!-- UBIGEO DE PARTIDA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150143]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE PARTIDA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV ATOCONGO 1860]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DespatchAddress>
|
||||
|
||||
|
||||
<!-- DATOS DEL REMITENTE -->
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
|
||||
<cac:TransportHandlingUnit>
|
||||
<!-- NUMERO DE CONTENEDOR -->
|
||||
<cbc:ID><![CDATA[-]]></cbc:ID>
|
||||
|
||||
<cac:TransportEquipment>
|
||||
<!-- VEHICULO PRINCIPAL -->
|
||||
<!-- PLACA - VEHICULO PRINCIPAL -->
|
||||
<cbc:ID><![CDATA[D0P728]]></cbc:ID>
|
||||
|
||||
<!-- Tarjeta Unica Circulacion / Cerificado Habilitacion Vehicular - Principal -->
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151319401</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES - VEHICULO PRINCIPAL -->
|
||||
<cac:ShipmentDocumentReference>
|
||||
<cbc:ID schemeID="06" schemeName="Entidad Autorizadora" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogoD37"/>
|
||||
</cac:ShipmentDocumentReference>
|
||||
|
||||
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
|
||||
|
||||
</cac:Shipment>
|
||||
|
||||
<!-- DETALLES DE BIENES A TRASLADAR -->
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID><![CDATA[1]]></cbc:ID>
|
||||
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">270</cbc:DeliveredQuantity>
|
||||
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
|
||||
<!-- DESCRIPCION -->
|
||||
<cbc:Description><![CDATA[CEMENTO TIPO I (SOL)]]></cbc:Description>
|
||||
|
||||
<!-- CODIGO DEL ITEM -->
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[01CE007]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--INDICADOR DE BIEN REGULADO POR SUNAT -->
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,44 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": "28/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "FF03",
|
||||
"numero": "1100",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": "361.69",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA",
|
||||
"fecha_emision": "22/05/2026",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "F001",
|
||||
"numero": "222569"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/011_correo/20516287641-31-EG03-253.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,111 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"fecha_emision": "2026-05-28",
|
||||
"tipo": "01",
|
||||
"serie": "FF03",
|
||||
"numero": "1100",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 361.69,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253"
|
||||
},
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129356"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "Servicio de Transporte ,270 bls de Cemento x s/1.3396, Punto de Partida: Av. Atocongo 1860 – Villa María del Triunfo, Punto de Llegada: Mz H2 Lt 31 Sector Miguel Grau – P. Alta – SJM, Valor referencial s/361.69, GRET: EG03-00000253 y según GRE: T001-0129356 Configuración Vehicular C2// Peso Aprox. 11.475 Tn.",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 361.6936,
|
||||
"total_linea": 306.52,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129356"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/011_correo/20516287641-01-FF03-1100.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"fecha_emision": "2026-05-22",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253",
|
||||
"ruc_receptor": "20516287641",
|
||||
"razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "01",
|
||||
"serie": "F001",
|
||||
"numero": "222569"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV ATOCONGO 1860",
|
||||
"punto_llegada": "MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA",
|
||||
"peso_bruto": "11.475",
|
||||
"unidad_peso_bruto": "TNE",
|
||||
"fecha_traslado": "2026-05-22",
|
||||
"vehiculo_principal": "D0P728",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q10011751",
|
||||
"nombre_conductor": "CUELLAR ALMERCO EDWIN GUIDO",
|
||||
"documento_conductor": "10011751",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO TIPO I (SOL)",
|
||||
"cantidad": 270.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/011_correo/20516287641-31-EG03-253.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,292 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><?xml-stylesheet type="text/xsl" href="factura2.1.xsl"?><Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sac="urn:sunat:names:specification:ubl:peru:schema:xsd:SunatAggregateComponents-1" xmlns:stat="urn:oasis:names:specification:ubl:schema:xsd:DocumentStatusCode-1.0" xmlns:udt="urn:un:unece:uncefact:data:draft:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<sac:AdditionalInformation>
|
||||
|
||||
</sac:AdditionalInformation>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent><ds:Signature Id="SignSUNAT"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>jp+43Xx8RPmSvDKRvsjnomUPipo=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>C2AGSHKc3qr0XB3dTzvlh56mDMuWw/Wo5N0WT5IXXf4q5aoGK1EbexWRbZgKZuKdZGcuxxB1eoqE/y5py1uAPPPrGup+smYZuf1Nn9lnR8F9tdvkNL5IZT7zSPPBsqYhnHPMcMl8iRCCjJz1vHsd91LiTWbJrcO7+tkW3zgzjbR1OXkZZ/RToccfLajzrfXgrCu3gbZBiM4kTvLoT4xExhY+3UdMeAsmxneKKcbYqMcL9VicImmthATNoFp15n/jQFR/SIi+vhIh6C5tZgPPIufVgqt1+Iss+lO50HvYdx5gYdSx03lCzjvzAZP2qg5viIoTc9tA73JVS3FouWa11w==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIIFrjCCBJagAwIBAgIIf9Td7Evg0UswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQwODA5MTYxNTM5WhcNMjcwODA5MTYxNTAwWjCCAVQxKzApBgNVBAkMIkFWLiBHQVJDSUxBU08gREUgTEEgVkVHQSBOUk8uIDE0NzIxIjAgBgkqhkiG9w0BCQEWE3JtZXphZ0BzdW5hdC5nb2IucGUxQTA/BgNVBAMMOFNVUEVSSU5ULiBOQUMuIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRwwGgYDVQQLDBNBR0VOVEUgQVVUT01BVElaQURPMS4wLAYDVQQLDCVWYWxpZGFkbyBwb3IgQUJDIElERU5USURBRCBESUdJVEFMIEVSMVQwUgYDVQQKDEtTVVBFUklOVEVOREVOQ0lBIE5BQ0lPTkFMIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBIC0gU1VOQVQxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1apapJOwMj9tBpgKAgjRwIloUk+xwvQZxc0s/4yl4mDSrc/F/PKZ3QBmKb43fFwivqPUvsr68fQTfyLKM14B+xXwlbQ/yh3+87sMyulLhOPmtSOU0PE8Rw0PsmGVxf1L0HPAPc3Gvuhq4Z9Dx5ByED6s+VppDmncvctlJ/NrzYZCk9H91OinTTPVZrDtbmqnOYra8PaTRoCI9Fmndeo9Oo7esM7KVX9f53NEd/mNQqzAOrgSXthFuBZN7zOsGxJ4ZGrVzHSlCH/jFLgObEizHrqisgL1cxKj8QvbGLUjNtUuTvR5IY6hwRLCxbliTa84BN10E0jC7hhAnnuEIAFJiwIDAQABo4IBjjCCAYowDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAeBgNVHREEFzAVgRNybWV6YWdAc3VuYXQuZ29iLnBlMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUuRkPCyM25gAu5se9GraC/UO07X8wDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQBC8+YM7moZ7bKYCS+VzJ8wzydSboWeNuAs2CfkhI8hRMQr1r5WZg8pDlroCslF/r6SjbkrjuDHcGKJTM2riGEjlOD4CLU9VjOP7Td6CIZyJRLaz63pZYOwE0H0weG/PvYpopDZzJ6AXYzZxwYkJ03/x/vwaCss9ZvmsEn2E1xtGbnMe9MEsg8oF0ul3uRn8Qy5gF37fM7YKuF/r4iBS5uSvBcA5J2FbI/PQls7OgICDyb3W16GeluaT9krY5wQxilJSpGVU++nv5NzmRHkquH3ic2It/KP6MZ9X2tfg6FhpF6JaUz7MSY+J0KnDDcfJlhxgnkgoT5tV3Sr6z5PpQH6</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature></ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
|
||||
<cbc:ID>E001-6942</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-30</cbc:IssueDate>
|
||||
<cbc:IssueTime>10:54:25.0Z</cbc:IssueTime>
|
||||
<!-- COD 2106 : TIPO DE OPERACION TAXFREE -->
|
||||
<cbc:InvoiceTypeCode listAgencyName="PE:SUNAT" listID="1004" listName="Tipo de Documento" listSchemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo51" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" name="Tipo de Operacion">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000"><![CDATA[SON: UN MIL CUATROCIENTOS VEINTE Y 65/100 SOLES]]></cbc:Note>
|
||||
<cbc:Note languageLocaleID="2006"><![CDATA[Operación sujeta a detracción]]></cbc:Note>
|
||||
<cbc:Note><![CDATA[V.REF: S/ 1420.65 TN: 31.88]]></cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listAgencyName="United Nations Economic Commission for Europe" listID="ISO 4217 Alpha" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
|
||||
<cac:Signature>
|
||||
<cbc:ID>E001-6942</cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>SUNAT</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>SignSUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20220631541</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name/>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0</cbc:AddressTypeCode>
|
||||
<cbc:BuildingNumber/>
|
||||
<cbc:CitySubdivisionName>-</cbc:CitySubdivisionName>
|
||||
<cbc:CityName><![CDATA[CAÑETE]]></cbc:CityName>
|
||||
<cbc:CountrySubentity><![CDATA[LIMA]]></cbc:CountrySubentity>
|
||||
<cbc:CountrySubentityCode><![CDATA[150509]]></cbc:CountrySubentityCode>
|
||||
<cbc:District><![CDATA[MALA]]></cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. PANAMERICANA 604]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
<!-- INI Detraccion (1004): Registro MTC -->
|
||||
<cac:AgentParty>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:CompanyID schemeName="RegistroMTC">-</cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:AgentParty>
|
||||
<!-- FIN Detraccion (1004): Registro MTC -->
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<!-- COD TIPO DOC. TAXFREE: 7 PASAPORTE, B DOC.IDENTIF.PERS.NAT.NO DOM., G SALVOCONDUCTO -->
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="6" schemeName="Documento de Identidad" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0</cbc:AddressTypeCode>
|
||||
<cbc:BuildingNumber/>
|
||||
<cbc:CitySubdivisionName/>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:CountrySubentityCode><![CDATA[150143]]></cbc:CountrySubentityCode>
|
||||
<cbc:District>VILLA MARIA DEL TRIUNFO </cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[ AV. 26 DE NOVIEMBRE 2473 A.H. VIRGEN DE LOURDES PARADERO 14 NUEVA ESPERANZA - PISO 2 LIMA-LIMA-VILLA MARIA DEL TRIUNFO]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<!-- INICIO DIRECCION DETALLADA DEL CLIENTE FACTORING -->
|
||||
<cac:BuyerCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyLegalEntity>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:CitySubdivisionName/>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:CountrySubentityCode>150143</cbc:CountrySubentityCode>
|
||||
<cbc:District>VILLA MARIA DEL TRIUNFO</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV. 26 DE NOVIEMBRE 2473 A.H. VIRGEN DE LOURDES PARADERO 14 NUEVA ESPERANZA PISO 2 LIMA LIMA VILLA MARIA DEL TRIUNFO]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:BuyerCustomerParty>
|
||||
|
||||
<!--FIN DIRECCION DETALLADA DEL CLIENTE FACTORING -->
|
||||
|
||||
<!-- Inicio de detracciones -->
|
||||
<cac:PaymentMeans>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansCode>001</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>00571016788</cbc:ID>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>Detraccion</cbc:ID>
|
||||
<cbc:PaymentMeansID>027</cbc:PaymentMeansID>
|
||||
<cbc:PaymentPercent>4.00</cbc:PaymentPercent>
|
||||
<cbc:Amount currencyID="PEN">57.00</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<!-- Fin de detracciones -->
|
||||
|
||||
<!-- INICIO DATOS DE FORMA DE PAGO -->
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">1363.65</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">1363.65</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-12</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
|
||||
<!-- FIN DE DATOS DE FORMA DE PAGO -->
|
||||
<!-- INICIO DATOS DE RETENCION -->
|
||||
<!-- FIN DE DATOS DE RETENCION -->
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">216.71</cbc:TaxAmount>
|
||||
|
||||
|
||||
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">1203.94</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">216.71</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeAgencyName="United Nations Economic Commission for Europe" schemeID="UN/ECE 5305" schemeName="Tax Category Identifier">S</cbc:ID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="UN/ECE 5153" schemeName="Codigo de tributos">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">1203.94</cbc:LineExtensionAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="PEN">0.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="PEN">0.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="PEN">0.00</cbc:PrepaidAmount>
|
||||
|
||||
<cbc:PayableAmount currencyID="PEN">1420.65</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="NIU" unitCodeListAgencyName="United Nations Economic Commission for Europe" unitCodeListID="UN/ECE rec 20">1.00</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">1203.941</cbc:LineExtensionAmount>
|
||||
|
||||
<cbc:FreeOfChargeIndicator>false</cbc:FreeOfChargeIndicator>
|
||||
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">1420.65038</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<!-- Inicio de detracciones - Tipo operacion 1004-->
|
||||
<cac:Delivery>
|
||||
<cac:DeliveryLocation>
|
||||
<cac:Address>
|
||||
<cbc:ID>150509</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. PANAMERICANA NRO 602 - LIMA - CAÑETE - MALA</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:Address>
|
||||
</cac:DeliveryLocation>
|
||||
<cac:Despatch>
|
||||
<cac:DespatchAddress>
|
||||
<cbc:ID>150143</cbc:ID>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV ATOCONGO 1860 - LIMA - LIMA - VILLA MARIA DEL TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:DespatchAddress>
|
||||
</cac:Despatch>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">0.00</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>02</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">0.00</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:DeliveryTerms>
|
||||
<cbc:ID>03</cbc:ID>
|
||||
<cbc:Amount currencyID="PEN">0.00</cbc:Amount>
|
||||
</cac:DeliveryTerms>
|
||||
<cac:Shipment>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
<!-- Detalle ruta principal -->
|
||||
<cac:Consignment>
|
||||
<cbc:ID>0</cbc:ID>
|
||||
<cac:TransportHandlingUnit>
|
||||
<cac:TransportEquipment>
|
||||
<cbc:SizeTypeCode>-</cbc:SizeTypeCode>
|
||||
<cbc:ReturnabilityIndicator>false</cbc:ReturnabilityIndicator>
|
||||
</cac:TransportEquipment>
|
||||
<cac:MeasurementDimension>
|
||||
<cbc:AttributeID>01</cbc:AttributeID>
|
||||
<cbc:Measure unitCode="TNE">0.00</cbc:Measure>
|
||||
</cac:MeasurementDimension>
|
||||
</cac:TransportHandlingUnit>
|
||||
</cac:Consignment>
|
||||
</cac:Shipment>
|
||||
</cac:Delivery>
|
||||
<!-- Fin de detracciones - Tipo operacion 1004-->
|
||||
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="PEN">0.00</cbc:Amount>
|
||||
</cac:AllowanceCharge>
|
||||
|
||||
<!-- TAX Impuestos Item -->
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">216.70938</cbc:TaxAmount>
|
||||
<!-- cac:TaxSubtotal -->
|
||||
|
||||
|
||||
<!--Excluyentes :: Otro Tributo - Gratuita(Bonificacion) - Exportacion - Onerosa(Bonitificacion) {Gravada, Inafecta, Exonerada} -->
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">1203.941</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">216.70938</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID schemeAgencyName="United Nations Economic Commission for Europe" schemeID="UN/ECE 5305" schemeName="Tax Category Identifier">S</cbc:ID>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
|
||||
<cbc:TaxExemptionReasonCode listAgencyName="PE:SUNAT" listName="Afectacion del IGV" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo07">10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeAgencyName="PE:SUNAT" schemeID="UN/ECE 5153" schemeName="Codigo de tributos">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<!-- /cac:TaxSubtotal -->
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description><![CDATA[SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:EG03-2502 Y G.R.R: T001-129610 DEL 27.05.26 F9V-838/C4E-990 CATEGORIA: T3S3]]></cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID/>
|
||||
</cac:SellersItemIdentification>
|
||||
<!-- Inicio Código de producto GTIN/Sunat 2-->
|
||||
<!-- Fin Código de producto GTIN/Sunat-->
|
||||
</cac:Item>
|
||||
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">1203.941</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,63 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20220631541",
|
||||
"razon_social_emisor": "A. BERIO Y CIA S.A.C.",
|
||||
"fecha_emision": "30/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "E001",
|
||||
"numero": "6942",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": "1363.65",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": "57.00",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "UNIDAD SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935- CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:EG03-2502 Y G.R.R: T001-129610 DEL 27.05.26 F9V-838/C4E-990 CATEGORIA: T3S3",
|
||||
"cantidad": "1.00",
|
||||
"precio_unitario": "1203.941",
|
||||
"total_linea": "0.00",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129610"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "2502"
|
||||
}
|
||||
}
|
||||
],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/012_correo/20220631541-01-E001-6942.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20220631541",
|
||||
"razon_social_emisor": "DEPOSITO DE MATERIALES DE CONSTRUCCION JUAN PABLO II S.A.C.",
|
||||
"fecha_emision": "27/05/2026",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "2502",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "DEPOSITO DE MATERIALES DE CONSTRUCCION JUAN PABLO II S.A.C.",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129610"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,64 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20220631541",
|
||||
"razon_social_emisor": "EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC",
|
||||
"fecha_emision": "2026-05-30",
|
||||
"tipo": "01",
|
||||
"serie": "E001",
|
||||
"numero": "6942",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 1420.65,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "2502"
|
||||
},
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129610"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": true,
|
||||
"codigo_detraccion": "027",
|
||||
"porcentaje_detraccion": 4.0,
|
||||
"monto_detraccion": 57.0,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:EG03-2502 Y G.R.R: T001-129610 DEL 27.05.26 F9V-838/C4E-990 CATEGORIA: T3S3",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 1420.65038,
|
||||
"total_linea": 1203.941,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129610"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "2502"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/012_correo/20220631541-01-E001-6942.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<ext:UBLExtensions>
|
||||
<ext:UBLExtension>
|
||||
<ext:ExtensionContent>
|
||||
<ds:Signature Id="NubeFacTSign">
|
||||
<ds:SignedInfo>
|
||||
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
|
||||
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
|
||||
<ds:Reference URI="">
|
||||
<ds:Transforms>
|
||||
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
</ds:Transforms>
|
||||
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
|
||||
<ds:DigestValue>iqqbui/4mECjZwCUF7Pzs/N3icjZktM24HG7wEB4PM4=</ds:DigestValue>
|
||||
</ds:Reference>
|
||||
</ds:SignedInfo>
|
||||
<ds:SignatureValue>W8oT+dnoylFsSrUUc8Wn0o1ly02bKaD95gC3IRnhe/TmtbezqYzPPgpB4/QpgcAUO0o62OH7N7F7n0YY0qBIjBrTQ8dZrUe5MC8EeulFYRRfZg+tWVQC0+xpxUuAmNWio8qakT/dXC1pK/mjFJU3y3v4OoU4u02uCRinNt27NB/TYlOC0pyF5/bM0W3EuQ/p8wDEyelevBnU/rbJkXXaEpMR+OhV+3SPoS5jFED/RW0V1MqWhKZxjU2nv2Vl72T9i9lSY8Sf+bTIpqxRCbEQsrZ0f2k19FiDAkyPxAJOy9+TQjhQgg4cuNVp5Oi8BuMI9hp6Bhkq6T+9DD3IA0sOYQ==</ds:SignatureValue>
|
||||
<ds:KeyInfo>
|
||||
<ds:X509Data>
|
||||
<ds:X509SubjectName>street=CAL. LIBERTAD NRO. 176 INT. 211,emailAddress=sistemas@nubefact.com,CN=NUBEFACT WEB,OU=20600695771,OU=Validado por Llama.pe ER,O=NUBEFACT S.A.,L=LIMA,C=PE</ds:X509SubjectName>
|
||||
<ds:X509Certificate>MIIFLzCCBBegAwIBAgIIeqYdzau699YwDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjYwMzA1MTgzODI1WhcNMjkwMzA0MTgzODAwWjCB1DEoMCYGA1UECQwfQ0FMLiBMSUJFUlRBRCBOUk8uIDE3NiBJTlQuIDIxMTEkMCIGCSqGSIb3DQEJARYVc2lzdGVtYXNAbnViZWZhY3QuY29tMRUwEwYDVQQDDAxOVUJFRkFDVCBXRUIxFDASBgNVBAsMCzIwNjAwNjk1NzcxMSEwHwYDVQQLDBhWYWxpZGFkbyBwb3IgTGxhbWEucGUgRVIxFjAUBgNVBAoMDU5VQkVGQUNUIFMuQS4xDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3PnivJidKntheakfk5pA2SOXyG66a1FQtSW1BtXMpN2C953XT9iJLbR9kD/2hUsTs08drxdkSeKJwyMvUL41VpGX54PkSBXg1nqwbNN9dwj+zSd1PsFcmLtpEizyU4r6B8PSo07cdAzisAhnt3F1X/LcpcuJcUT3x88RJt18vSbh903Ihvp6BV7BCkJk/MJSRKeJnVMYJPtrgLvTxH03DUs6mIozR673WmYZAdzXPo1Kv0JpfrP/XTcaZECe2VQ+l7OEQS/s2bSjL7K8VgvTW+PtkCGZu9q6UUYsr3F1UL7TVad9zEFgL7rMQvELT7r+YWCP4AwVfTrXvqAoMednKQIDAQABo4IBkDCCAYwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAgBgNVHREEGTAXgRVzaXN0ZW1hc0BudWJlZmFjdC5jb20wRgYDVR0gBD8wPTA7Bg0rBgEEAYOXdwABAAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vbGxhbWEucGUvcmVwb3NpdG9yeS8wHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHA6Ly9jcmwubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY3JsMB0GA1UdDgQWBBSZK2idJe/W7w+eTwXNhJ/o8XK6pjAOBgNVHQ8BAf8EBAMCBsAwDQYJKoZIhvcNAQELBQADggEBAIEF6UtQGQ+yLKVVRCdiogInGUGv7IECqg9gMQNZBZ2ZP9SgQOOTFIsDI0psbS3D6u/wJ2vgf78a287ysqJUcGqhW1+plQh4toN3v8bCqwXACTIYW6bUU5bOab0QY//xrLkNZ8Iwa/M/LZstU3dgZjIwXtcMD+ANAIynN4rcNNgeVja8lnbYU3WQ1u9UIjMxtSp1rLf4mwTGSeLI1uuAWgWczkMaFjMF1RJhX9VlKX8qDC+pr/jiu8LTHt8VDeVvDwpZ4qVbI/8qq+VUyXjBffcDdeY5qb75nnlhEMHLey3t/GcEo80nmtjTKmBdroVkooIat7PcSvfQQ+kzrSnV2as=</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</ds:Signature>
|
||||
</ext:ExtensionContent>
|
||||
</ext:UBLExtension>
|
||||
</ext:UBLExtensions>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID>FF03-1100</cbc:ID>
|
||||
<cbc:IssueDate>2026-05-28</cbc:IssueDate>
|
||||
<cbc:IssueTime>21:01:03</cbc:IssueTime>
|
||||
<cbc:InvoiceTypeCode listID="0101" listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01" name="Tipo de Operacion" listSchemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo51">01</cbc:InvoiceTypeCode>
|
||||
<cbc:Note languageLocaleID="1000">TRESCIENTOS SESENTA Y UNO CON 69/100 SOLES</cbc:Note>
|
||||
<cbc:Note>Obs: OPERACION SUJETA AL SPOT CON EL GOBIERNO CENTRAL CTA CTE 00-058-189227-BANCO DE LA NACION N REG MTC 1548287 CNG</cbc:Note>
|
||||
<cbc:DocumentCurrencyCode listID="ISO 4217 Alpha" listAgencyName="United Nations Economic Commission for Europe" listName="Currency">PEN</cbc:DocumentCurrencyCode>
|
||||
<cac:Signature>
|
||||
<cbc:ID>20516287641</cbc:ID>
|
||||
<cbc:Note>WWW.NUBEFACT.COM</cbc:Note>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>20516287641</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>20516287641</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20516287641</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI">150133</cbc:ID>
|
||||
<cbc:AddressTypeCode listAgencyName="PE:SUNAT" listName="Establecimientos anexos">0000</cbc:AddressTypeCode>
|
||||
<cbc:CityName>LIMA</cbc:CityName>
|
||||
<cbc:CountrySubentity>LIMA</cbc:CountrySubentity>
|
||||
<cbc:District>SAN JUAN DE MIRAFLORES</cbc:District>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>MZA. H2 LOTE. 31 P.J. PAMPLONA ALTA-SEC M. GRAU (AV SOLIDARIDAD CON SALVADOR ALLENDE) LIMA - LIMA - SAN JUAN DE MIRAFLORES</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode listID="ISO 3166-1" listAgencyName="United Nations Economic Commission for Europe" listName="Country">PE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06">20100029741</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>A. BERIO Y CIA S.A.C.</cbc:RegistrationName>
|
||||
<cac:RegistrationAddress>
|
||||
<cac:AddressLine>
|
||||
<cbc:Line>AV. 26 DE NOVIEMBRE NRO. 2473 A.H. VIRGEN DE LOURDES (PARADERO 14 NUEVA ESPERANZA - PISO 2) LIMA - LIMA - VILLA MARIA DEL TRIUNFO</cbc:Line>
|
||||
</cac:AddressLine>
|
||||
</cac:RegistrationAddress>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Credito</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">361.69</cbc:Amount>
|
||||
</cac:PaymentTerms>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:ID>FormaPago</cbc:ID>
|
||||
<cbc:PaymentMeansID>Cuota001</cbc:PaymentMeansID>
|
||||
<cbc:Amount currencyID="PEN">361.69</cbc:Amount>
|
||||
<cbc:PaymentDueDate>2026-06-28</cbc:PaymentDueDate>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">306.52</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">306.52</cbc:LineExtensionAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="PEN">361.69</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="PEN">0.00</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="PEN">0.00</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="PEN">0.00</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="PEN">361.69</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">1.0</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="PEN">306.52</cbc:LineExtensionAmount>
|
||||
<cac:PricingReference>
|
||||
<cac:AlternativeConditionPrice>
|
||||
<cbc:PriceAmount currencyID="PEN">361.6936</cbc:PriceAmount>
|
||||
<cbc:PriceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Precio" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16">01</cbc:PriceTypeCode>
|
||||
</cac:AlternativeConditionPrice>
|
||||
</cac:PricingReference>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="PEN">306.52</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="PEN">55.17</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:Percent>18.00</cbc:Percent>
|
||||
<cbc:TaxExemptionReasonCode listAgencyName="PE:SUNAT" listName="Afectacion del IGV" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo07">10</cbc:TaxExemptionReasonCode>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeName="Codigo de tributos" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo05">1000</cbc:ID>
|
||||
<cbc:Name>IGV</cbc:Name>
|
||||
<cbc:TaxTypeCode>VAT</cbc:TaxTypeCode>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:Item>
|
||||
<cbc:Description>Servicio de Transporte ,270 bls de Cemento x s/1.3396, Punto de Partida: Av. Atocongo 1860 – Villa María del Triunfo, Punto de Llegada: Mz H2 Lt 31 Sector Miguel Grau – P. Alta – SJM, Valor referencial s/361.69, GRET: EG03-00000253 y según GRE: T001-0129356 Configuración Vehicular C2// Peso Aprox. 11.475 Tn.</cbc:Description>
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID>01</cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="PEN">306.52</cbc:PriceAmount>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<!-- GENERADO DESDE WWW.NUBEFACT.COM -->
|
||||
</Invoice>
|
||||
Binary file not shown.
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<DespatchAdvice xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"><ext:UBLExtensions xmlns=""><ext:UBLExtension><ext:ExtensionContent><Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||
<SignedInfo>
|
||||
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
|
||||
<Reference URI="">
|
||||
<Transforms>
|
||||
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
|
||||
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
|
||||
</Transforms>
|
||||
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
|
||||
<DigestValue>sWk7w54B3qSkE66OsIliqVPlC98=</DigestValue>
|
||||
</Reference>
|
||||
</SignedInfo>
|
||||
<SignatureValue>l67MapXzaQ8uhdOQr/x/BdHm+uwEGfloD+/8O9DZzlwBGYbMxMBx+KspDmSUkCRqFeRjjpSg/85bKL/W2Fqg0saS0hm+gIPnP6jfAuD3fhmkBOVumvtsajEJ0tITs6+zWqsAQykKKlmgoF4aNDySBuNRjwB4RBIjsh+EoQuuV9JMFb7IgBw93UFe0BxrWfMxtyWTK3B2xOcUpTxWQnTq02cZl/46k68d+HF8NU9EMtZFeWpYU1bh2DkUPUZ4TM2GDD7bcLj5qkYa/xsjQGUDSJRqw1hJQsOphwQjnUex1cxGRUe4oCQ00fxwH1UMAsUCqDHtyspqGL2ugfOgzx+Fog==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIFrjCCBJagAwIBAgIIf9Td7Evg0UswDQYJKoZIhvcNAQELBQAwRjEkMCIGA1UEAwwbTGxhbWEucGUgU0hBMjU2IFN0YW5kYXJkIENBMREwDwYDVQQKDAhMTEFNQS5QRTELMAkGA1UEBhMCUEUwHhcNMjQwODA5MTYxNTM5WhcNMjcwODA5MTYxNTAwWjCCAVQxKzApBgNVBAkMIkFWLiBHQVJDSUxBU08gREUgTEEgVkVHQSBOUk8uIDE0NzIxIjAgBgkqhkiG9w0BCQEWE3JtZXphZ0BzdW5hdC5nb2IucGUxQTA/BgNVBAMMOFNVUEVSSU5ULiBOQUMuIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRwwGgYDVQQLDBNBR0VOVEUgQVVUT01BVElaQURPMS4wLAYDVQQLDCVWYWxpZGFkbyBwb3IgQUJDIElERU5USURBRCBESUdJVEFMIEVSMVQwUgYDVQQKDEtTVVBFUklOVEVOREVOQ0lBIE5BQ0lPTkFMIERFIEFEVUFOQVMgWSBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBIC0gU1VOQVQxDTALBgNVBAcMBExJTUExCzAJBgNVBAYTAlBFMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1apapJOwMj9tBpgKAgjRwIloUk+xwvQZxc0s/4yl4mDSrc/F/PKZ3QBmKb43fFwivqPUvsr68fQTfyLKM14B+xXwlbQ/yh3+87sMyulLhOPmtSOU0PE8Rw0PsmGVxf1L0HPAPc3Gvuhq4Z9Dx5ByED6s+VppDmncvctlJ/NrzYZCk9H91OinTTPVZrDtbmqnOYra8PaTRoCI9Fmndeo9Oo7esM7KVX9f53NEd/mNQqzAOrgSXthFuBZN7zOsGxJ4ZGrVzHSlCH/jFLgObEizHrqisgL1cxKj8QvbGLUjNtUuTvR5IY6hwRLCxbliTa84BN10E0jC7hhAnnuEIAFJiwIDAQABo4IBjjCCAYowDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBRdiFut62X7/mii5NlvPVdyou8rmTBnBggrBgEFBQcBAQRbMFkwNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQubGxhbWEucGUvbGxhbWFwZXN0YW5kYXJkY2EuY2VyMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5sbGFtYS5wZTAeBgNVHREEFzAVgRNybWV6YWdAc3VuYXQuZ29iLnBlMEYGA1UdIAQ/MD0wOwYNKwYBBAGDl3cAAQADATAqMCgGCCsGAQUFBwIBFhxodHRwczovL2xsYW1hLnBlL3JlcG9zaXRvcnkvMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmxsYW1hLnBlL2xsYW1hcGVzdGFuZGFyZGNhLmNybDAdBgNVHQ4EFgQUuRkPCyM25gAu5se9GraC/UO07X8wDgYDVR0PAQH/BAQDAgbAMA0GCSqGSIb3DQEBCwUAA4IBAQBC8+YM7moZ7bKYCS+VzJ8wzydSboWeNuAs2CfkhI8hRMQr1r5WZg8pDlroCslF/r6SjbkrjuDHcGKJTM2riGEjlOD4CLU9VjOP7Td6CIZyJRLaz63pZYOwE0H0weG/PvYpopDZzJ6AXYzZxwYkJ03/x/vwaCss9ZvmsEn2E1xtGbnMe9MEsg8oF0ul3uRn8Qy5gF37fM7YKuF/r4iBS5uSvBcA5J2FbI/PQls7OgICDyb3W16GeluaT9krY5wQxilJSpGVU++nv5NzmRHkquH3ic2It/KP6MZ9X2tfg6FhpF6JaUz7MSY+J0KnDDcfJlhxgnkgoT5tV3Sr6z5PpQH6</X509Certificate><X509IssuerSerial><X509IssuerName>C=PE, O=LLAMA.PE, CN=Llama.pe SHA256 Standard CA</X509IssuerName><X509SerialNumber>9211231144834552139</X509SerialNumber></X509IssuerSerial></X509Data></KeyInfo><Proposito>Cumple proposito</Proposito><Revocacion>Cumple revocacion</Revocacion><TSL>Cumple tsl</TSL><Expiracion>No ha expirado</Expiracion></Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions>
|
||||
<!--ext:UBLExtensions>
|
||||
</ext:UBLExtensions-->
|
||||
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
|
||||
<cbc:CustomizationID>2.0</cbc:CustomizationID>
|
||||
<cbc:ID><![CDATA[EG03-253]]></cbc:ID>
|
||||
|
||||
<!-- FECHA Y HORA DE EMISION -->
|
||||
<cbc:IssueDate>2026-05-22</cbc:IssueDate>
|
||||
<cbc:IssueTime>16:26:26</cbc:IssueTime>
|
||||
<cbc:DespatchAdviceTypeCode listAgencyName="PE:SUNAT" listName="Tipo de Documento" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo01">31</cbc:DespatchAdviceTypeCode>
|
||||
<cbc:Note><![CDATA[GRE: T001-0129356]]></cbc:Note>
|
||||
|
||||
<!-- DOCUMENTOS ADICIONALES (Catalogo D41)-->
|
||||
<cac:AdditionalDocumentReference>
|
||||
<cbc:ID><![CDATA[F001-222569]]></cbc:ID>
|
||||
<cbc:DocumentTypeCode listAgencyName="PE:SUNAT" listName="Documento relacionado al transporte" listURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo61">01</cbc:DocumentTypeCode>
|
||||
<cbc:DocumentType><![CDATA[Factura]]></cbc:DocumentType>
|
||||
<cac:IssuerParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
</cac:IssuerParty>
|
||||
</cac:AdditionalDocumentReference>
|
||||
|
||||
<cac:Signature>
|
||||
<cbc:ID><![CDATA[SUNAT]]></cbc:ID>
|
||||
<cac:SignatoryParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID><![CDATA[20131312955]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name><![CDATA[SUNAT]]></cbc:Name>
|
||||
</cac:PartyName>
|
||||
</cac:SignatoryParty>
|
||||
<cac:DigitalSignatureAttachment>
|
||||
<cac:ExternalReference>
|
||||
<cbc:URI>#SUNAT</cbc:URI>
|
||||
</cac:ExternalReference>
|
||||
</cac:DigitalSignatureAttachment>
|
||||
</cac:Signature>
|
||||
|
||||
<!-- DATOS DEL EMISOR (TRANSPORTISTA) -->
|
||||
<cac:DespatchSupplierParty>
|
||||
<cac:Party>
|
||||
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20516287641]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DespatchSupplierParty>
|
||||
|
||||
<!-- DATOS DEL RECEPTOR (DESTINATARIO) -->
|
||||
<cac:DeliveryCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20516287641]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:DeliveryCustomerParty>
|
||||
|
||||
<!-- DATOS DE QUIEN PAGA EL SERVICIO -->
|
||||
<cac:OriginatorCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:OriginatorCustomerParty>
|
||||
|
||||
<!-- DATOS DEL TRASLADO -->
|
||||
<cac:Shipment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
<!-- PESO BRUTO TOTAL DE LA CARGA -->
|
||||
<cbc:GrossWeightMeasure unitCode="TNE">11.475</cbc:GrossWeightMeasure>
|
||||
|
||||
<!-- INDICADORES -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Indicador de pagador del flete -->
|
||||
<cbc:SpecialInstructions>SUNAT_Envio_IndicadorPagadorFlete_Remitente</cbc:SpecialInstructions>
|
||||
|
||||
<cac:Consignment>
|
||||
<!-- ID OBLIGATORIO POR UBL -->
|
||||
<cbc:ID><![CDATA[SUNAT_Envio]]></cbc:ID>
|
||||
|
||||
</cac:Consignment>
|
||||
|
||||
<cac:ShipmentStage>
|
||||
|
||||
<!-- FECHA DE INICIO DEL TRASLADO -->
|
||||
<cac:TransitPeriod>
|
||||
<cbc:StartDate>2026-05-22</cbc:StartDate>
|
||||
</cac:TransitPeriod>
|
||||
|
||||
<!-- DATOS DEL TRANSPORTISTA -->
|
||||
<cac:CarrierParty>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES -->
|
||||
<cac:PartyLegalEntity>
|
||||
<!-- NUMERO DE REGISTRO DEL MTC -->
|
||||
<cbc:CompanyID><![CDATA[1548287CNG]]></cbc:CompanyID>
|
||||
</cac:PartyLegalEntity>
|
||||
|
||||
</cac:CarrierParty>
|
||||
<!-- CONDUCTOR PRINCIPAL -->
|
||||
<cac:DriverPerson>
|
||||
<!-- TIPO Y NUMERO DE DOCUMENTO DE IDENTIDAD -->
|
||||
<cbc:ID schemeID="1" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[10011751]]></cbc:ID>
|
||||
|
||||
<!-- NOMBRES -->
|
||||
<cbc:FirstName>CUELLAR ALMERCO EDWIN GUIDO</cbc:FirstName>
|
||||
|
||||
<!-- APELLIDOS -->
|
||||
<cbc:FamilyName>CUELLAR ALMERCO EDWIN GUIDO</cbc:FamilyName>
|
||||
|
||||
<!-- TIPO DE CONDUCTOR: PRINCIPAL -->
|
||||
<cbc:JobTitle>Principal</cbc:JobTitle>
|
||||
|
||||
<cac:IdentityDocumentReference>
|
||||
<!-- LICENCIA DE CONDUCIR -->
|
||||
<cbc:ID><![CDATA[Q10011751]]></cbc:ID>
|
||||
</cac:IdentityDocumentReference>
|
||||
</cac:DriverPerson>
|
||||
|
||||
</cac:ShipmentStage>
|
||||
|
||||
<cac:Delivery>
|
||||
<!-- DIRECCION DEL PUNTO DE LLEGADA -->
|
||||
<cac:DeliveryAddress>
|
||||
<!-- UBIGEO DE LLEGADA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150133]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE LLEGADA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DeliveryAddress>
|
||||
|
||||
<cac:Despatch>
|
||||
<!-- DIRECCION DEL PUNTO DE PARTIDA -->
|
||||
<cac:DespatchAddress>
|
||||
<!-- UBIGEO DE PARTIDA -->
|
||||
<cbc:ID schemeName="Ubigeos" schemeAgencyName="PE:INEI"><![CDATA[150143]]></cbc:ID>
|
||||
|
||||
<!-- DIRECCION COMPLETA Y DETALLADA DE PARTIDA -->
|
||||
<cac:AddressLine>
|
||||
<cbc:Line><![CDATA[AV ATOCONGO 1860]]></cbc:Line>
|
||||
</cac:AddressLine>
|
||||
|
||||
</cac:DespatchAddress>
|
||||
|
||||
|
||||
<!-- DATOS DEL REMITENTE -->
|
||||
<cac:DespatchParty>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="6" schemeName="Documento de Identidad" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"><![CDATA[20100029741]]></cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName><![CDATA[A. BERIO Y CIA S.A.C.]]></cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:DespatchParty>
|
||||
</cac:Despatch>
|
||||
</cac:Delivery>
|
||||
|
||||
<cac:TransportHandlingUnit>
|
||||
<!-- NUMERO DE CONTENEDOR -->
|
||||
<cbc:ID><![CDATA[-]]></cbc:ID>
|
||||
|
||||
<cac:TransportEquipment>
|
||||
<!-- VEHICULO PRINCIPAL -->
|
||||
<!-- PLACA - VEHICULO PRINCIPAL -->
|
||||
<cbc:ID><![CDATA[D0P728]]></cbc:ID>
|
||||
|
||||
<!-- Tarjeta Unica Circulacion / Cerificado Habilitacion Vehicular - Principal -->
|
||||
<cac:ApplicableTransportMeans>
|
||||
<cbc:RegistrationNationalityID>0151319401</cbc:RegistrationNationalityID>
|
||||
</cac:ApplicableTransportMeans>
|
||||
|
||||
<!-- AUTORIZACIONES ESPECIALES - VEHICULO PRINCIPAL -->
|
||||
<cac:ShipmentDocumentReference>
|
||||
<cbc:ID schemeID="06" schemeName="Entidad Autorizadora" schemeAgencyName="PE:SUNAT" schemeURI="urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogoD37"/>
|
||||
</cac:ShipmentDocumentReference>
|
||||
|
||||
|
||||
</cac:TransportEquipment>
|
||||
</cac:TransportHandlingUnit>
|
||||
|
||||
|
||||
</cac:Shipment>
|
||||
|
||||
<!-- DETALLES DE BIENES A TRASLADAR -->
|
||||
<cac:DespatchLine>
|
||||
<!-- NUMERO DE ORDEN DEL ITEM -->
|
||||
<cbc:ID><![CDATA[1]]></cbc:ID>
|
||||
|
||||
<!-- CANTIDAD -->
|
||||
<cbc:DeliveredQuantity unitCode="NIU" unitCodeListID="UN/ECE rec 20" unitCodeListAgencyName="United Nations Economic Commission for Europe">270</cbc:DeliveredQuantity>
|
||||
|
||||
<cac:OrderLineReference>
|
||||
<cbc:LineID>1</cbc:LineID>
|
||||
</cac:OrderLineReference>
|
||||
<cac:Item>
|
||||
|
||||
<!-- DESCRIPCION -->
|
||||
<cbc:Description><![CDATA[CEMENTO TIPO I (SOL)]]></cbc:Description>
|
||||
|
||||
<!-- CODIGO DEL ITEM -->
|
||||
<cac:SellersItemIdentification>
|
||||
<cbc:ID><![CDATA[01CE007]]></cbc:ID>
|
||||
</cac:SellersItemIdentification>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--INDICADOR DE BIEN REGULADO POR SUNAT -->
|
||||
</cac:Item>
|
||||
</cac:DespatchLine>
|
||||
|
||||
</DespatchAdvice>
|
||||
@@ -0,0 +1,44 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": null,
|
||||
"fecha_emision": "28/05/2026",
|
||||
"tipo": "01",
|
||||
"serie": "FF03",
|
||||
"numero": "1100",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": null,
|
||||
"total_factura": "361.69",
|
||||
"documentos_referencia": [],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf"
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA",
|
||||
"fecha_emision": "22/05/2026",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "F001",
|
||||
"numero": "222569"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"lineas": [],
|
||||
"ruta_pdf": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/013_correo/20516287641-31-EG03-253.pdf"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,111 @@
|
||||
[
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"fecha_emision": "2026-05-28",
|
||||
"tipo": "01",
|
||||
"serie": "FF03",
|
||||
"numero": "1100",
|
||||
"ruc_receptor": "20100029741",
|
||||
"razon_social_receptor": "A. BERIO Y CIA S.A.C.",
|
||||
"total_factura": 361.69,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253"
|
||||
},
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129356"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": null,
|
||||
"punto_llegada": null,
|
||||
"peso_bruto": null,
|
||||
"unidad_peso_bruto": null,
|
||||
"fecha_traslado": null,
|
||||
"vehiculo_principal": null,
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": null,
|
||||
"nombre_conductor": null,
|
||||
"documento_conductor": null,
|
||||
"ubigeo_partida": null,
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "Servicio de Transporte ,270 bls de Cemento x s/1.3396, Punto de Partida: Av. Atocongo 1860 – Villa María del Triunfo, Punto de Llegada: Mz H2 Lt 31 Sector Miguel Grau – P. Alta – SJM, Valor referencial s/361.69, GRET: EG03-00000253 y según GRE: T001-0129356 Configuración Vehicular C2// Peso Aprox. 11.475 Tn.",
|
||||
"cantidad": 1.0,
|
||||
"precio_unitario": 361.6936,
|
||||
"total_linea": 306.52,
|
||||
"notes_text": "",
|
||||
"guias_remision": [
|
||||
{
|
||||
"tipo": "09",
|
||||
"serie": "T001",
|
||||
"numero": "129356"
|
||||
}
|
||||
],
|
||||
"guia_transportista": {
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Factura",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/013_correo/20516287641-01-FF03-1100.xml",
|
||||
"ruta_pdf": null
|
||||
},
|
||||
{
|
||||
"ruc_emisor": "20516287641",
|
||||
"razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"fecha_emision": "2026-05-22",
|
||||
"tipo": "31",
|
||||
"serie": "EG03",
|
||||
"numero": "253",
|
||||
"ruc_receptor": "20516287641",
|
||||
"razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL",
|
||||
"total_factura": null,
|
||||
"documentos_referencia": [
|
||||
{
|
||||
"tipo": "01",
|
||||
"serie": "F001",
|
||||
"numero": "222569"
|
||||
}
|
||||
],
|
||||
"tiene_detraccion": false,
|
||||
"codigo_detraccion": null,
|
||||
"porcentaje_detraccion": null,
|
||||
"monto_detraccion": null,
|
||||
"punto_partida": "AV ATOCONGO 1860",
|
||||
"punto_llegada": "MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA",
|
||||
"peso_bruto": "11.475",
|
||||
"unidad_peso_bruto": "TNE",
|
||||
"fecha_traslado": "2026-05-22",
|
||||
"vehiculo_principal": "D0P728",
|
||||
"vehiculo_secundario": null,
|
||||
"licencia_conductor": "Q10011751",
|
||||
"nombre_conductor": "CUELLAR ALMERCO EDWIN GUIDO",
|
||||
"documento_conductor": "10011751",
|
||||
"ubigeo_partida": "150143",
|
||||
"lineas": [
|
||||
{
|
||||
"descripcion": "CEMENTO TIPO I (SOL)",
|
||||
"cantidad": 270.0,
|
||||
"precio_unitario": 0.0,
|
||||
"total_linea": 0.0,
|
||||
"notes_text": "",
|
||||
"guias_remision": [],
|
||||
"guia_transportista": null
|
||||
}
|
||||
],
|
||||
"tipo_descripcion": "Guía de Remisión Transportista",
|
||||
"ruta_xml": "/Users/george/Documents/Desarrollo/Python/aberio/descarga_factura_transporte/tests/correos_prueba/013_correo/20516287641-31-EG03-253.xml",
|
||||
"ruta_pdf": null
|
||||
}
|
||||
]
|
||||
Binary file not shown.
Loaded 100 of 233 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user