From 1d6d8691111f90abf4c87de537cba94ca9fa4f1e Mon Sep 17 00:00:00 2001 From: George Date: Thu, 15 Oct 2026 00:14:41 -0500 Subject: [PATCH] se reorganiza tests/ y se agrega suite pytest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Los scripts manuales pasan a tools/ y los correos de ejemplo a tests/fixtures/. Suite de 95 pruebas: caracterización de la extracción sobre los 46 correos (resultados esperados en tests/golden/, fuera de la carpeta que descargar_correos_prueba borra), unitarias de draft_sap, notificaciones, documentos, adjuntos y config_validator, y flujo completo de _procesar_un_correo con SAP/HANA/Outlook simulados. pytest como dependencia dev y configuración en pyproject.toml. Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 3 + README.md | 17 +- docs/inventario.md | 1 + pyproject.toml | 9 + tests/conftest.py | 13 + .../001_correo/10060028686-01-F002-2450.xml | 0 .../001_correo/20506689326-31-V002-11.xml | 0 .../001_correo/xml_resultado_001.json | 0 .../002_correo/20340843607-01-F002-2188.pdf | Bin .../002_correo/20340843607-01-F002-2188.xml | 0 .../002_correo/20340843607-31-V001-227.pdf | Bin .../002_correo/20340843607-31-V001-227.xml | 0 .../002_correo/pdf_resultado_002.json | 0 .../002_correo/xml_resultado_002.json | 0 .../003_correo/20506689326-01-FE07-1559.pdf | Bin .../003_correo/20506689326-01-FE07-1559.xml | 0 .../003_correo/20506689326-31-V002-11.pdf | Bin .../003_correo/20506689326-31-V002-11.xml | 0 .../003_correo/pdf_resultado_003.json | 0 .../003_correo/xml_resultado_003.json | 0 .../004_correo/20551006914-01-F004-5989.xml | 0 .../004_correo/20551006914-09-F004-5989.pdf | Bin .../004_correo/20551006914-31-V002-1427.pdf | Bin .../004_correo/20551006914-31-V002-1427.xml | 0 .../004_correo/pdf_resultado_004.json | 0 .../004_correo/xml_resultado_004.json | 0 .../005_correo/20555929006-01-F004-3544.xml | 0 .../005_correo/20555929006-09-F004-3544.pdf | Bin .../005_correo/20555929006-31-V002-1358.pdf | Bin .../005_correo/20555929006-31-V002-1358.xml | 0 .../005_correo/pdf_resultado_005.json | 0 .../005_correo/xml_resultado_005.json | 0 .../20100811571-01-F011-2786-V002-4575.pdf | Bin .../006_correo/20100811571-01-F011-2786.xml | 0 .../006_correo/20100811571-01-T001-129813.pdf | Bin .../006_correo/20100811571-31-V002-4575.xml | 0 .../006_correo/pdf_resultado_006.json | 0 .../006_correo/xml_resultado_006.json | 0 .../007_correo/10091153136-31-VPP1-516.xml | 0 .../007_correo/xml_resultado_007.json | 0 .../008_correo/20154645005-01-F002-52385.pdf | Bin .../008_correo/20154645005-01-F002-52385.xml | 0 .../008_correo/20154645005-31-2605-33.pdf | Bin .../008_correo/20154645005-31-V001-4156.xml | 0 .../008_correo/pdf_resultado_008.json | 0 .../008_correo/xml_resultado_008.json | 0 .../10091153136-01-FPP1-15407-VPP1-516.pdf | Bin .../009_correo/10091153136-01-FPP1-15407.pdf | Bin .../009_correo/10091153136-01-FPP1-15407.xml | 0 .../009_correo/10091153136-31-VPP1-516.xml | 0 .../009_correo/pdf_resultado_009.json | 0 .../009_correo/xml_resultado_009.json | 0 .../010_correo/10154500010-01-FF01-3308.pdf | Bin .../010_correo/10154500010-31-2605-33.pdf | Bin .../010_correo/10154500010-31-EG03-216.xml | 0 .../CDR-10154500010-01-FF01-3308.xml | 0 .../010_correo/pdf_resultado_010.json | 0 .../010_correo/xml_resultado_010.json | 0 .../011_correo/20516287641-01-FF03-1100.pdf | Bin .../011_correo/20516287641-01-FF03-1100.xml | 0 .../011_correo/20516287641-31-EG03-253.pdf | Bin .../011_correo/20516287641-31-EG03-253.xml | 0 .../011_correo/pdf_resultado_011.json | 0 .../011_correo/xml_resultado_011.json | 0 .../012_correo/20220631541-01-E001-6942.pdf | Bin .../012_correo/20220631541-01-E001-6942.xml | 0 .../012_correo/20220631541-31-EG03-2502.pdf | Bin .../012_correo/pdf_resultado_012.json | 0 .../012_correo/xml_resultado_012.json | 0 .../013_correo/20516287641-01-FF03-1100.pdf | Bin .../013_correo/20516287641-01-FF03-1100.xml | 0 .../013_correo/20516287641-31-EG03-253.pdf | Bin .../013_correo/20516287641-31-EG03-253.xml | 0 .../013_correo/pdf_resultado_013.json | 0 .../013_correo/xml_resultado_013.json | 0 .../014_correo/10154500010-01-FF01-3308.pdf | Bin .../014_correo/10154500010-31-2605-33.pdf | Bin .../014_correo/10154500010-31-EG03-216.xml | 0 .../CDR-10154500010-01-FF01-3308.xml | 0 .../014_correo/pdf_resultado_014.json | 0 .../014_correo/xml_resultado_014.json | 0 .../015_correo/20552807970-01-E001-2403.pdf | Bin .../015_correo/20552807970-01-E001-2403.xml | 0 .../015_correo/pdf_resultado_015.json | 0 .../015_correo/xml_resultado_015.json | 0 .../017_correo/20261374898-01-FF05-100429.pdf | Bin .../017_correo/20261374898-01-FF05-100429.xml | 0 .../017_correo/pdf_resultado_017.json | 0 .../017_correo/xml_resultado_017.json | 0 .../018_correo/20500864703-01-F002-20851.pdf | Bin .../018_correo/20500864703-01-F002-20851.xml | 0 .../CDR-20500864703-01-F002-20851.xml | 0 .../018_correo/pdf_resultado_018.json | 0 .../018_correo/xml_resultado_018.json | 0 .../019_correo/20552793499-01-E001-5506.pdf | Bin .../019_correo/20552793499-01-E001-5506.xml | 0 .../019_correo/pdf_resultado_019.json | 0 .../019_correo/xml_resultado_019.json | 0 .../020_correo/20261374898-01-FF05-100595.pdf | Bin .../020_correo/20261374898-01-FF05-100595.xml | 0 .../020_correo/pdf_resultado_020.json | 0 .../020_correo/xml_resultado_020.json | 0 .../021_correo/20261374898-01-FF05-100595.pdf | Bin .../021_correo/20261374898-01-FF05-100595.xml | 0 .../021_correo/pdf_resultado_021.json | 0 .../021_correo/xml_resultado_021.json | 0 .../022_correo/20154645005-01-F002-53135.pdf | Bin .../022_correo/20154645005-01-F002-53135.xml | 0 .../022_correo/pdf_resultado_022.json | 0 .../022_correo/xml_resultado_022.json | 0 .../023_correo/20538637280-01-F001-70705.pdf | Bin .../023_correo/20538637280-01-F001-70705.xml | 0 .../023_correo/pdf_resultado_023.json | 0 .../023_correo/xml_resultado_023.json | 0 .../024_correo/20537929520-01-F002-486.pdf | Bin .../024_correo/pdf_resultado_024.json | 0 .../025_correo/20537929520-01-F002-488.pdf | Bin .../025_correo/pdf_resultado_025.json | 0 .../026_correo/20537929520-01-F002-486.pdf | Bin .../026_correo/pdf_resultado_026.json | 0 .../027_correo/20537929520-01-F002-486.pdf | Bin .../027_correo/pdf_resultado_027.json | 0 .../028_correo/20537929520-01-F002-486.pdf | Bin .../028_correo/20537929520-01-F002-486.xml | 0 .../028_correo/pdf_resultado_028.json | 0 .../028_correo/xml_resultado_028.json | 0 .../029_correo/20261374898-01-FF05-100595.pdf | Bin .../029_correo/20261374898-01-FF05-100595.xml | 0 .../029_correo/pdf_resultado_029.json | 0 .../029_correo/xml_resultado_029.json | 0 .../030_correo/20154645005-01-F002-53359.pdf | Bin .../030_correo/20154645005-01-F002-53359.xml | 0 .../030_correo/pdf_resultado_030.json | 0 .../030_correo/xml_resultado_030.json | 0 .../031_correo/20500864703-01-F002-21184.pdf | Bin .../031_correo/20500864703-01-F002-21184.xml | 0 .../CDR-20500864703-01-F002-21184.xml | 0 .../031_correo/pdf_resultado_031.json | 0 .../031_correo/xml_resultado_031.json | 0 .../032_correo/20604034303-01-F002-3210.pdf | Bin .../032_correo/20604034303-01-F002-3210.xml | 0 .../032_correo/pdf_resultado_032.json | 0 .../032_correo/xml_resultado_032.json | 0 .../033_correo/20552793499-01-E001-5554.pdf | Bin .../033_correo/20552793499-01-E001-5554.xml | 0 .../033_correo/pdf_resultado_033.json | 0 .../033_correo/xml_resultado_033.json | 0 .../035_correo/20614715252-01-E001-737.pdf | Bin .../035_correo/20614715252-01-E001-737.xml | 0 .../035_correo/pdf_resultado_035.json | 0 .../035_correo/xml_resultado_035.json | 0 .../036_correo/20520758829-01-E001-1214.pdf | Bin .../036_correo/20520758829-01-E001-1214.xml | 0 .../036_correo/pdf_resultado_036.json | 0 .../036_correo/xml_resultado_036.json | 0 .../037_correo/20524528992-01-E001-861.pdf | Bin .../037_correo/20524528992-01-E001-861.xml | 0 .../037_correo/pdf_resultado_037.json | 0 .../037_correo/xml_resultado_037.json | 0 .../038_correo/20612674133-01-E001-2.pdf | Bin .../038_correo/20612674133-01-E001-2.xml | 0 .../038_correo/pdf_resultado_038.json | 0 .../038_correo/xml_resultado_038.json | 0 .../039_correo/10154250161-01-E001-858.pdf | Bin .../039_correo/10154250161-01-E001-858.xml | 0 .../039_correo/pdf_resultado_039.json | 0 .../039_correo/xml_resultado_039.json | 0 .../040_correo/20520758829-01-E001-1214.pdf | Bin .../040_correo/20520758829-01-E001-1214.xml | 0 .../040_correo/pdf_resultado_040.json | 0 .../040_correo/xml_resultado_040.json | 0 .../041_correo/20524528992-01-E001-861.pdf | Bin .../041_correo/20524528992-01-E001-861.xml | 0 .../041_correo/pdf_resultado_041.json | 0 .../041_correo/xml_resultado_041.json | 0 .../042_correo/20220631541-01-E001-6994.pdf | Bin .../042_correo/20220631541-01-E001-6994.xml | 0 .../042_correo/pdf_resultado_042.json | 0 .../042_correo/xml_resultado_042.json | 0 .../043_correo/20525144951-01-E001-15679.pdf | Bin .../043_correo/20525144951-01-E001-15679.xml | 0 .../043_correo/pdf_resultado_043.json | 0 .../043_correo/xml_resultado_043.json | 0 .../044_correo/20220631541-01-E001-6994.pdf | Bin .../044_correo/20220631541-01-E001-6994.xml | 0 .../044_correo/pdf_resultado_044.json | 0 .../044_correo/xml_resultado_044.json | 0 .../045_correo/10075211215-01-E001-7266.pdf | Bin .../045_correo/10075211215-01-E001-7266.xml | 0 .../045_correo/pdf_resultado_045.json | 0 .../045_correo/xml_resultado_045.json | 0 .../046_correo/20525144951-01-E001-15864.pdf | Bin .../046_correo/20525144951-01-E001-15864.xml | 0 .../046_correo/pdf_resultado_046.json | 0 .../046_correo/xml_resultado_046.json | 0 .../047_correo/20603551151-01-E001-3915.pdf | Bin .../047_correo/20603551151-01-E001-3915.xml | 0 .../047_correo/pdf_resultado_047.json | 0 .../047_correo/xml_resultado_047.json | 0 .../048_correo/20220631541-01-E001-7055.pdf | Bin .../048_correo/20220631541-01-E001-7055.xml | 0 .../048_correo/pdf_resultado_048.json | 0 .../048_correo/xml_resultado_048.json | 0 .../correos_prueba/indice_correos.json | 0 tests/golden/001_correo.json | 138 ++++ tests/golden/002_correo.json | 189 ++++++ tests/golden/003_correo.json | 223 +++++++ tests/golden/004_correo.json | 167 +++++ tests/golden/005_correo.json | 167 +++++ tests/golden/006_correo.json | 158 +++++ tests/golden/007_correo.json | 64 ++ tests/golden/008_correo.json | 198 ++++++ tests/golden/009_correo.json | 170 +++++ tests/golden/010_correo.json | 109 ++++ tests/golden/011_correo.json | 164 +++++ tests/golden/012_correo.json | 134 ++++ tests/golden/013_correo.json | 164 +++++ tests/golden/014_correo.json | 109 ++++ tests/golden/015_correo.json | 112 ++++ tests/golden/017_correo.json | 528 +++++++++++++++ tests/golden/018_correo.json | 115 ++++ tests/golden/019_correo.json | 112 ++++ tests/golden/020_correo.json | 606 ++++++++++++++++++ tests/golden/021_correo.json | 528 +++++++++++++++ tests/golden/022_correo.json | 114 ++++ tests/golden/023_correo.json | 114 ++++ tests/golden/024_correo.json | 11 + tests/golden/025_correo.json | 11 + tests/golden/026_correo.json | 11 + tests/golden/027_correo.json | 11 + tests/golden/028_correo.json | 86 +++ tests/golden/029_correo.json | 528 +++++++++++++++ tests/golden/030_correo.json | 114 ++++ tests/golden/031_correo.json | 115 ++++ tests/golden/032_correo.json | 95 +++ tests/golden/033_correo.json | 120 ++++ tests/golden/035_correo.json | 91 +++ tests/golden/036_correo.json | 130 ++++ tests/golden/037_correo.json | 122 ++++ tests/golden/038_correo.json | 91 +++ tests/golden/039_correo.json | 120 ++++ tests/golden/040_correo.json | 130 ++++ tests/golden/041_correo.json | 122 ++++ tests/golden/042_correo.json | 109 ++++ tests/golden/043_correo.json | 130 ++++ tests/golden/044_correo.json | 109 ++++ tests/golden/045_correo.json | 112 ++++ tests/golden/046_correo.json | 130 ++++ tests/golden/047_correo.json | 122 ++++ tests/golden/048_correo.json | 119 ++++ tests/test_config_validator.py | 76 +++ tests/test_documentos.py | 123 ++++ tests/test_draft_sap.py | 232 +++++++ tests/test_extraccion_correos.py | 85 +++ tests/test_notificaciones.py | 46 ++ tests/test_pipeline_flujo.py | 146 +++++ {tests => tools}/completar_guias_pipeline.py | 2 +- {tests => tools}/descargar_correos_prueba.py | 2 +- {tests => tools}/explorar_notes_xml.py | 2 +- {tests => tools}/procesar_pdfs_prueba.py | 2 +- {tests => tools}/procesar_xmls_prueba.py | 2 +- 261 files changed, 7876 insertions(+), 7 deletions(-) create mode 100644 tests/conftest.py rename tests/{ => fixtures}/correos_prueba/001_correo/10060028686-01-F002-2450.xml (100%) rename tests/{ => fixtures}/correos_prueba/001_correo/20506689326-31-V002-11.xml (100%) rename tests/{ => fixtures}/correos_prueba/001_correo/xml_resultado_001.json (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/20340843607-01-F002-2188.pdf (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/20340843607-01-F002-2188.xml (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/20340843607-31-V001-227.pdf (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/20340843607-31-V001-227.xml (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/pdf_resultado_002.json (100%) rename tests/{ => fixtures}/correos_prueba/002_correo/xml_resultado_002.json (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/20506689326-01-FE07-1559.xml (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/20506689326-31-V002-11.pdf (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/20506689326-31-V002-11.xml (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/pdf_resultado_003.json (100%) rename tests/{ => fixtures}/correos_prueba/003_correo/xml_resultado_003.json (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/20551006914-01-F004-5989.xml (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/20551006914-09-F004-5989.pdf (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/20551006914-31-V002-1427.pdf (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/20551006914-31-V002-1427.xml (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/pdf_resultado_004.json (100%) rename tests/{ => fixtures}/correos_prueba/004_correo/xml_resultado_004.json (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/20555929006-01-F004-3544.xml (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/20555929006-09-F004-3544.pdf (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/20555929006-31-V002-1358.pdf (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/20555929006-31-V002-1358.xml (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/pdf_resultado_005.json (100%) rename tests/{ => fixtures}/correos_prueba/005_correo/xml_resultado_005.json (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/20100811571-01-F011-2786-V002-4575.pdf (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/20100811571-01-F011-2786.xml (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/20100811571-01-T001-129813.pdf (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/20100811571-31-V002-4575.xml (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/pdf_resultado_006.json (100%) rename tests/{ => fixtures}/correos_prueba/006_correo/xml_resultado_006.json (100%) rename tests/{ => fixtures}/correos_prueba/007_correo/10091153136-31-VPP1-516.xml (100%) rename tests/{ => fixtures}/correos_prueba/007_correo/xml_resultado_007.json (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/20154645005-01-F002-52385.pdf (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/20154645005-01-F002-52385.xml (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/20154645005-31-2605-33.pdf (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/20154645005-31-V001-4156.xml (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/pdf_resultado_008.json (100%) rename tests/{ => fixtures}/correos_prueba/008_correo/xml_resultado_008.json (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/10091153136-01-FPP1-15407-VPP1-516.pdf (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/10091153136-31-VPP1-516.xml (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/pdf_resultado_009.json (100%) rename tests/{ => fixtures}/correos_prueba/009_correo/xml_resultado_009.json (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/10154500010-31-2605-33.pdf (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/10154500010-31-EG03-216.xml (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/CDR-10154500010-01-FF01-3308.xml (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/pdf_resultado_010.json (100%) rename tests/{ => fixtures}/correos_prueba/010_correo/xml_resultado_010.json (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/20516287641-01-FF03-1100.xml (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/20516287641-31-EG03-253.pdf (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/20516287641-31-EG03-253.xml (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/pdf_resultado_011.json (100%) rename tests/{ => fixtures}/correos_prueba/011_correo/xml_resultado_011.json (100%) rename tests/{ => fixtures}/correos_prueba/012_correo/20220631541-01-E001-6942.pdf (100%) rename tests/{ => fixtures}/correos_prueba/012_correo/20220631541-01-E001-6942.xml (100%) rename tests/{ => fixtures}/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf (100%) rename tests/{ => fixtures}/correos_prueba/012_correo/pdf_resultado_012.json (100%) rename tests/{ => fixtures}/correos_prueba/012_correo/xml_resultado_012.json (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/20516287641-01-FF03-1100.xml (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/20516287641-31-EG03-253.pdf (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/20516287641-31-EG03-253.xml (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/pdf_resultado_013.json (100%) rename tests/{ => fixtures}/correos_prueba/013_correo/xml_resultado_013.json (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/10154500010-01-FF01-3308.pdf (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/10154500010-31-2605-33.pdf (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/10154500010-31-EG03-216.xml (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/CDR-10154500010-01-FF01-3308.xml (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/pdf_resultado_014.json (100%) rename tests/{ => fixtures}/correos_prueba/014_correo/xml_resultado_014.json (100%) rename tests/{ => fixtures}/correos_prueba/015_correo/20552807970-01-E001-2403.pdf (100%) rename tests/{ => fixtures}/correos_prueba/015_correo/20552807970-01-E001-2403.xml (100%) rename tests/{ => fixtures}/correos_prueba/015_correo/pdf_resultado_015.json (100%) rename tests/{ => fixtures}/correos_prueba/015_correo/xml_resultado_015.json (100%) rename tests/{ => fixtures}/correos_prueba/017_correo/20261374898-01-FF05-100429.pdf (100%) rename tests/{ => fixtures}/correos_prueba/017_correo/20261374898-01-FF05-100429.xml (100%) rename tests/{ => fixtures}/correos_prueba/017_correo/pdf_resultado_017.json (100%) rename tests/{ => fixtures}/correos_prueba/017_correo/xml_resultado_017.json (100%) rename tests/{ => fixtures}/correos_prueba/018_correo/20500864703-01-F002-20851.pdf (100%) rename tests/{ => fixtures}/correos_prueba/018_correo/20500864703-01-F002-20851.xml (100%) rename tests/{ => fixtures}/correos_prueba/018_correo/CDR-20500864703-01-F002-20851.xml (100%) rename tests/{ => fixtures}/correos_prueba/018_correo/pdf_resultado_018.json (100%) rename tests/{ => fixtures}/correos_prueba/018_correo/xml_resultado_018.json (100%) rename tests/{ => fixtures}/correos_prueba/019_correo/20552793499-01-E001-5506.pdf (100%) rename tests/{ => fixtures}/correos_prueba/019_correo/20552793499-01-E001-5506.xml (100%) rename tests/{ => fixtures}/correos_prueba/019_correo/pdf_resultado_019.json (100%) rename tests/{ => fixtures}/correos_prueba/019_correo/xml_resultado_019.json (100%) rename tests/{ => fixtures}/correos_prueba/020_correo/20261374898-01-FF05-100595.pdf (100%) rename tests/{ => fixtures}/correos_prueba/020_correo/20261374898-01-FF05-100595.xml (100%) rename tests/{ => fixtures}/correos_prueba/020_correo/pdf_resultado_020.json (100%) rename tests/{ => fixtures}/correos_prueba/020_correo/xml_resultado_020.json (100%) rename tests/{ => fixtures}/correos_prueba/021_correo/20261374898-01-FF05-100595.pdf (100%) rename tests/{ => fixtures}/correos_prueba/021_correo/20261374898-01-FF05-100595.xml (100%) rename tests/{ => fixtures}/correos_prueba/021_correo/pdf_resultado_021.json (100%) rename tests/{ => fixtures}/correos_prueba/021_correo/xml_resultado_021.json (100%) rename tests/{ => fixtures}/correos_prueba/022_correo/20154645005-01-F002-53135.pdf (100%) rename tests/{ => fixtures}/correos_prueba/022_correo/20154645005-01-F002-53135.xml (100%) rename tests/{ => fixtures}/correos_prueba/022_correo/pdf_resultado_022.json (100%) rename tests/{ => fixtures}/correos_prueba/022_correo/xml_resultado_022.json (100%) rename tests/{ => fixtures}/correos_prueba/023_correo/20538637280-01-F001-70705.pdf (100%) rename tests/{ => fixtures}/correos_prueba/023_correo/20538637280-01-F001-70705.xml (100%) rename tests/{ => fixtures}/correos_prueba/023_correo/pdf_resultado_023.json (100%) rename tests/{ => fixtures}/correos_prueba/023_correo/xml_resultado_023.json (100%) rename tests/{ => fixtures}/correos_prueba/024_correo/20537929520-01-F002-486.pdf (100%) rename tests/{ => fixtures}/correos_prueba/024_correo/pdf_resultado_024.json (100%) rename tests/{ => fixtures}/correos_prueba/025_correo/20537929520-01-F002-488.pdf (100%) rename tests/{ => fixtures}/correos_prueba/025_correo/pdf_resultado_025.json (100%) rename tests/{ => fixtures}/correos_prueba/026_correo/20537929520-01-F002-486.pdf (100%) rename tests/{ => fixtures}/correos_prueba/026_correo/pdf_resultado_026.json (100%) rename tests/{ => fixtures}/correos_prueba/027_correo/20537929520-01-F002-486.pdf (100%) rename tests/{ => fixtures}/correos_prueba/027_correo/pdf_resultado_027.json (100%) rename tests/{ => fixtures}/correos_prueba/028_correo/20537929520-01-F002-486.pdf (100%) rename tests/{ => fixtures}/correos_prueba/028_correo/20537929520-01-F002-486.xml (100%) rename tests/{ => fixtures}/correos_prueba/028_correo/pdf_resultado_028.json (100%) rename tests/{ => fixtures}/correos_prueba/028_correo/xml_resultado_028.json (100%) rename tests/{ => fixtures}/correos_prueba/029_correo/20261374898-01-FF05-100595.pdf (100%) rename tests/{ => fixtures}/correos_prueba/029_correo/20261374898-01-FF05-100595.xml (100%) rename tests/{ => fixtures}/correos_prueba/029_correo/pdf_resultado_029.json (100%) rename tests/{ => fixtures}/correos_prueba/029_correo/xml_resultado_029.json (100%) rename tests/{ => fixtures}/correos_prueba/030_correo/20154645005-01-F002-53359.pdf (100%) rename tests/{ => fixtures}/correos_prueba/030_correo/20154645005-01-F002-53359.xml (100%) rename tests/{ => fixtures}/correos_prueba/030_correo/pdf_resultado_030.json (100%) rename tests/{ => fixtures}/correos_prueba/030_correo/xml_resultado_030.json (100%) rename tests/{ => fixtures}/correos_prueba/031_correo/20500864703-01-F002-21184.pdf (100%) rename tests/{ => fixtures}/correos_prueba/031_correo/20500864703-01-F002-21184.xml (100%) rename tests/{ => fixtures}/correos_prueba/031_correo/CDR-20500864703-01-F002-21184.xml (100%) rename tests/{ => fixtures}/correos_prueba/031_correo/pdf_resultado_031.json (100%) rename tests/{ => fixtures}/correos_prueba/031_correo/xml_resultado_031.json (100%) rename tests/{ => fixtures}/correos_prueba/032_correo/20604034303-01-F002-3210.pdf (100%) rename tests/{ => fixtures}/correos_prueba/032_correo/20604034303-01-F002-3210.xml (100%) rename tests/{ => fixtures}/correos_prueba/032_correo/pdf_resultado_032.json (100%) rename tests/{ => fixtures}/correos_prueba/032_correo/xml_resultado_032.json (100%) rename tests/{ => fixtures}/correos_prueba/033_correo/20552793499-01-E001-5554.pdf (100%) rename tests/{ => fixtures}/correos_prueba/033_correo/20552793499-01-E001-5554.xml (100%) rename tests/{ => fixtures}/correos_prueba/033_correo/pdf_resultado_033.json (100%) rename tests/{ => fixtures}/correos_prueba/033_correo/xml_resultado_033.json (100%) rename tests/{ => fixtures}/correos_prueba/035_correo/20614715252-01-E001-737.pdf (100%) rename tests/{ => fixtures}/correos_prueba/035_correo/20614715252-01-E001-737.xml (100%) rename tests/{ => fixtures}/correos_prueba/035_correo/pdf_resultado_035.json (100%) rename tests/{ => fixtures}/correos_prueba/035_correo/xml_resultado_035.json (100%) rename tests/{ => fixtures}/correos_prueba/036_correo/20520758829-01-E001-1214.pdf (100%) rename tests/{ => fixtures}/correos_prueba/036_correo/20520758829-01-E001-1214.xml (100%) rename tests/{ => fixtures}/correos_prueba/036_correo/pdf_resultado_036.json (100%) rename tests/{ => fixtures}/correos_prueba/036_correo/xml_resultado_036.json (100%) rename tests/{ => fixtures}/correos_prueba/037_correo/20524528992-01-E001-861.pdf (100%) rename tests/{ => fixtures}/correos_prueba/037_correo/20524528992-01-E001-861.xml (100%) rename tests/{ => fixtures}/correos_prueba/037_correo/pdf_resultado_037.json (100%) rename tests/{ => fixtures}/correos_prueba/037_correo/xml_resultado_037.json (100%) rename tests/{ => fixtures}/correos_prueba/038_correo/20612674133-01-E001-2.pdf (100%) rename tests/{ => fixtures}/correos_prueba/038_correo/20612674133-01-E001-2.xml (100%) rename tests/{ => fixtures}/correos_prueba/038_correo/pdf_resultado_038.json (100%) rename tests/{ => fixtures}/correos_prueba/038_correo/xml_resultado_038.json (100%) rename tests/{ => fixtures}/correos_prueba/039_correo/10154250161-01-E001-858.pdf (100%) rename tests/{ => fixtures}/correos_prueba/039_correo/10154250161-01-E001-858.xml (100%) rename tests/{ => fixtures}/correos_prueba/039_correo/pdf_resultado_039.json (100%) rename tests/{ => fixtures}/correos_prueba/039_correo/xml_resultado_039.json (100%) rename tests/{ => fixtures}/correos_prueba/040_correo/20520758829-01-E001-1214.pdf (100%) rename tests/{ => fixtures}/correos_prueba/040_correo/20520758829-01-E001-1214.xml (100%) rename tests/{ => fixtures}/correos_prueba/040_correo/pdf_resultado_040.json (100%) rename tests/{ => fixtures}/correos_prueba/040_correo/xml_resultado_040.json (100%) rename tests/{ => fixtures}/correos_prueba/041_correo/20524528992-01-E001-861.pdf (100%) rename tests/{ => fixtures}/correos_prueba/041_correo/20524528992-01-E001-861.xml (100%) rename tests/{ => fixtures}/correos_prueba/041_correo/pdf_resultado_041.json (100%) rename tests/{ => fixtures}/correos_prueba/041_correo/xml_resultado_041.json (100%) rename tests/{ => fixtures}/correos_prueba/042_correo/20220631541-01-E001-6994.pdf (100%) rename tests/{ => fixtures}/correos_prueba/042_correo/20220631541-01-E001-6994.xml (100%) rename tests/{ => fixtures}/correos_prueba/042_correo/pdf_resultado_042.json (100%) rename tests/{ => fixtures}/correos_prueba/042_correo/xml_resultado_042.json (100%) rename tests/{ => fixtures}/correos_prueba/043_correo/20525144951-01-E001-15679.pdf (100%) rename tests/{ => fixtures}/correos_prueba/043_correo/20525144951-01-E001-15679.xml (100%) rename tests/{ => fixtures}/correos_prueba/043_correo/pdf_resultado_043.json (100%) rename tests/{ => fixtures}/correos_prueba/043_correo/xml_resultado_043.json (100%) rename tests/{ => fixtures}/correos_prueba/044_correo/20220631541-01-E001-6994.pdf (100%) rename tests/{ => fixtures}/correos_prueba/044_correo/20220631541-01-E001-6994.xml (100%) rename tests/{ => fixtures}/correos_prueba/044_correo/pdf_resultado_044.json (100%) rename tests/{ => fixtures}/correos_prueba/044_correo/xml_resultado_044.json (100%) rename tests/{ => fixtures}/correos_prueba/045_correo/10075211215-01-E001-7266.pdf (100%) rename tests/{ => fixtures}/correos_prueba/045_correo/10075211215-01-E001-7266.xml (100%) rename tests/{ => fixtures}/correos_prueba/045_correo/pdf_resultado_045.json (100%) rename tests/{ => fixtures}/correos_prueba/045_correo/xml_resultado_045.json (100%) rename tests/{ => fixtures}/correos_prueba/046_correo/20525144951-01-E001-15864.pdf (100%) rename tests/{ => fixtures}/correos_prueba/046_correo/20525144951-01-E001-15864.xml (100%) rename tests/{ => fixtures}/correos_prueba/046_correo/pdf_resultado_046.json (100%) rename tests/{ => fixtures}/correos_prueba/046_correo/xml_resultado_046.json (100%) rename tests/{ => fixtures}/correos_prueba/047_correo/20603551151-01-E001-3915.pdf (100%) rename tests/{ => fixtures}/correos_prueba/047_correo/20603551151-01-E001-3915.xml (100%) rename tests/{ => fixtures}/correos_prueba/047_correo/pdf_resultado_047.json (100%) rename tests/{ => fixtures}/correos_prueba/047_correo/xml_resultado_047.json (100%) rename tests/{ => fixtures}/correos_prueba/048_correo/20220631541-01-E001-7055.pdf (100%) rename tests/{ => fixtures}/correos_prueba/048_correo/20220631541-01-E001-7055.xml (100%) rename tests/{ => fixtures}/correos_prueba/048_correo/pdf_resultado_048.json (100%) rename tests/{ => fixtures}/correos_prueba/048_correo/xml_resultado_048.json (100%) rename tests/{ => fixtures}/correos_prueba/indice_correos.json (100%) create mode 100644 tests/golden/001_correo.json create mode 100644 tests/golden/002_correo.json create mode 100644 tests/golden/003_correo.json create mode 100644 tests/golden/004_correo.json create mode 100644 tests/golden/005_correo.json create mode 100644 tests/golden/006_correo.json create mode 100644 tests/golden/007_correo.json create mode 100644 tests/golden/008_correo.json create mode 100644 tests/golden/009_correo.json create mode 100644 tests/golden/010_correo.json create mode 100644 tests/golden/011_correo.json create mode 100644 tests/golden/012_correo.json create mode 100644 tests/golden/013_correo.json create mode 100644 tests/golden/014_correo.json create mode 100644 tests/golden/015_correo.json create mode 100644 tests/golden/017_correo.json create mode 100644 tests/golden/018_correo.json create mode 100644 tests/golden/019_correo.json create mode 100644 tests/golden/020_correo.json create mode 100644 tests/golden/021_correo.json create mode 100644 tests/golden/022_correo.json create mode 100644 tests/golden/023_correo.json create mode 100644 tests/golden/024_correo.json create mode 100644 tests/golden/025_correo.json create mode 100644 tests/golden/026_correo.json create mode 100644 tests/golden/027_correo.json create mode 100644 tests/golden/028_correo.json create mode 100644 tests/golden/029_correo.json create mode 100644 tests/golden/030_correo.json create mode 100644 tests/golden/031_correo.json create mode 100644 tests/golden/032_correo.json create mode 100644 tests/golden/033_correo.json create mode 100644 tests/golden/035_correo.json create mode 100644 tests/golden/036_correo.json create mode 100644 tests/golden/037_correo.json create mode 100644 tests/golden/038_correo.json create mode 100644 tests/golden/039_correo.json create mode 100644 tests/golden/040_correo.json create mode 100644 tests/golden/041_correo.json create mode 100644 tests/golden/042_correo.json create mode 100644 tests/golden/043_correo.json create mode 100644 tests/golden/044_correo.json create mode 100644 tests/golden/045_correo.json create mode 100644 tests/golden/046_correo.json create mode 100644 tests/golden/047_correo.json create mode 100644 tests/golden/048_correo.json create mode 100644 tests/test_config_validator.py create mode 100644 tests/test_documentos.py create mode 100644 tests/test_draft_sap.py create mode 100644 tests/test_extraccion_correos.py create mode 100644 tests/test_notificaciones.py create mode 100644 tests/test_pipeline_flujo.py rename {tests => tools}/completar_guias_pipeline.py (95%) rename {tests => tools}/descargar_correos_prueba.py (96%) rename {tests => tools}/explorar_notes_xml.py (92%) rename {tests => tools}/procesar_pdfs_prueba.py (97%) rename {tests => tools}/procesar_xmls_prueba.py (97%) diff --git a/.gitignore b/.gitignore index 4304f8b..a938570 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ adjuntos/ resultado/ emails.db .env.dev +.pytest_cache/ +*.egg-info/ +build/ procesos/ diff --git a/README.md b/README.md index ff9b5d7..0dcef32 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,19 @@ python tools/consulta_rapida.py --set # reprocesar correos por ID (se El demonio trabaja por bloques horarios (cada 1, 5, 30 o 60 minutos según la hora) y duerme fuera de ellos. Los bloques están en `HORARIOS` de `main.py` y se explican en [`docs/main.md`](docs/main.md). +## Pruebas + +```bash +pip install -e ".[dev]" # instala pytest +pytest # ~95 pruebas, unos 3 segundos; no tocan SAP, HANA ni Outlook +``` + +- **Extracción** (`tests/test_extraccion_correos.py`): corre la extracción real sobre cada correo de `tests/fixtures/correos_prueba/` y la compara con `tests/golden/.json`. Esos resultados esperados fijan el comportamiento actual; no prueban que sea correcto. Si cambias la extracción a propósito, revisa el diff y regenéralos con `UPDATE_GOLDEN=1 pytest tests/test_extraccion_correos.py`. +- **Unitarias**: validación de precios, construcción del draft, notificaciones, guías, copia a red, filtrado de adjuntos y validación del `.env`. +- **Flujo completo** (`tests/test_pipeline_flujo.py`): `_procesar_un_correo` con SAP, HANA, Outlook y la BD simulados. + +Los scripts de `tools/` (`procesar_pdfs_prueba.py`, `procesar_xmls_prueba.py`, etc.) son anteriores a la suite: escriben `xml_resultado_*.json` y `pdf_resultado_*.json` dentro de cada carpeta de `tests/fixtures/correos_prueba/`. Esos archivos no los usa ninguna prueba y pueden estar desactualizados. `tools/descargar_correos_prueba.py` **borra y vuelve a descargar** toda esa carpeta de correos reales. + ## Carpetas de salida (ignoradas por git) | Ruta | Contenido | @@ -62,8 +75,8 @@ El demonio trabaja por bloques horarios (cada 1, 5, 30 o 60 minutos según la ho | `sunat_schema.py`, `pdf_utilities.py` | Lectura de XML SUNAT y de PDF | | `database_utilities.py`, `email_utilities.py` | SQLite local; ZIP y filtrado de adjuntos | | `logger_manager.py`, `config_validator.py`, `pipeline_utils.py` | Logging, validación del `.env`, utilidades | -| `tools/` | Scripts manuales (`consulta_rapida.py`, `aberio.http`, datos de prueba) | -| `tests/` | Scripts de prueba manual y correos de ejemplo (`tests/correos_prueba/`) | +| `tools/` | Scripts manuales: reprocesar correos, regenerar/inspeccionar los correos de prueba, `aberio.http` | +| `tests/` | Suite pytest, correos de ejemplo (`tests/fixtures/`) y resultados esperados (`tests/golden/`) | ## Documentación diff --git a/docs/inventario.md b/docs/inventario.md index 372d3bb..05cb5a7 100644 --- a/docs/inventario.md +++ b/docs/inventario.md @@ -18,6 +18,7 @@ | `outlook_utilities.py` | 249 | Comunicación con Microsoft Graph | | `hana_manager.py` | 141 | Comunicación con SAP HANA directa (fallback de `sapb1_manager` y valor referencial) | | `database_utilities.py` | 117 | SQLite local (cache de correos) | +| `tools/*_prueba.py`, `tools/completar_guias_pipeline.py`, `tools/explorar_notes_xml.py` | — | Scripts manuales sobre `tests/fixtures/correos_prueba/` (anteriores a la suite pytest) | | `tools/consulta_rapida.py` | 120 | Script auxiliar para reprocesar correos por ID (sets en `tools/ids_prueba.json`) | | `config_validator.py` | 83 | Valida el `.env` al arrancar (obligatorias, ruta de red, avisos de SSL) | | `email_utilities.py` | 55 | Utilitarios de adjuntos (ZIP, filtrado) | diff --git a/pyproject.toml b/pyproject.toml index eff64d3..8c7dedc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,15 @@ dependencies = [ "urllib3==2.7.0", ] +[project.optional-dependencies] +dev = [ + "pytest==9.1.1", +] + +[tool.pytest.ini_options] +testpaths = ["tests"] +pythonpath = ["."] + [tool.setuptools] py-modules = [ "adjuntos", diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..ff2d77a --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,13 @@ +import os + +import pytest + +RAIZ = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +FIXTURES = os.path.join(RAIZ, "tests", "fixtures", "correos_prueba") +GOLDEN = os.path.join(RAIZ, "tests", "golden") + + +@pytest.fixture +def actualizar_golden() -> bool: + """True si se ejecutó con ``UPDATE_GOLDEN=1`` (regenera los resultados esperados).""" + return os.environ.get("UPDATE_GOLDEN") == "1" diff --git a/tests/correos_prueba/001_correo/10060028686-01-F002-2450.xml b/tests/fixtures/correos_prueba/001_correo/10060028686-01-F002-2450.xml similarity index 100% rename from tests/correos_prueba/001_correo/10060028686-01-F002-2450.xml rename to tests/fixtures/correos_prueba/001_correo/10060028686-01-F002-2450.xml diff --git a/tests/correos_prueba/001_correo/20506689326-31-V002-11.xml b/tests/fixtures/correos_prueba/001_correo/20506689326-31-V002-11.xml similarity index 100% rename from tests/correos_prueba/001_correo/20506689326-31-V002-11.xml rename to tests/fixtures/correos_prueba/001_correo/20506689326-31-V002-11.xml diff --git a/tests/correos_prueba/001_correo/xml_resultado_001.json b/tests/fixtures/correos_prueba/001_correo/xml_resultado_001.json similarity index 100% rename from tests/correos_prueba/001_correo/xml_resultado_001.json rename to tests/fixtures/correos_prueba/001_correo/xml_resultado_001.json diff --git a/tests/correos_prueba/002_correo/20340843607-01-F002-2188.pdf b/tests/fixtures/correos_prueba/002_correo/20340843607-01-F002-2188.pdf similarity index 100% rename from tests/correos_prueba/002_correo/20340843607-01-F002-2188.pdf rename to tests/fixtures/correos_prueba/002_correo/20340843607-01-F002-2188.pdf diff --git a/tests/correos_prueba/002_correo/20340843607-01-F002-2188.xml b/tests/fixtures/correos_prueba/002_correo/20340843607-01-F002-2188.xml similarity index 100% rename from tests/correos_prueba/002_correo/20340843607-01-F002-2188.xml rename to tests/fixtures/correos_prueba/002_correo/20340843607-01-F002-2188.xml diff --git a/tests/correos_prueba/002_correo/20340843607-31-V001-227.pdf b/tests/fixtures/correos_prueba/002_correo/20340843607-31-V001-227.pdf similarity index 100% rename from tests/correos_prueba/002_correo/20340843607-31-V001-227.pdf rename to tests/fixtures/correos_prueba/002_correo/20340843607-31-V001-227.pdf diff --git a/tests/correos_prueba/002_correo/20340843607-31-V001-227.xml b/tests/fixtures/correos_prueba/002_correo/20340843607-31-V001-227.xml similarity index 100% rename from tests/correos_prueba/002_correo/20340843607-31-V001-227.xml rename to tests/fixtures/correos_prueba/002_correo/20340843607-31-V001-227.xml diff --git a/tests/correos_prueba/002_correo/pdf_resultado_002.json b/tests/fixtures/correos_prueba/002_correo/pdf_resultado_002.json similarity index 100% rename from tests/correos_prueba/002_correo/pdf_resultado_002.json rename to tests/fixtures/correos_prueba/002_correo/pdf_resultado_002.json diff --git a/tests/correos_prueba/002_correo/xml_resultado_002.json b/tests/fixtures/correos_prueba/002_correo/xml_resultado_002.json similarity index 100% rename from tests/correos_prueba/002_correo/xml_resultado_002.json rename to tests/fixtures/correos_prueba/002_correo/xml_resultado_002.json diff --git a/tests/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf b/tests/fixtures/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf similarity index 100% rename from tests/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf rename to tests/fixtures/correos_prueba/003_correo/20506689326-01-FE07-1559.pdf diff --git a/tests/correos_prueba/003_correo/20506689326-01-FE07-1559.xml b/tests/fixtures/correos_prueba/003_correo/20506689326-01-FE07-1559.xml similarity index 100% rename from tests/correos_prueba/003_correo/20506689326-01-FE07-1559.xml rename to tests/fixtures/correos_prueba/003_correo/20506689326-01-FE07-1559.xml diff --git a/tests/correos_prueba/003_correo/20506689326-31-V002-11.pdf b/tests/fixtures/correos_prueba/003_correo/20506689326-31-V002-11.pdf similarity index 100% rename from tests/correos_prueba/003_correo/20506689326-31-V002-11.pdf rename to tests/fixtures/correos_prueba/003_correo/20506689326-31-V002-11.pdf diff --git a/tests/correos_prueba/003_correo/20506689326-31-V002-11.xml b/tests/fixtures/correos_prueba/003_correo/20506689326-31-V002-11.xml similarity index 100% rename from tests/correos_prueba/003_correo/20506689326-31-V002-11.xml rename to tests/fixtures/correos_prueba/003_correo/20506689326-31-V002-11.xml diff --git a/tests/correos_prueba/003_correo/pdf_resultado_003.json b/tests/fixtures/correos_prueba/003_correo/pdf_resultado_003.json similarity index 100% rename from tests/correos_prueba/003_correo/pdf_resultado_003.json rename to tests/fixtures/correos_prueba/003_correo/pdf_resultado_003.json diff --git a/tests/correos_prueba/003_correo/xml_resultado_003.json b/tests/fixtures/correos_prueba/003_correo/xml_resultado_003.json similarity index 100% rename from tests/correos_prueba/003_correo/xml_resultado_003.json rename to tests/fixtures/correos_prueba/003_correo/xml_resultado_003.json diff --git a/tests/correos_prueba/004_correo/20551006914-01-F004-5989.xml b/tests/fixtures/correos_prueba/004_correo/20551006914-01-F004-5989.xml similarity index 100% rename from tests/correos_prueba/004_correo/20551006914-01-F004-5989.xml rename to tests/fixtures/correos_prueba/004_correo/20551006914-01-F004-5989.xml diff --git a/tests/correos_prueba/004_correo/20551006914-09-F004-5989.pdf b/tests/fixtures/correos_prueba/004_correo/20551006914-09-F004-5989.pdf similarity index 100% rename from tests/correos_prueba/004_correo/20551006914-09-F004-5989.pdf rename to tests/fixtures/correos_prueba/004_correo/20551006914-09-F004-5989.pdf diff --git a/tests/correos_prueba/004_correo/20551006914-31-V002-1427.pdf b/tests/fixtures/correos_prueba/004_correo/20551006914-31-V002-1427.pdf similarity index 100% rename from tests/correos_prueba/004_correo/20551006914-31-V002-1427.pdf rename to tests/fixtures/correos_prueba/004_correo/20551006914-31-V002-1427.pdf diff --git a/tests/correos_prueba/004_correo/20551006914-31-V002-1427.xml b/tests/fixtures/correos_prueba/004_correo/20551006914-31-V002-1427.xml similarity index 100% rename from tests/correos_prueba/004_correo/20551006914-31-V002-1427.xml rename to tests/fixtures/correos_prueba/004_correo/20551006914-31-V002-1427.xml diff --git a/tests/correos_prueba/004_correo/pdf_resultado_004.json b/tests/fixtures/correos_prueba/004_correo/pdf_resultado_004.json similarity index 100% rename from tests/correos_prueba/004_correo/pdf_resultado_004.json rename to tests/fixtures/correos_prueba/004_correo/pdf_resultado_004.json diff --git a/tests/correos_prueba/004_correo/xml_resultado_004.json b/tests/fixtures/correos_prueba/004_correo/xml_resultado_004.json similarity index 100% rename from tests/correos_prueba/004_correo/xml_resultado_004.json rename to tests/fixtures/correos_prueba/004_correo/xml_resultado_004.json diff --git a/tests/correos_prueba/005_correo/20555929006-01-F004-3544.xml b/tests/fixtures/correos_prueba/005_correo/20555929006-01-F004-3544.xml similarity index 100% rename from tests/correos_prueba/005_correo/20555929006-01-F004-3544.xml rename to tests/fixtures/correos_prueba/005_correo/20555929006-01-F004-3544.xml diff --git a/tests/correos_prueba/005_correo/20555929006-09-F004-3544.pdf b/tests/fixtures/correos_prueba/005_correo/20555929006-09-F004-3544.pdf similarity index 100% rename from tests/correos_prueba/005_correo/20555929006-09-F004-3544.pdf rename to tests/fixtures/correos_prueba/005_correo/20555929006-09-F004-3544.pdf diff --git a/tests/correos_prueba/005_correo/20555929006-31-V002-1358.pdf b/tests/fixtures/correos_prueba/005_correo/20555929006-31-V002-1358.pdf similarity index 100% rename from tests/correos_prueba/005_correo/20555929006-31-V002-1358.pdf rename to tests/fixtures/correos_prueba/005_correo/20555929006-31-V002-1358.pdf diff --git a/tests/correos_prueba/005_correo/20555929006-31-V002-1358.xml b/tests/fixtures/correos_prueba/005_correo/20555929006-31-V002-1358.xml similarity index 100% rename from tests/correos_prueba/005_correo/20555929006-31-V002-1358.xml rename to tests/fixtures/correos_prueba/005_correo/20555929006-31-V002-1358.xml diff --git a/tests/correos_prueba/005_correo/pdf_resultado_005.json b/tests/fixtures/correos_prueba/005_correo/pdf_resultado_005.json similarity index 100% rename from tests/correos_prueba/005_correo/pdf_resultado_005.json rename to tests/fixtures/correos_prueba/005_correo/pdf_resultado_005.json diff --git a/tests/correos_prueba/005_correo/xml_resultado_005.json b/tests/fixtures/correos_prueba/005_correo/xml_resultado_005.json similarity index 100% rename from tests/correos_prueba/005_correo/xml_resultado_005.json rename to tests/fixtures/correos_prueba/005_correo/xml_resultado_005.json diff --git a/tests/correos_prueba/006_correo/20100811571-01-F011-2786-V002-4575.pdf b/tests/fixtures/correos_prueba/006_correo/20100811571-01-F011-2786-V002-4575.pdf similarity index 100% rename from tests/correos_prueba/006_correo/20100811571-01-F011-2786-V002-4575.pdf rename to tests/fixtures/correos_prueba/006_correo/20100811571-01-F011-2786-V002-4575.pdf diff --git a/tests/correos_prueba/006_correo/20100811571-01-F011-2786.xml b/tests/fixtures/correos_prueba/006_correo/20100811571-01-F011-2786.xml similarity index 100% rename from tests/correos_prueba/006_correo/20100811571-01-F011-2786.xml rename to tests/fixtures/correos_prueba/006_correo/20100811571-01-F011-2786.xml diff --git a/tests/correos_prueba/006_correo/20100811571-01-T001-129813.pdf b/tests/fixtures/correos_prueba/006_correo/20100811571-01-T001-129813.pdf similarity index 100% rename from tests/correos_prueba/006_correo/20100811571-01-T001-129813.pdf rename to tests/fixtures/correos_prueba/006_correo/20100811571-01-T001-129813.pdf diff --git a/tests/correos_prueba/006_correo/20100811571-31-V002-4575.xml b/tests/fixtures/correos_prueba/006_correo/20100811571-31-V002-4575.xml similarity index 100% rename from tests/correos_prueba/006_correo/20100811571-31-V002-4575.xml rename to tests/fixtures/correos_prueba/006_correo/20100811571-31-V002-4575.xml diff --git a/tests/correos_prueba/006_correo/pdf_resultado_006.json b/tests/fixtures/correos_prueba/006_correo/pdf_resultado_006.json similarity index 100% rename from tests/correos_prueba/006_correo/pdf_resultado_006.json rename to tests/fixtures/correos_prueba/006_correo/pdf_resultado_006.json diff --git a/tests/correos_prueba/006_correo/xml_resultado_006.json b/tests/fixtures/correos_prueba/006_correo/xml_resultado_006.json similarity index 100% rename from tests/correos_prueba/006_correo/xml_resultado_006.json rename to tests/fixtures/correos_prueba/006_correo/xml_resultado_006.json diff --git a/tests/correos_prueba/007_correo/10091153136-31-VPP1-516.xml b/tests/fixtures/correos_prueba/007_correo/10091153136-31-VPP1-516.xml similarity index 100% rename from tests/correos_prueba/007_correo/10091153136-31-VPP1-516.xml rename to tests/fixtures/correos_prueba/007_correo/10091153136-31-VPP1-516.xml diff --git a/tests/correos_prueba/007_correo/xml_resultado_007.json b/tests/fixtures/correos_prueba/007_correo/xml_resultado_007.json similarity index 100% rename from tests/correos_prueba/007_correo/xml_resultado_007.json rename to tests/fixtures/correos_prueba/007_correo/xml_resultado_007.json diff --git a/tests/correos_prueba/008_correo/20154645005-01-F002-52385.pdf b/tests/fixtures/correos_prueba/008_correo/20154645005-01-F002-52385.pdf similarity index 100% rename from tests/correos_prueba/008_correo/20154645005-01-F002-52385.pdf rename to tests/fixtures/correos_prueba/008_correo/20154645005-01-F002-52385.pdf diff --git a/tests/correos_prueba/008_correo/20154645005-01-F002-52385.xml b/tests/fixtures/correos_prueba/008_correo/20154645005-01-F002-52385.xml similarity index 100% rename from tests/correos_prueba/008_correo/20154645005-01-F002-52385.xml rename to tests/fixtures/correos_prueba/008_correo/20154645005-01-F002-52385.xml diff --git a/tests/correos_prueba/008_correo/20154645005-31-2605-33.pdf b/tests/fixtures/correos_prueba/008_correo/20154645005-31-2605-33.pdf similarity index 100% rename from tests/correos_prueba/008_correo/20154645005-31-2605-33.pdf rename to tests/fixtures/correos_prueba/008_correo/20154645005-31-2605-33.pdf diff --git a/tests/correos_prueba/008_correo/20154645005-31-V001-4156.xml b/tests/fixtures/correos_prueba/008_correo/20154645005-31-V001-4156.xml similarity index 100% rename from tests/correos_prueba/008_correo/20154645005-31-V001-4156.xml rename to tests/fixtures/correos_prueba/008_correo/20154645005-31-V001-4156.xml diff --git a/tests/correos_prueba/008_correo/pdf_resultado_008.json b/tests/fixtures/correos_prueba/008_correo/pdf_resultado_008.json similarity index 100% rename from tests/correos_prueba/008_correo/pdf_resultado_008.json rename to tests/fixtures/correos_prueba/008_correo/pdf_resultado_008.json diff --git a/tests/correos_prueba/008_correo/xml_resultado_008.json b/tests/fixtures/correos_prueba/008_correo/xml_resultado_008.json similarity index 100% rename from tests/correos_prueba/008_correo/xml_resultado_008.json rename to tests/fixtures/correos_prueba/008_correo/xml_resultado_008.json diff --git a/tests/correos_prueba/009_correo/10091153136-01-FPP1-15407-VPP1-516.pdf b/tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407-VPP1-516.pdf similarity index 100% rename from tests/correos_prueba/009_correo/10091153136-01-FPP1-15407-VPP1-516.pdf rename to tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407-VPP1-516.pdf diff --git a/tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf b/tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf similarity index 100% rename from tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf rename to tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407.pdf diff --git a/tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml b/tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml similarity index 100% rename from tests/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml rename to tests/fixtures/correos_prueba/009_correo/10091153136-01-FPP1-15407.xml diff --git a/tests/correos_prueba/009_correo/10091153136-31-VPP1-516.xml b/tests/fixtures/correos_prueba/009_correo/10091153136-31-VPP1-516.xml similarity index 100% rename from tests/correos_prueba/009_correo/10091153136-31-VPP1-516.xml rename to tests/fixtures/correos_prueba/009_correo/10091153136-31-VPP1-516.xml diff --git a/tests/correos_prueba/009_correo/pdf_resultado_009.json b/tests/fixtures/correos_prueba/009_correo/pdf_resultado_009.json similarity index 100% rename from tests/correos_prueba/009_correo/pdf_resultado_009.json rename to tests/fixtures/correos_prueba/009_correo/pdf_resultado_009.json diff --git a/tests/correos_prueba/009_correo/xml_resultado_009.json b/tests/fixtures/correos_prueba/009_correo/xml_resultado_009.json similarity index 100% rename from tests/correos_prueba/009_correo/xml_resultado_009.json rename to tests/fixtures/correos_prueba/009_correo/xml_resultado_009.json diff --git a/tests/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf b/tests/fixtures/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf similarity index 100% rename from tests/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf rename to tests/fixtures/correos_prueba/010_correo/10154500010-01-FF01-3308.pdf diff --git a/tests/correos_prueba/010_correo/10154500010-31-2605-33.pdf b/tests/fixtures/correos_prueba/010_correo/10154500010-31-2605-33.pdf similarity index 100% rename from tests/correos_prueba/010_correo/10154500010-31-2605-33.pdf rename to tests/fixtures/correos_prueba/010_correo/10154500010-31-2605-33.pdf diff --git a/tests/correos_prueba/010_correo/10154500010-31-EG03-216.xml b/tests/fixtures/correos_prueba/010_correo/10154500010-31-EG03-216.xml similarity index 100% rename from tests/correos_prueba/010_correo/10154500010-31-EG03-216.xml rename to tests/fixtures/correos_prueba/010_correo/10154500010-31-EG03-216.xml diff --git a/tests/correos_prueba/010_correo/CDR-10154500010-01-FF01-3308.xml b/tests/fixtures/correos_prueba/010_correo/CDR-10154500010-01-FF01-3308.xml similarity index 100% rename from tests/correos_prueba/010_correo/CDR-10154500010-01-FF01-3308.xml rename to tests/fixtures/correos_prueba/010_correo/CDR-10154500010-01-FF01-3308.xml diff --git a/tests/correos_prueba/010_correo/pdf_resultado_010.json b/tests/fixtures/correos_prueba/010_correo/pdf_resultado_010.json similarity index 100% rename from tests/correos_prueba/010_correo/pdf_resultado_010.json rename to tests/fixtures/correos_prueba/010_correo/pdf_resultado_010.json diff --git a/tests/correos_prueba/010_correo/xml_resultado_010.json b/tests/fixtures/correos_prueba/010_correo/xml_resultado_010.json similarity index 100% rename from tests/correos_prueba/010_correo/xml_resultado_010.json rename to tests/fixtures/correos_prueba/010_correo/xml_resultado_010.json diff --git a/tests/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf b/tests/fixtures/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf similarity index 100% rename from tests/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf rename to tests/fixtures/correos_prueba/011_correo/20516287641-01-FF03-1100.pdf diff --git a/tests/correos_prueba/011_correo/20516287641-01-FF03-1100.xml b/tests/fixtures/correos_prueba/011_correo/20516287641-01-FF03-1100.xml similarity index 100% rename from tests/correos_prueba/011_correo/20516287641-01-FF03-1100.xml rename to tests/fixtures/correos_prueba/011_correo/20516287641-01-FF03-1100.xml diff --git a/tests/correos_prueba/011_correo/20516287641-31-EG03-253.pdf b/tests/fixtures/correos_prueba/011_correo/20516287641-31-EG03-253.pdf similarity index 100% rename from tests/correos_prueba/011_correo/20516287641-31-EG03-253.pdf rename to tests/fixtures/correos_prueba/011_correo/20516287641-31-EG03-253.pdf diff --git a/tests/correos_prueba/011_correo/20516287641-31-EG03-253.xml b/tests/fixtures/correos_prueba/011_correo/20516287641-31-EG03-253.xml similarity index 100% rename from tests/correos_prueba/011_correo/20516287641-31-EG03-253.xml rename to tests/fixtures/correos_prueba/011_correo/20516287641-31-EG03-253.xml diff --git a/tests/correos_prueba/011_correo/pdf_resultado_011.json b/tests/fixtures/correos_prueba/011_correo/pdf_resultado_011.json similarity index 100% rename from tests/correos_prueba/011_correo/pdf_resultado_011.json rename to tests/fixtures/correos_prueba/011_correo/pdf_resultado_011.json diff --git a/tests/correos_prueba/011_correo/xml_resultado_011.json b/tests/fixtures/correos_prueba/011_correo/xml_resultado_011.json similarity index 100% rename from tests/correos_prueba/011_correo/xml_resultado_011.json rename to tests/fixtures/correos_prueba/011_correo/xml_resultado_011.json diff --git a/tests/correos_prueba/012_correo/20220631541-01-E001-6942.pdf b/tests/fixtures/correos_prueba/012_correo/20220631541-01-E001-6942.pdf similarity index 100% rename from tests/correos_prueba/012_correo/20220631541-01-E001-6942.pdf rename to tests/fixtures/correos_prueba/012_correo/20220631541-01-E001-6942.pdf diff --git a/tests/correos_prueba/012_correo/20220631541-01-E001-6942.xml b/tests/fixtures/correos_prueba/012_correo/20220631541-01-E001-6942.xml similarity index 100% rename from tests/correos_prueba/012_correo/20220631541-01-E001-6942.xml rename to tests/fixtures/correos_prueba/012_correo/20220631541-01-E001-6942.xml diff --git a/tests/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf b/tests/fixtures/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf similarity index 100% rename from tests/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf rename to tests/fixtures/correos_prueba/012_correo/20220631541-31-EG03-2502.pdf diff --git a/tests/correos_prueba/012_correo/pdf_resultado_012.json b/tests/fixtures/correos_prueba/012_correo/pdf_resultado_012.json similarity index 100% rename from tests/correos_prueba/012_correo/pdf_resultado_012.json rename to tests/fixtures/correos_prueba/012_correo/pdf_resultado_012.json diff --git a/tests/correos_prueba/012_correo/xml_resultado_012.json b/tests/fixtures/correos_prueba/012_correo/xml_resultado_012.json similarity index 100% rename from tests/correos_prueba/012_correo/xml_resultado_012.json rename to tests/fixtures/correos_prueba/012_correo/xml_resultado_012.json diff --git a/tests/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf b/tests/fixtures/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf similarity index 100% rename from tests/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf rename to tests/fixtures/correos_prueba/013_correo/20516287641-01-FF03-1100.pdf diff --git a/tests/correos_prueba/013_correo/20516287641-01-FF03-1100.xml b/tests/fixtures/correos_prueba/013_correo/20516287641-01-FF03-1100.xml similarity index 100% rename from tests/correos_prueba/013_correo/20516287641-01-FF03-1100.xml rename to tests/fixtures/correos_prueba/013_correo/20516287641-01-FF03-1100.xml diff --git a/tests/correos_prueba/013_correo/20516287641-31-EG03-253.pdf b/tests/fixtures/correos_prueba/013_correo/20516287641-31-EG03-253.pdf similarity index 100% rename from tests/correos_prueba/013_correo/20516287641-31-EG03-253.pdf rename to tests/fixtures/correos_prueba/013_correo/20516287641-31-EG03-253.pdf diff --git a/tests/correos_prueba/013_correo/20516287641-31-EG03-253.xml b/tests/fixtures/correos_prueba/013_correo/20516287641-31-EG03-253.xml similarity index 100% rename from tests/correos_prueba/013_correo/20516287641-31-EG03-253.xml rename to tests/fixtures/correos_prueba/013_correo/20516287641-31-EG03-253.xml diff --git a/tests/correos_prueba/013_correo/pdf_resultado_013.json b/tests/fixtures/correos_prueba/013_correo/pdf_resultado_013.json similarity index 100% rename from tests/correos_prueba/013_correo/pdf_resultado_013.json rename to tests/fixtures/correos_prueba/013_correo/pdf_resultado_013.json diff --git a/tests/correos_prueba/013_correo/xml_resultado_013.json b/tests/fixtures/correos_prueba/013_correo/xml_resultado_013.json similarity index 100% rename from tests/correos_prueba/013_correo/xml_resultado_013.json rename to tests/fixtures/correos_prueba/013_correo/xml_resultado_013.json diff --git a/tests/correos_prueba/014_correo/10154500010-01-FF01-3308.pdf b/tests/fixtures/correos_prueba/014_correo/10154500010-01-FF01-3308.pdf similarity index 100% rename from tests/correos_prueba/014_correo/10154500010-01-FF01-3308.pdf rename to tests/fixtures/correos_prueba/014_correo/10154500010-01-FF01-3308.pdf diff --git a/tests/correos_prueba/014_correo/10154500010-31-2605-33.pdf b/tests/fixtures/correos_prueba/014_correo/10154500010-31-2605-33.pdf similarity index 100% rename from tests/correos_prueba/014_correo/10154500010-31-2605-33.pdf rename to tests/fixtures/correos_prueba/014_correo/10154500010-31-2605-33.pdf diff --git a/tests/correos_prueba/014_correo/10154500010-31-EG03-216.xml b/tests/fixtures/correos_prueba/014_correo/10154500010-31-EG03-216.xml similarity index 100% rename from tests/correos_prueba/014_correo/10154500010-31-EG03-216.xml rename to tests/fixtures/correos_prueba/014_correo/10154500010-31-EG03-216.xml diff --git a/tests/correos_prueba/014_correo/CDR-10154500010-01-FF01-3308.xml b/tests/fixtures/correos_prueba/014_correo/CDR-10154500010-01-FF01-3308.xml similarity index 100% rename from tests/correos_prueba/014_correo/CDR-10154500010-01-FF01-3308.xml rename to tests/fixtures/correos_prueba/014_correo/CDR-10154500010-01-FF01-3308.xml diff --git a/tests/correos_prueba/014_correo/pdf_resultado_014.json b/tests/fixtures/correos_prueba/014_correo/pdf_resultado_014.json similarity index 100% rename from tests/correos_prueba/014_correo/pdf_resultado_014.json rename to tests/fixtures/correos_prueba/014_correo/pdf_resultado_014.json diff --git a/tests/correos_prueba/014_correo/xml_resultado_014.json b/tests/fixtures/correos_prueba/014_correo/xml_resultado_014.json similarity index 100% rename from tests/correos_prueba/014_correo/xml_resultado_014.json rename to tests/fixtures/correos_prueba/014_correo/xml_resultado_014.json diff --git a/tests/correos_prueba/015_correo/20552807970-01-E001-2403.pdf b/tests/fixtures/correos_prueba/015_correo/20552807970-01-E001-2403.pdf similarity index 100% rename from tests/correos_prueba/015_correo/20552807970-01-E001-2403.pdf rename to tests/fixtures/correos_prueba/015_correo/20552807970-01-E001-2403.pdf diff --git a/tests/correos_prueba/015_correo/20552807970-01-E001-2403.xml b/tests/fixtures/correos_prueba/015_correo/20552807970-01-E001-2403.xml similarity index 100% rename from tests/correos_prueba/015_correo/20552807970-01-E001-2403.xml rename to tests/fixtures/correos_prueba/015_correo/20552807970-01-E001-2403.xml diff --git a/tests/correos_prueba/015_correo/pdf_resultado_015.json b/tests/fixtures/correos_prueba/015_correo/pdf_resultado_015.json similarity index 100% rename from tests/correos_prueba/015_correo/pdf_resultado_015.json rename to tests/fixtures/correos_prueba/015_correo/pdf_resultado_015.json diff --git a/tests/correos_prueba/015_correo/xml_resultado_015.json b/tests/fixtures/correos_prueba/015_correo/xml_resultado_015.json similarity index 100% rename from tests/correos_prueba/015_correo/xml_resultado_015.json rename to tests/fixtures/correos_prueba/015_correo/xml_resultado_015.json diff --git a/tests/correos_prueba/017_correo/20261374898-01-FF05-100429.pdf b/tests/fixtures/correos_prueba/017_correo/20261374898-01-FF05-100429.pdf similarity index 100% rename from tests/correos_prueba/017_correo/20261374898-01-FF05-100429.pdf rename to tests/fixtures/correos_prueba/017_correo/20261374898-01-FF05-100429.pdf diff --git a/tests/correos_prueba/017_correo/20261374898-01-FF05-100429.xml b/tests/fixtures/correos_prueba/017_correo/20261374898-01-FF05-100429.xml similarity index 100% rename from tests/correos_prueba/017_correo/20261374898-01-FF05-100429.xml rename to tests/fixtures/correos_prueba/017_correo/20261374898-01-FF05-100429.xml diff --git a/tests/correos_prueba/017_correo/pdf_resultado_017.json b/tests/fixtures/correos_prueba/017_correo/pdf_resultado_017.json similarity index 100% rename from tests/correos_prueba/017_correo/pdf_resultado_017.json rename to tests/fixtures/correos_prueba/017_correo/pdf_resultado_017.json diff --git a/tests/correos_prueba/017_correo/xml_resultado_017.json b/tests/fixtures/correos_prueba/017_correo/xml_resultado_017.json similarity index 100% rename from tests/correos_prueba/017_correo/xml_resultado_017.json rename to tests/fixtures/correos_prueba/017_correo/xml_resultado_017.json diff --git a/tests/correos_prueba/018_correo/20500864703-01-F002-20851.pdf b/tests/fixtures/correos_prueba/018_correo/20500864703-01-F002-20851.pdf similarity index 100% rename from tests/correos_prueba/018_correo/20500864703-01-F002-20851.pdf rename to tests/fixtures/correos_prueba/018_correo/20500864703-01-F002-20851.pdf diff --git a/tests/correos_prueba/018_correo/20500864703-01-F002-20851.xml b/tests/fixtures/correos_prueba/018_correo/20500864703-01-F002-20851.xml similarity index 100% rename from tests/correos_prueba/018_correo/20500864703-01-F002-20851.xml rename to tests/fixtures/correos_prueba/018_correo/20500864703-01-F002-20851.xml diff --git a/tests/correos_prueba/018_correo/CDR-20500864703-01-F002-20851.xml b/tests/fixtures/correos_prueba/018_correo/CDR-20500864703-01-F002-20851.xml similarity index 100% rename from tests/correos_prueba/018_correo/CDR-20500864703-01-F002-20851.xml rename to tests/fixtures/correos_prueba/018_correo/CDR-20500864703-01-F002-20851.xml diff --git a/tests/correos_prueba/018_correo/pdf_resultado_018.json b/tests/fixtures/correos_prueba/018_correo/pdf_resultado_018.json similarity index 100% rename from tests/correos_prueba/018_correo/pdf_resultado_018.json rename to tests/fixtures/correos_prueba/018_correo/pdf_resultado_018.json diff --git a/tests/correos_prueba/018_correo/xml_resultado_018.json b/tests/fixtures/correos_prueba/018_correo/xml_resultado_018.json similarity index 100% rename from tests/correos_prueba/018_correo/xml_resultado_018.json rename to tests/fixtures/correos_prueba/018_correo/xml_resultado_018.json diff --git a/tests/correos_prueba/019_correo/20552793499-01-E001-5506.pdf b/tests/fixtures/correos_prueba/019_correo/20552793499-01-E001-5506.pdf similarity index 100% rename from tests/correos_prueba/019_correo/20552793499-01-E001-5506.pdf rename to tests/fixtures/correos_prueba/019_correo/20552793499-01-E001-5506.pdf diff --git a/tests/correos_prueba/019_correo/20552793499-01-E001-5506.xml b/tests/fixtures/correos_prueba/019_correo/20552793499-01-E001-5506.xml similarity index 100% rename from tests/correos_prueba/019_correo/20552793499-01-E001-5506.xml rename to tests/fixtures/correos_prueba/019_correo/20552793499-01-E001-5506.xml diff --git a/tests/correos_prueba/019_correo/pdf_resultado_019.json b/tests/fixtures/correos_prueba/019_correo/pdf_resultado_019.json similarity index 100% rename from tests/correos_prueba/019_correo/pdf_resultado_019.json rename to tests/fixtures/correos_prueba/019_correo/pdf_resultado_019.json diff --git a/tests/correos_prueba/019_correo/xml_resultado_019.json b/tests/fixtures/correos_prueba/019_correo/xml_resultado_019.json similarity index 100% rename from tests/correos_prueba/019_correo/xml_resultado_019.json rename to tests/fixtures/correos_prueba/019_correo/xml_resultado_019.json diff --git a/tests/correos_prueba/020_correo/20261374898-01-FF05-100595.pdf b/tests/fixtures/correos_prueba/020_correo/20261374898-01-FF05-100595.pdf similarity index 100% rename from tests/correos_prueba/020_correo/20261374898-01-FF05-100595.pdf rename to tests/fixtures/correos_prueba/020_correo/20261374898-01-FF05-100595.pdf diff --git a/tests/correos_prueba/020_correo/20261374898-01-FF05-100595.xml b/tests/fixtures/correos_prueba/020_correo/20261374898-01-FF05-100595.xml similarity index 100% rename from tests/correos_prueba/020_correo/20261374898-01-FF05-100595.xml rename to tests/fixtures/correos_prueba/020_correo/20261374898-01-FF05-100595.xml diff --git a/tests/correos_prueba/020_correo/pdf_resultado_020.json b/tests/fixtures/correos_prueba/020_correo/pdf_resultado_020.json similarity index 100% rename from tests/correos_prueba/020_correo/pdf_resultado_020.json rename to tests/fixtures/correos_prueba/020_correo/pdf_resultado_020.json diff --git a/tests/correos_prueba/020_correo/xml_resultado_020.json b/tests/fixtures/correos_prueba/020_correo/xml_resultado_020.json similarity index 100% rename from tests/correos_prueba/020_correo/xml_resultado_020.json rename to tests/fixtures/correos_prueba/020_correo/xml_resultado_020.json diff --git a/tests/correos_prueba/021_correo/20261374898-01-FF05-100595.pdf b/tests/fixtures/correos_prueba/021_correo/20261374898-01-FF05-100595.pdf similarity index 100% rename from tests/correos_prueba/021_correo/20261374898-01-FF05-100595.pdf rename to tests/fixtures/correos_prueba/021_correo/20261374898-01-FF05-100595.pdf diff --git a/tests/correos_prueba/021_correo/20261374898-01-FF05-100595.xml b/tests/fixtures/correos_prueba/021_correo/20261374898-01-FF05-100595.xml similarity index 100% rename from tests/correos_prueba/021_correo/20261374898-01-FF05-100595.xml rename to tests/fixtures/correos_prueba/021_correo/20261374898-01-FF05-100595.xml diff --git a/tests/correos_prueba/021_correo/pdf_resultado_021.json b/tests/fixtures/correos_prueba/021_correo/pdf_resultado_021.json similarity index 100% rename from tests/correos_prueba/021_correo/pdf_resultado_021.json rename to tests/fixtures/correos_prueba/021_correo/pdf_resultado_021.json diff --git a/tests/correos_prueba/021_correo/xml_resultado_021.json b/tests/fixtures/correos_prueba/021_correo/xml_resultado_021.json similarity index 100% rename from tests/correos_prueba/021_correo/xml_resultado_021.json rename to tests/fixtures/correos_prueba/021_correo/xml_resultado_021.json diff --git a/tests/correos_prueba/022_correo/20154645005-01-F002-53135.pdf b/tests/fixtures/correos_prueba/022_correo/20154645005-01-F002-53135.pdf similarity index 100% rename from tests/correos_prueba/022_correo/20154645005-01-F002-53135.pdf rename to tests/fixtures/correos_prueba/022_correo/20154645005-01-F002-53135.pdf diff --git a/tests/correos_prueba/022_correo/20154645005-01-F002-53135.xml b/tests/fixtures/correos_prueba/022_correo/20154645005-01-F002-53135.xml similarity index 100% rename from tests/correos_prueba/022_correo/20154645005-01-F002-53135.xml rename to tests/fixtures/correos_prueba/022_correo/20154645005-01-F002-53135.xml diff --git a/tests/correos_prueba/022_correo/pdf_resultado_022.json b/tests/fixtures/correos_prueba/022_correo/pdf_resultado_022.json similarity index 100% rename from tests/correos_prueba/022_correo/pdf_resultado_022.json rename to tests/fixtures/correos_prueba/022_correo/pdf_resultado_022.json diff --git a/tests/correos_prueba/022_correo/xml_resultado_022.json b/tests/fixtures/correos_prueba/022_correo/xml_resultado_022.json similarity index 100% rename from tests/correos_prueba/022_correo/xml_resultado_022.json rename to tests/fixtures/correos_prueba/022_correo/xml_resultado_022.json diff --git a/tests/correos_prueba/023_correo/20538637280-01-F001-70705.pdf b/tests/fixtures/correos_prueba/023_correo/20538637280-01-F001-70705.pdf similarity index 100% rename from tests/correos_prueba/023_correo/20538637280-01-F001-70705.pdf rename to tests/fixtures/correos_prueba/023_correo/20538637280-01-F001-70705.pdf diff --git a/tests/correos_prueba/023_correo/20538637280-01-F001-70705.xml b/tests/fixtures/correos_prueba/023_correo/20538637280-01-F001-70705.xml similarity index 100% rename from tests/correos_prueba/023_correo/20538637280-01-F001-70705.xml rename to tests/fixtures/correos_prueba/023_correo/20538637280-01-F001-70705.xml diff --git a/tests/correos_prueba/023_correo/pdf_resultado_023.json b/tests/fixtures/correos_prueba/023_correo/pdf_resultado_023.json similarity index 100% rename from tests/correos_prueba/023_correo/pdf_resultado_023.json rename to tests/fixtures/correos_prueba/023_correo/pdf_resultado_023.json diff --git a/tests/correos_prueba/023_correo/xml_resultado_023.json b/tests/fixtures/correos_prueba/023_correo/xml_resultado_023.json similarity index 100% rename from tests/correos_prueba/023_correo/xml_resultado_023.json rename to tests/fixtures/correos_prueba/023_correo/xml_resultado_023.json diff --git a/tests/correos_prueba/024_correo/20537929520-01-F002-486.pdf b/tests/fixtures/correos_prueba/024_correo/20537929520-01-F002-486.pdf similarity index 100% rename from tests/correos_prueba/024_correo/20537929520-01-F002-486.pdf rename to tests/fixtures/correos_prueba/024_correo/20537929520-01-F002-486.pdf diff --git a/tests/correos_prueba/024_correo/pdf_resultado_024.json b/tests/fixtures/correos_prueba/024_correo/pdf_resultado_024.json similarity index 100% rename from tests/correos_prueba/024_correo/pdf_resultado_024.json rename to tests/fixtures/correos_prueba/024_correo/pdf_resultado_024.json diff --git a/tests/correos_prueba/025_correo/20537929520-01-F002-488.pdf b/tests/fixtures/correos_prueba/025_correo/20537929520-01-F002-488.pdf similarity index 100% rename from tests/correos_prueba/025_correo/20537929520-01-F002-488.pdf rename to tests/fixtures/correos_prueba/025_correo/20537929520-01-F002-488.pdf diff --git a/tests/correos_prueba/025_correo/pdf_resultado_025.json b/tests/fixtures/correos_prueba/025_correo/pdf_resultado_025.json similarity index 100% rename from tests/correos_prueba/025_correo/pdf_resultado_025.json rename to tests/fixtures/correos_prueba/025_correo/pdf_resultado_025.json diff --git a/tests/correos_prueba/026_correo/20537929520-01-F002-486.pdf b/tests/fixtures/correos_prueba/026_correo/20537929520-01-F002-486.pdf similarity index 100% rename from tests/correos_prueba/026_correo/20537929520-01-F002-486.pdf rename to tests/fixtures/correos_prueba/026_correo/20537929520-01-F002-486.pdf diff --git a/tests/correos_prueba/026_correo/pdf_resultado_026.json b/tests/fixtures/correos_prueba/026_correo/pdf_resultado_026.json similarity index 100% rename from tests/correos_prueba/026_correo/pdf_resultado_026.json rename to tests/fixtures/correos_prueba/026_correo/pdf_resultado_026.json diff --git a/tests/correos_prueba/027_correo/20537929520-01-F002-486.pdf b/tests/fixtures/correos_prueba/027_correo/20537929520-01-F002-486.pdf similarity index 100% rename from tests/correos_prueba/027_correo/20537929520-01-F002-486.pdf rename to tests/fixtures/correos_prueba/027_correo/20537929520-01-F002-486.pdf diff --git a/tests/correos_prueba/027_correo/pdf_resultado_027.json b/tests/fixtures/correos_prueba/027_correo/pdf_resultado_027.json similarity index 100% rename from tests/correos_prueba/027_correo/pdf_resultado_027.json rename to tests/fixtures/correos_prueba/027_correo/pdf_resultado_027.json diff --git a/tests/correos_prueba/028_correo/20537929520-01-F002-486.pdf b/tests/fixtures/correos_prueba/028_correo/20537929520-01-F002-486.pdf similarity index 100% rename from tests/correos_prueba/028_correo/20537929520-01-F002-486.pdf rename to tests/fixtures/correos_prueba/028_correo/20537929520-01-F002-486.pdf diff --git a/tests/correos_prueba/028_correo/20537929520-01-F002-486.xml b/tests/fixtures/correos_prueba/028_correo/20537929520-01-F002-486.xml similarity index 100% rename from tests/correos_prueba/028_correo/20537929520-01-F002-486.xml rename to tests/fixtures/correos_prueba/028_correo/20537929520-01-F002-486.xml diff --git a/tests/correos_prueba/028_correo/pdf_resultado_028.json b/tests/fixtures/correos_prueba/028_correo/pdf_resultado_028.json similarity index 100% rename from tests/correos_prueba/028_correo/pdf_resultado_028.json rename to tests/fixtures/correos_prueba/028_correo/pdf_resultado_028.json diff --git a/tests/correos_prueba/028_correo/xml_resultado_028.json b/tests/fixtures/correos_prueba/028_correo/xml_resultado_028.json similarity index 100% rename from tests/correos_prueba/028_correo/xml_resultado_028.json rename to tests/fixtures/correos_prueba/028_correo/xml_resultado_028.json diff --git a/tests/correos_prueba/029_correo/20261374898-01-FF05-100595.pdf b/tests/fixtures/correos_prueba/029_correo/20261374898-01-FF05-100595.pdf similarity index 100% rename from tests/correos_prueba/029_correo/20261374898-01-FF05-100595.pdf rename to tests/fixtures/correos_prueba/029_correo/20261374898-01-FF05-100595.pdf diff --git a/tests/correos_prueba/029_correo/20261374898-01-FF05-100595.xml b/tests/fixtures/correos_prueba/029_correo/20261374898-01-FF05-100595.xml similarity index 100% rename from tests/correos_prueba/029_correo/20261374898-01-FF05-100595.xml rename to tests/fixtures/correos_prueba/029_correo/20261374898-01-FF05-100595.xml diff --git a/tests/correos_prueba/029_correo/pdf_resultado_029.json b/tests/fixtures/correos_prueba/029_correo/pdf_resultado_029.json similarity index 100% rename from tests/correos_prueba/029_correo/pdf_resultado_029.json rename to tests/fixtures/correos_prueba/029_correo/pdf_resultado_029.json diff --git a/tests/correos_prueba/029_correo/xml_resultado_029.json b/tests/fixtures/correos_prueba/029_correo/xml_resultado_029.json similarity index 100% rename from tests/correos_prueba/029_correo/xml_resultado_029.json rename to tests/fixtures/correos_prueba/029_correo/xml_resultado_029.json diff --git a/tests/correos_prueba/030_correo/20154645005-01-F002-53359.pdf b/tests/fixtures/correos_prueba/030_correo/20154645005-01-F002-53359.pdf similarity index 100% rename from tests/correos_prueba/030_correo/20154645005-01-F002-53359.pdf rename to tests/fixtures/correos_prueba/030_correo/20154645005-01-F002-53359.pdf diff --git a/tests/correos_prueba/030_correo/20154645005-01-F002-53359.xml b/tests/fixtures/correos_prueba/030_correo/20154645005-01-F002-53359.xml similarity index 100% rename from tests/correos_prueba/030_correo/20154645005-01-F002-53359.xml rename to tests/fixtures/correos_prueba/030_correo/20154645005-01-F002-53359.xml diff --git a/tests/correos_prueba/030_correo/pdf_resultado_030.json b/tests/fixtures/correos_prueba/030_correo/pdf_resultado_030.json similarity index 100% rename from tests/correos_prueba/030_correo/pdf_resultado_030.json rename to tests/fixtures/correos_prueba/030_correo/pdf_resultado_030.json diff --git a/tests/correos_prueba/030_correo/xml_resultado_030.json b/tests/fixtures/correos_prueba/030_correo/xml_resultado_030.json similarity index 100% rename from tests/correos_prueba/030_correo/xml_resultado_030.json rename to tests/fixtures/correos_prueba/030_correo/xml_resultado_030.json diff --git a/tests/correos_prueba/031_correo/20500864703-01-F002-21184.pdf b/tests/fixtures/correos_prueba/031_correo/20500864703-01-F002-21184.pdf similarity index 100% rename from tests/correos_prueba/031_correo/20500864703-01-F002-21184.pdf rename to tests/fixtures/correos_prueba/031_correo/20500864703-01-F002-21184.pdf diff --git a/tests/correos_prueba/031_correo/20500864703-01-F002-21184.xml b/tests/fixtures/correos_prueba/031_correo/20500864703-01-F002-21184.xml similarity index 100% rename from tests/correos_prueba/031_correo/20500864703-01-F002-21184.xml rename to tests/fixtures/correos_prueba/031_correo/20500864703-01-F002-21184.xml diff --git a/tests/correos_prueba/031_correo/CDR-20500864703-01-F002-21184.xml b/tests/fixtures/correos_prueba/031_correo/CDR-20500864703-01-F002-21184.xml similarity index 100% rename from tests/correos_prueba/031_correo/CDR-20500864703-01-F002-21184.xml rename to tests/fixtures/correos_prueba/031_correo/CDR-20500864703-01-F002-21184.xml diff --git a/tests/correos_prueba/031_correo/pdf_resultado_031.json b/tests/fixtures/correos_prueba/031_correo/pdf_resultado_031.json similarity index 100% rename from tests/correos_prueba/031_correo/pdf_resultado_031.json rename to tests/fixtures/correos_prueba/031_correo/pdf_resultado_031.json diff --git a/tests/correos_prueba/031_correo/xml_resultado_031.json b/tests/fixtures/correos_prueba/031_correo/xml_resultado_031.json similarity index 100% rename from tests/correos_prueba/031_correo/xml_resultado_031.json rename to tests/fixtures/correos_prueba/031_correo/xml_resultado_031.json diff --git a/tests/correos_prueba/032_correo/20604034303-01-F002-3210.pdf b/tests/fixtures/correos_prueba/032_correo/20604034303-01-F002-3210.pdf similarity index 100% rename from tests/correos_prueba/032_correo/20604034303-01-F002-3210.pdf rename to tests/fixtures/correos_prueba/032_correo/20604034303-01-F002-3210.pdf diff --git a/tests/correos_prueba/032_correo/20604034303-01-F002-3210.xml b/tests/fixtures/correos_prueba/032_correo/20604034303-01-F002-3210.xml similarity index 100% rename from tests/correos_prueba/032_correo/20604034303-01-F002-3210.xml rename to tests/fixtures/correos_prueba/032_correo/20604034303-01-F002-3210.xml diff --git a/tests/correos_prueba/032_correo/pdf_resultado_032.json b/tests/fixtures/correos_prueba/032_correo/pdf_resultado_032.json similarity index 100% rename from tests/correos_prueba/032_correo/pdf_resultado_032.json rename to tests/fixtures/correos_prueba/032_correo/pdf_resultado_032.json diff --git a/tests/correos_prueba/032_correo/xml_resultado_032.json b/tests/fixtures/correos_prueba/032_correo/xml_resultado_032.json similarity index 100% rename from tests/correos_prueba/032_correo/xml_resultado_032.json rename to tests/fixtures/correos_prueba/032_correo/xml_resultado_032.json diff --git a/tests/correos_prueba/033_correo/20552793499-01-E001-5554.pdf b/tests/fixtures/correos_prueba/033_correo/20552793499-01-E001-5554.pdf similarity index 100% rename from tests/correos_prueba/033_correo/20552793499-01-E001-5554.pdf rename to tests/fixtures/correos_prueba/033_correo/20552793499-01-E001-5554.pdf diff --git a/tests/correos_prueba/033_correo/20552793499-01-E001-5554.xml b/tests/fixtures/correos_prueba/033_correo/20552793499-01-E001-5554.xml similarity index 100% rename from tests/correos_prueba/033_correo/20552793499-01-E001-5554.xml rename to tests/fixtures/correos_prueba/033_correo/20552793499-01-E001-5554.xml diff --git a/tests/correos_prueba/033_correo/pdf_resultado_033.json b/tests/fixtures/correos_prueba/033_correo/pdf_resultado_033.json similarity index 100% rename from tests/correos_prueba/033_correo/pdf_resultado_033.json rename to tests/fixtures/correos_prueba/033_correo/pdf_resultado_033.json diff --git a/tests/correos_prueba/033_correo/xml_resultado_033.json b/tests/fixtures/correos_prueba/033_correo/xml_resultado_033.json similarity index 100% rename from tests/correos_prueba/033_correo/xml_resultado_033.json rename to tests/fixtures/correos_prueba/033_correo/xml_resultado_033.json diff --git a/tests/correos_prueba/035_correo/20614715252-01-E001-737.pdf b/tests/fixtures/correos_prueba/035_correo/20614715252-01-E001-737.pdf similarity index 100% rename from tests/correos_prueba/035_correo/20614715252-01-E001-737.pdf rename to tests/fixtures/correos_prueba/035_correo/20614715252-01-E001-737.pdf diff --git a/tests/correos_prueba/035_correo/20614715252-01-E001-737.xml b/tests/fixtures/correos_prueba/035_correo/20614715252-01-E001-737.xml similarity index 100% rename from tests/correos_prueba/035_correo/20614715252-01-E001-737.xml rename to tests/fixtures/correos_prueba/035_correo/20614715252-01-E001-737.xml diff --git a/tests/correos_prueba/035_correo/pdf_resultado_035.json b/tests/fixtures/correos_prueba/035_correo/pdf_resultado_035.json similarity index 100% rename from tests/correos_prueba/035_correo/pdf_resultado_035.json rename to tests/fixtures/correos_prueba/035_correo/pdf_resultado_035.json diff --git a/tests/correos_prueba/035_correo/xml_resultado_035.json b/tests/fixtures/correos_prueba/035_correo/xml_resultado_035.json similarity index 100% rename from tests/correos_prueba/035_correo/xml_resultado_035.json rename to tests/fixtures/correos_prueba/035_correo/xml_resultado_035.json diff --git a/tests/correos_prueba/036_correo/20520758829-01-E001-1214.pdf b/tests/fixtures/correos_prueba/036_correo/20520758829-01-E001-1214.pdf similarity index 100% rename from tests/correos_prueba/036_correo/20520758829-01-E001-1214.pdf rename to tests/fixtures/correos_prueba/036_correo/20520758829-01-E001-1214.pdf diff --git a/tests/correos_prueba/036_correo/20520758829-01-E001-1214.xml b/tests/fixtures/correos_prueba/036_correo/20520758829-01-E001-1214.xml similarity index 100% rename from tests/correos_prueba/036_correo/20520758829-01-E001-1214.xml rename to tests/fixtures/correos_prueba/036_correo/20520758829-01-E001-1214.xml diff --git a/tests/correos_prueba/036_correo/pdf_resultado_036.json b/tests/fixtures/correos_prueba/036_correo/pdf_resultado_036.json similarity index 100% rename from tests/correos_prueba/036_correo/pdf_resultado_036.json rename to tests/fixtures/correos_prueba/036_correo/pdf_resultado_036.json diff --git a/tests/correos_prueba/036_correo/xml_resultado_036.json b/tests/fixtures/correos_prueba/036_correo/xml_resultado_036.json similarity index 100% rename from tests/correos_prueba/036_correo/xml_resultado_036.json rename to tests/fixtures/correos_prueba/036_correo/xml_resultado_036.json diff --git a/tests/correos_prueba/037_correo/20524528992-01-E001-861.pdf b/tests/fixtures/correos_prueba/037_correo/20524528992-01-E001-861.pdf similarity index 100% rename from tests/correos_prueba/037_correo/20524528992-01-E001-861.pdf rename to tests/fixtures/correos_prueba/037_correo/20524528992-01-E001-861.pdf diff --git a/tests/correos_prueba/037_correo/20524528992-01-E001-861.xml b/tests/fixtures/correos_prueba/037_correo/20524528992-01-E001-861.xml similarity index 100% rename from tests/correos_prueba/037_correo/20524528992-01-E001-861.xml rename to tests/fixtures/correos_prueba/037_correo/20524528992-01-E001-861.xml diff --git a/tests/correos_prueba/037_correo/pdf_resultado_037.json b/tests/fixtures/correos_prueba/037_correo/pdf_resultado_037.json similarity index 100% rename from tests/correos_prueba/037_correo/pdf_resultado_037.json rename to tests/fixtures/correos_prueba/037_correo/pdf_resultado_037.json diff --git a/tests/correos_prueba/037_correo/xml_resultado_037.json b/tests/fixtures/correos_prueba/037_correo/xml_resultado_037.json similarity index 100% rename from tests/correos_prueba/037_correo/xml_resultado_037.json rename to tests/fixtures/correos_prueba/037_correo/xml_resultado_037.json diff --git a/tests/correos_prueba/038_correo/20612674133-01-E001-2.pdf b/tests/fixtures/correos_prueba/038_correo/20612674133-01-E001-2.pdf similarity index 100% rename from tests/correos_prueba/038_correo/20612674133-01-E001-2.pdf rename to tests/fixtures/correos_prueba/038_correo/20612674133-01-E001-2.pdf diff --git a/tests/correos_prueba/038_correo/20612674133-01-E001-2.xml b/tests/fixtures/correos_prueba/038_correo/20612674133-01-E001-2.xml similarity index 100% rename from tests/correos_prueba/038_correo/20612674133-01-E001-2.xml rename to tests/fixtures/correos_prueba/038_correo/20612674133-01-E001-2.xml diff --git a/tests/correos_prueba/038_correo/pdf_resultado_038.json b/tests/fixtures/correos_prueba/038_correo/pdf_resultado_038.json similarity index 100% rename from tests/correos_prueba/038_correo/pdf_resultado_038.json rename to tests/fixtures/correos_prueba/038_correo/pdf_resultado_038.json diff --git a/tests/correos_prueba/038_correo/xml_resultado_038.json b/tests/fixtures/correos_prueba/038_correo/xml_resultado_038.json similarity index 100% rename from tests/correos_prueba/038_correo/xml_resultado_038.json rename to tests/fixtures/correos_prueba/038_correo/xml_resultado_038.json diff --git a/tests/correos_prueba/039_correo/10154250161-01-E001-858.pdf b/tests/fixtures/correos_prueba/039_correo/10154250161-01-E001-858.pdf similarity index 100% rename from tests/correos_prueba/039_correo/10154250161-01-E001-858.pdf rename to tests/fixtures/correos_prueba/039_correo/10154250161-01-E001-858.pdf diff --git a/tests/correos_prueba/039_correo/10154250161-01-E001-858.xml b/tests/fixtures/correos_prueba/039_correo/10154250161-01-E001-858.xml similarity index 100% rename from tests/correos_prueba/039_correo/10154250161-01-E001-858.xml rename to tests/fixtures/correos_prueba/039_correo/10154250161-01-E001-858.xml diff --git a/tests/correos_prueba/039_correo/pdf_resultado_039.json b/tests/fixtures/correos_prueba/039_correo/pdf_resultado_039.json similarity index 100% rename from tests/correos_prueba/039_correo/pdf_resultado_039.json rename to tests/fixtures/correos_prueba/039_correo/pdf_resultado_039.json diff --git a/tests/correos_prueba/039_correo/xml_resultado_039.json b/tests/fixtures/correos_prueba/039_correo/xml_resultado_039.json similarity index 100% rename from tests/correos_prueba/039_correo/xml_resultado_039.json rename to tests/fixtures/correos_prueba/039_correo/xml_resultado_039.json diff --git a/tests/correos_prueba/040_correo/20520758829-01-E001-1214.pdf b/tests/fixtures/correos_prueba/040_correo/20520758829-01-E001-1214.pdf similarity index 100% rename from tests/correos_prueba/040_correo/20520758829-01-E001-1214.pdf rename to tests/fixtures/correos_prueba/040_correo/20520758829-01-E001-1214.pdf diff --git a/tests/correos_prueba/040_correo/20520758829-01-E001-1214.xml b/tests/fixtures/correos_prueba/040_correo/20520758829-01-E001-1214.xml similarity index 100% rename from tests/correos_prueba/040_correo/20520758829-01-E001-1214.xml rename to tests/fixtures/correos_prueba/040_correo/20520758829-01-E001-1214.xml diff --git a/tests/correos_prueba/040_correo/pdf_resultado_040.json b/tests/fixtures/correos_prueba/040_correo/pdf_resultado_040.json similarity index 100% rename from tests/correos_prueba/040_correo/pdf_resultado_040.json rename to tests/fixtures/correos_prueba/040_correo/pdf_resultado_040.json diff --git a/tests/correos_prueba/040_correo/xml_resultado_040.json b/tests/fixtures/correos_prueba/040_correo/xml_resultado_040.json similarity index 100% rename from tests/correos_prueba/040_correo/xml_resultado_040.json rename to tests/fixtures/correos_prueba/040_correo/xml_resultado_040.json diff --git a/tests/correos_prueba/041_correo/20524528992-01-E001-861.pdf b/tests/fixtures/correos_prueba/041_correo/20524528992-01-E001-861.pdf similarity index 100% rename from tests/correos_prueba/041_correo/20524528992-01-E001-861.pdf rename to tests/fixtures/correos_prueba/041_correo/20524528992-01-E001-861.pdf diff --git a/tests/correos_prueba/041_correo/20524528992-01-E001-861.xml b/tests/fixtures/correos_prueba/041_correo/20524528992-01-E001-861.xml similarity index 100% rename from tests/correos_prueba/041_correo/20524528992-01-E001-861.xml rename to tests/fixtures/correos_prueba/041_correo/20524528992-01-E001-861.xml diff --git a/tests/correos_prueba/041_correo/pdf_resultado_041.json b/tests/fixtures/correos_prueba/041_correo/pdf_resultado_041.json similarity index 100% rename from tests/correos_prueba/041_correo/pdf_resultado_041.json rename to tests/fixtures/correos_prueba/041_correo/pdf_resultado_041.json diff --git a/tests/correos_prueba/041_correo/xml_resultado_041.json b/tests/fixtures/correos_prueba/041_correo/xml_resultado_041.json similarity index 100% rename from tests/correos_prueba/041_correo/xml_resultado_041.json rename to tests/fixtures/correos_prueba/041_correo/xml_resultado_041.json diff --git a/tests/correos_prueba/042_correo/20220631541-01-E001-6994.pdf b/tests/fixtures/correos_prueba/042_correo/20220631541-01-E001-6994.pdf similarity index 100% rename from tests/correos_prueba/042_correo/20220631541-01-E001-6994.pdf rename to tests/fixtures/correos_prueba/042_correo/20220631541-01-E001-6994.pdf diff --git a/tests/correos_prueba/042_correo/20220631541-01-E001-6994.xml b/tests/fixtures/correos_prueba/042_correo/20220631541-01-E001-6994.xml similarity index 100% rename from tests/correos_prueba/042_correo/20220631541-01-E001-6994.xml rename to tests/fixtures/correos_prueba/042_correo/20220631541-01-E001-6994.xml diff --git a/tests/correos_prueba/042_correo/pdf_resultado_042.json b/tests/fixtures/correos_prueba/042_correo/pdf_resultado_042.json similarity index 100% rename from tests/correos_prueba/042_correo/pdf_resultado_042.json rename to tests/fixtures/correos_prueba/042_correo/pdf_resultado_042.json diff --git a/tests/correos_prueba/042_correo/xml_resultado_042.json b/tests/fixtures/correos_prueba/042_correo/xml_resultado_042.json similarity index 100% rename from tests/correos_prueba/042_correo/xml_resultado_042.json rename to tests/fixtures/correos_prueba/042_correo/xml_resultado_042.json diff --git a/tests/correos_prueba/043_correo/20525144951-01-E001-15679.pdf b/tests/fixtures/correos_prueba/043_correo/20525144951-01-E001-15679.pdf similarity index 100% rename from tests/correos_prueba/043_correo/20525144951-01-E001-15679.pdf rename to tests/fixtures/correos_prueba/043_correo/20525144951-01-E001-15679.pdf diff --git a/tests/correos_prueba/043_correo/20525144951-01-E001-15679.xml b/tests/fixtures/correos_prueba/043_correo/20525144951-01-E001-15679.xml similarity index 100% rename from tests/correos_prueba/043_correo/20525144951-01-E001-15679.xml rename to tests/fixtures/correos_prueba/043_correo/20525144951-01-E001-15679.xml diff --git a/tests/correos_prueba/043_correo/pdf_resultado_043.json b/tests/fixtures/correos_prueba/043_correo/pdf_resultado_043.json similarity index 100% rename from tests/correos_prueba/043_correo/pdf_resultado_043.json rename to tests/fixtures/correos_prueba/043_correo/pdf_resultado_043.json diff --git a/tests/correos_prueba/043_correo/xml_resultado_043.json b/tests/fixtures/correos_prueba/043_correo/xml_resultado_043.json similarity index 100% rename from tests/correos_prueba/043_correo/xml_resultado_043.json rename to tests/fixtures/correos_prueba/043_correo/xml_resultado_043.json diff --git a/tests/correos_prueba/044_correo/20220631541-01-E001-6994.pdf b/tests/fixtures/correos_prueba/044_correo/20220631541-01-E001-6994.pdf similarity index 100% rename from tests/correos_prueba/044_correo/20220631541-01-E001-6994.pdf rename to tests/fixtures/correos_prueba/044_correo/20220631541-01-E001-6994.pdf diff --git a/tests/correos_prueba/044_correo/20220631541-01-E001-6994.xml b/tests/fixtures/correos_prueba/044_correo/20220631541-01-E001-6994.xml similarity index 100% rename from tests/correos_prueba/044_correo/20220631541-01-E001-6994.xml rename to tests/fixtures/correos_prueba/044_correo/20220631541-01-E001-6994.xml diff --git a/tests/correos_prueba/044_correo/pdf_resultado_044.json b/tests/fixtures/correos_prueba/044_correo/pdf_resultado_044.json similarity index 100% rename from tests/correos_prueba/044_correo/pdf_resultado_044.json rename to tests/fixtures/correos_prueba/044_correo/pdf_resultado_044.json diff --git a/tests/correos_prueba/044_correo/xml_resultado_044.json b/tests/fixtures/correos_prueba/044_correo/xml_resultado_044.json similarity index 100% rename from tests/correos_prueba/044_correo/xml_resultado_044.json rename to tests/fixtures/correos_prueba/044_correo/xml_resultado_044.json diff --git a/tests/correos_prueba/045_correo/10075211215-01-E001-7266.pdf b/tests/fixtures/correos_prueba/045_correo/10075211215-01-E001-7266.pdf similarity index 100% rename from tests/correos_prueba/045_correo/10075211215-01-E001-7266.pdf rename to tests/fixtures/correos_prueba/045_correo/10075211215-01-E001-7266.pdf diff --git a/tests/correos_prueba/045_correo/10075211215-01-E001-7266.xml b/tests/fixtures/correos_prueba/045_correo/10075211215-01-E001-7266.xml similarity index 100% rename from tests/correos_prueba/045_correo/10075211215-01-E001-7266.xml rename to tests/fixtures/correos_prueba/045_correo/10075211215-01-E001-7266.xml diff --git a/tests/correos_prueba/045_correo/pdf_resultado_045.json b/tests/fixtures/correos_prueba/045_correo/pdf_resultado_045.json similarity index 100% rename from tests/correos_prueba/045_correo/pdf_resultado_045.json rename to tests/fixtures/correos_prueba/045_correo/pdf_resultado_045.json diff --git a/tests/correos_prueba/045_correo/xml_resultado_045.json b/tests/fixtures/correos_prueba/045_correo/xml_resultado_045.json similarity index 100% rename from tests/correos_prueba/045_correo/xml_resultado_045.json rename to tests/fixtures/correos_prueba/045_correo/xml_resultado_045.json diff --git a/tests/correos_prueba/046_correo/20525144951-01-E001-15864.pdf b/tests/fixtures/correos_prueba/046_correo/20525144951-01-E001-15864.pdf similarity index 100% rename from tests/correos_prueba/046_correo/20525144951-01-E001-15864.pdf rename to tests/fixtures/correos_prueba/046_correo/20525144951-01-E001-15864.pdf diff --git a/tests/correos_prueba/046_correo/20525144951-01-E001-15864.xml b/tests/fixtures/correos_prueba/046_correo/20525144951-01-E001-15864.xml similarity index 100% rename from tests/correos_prueba/046_correo/20525144951-01-E001-15864.xml rename to tests/fixtures/correos_prueba/046_correo/20525144951-01-E001-15864.xml diff --git a/tests/correos_prueba/046_correo/pdf_resultado_046.json b/tests/fixtures/correos_prueba/046_correo/pdf_resultado_046.json similarity index 100% rename from tests/correos_prueba/046_correo/pdf_resultado_046.json rename to tests/fixtures/correos_prueba/046_correo/pdf_resultado_046.json diff --git a/tests/correos_prueba/046_correo/xml_resultado_046.json b/tests/fixtures/correos_prueba/046_correo/xml_resultado_046.json similarity index 100% rename from tests/correos_prueba/046_correo/xml_resultado_046.json rename to tests/fixtures/correos_prueba/046_correo/xml_resultado_046.json diff --git a/tests/correos_prueba/047_correo/20603551151-01-E001-3915.pdf b/tests/fixtures/correos_prueba/047_correo/20603551151-01-E001-3915.pdf similarity index 100% rename from tests/correos_prueba/047_correo/20603551151-01-E001-3915.pdf rename to tests/fixtures/correos_prueba/047_correo/20603551151-01-E001-3915.pdf diff --git a/tests/correos_prueba/047_correo/20603551151-01-E001-3915.xml b/tests/fixtures/correos_prueba/047_correo/20603551151-01-E001-3915.xml similarity index 100% rename from tests/correos_prueba/047_correo/20603551151-01-E001-3915.xml rename to tests/fixtures/correos_prueba/047_correo/20603551151-01-E001-3915.xml diff --git a/tests/correos_prueba/047_correo/pdf_resultado_047.json b/tests/fixtures/correos_prueba/047_correo/pdf_resultado_047.json similarity index 100% rename from tests/correos_prueba/047_correo/pdf_resultado_047.json rename to tests/fixtures/correos_prueba/047_correo/pdf_resultado_047.json diff --git a/tests/correos_prueba/047_correo/xml_resultado_047.json b/tests/fixtures/correos_prueba/047_correo/xml_resultado_047.json similarity index 100% rename from tests/correos_prueba/047_correo/xml_resultado_047.json rename to tests/fixtures/correos_prueba/047_correo/xml_resultado_047.json diff --git a/tests/correos_prueba/048_correo/20220631541-01-E001-7055.pdf b/tests/fixtures/correos_prueba/048_correo/20220631541-01-E001-7055.pdf similarity index 100% rename from tests/correos_prueba/048_correo/20220631541-01-E001-7055.pdf rename to tests/fixtures/correos_prueba/048_correo/20220631541-01-E001-7055.pdf diff --git a/tests/correos_prueba/048_correo/20220631541-01-E001-7055.xml b/tests/fixtures/correos_prueba/048_correo/20220631541-01-E001-7055.xml similarity index 100% rename from tests/correos_prueba/048_correo/20220631541-01-E001-7055.xml rename to tests/fixtures/correos_prueba/048_correo/20220631541-01-E001-7055.xml diff --git a/tests/correos_prueba/048_correo/pdf_resultado_048.json b/tests/fixtures/correos_prueba/048_correo/pdf_resultado_048.json similarity index 100% rename from tests/correos_prueba/048_correo/pdf_resultado_048.json rename to tests/fixtures/correos_prueba/048_correo/pdf_resultado_048.json diff --git a/tests/correos_prueba/048_correo/xml_resultado_048.json b/tests/fixtures/correos_prueba/048_correo/xml_resultado_048.json similarity index 100% rename from tests/correos_prueba/048_correo/xml_resultado_048.json rename to tests/fixtures/correos_prueba/048_correo/xml_resultado_048.json diff --git a/tests/correos_prueba/indice_correos.json b/tests/fixtures/correos_prueba/indice_correos.json similarity index 100% rename from tests/correos_prueba/indice_correos.json rename to tests/fixtures/correos_prueba/indice_correos.json diff --git a/tests/golden/001_correo.json b/tests/golden/001_correo.json new file mode 100644 index 0000000..530caa2 --- /dev/null +++ b/tests/golden/001_correo.json @@ -0,0 +1,138 @@ +{ + "adjuntos": [ + "10060028686-01-F002-2450.xml", + "20506689326-31-V002-11.xml" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [], + "fecha_emision": "2026-05-26", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERV.TRANS.550 BLS ULTRA HSX1.3396", + "guia_transportista": { + "numero": "194", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128912", + "serie": "T001", + "tipo": "09" + } + ], + "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 | -", + "precio_unitario": 736.78, + "total_linea": 624.38, + "valor_referencial": 736.78 + } + ], + "monto_detraccion": 29.47, + "nombre_conductor": null, + "numero": "2450", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DANSA", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10060028686", + "ruc_receptor": "20100029741", + "ruta_pdf": null, + "ruta_xml": "10060028686-01-F002-2450.xml", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 736.78, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "09715404", + "documentos_referencia": [ + { + "numero": "128662", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128661", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-11", + "fecha_traslado": "2026-05-11", + "licencia_conductor": "Q09715404", + "lineas": [ + { + "cantidad": 550.0, + "descripcion": "BOLSA CEMENTO APU", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128662", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + }, + { + "cantidad": 200.0, + "descripcion": "BOLSA CEMENTO ANDINO ULTRA HS", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128661", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "HUAMAN ÑAHUE, JUAN", + "numero": "11", + "peso_bruto": "31875.00", + "porcentaje_detraccion": null, + "punto_llegada": "CA. PANAMERICANA SUR KM 98 SANTA CRUZ", + "punto_partida": "AV. ATOCONGO 1860", + "razon_social_emisor": "MATERIALES D`CASA S.A.C", + "razon_social_receptor": "MATERIALES D`CASA S.A.C", + "ruc_emisor": "20506689326", + "ruc_receptor": "20506689326", + "ruta_pdf": null, + "ruta_xml": "20506689326-31-V002-11.xml", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "F6P722", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/002_correo.json b/tests/golden/002_correo.json new file mode 100644 index 0000000..a8e7a5c --- /dev/null +++ b/tests/golden/002_correo.json @@ -0,0 +1,189 @@ +{ + "adjuntos": [ + "20340843607-01-F002-2188.pdf", + "20340843607-01-F002-2188.xml", + "20340843607-31-V001-227.pdf", + "20340843607-31-V001-227.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "28/05/2026", + "lineas": [ + { + "cantidad": "1.00", + "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", + "guia_transportista": { + "numero": "227", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129352", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "0.00", + "total_linea": "828.73" + } + ], + "monto_detraccion": "39.12", + "numero": "2188", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. RUC: 20100029741", + "ruc_emisor": "20340843607", + "ruc_receptor": "20100029741", + "ruta_pdf": "20340843607-01-F002-2188.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "977.91" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "22/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "227", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "CEMFISUR EIRL RUC: 20340843607", + "ruc_emisor": "20340843607", + "ruc_receptor": "20100029741", + "ruta_pdf": "20340843607-31-V001-227.pdf", + "serie": "V001", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20340843607-01-F002-2188.pdf", + "20340843607-31-V001-227.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129352", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "227", + "serie": "V001", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-28", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVI. DE TRANSP. 730 BLS. X 1.3396", + "guia_transportista": { + "numero": "227", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129352", + "serie": "T001", + "tipo": "09" + } + ], + "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 | -", + "precio_unitario": 977.91, + "total_linea": 828.73, + "valor_referencial": 977.91 + } + ], + "monto_detraccion": 39.12, + "nombre_conductor": null, + "numero": "2188", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "CEMFISUR", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20340843607", + "ruc_receptor": "20100029741", + "ruta_pdf": "20340843607-01-F002-2188.pdf", + "ruta_xml": "20340843607-01-F002-2188.xml", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 977.91, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "42857370", + "documentos_referencia": [ + { + "numero": "129352", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-22", + "fecha_traslado": "2026-05-22", + "licencia_conductor": "D42857370", + "lineas": [ + { + "cantidad": 730.0, + "descripcion": "CEMENTO SOL TIPO I - SOL", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "129352", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "YOMAR ERIKSON", + "numero": "227", + "peso_bruto": "31025.000", + "porcentaje_detraccion": null, + "punto_llegada": "AV.SANTIAGO DE SURCO 4869 (EX-T.MARSANO) - SANTIAGO DE SURCO", + "punto_partida": "AV. ATOCONGO 1860", + "razon_social_emisor": "CEMFISUR E.I.R.L.", + "razon_social_receptor": "CEMFISUR EIRL", + "ruc_emisor": "20340843607", + "ruc_receptor": "20340843607", + "ruta_pdf": "20340843607-31-V001-227.pdf", + "ruta_xml": "20340843607-31-V001-227.xml", + "serie": "V001", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "D7Y800", + "vehiculo_secundario": "D1K975" + } + ] +} diff --git a/tests/golden/003_correo.json b/tests/golden/003_correo.json new file mode 100644 index 0000000..9fcce64 --- /dev/null +++ b/tests/golden/003_correo.json @@ -0,0 +1,223 @@ +{ + "adjuntos": [ + "20506689326-01-FE07-1559.pdf", + "20506689326-01-FE07-1559.xml", + "20506689326-31-V002-11.pdf", + "20506689326-31-V002-11.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "27/05/2026", + "lineas": [ + { + "cantidad": "1.89", + "descripcion": "550 ZZ SERVICIO TRANSPORTE CEMENTO APU 027 SUNAT 0", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.89", + "total_linea": "1041.81" + }, + { + "cantidad": "1.89", + "descripcion": "200 ZZ SERVICIO TRANSPORTE CEMTO ANDINO/ULTRA 027 SUNAT 0", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.89", + "total_linea": "378.84" + } + ], + "monto_detraccion": "56.83", + "numero": "1559", + "porcentaje_detraccion": "4", + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20506689326", + "ruc_receptor": "20100029741", + "ruta_pdf": "20506689326-01-FE07-1559.pdf", + "serie": "FE07", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1363.82" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": null, + "lineas": [], + "monto_detraccion": null, + "numero": "11", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "MATERIALES D`CASA S.A.C", + "ruc_emisor": "20506689326", + "ruc_receptor": "20100029741", + "ruta_pdf": "20506689326-31-V002-11.pdf", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20506689326-01-FE07-1559.pdf", + "20506689326-31-V002-11.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "11", + "serie": "V002", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-13", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 550.0, + "descripcion": "SERVICIO TRANSPORTE CEMENTO APU 027 SUNAT", + "guia_transportista": { + "numero": "11", + "serie": "V002", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128662", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.8942, + "total_linea": 882.89, + "valor_referencial": null + }, + { + "cantidad": 200.0, + "descripcion": "SERVICIO TRANSPORTE CEMTO ANDINO/ULTRA 027 SUNAT", + "guia_transportista": { + "numero": "11", + "serie": "V002", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128661", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.8942, + "total_linea": 321.05, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "1559", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "MATERIALES D`CASA S.A.C", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20506689326", + "ruc_receptor": "20100029741", + "ruta_pdf": "20506689326-01-FE07-1559.pdf", + "ruta_xml": "20506689326-01-FE07-1559.xml", + "serie": "FE07", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1420.65, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "09715404", + "documentos_referencia": [ + { + "numero": "128662", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128661", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-11", + "fecha_traslado": "2026-05-11", + "licencia_conductor": "Q09715404", + "lineas": [ + { + "cantidad": 550.0, + "descripcion": "BOLSA CEMENTO APU", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128662", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + }, + { + "cantidad": 200.0, + "descripcion": "BOLSA CEMENTO ANDINO ULTRA HS", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128661", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "HUAMAN ÑAHUE, JUAN", + "numero": "11", + "peso_bruto": "31875.00", + "porcentaje_detraccion": null, + "punto_llegada": "CA. PANAMERICANA SUR KM 98 SANTA CRUZ", + "punto_partida": "AV. ATOCONGO 1860", + "razon_social_emisor": "MATERIALES D`CASA S.A.C", + "razon_social_receptor": "MATERIALES D`CASA S.A.C", + "ruc_emisor": "20506689326", + "ruc_receptor": "20506689326", + "ruta_pdf": "20506689326-31-V002-11.pdf", + "ruta_xml": "20506689326-31-V002-11.xml", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "F6P722", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/004_correo.json b/tests/golden/004_correo.json new file mode 100644 index 0000000..5c4e8fd --- /dev/null +++ b/tests/golden/004_correo.json @@ -0,0 +1,167 @@ +{ + "adjuntos": [ + "20551006914-01-F004-5989.pdf", + "20551006914-01-F004-5989.xml", + "20551006914-31-V002-1427.pdf", + "20551006914-31-V002-1427.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [ + { + "cantidad": "1.81", + "descripcion": "UND POR EL SERVICIO DE TRANSPORTE DE 125 BOLSAS DE CEMENTO SOL G.R.R. : T001-00129723 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.3125 M.T.C. :1544564CNG PLACA: C6Y857 / D2P996 NETO A COBRAR :S/ 226.45", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.81", + "total_linea": "226.45" + } + ], + "monto_detraccion": null, + "numero": "5989", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20551006914", + "ruc_receptor": "20100029741", + "ruta_pdf": "20551006914-01-F004-5989.pdf", + "serie": "F004", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "226.45" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": null, + "lineas": [], + "monto_detraccion": null, + "numero": "1427", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20551006914", + "ruc_receptor": "20100029741", + "ruta_pdf": "20551006914-31-V002-1427.pdf", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20551006914-01-F004-5989.pdf", + "20551006914-31-V002-1427.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129723", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1427", + "serie": "V002", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 125.0, + "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", + "guia_transportista": { + "numero": "1427", + "serie": "V002", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129723", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.8116, + "total_linea": 191.91, + "valor_referencial": 226.45 + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "5989", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "R & P TRANSFER S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20551006914", + "ruc_receptor": "20100029741", + "ruta_pdf": "20551006914-01-F004-5989.pdf", + "ruta_xml": "20551006914-01-F004-5989.xml", + "serie": "F004", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 226.45, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "45322098", + "documentos_referencia": [], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q45322098", + "lineas": [ + { + "cantidad": 125.0, + "descripcion": "CEMENTO SOL T1", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "LUIS MIGUEL", + "numero": "1427", + "peso_bruto": "5.313", + "porcentaje_detraccion": null, + "punto_llegada": "CAR.PANAMERICANA SUR KM 59 MZA. A LOTE. 1 A.V. LA PONDEROSA (PUENTE PU", + "punto_partida": "AV ATOCONGO 1860 LIMA LIMA VMT", + "razon_social_emisor": "R & P TRANSFER S.A.C.", + "razon_social_receptor": "CONSORCIO UNION FERRETERA S.A.C. - CONSUFER S.A.C.", + "ruc_emisor": "20551006914", + "ruc_receptor": "20550744024", + "ruta_pdf": "20551006914-31-V002-1427.pdf", + "ruta_xml": "20551006914-31-V002-1427.xml", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "C6Y857", + "vehiculo_secundario": "D2P996" + } + ] +} diff --git a/tests/golden/005_correo.json b/tests/golden/005_correo.json new file mode 100644 index 0000000..a9ada52 --- /dev/null +++ b/tests/golden/005_correo.json @@ -0,0 +1,167 @@ +{ + "adjuntos": [ + "20555929006-01-F004-3544.pdf", + "20555929006-01-F004-3544.xml", + "20555929006-31-V002-1358.pdf", + "20555929006-31-V002-1358.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [ + { + "cantidad": "1.34", + "descripcion": "UND POR EL SERVICIO DE TRANSPORTE DE 481 BOLSAS DE CEMENTO SOL G.R.R. : T001-00129721 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.N. : 20.4425 M.T.C. : 1567858CNG PLACA: AYI792 / D8L996 NETO A COBRAR :S/ 618.35", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.34", + "total_linea": "644.35" + } + ], + "monto_detraccion": "26.00", + "numero": "3544", + "porcentaje_detraccion": "4.00", + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20555929006", + "ruc_receptor": "20100029741", + "ruta_pdf": "20555929006-01-F004-3544.pdf", + "serie": "F004", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "644.35" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": null, + "lineas": [], + "monto_detraccion": null, + "numero": "1358", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20555929006", + "ruc_receptor": "20100029741", + "ruta_pdf": "20555929006-31-V002-1358.pdf", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20555929006-01-F004-3544.pdf", + "20555929006-31-V002-1358.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129721", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1358", + "serie": "V002", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 481.0, + "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", + "guia_transportista": { + "numero": "1358", + "serie": "V002", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129721", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.3396, + "total_linea": 546.06, + "valor_referencial": 644.35 + } + ], + "monto_detraccion": 26.0, + "nombre_conductor": null, + "numero": "3544", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DIFENAS S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20555929006", + "ruc_receptor": "20100029741", + "ruta_pdf": "20555929006-01-F004-3544.pdf", + "ruta_xml": "20555929006-01-F004-3544.xml", + "serie": "F004", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 644.35, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "09251892", + "documentos_referencia": [], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q09251892", + "lineas": [ + { + "cantidad": 481.0, + "descripcion": "CEMENTO SOL T1", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "CARLOS", + "numero": "1358", + "peso_bruto": "20.443", + "porcentaje_detraccion": null, + "punto_llegada": "AV. PROLONGACION SAENZ PENA - LAS PALMAS MZA. H LOTE. 7 OTR. UCV 12203 SUBL B SECTOR CODIGO CATAST", + "punto_partida": "AV ATOCONGO 1860 VMT LIMA LIMA", + "razon_social_emisor": "DISTRIBUIDORA FERRETERA NASCA S.A.C", + "razon_social_receptor": "CONSORCIO UNION FERRETERA S.A.C. - CONSUFER", + "ruc_emisor": "20555929006", + "ruc_receptor": "20550744024", + "ruta_pdf": "20555929006-31-V002-1358.pdf", + "ruta_xml": "20555929006-31-V002-1358.xml", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "AYI792", + "vehiculo_secundario": "D8L996" + } + ] +} diff --git a/tests/golden/006_correo.json b/tests/golden/006_correo.json new file mode 100644 index 0000000..199c113 --- /dev/null +++ b/tests/golden/006_correo.json @@ -0,0 +1,158 @@ +{ + "adjuntos": [ + "20100811571-01-F011-2786.xml", + "20100811571-01-T001-129813.pdf", + "20100811571-31-2605-33.pdf", + "20100811571-31-V002-4575.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "05/33/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "33", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20100811571", + "ruc_receptor": "20100029741", + "ruta_pdf": "20100811571-31-2605-33.pdf", + "serie": "2605", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/05/2026", + "lineas": [ + { + "cantidad": "870.74", + "descripcion": "Medida SERVICIO DE TRANSPORTE NIU S/", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "870.74", + "total_linea": "737.92" + } + ], + "monto_detraccion": "34.83", + "numero": "129813", + "porcentaje_detraccion": "4.0", + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20100811571", + "ruc_receptor": "20100029741", + "ruta_pdf": "20100811571-01-T001-129813.pdf", + "serie": "T001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "870.74" + } + ], + "pdf_cache": [ + "20100811571-01-T001-129813.pdf", + "20100811571-31-2605-33.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [], + "fecha_emision": "2026-05-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 870.74, + "total_linea": 737.92, + "valor_referencial": null + } + ], + "monto_detraccion": 34.83, + "nombre_conductor": null, + "numero": "2786", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TREFILADOS EL SALVADOR SRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20100811571", + "ruc_receptor": "20100029741", + "ruta_pdf": null, + "ruta_xml": "20100811571-01-F011-2786.xml", + "serie": "F011", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 870.74, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "09722754", + "documentos_referencia": [ + { + "numero": "129813", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-30", + "fecha_traslado": "2026-05-30", + "licencia_conductor": "Q09722754", + "lineas": [ + { + "cantidad": 650.0, + "descripcion": "$it.Descripcion", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "129813", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "EMILIANO", + "numero": "4575", + "peso_bruto": "27625.00", + "porcentaje_detraccion": null, + "punto_llegada": "PQ. IND. MZ. G LTE 8,9 (LIMA-LIMA-VILLA EL SALVADOR)", + "punto_partida": "AV. ATOCONGO N° 1860 (LIMA-LIMA-VILLA MARIA DEL TRIUNFO)", + "razon_social_emisor": "TREFILADOS EL SALVADOR SRL", + "razon_social_receptor": "TREFILADOS EL SALVADOR SRL", + "ruc_emisor": "20100811571", + "ruc_receptor": "20100811571", + "ruta_pdf": null, + "ruta_xml": "20100811571-31-V002-4575.xml", + "serie": "V002", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "B7C885", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/007_correo.json b/tests/golden/007_correo.json new file mode 100644 index 0000000..2e353ed --- /dev/null +++ b/tests/golden/007_correo.json @@ -0,0 +1,64 @@ +{ + "adjuntos": [ + "10091153136-31-VPP1-516.xml" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": "42327525", + "documentos_referencia": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q42327525", + "lineas": [ + { + "cantidad": 520.0, + "descripcion": "CEMENTO SOL 42.50KG", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "LUIS AUGUSTO", + "numero": "516", + "peso_bruto": "22.1", + "porcentaje_detraccion": null, + "punto_llegada": "PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA", + "punto_partida": "AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO", + "razon_social_emisor": "ZAPATA ARAPA EUSEBIO", + "razon_social_receptor": "ZAPATA ARAPA EUSEBIO", + "ruc_emisor": "10091153136", + "ruc_receptor": "10091153136", + "ruta_pdf": null, + "ruta_xml": "10091153136-31-VPP1-516.xml", + "serie": "VPP1", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "ABB758", + "vehiculo_secundario": "A6T980" + } + ] +} diff --git a/tests/golden/008_correo.json b/tests/golden/008_correo.json new file mode 100644 index 0000000..a201130 --- /dev/null +++ b/tests/golden/008_correo.json @@ -0,0 +1,198 @@ +{ + "adjuntos": [ + "20154645005-01-F002-52385.pdf", + "20154645005-01-F002-52385.xml", + "20154645005-31-2605-33.pdf", + "20154645005-31-V001-4156.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "27/05/2026", + "lineas": [ + { + "cantidad": "1.0000", + "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", + "guia_transportista": { + "numero": "4156", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129437", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "0.00", + "total_linea": "509.05" + } + ], + "monto_detraccion": "27.00", + "numero": "52385", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. MONEDA: SOLES", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-52385.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "20.00" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "05/33/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "33", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-31-2605-33.pdf", + "serie": "2605", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20154645005-01-F002-52385.pdf", + "20154645005-31-2605-33.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129437", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4156", + "serie": "V001", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-27", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "4156", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129437", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 509.05, + "total_linea": 431.4, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "52385", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA S R L", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-52385.pdf", + "ruta_xml": "20154645005-01-F002-52385.xml", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 509.05, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "42833005", + "documentos_referencia": [ + { + "numero": "129437", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4156", + "serie": "V001", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-25", + "fecha_traslado": "2026-05-25", + "licencia_conductor": "Q42833005", + "lineas": [ + { + "cantidad": 380.0, + "descripcion": "CEMENTO APU", + "guia_transportista": { + "numero": "4156", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129437", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "RUBEN", + "numero": "4156", + "peso_bruto": "16150", + "porcentaje_detraccion": null, + "punto_llegada": "JR. LOMA DE LOS PENSAMIENTOS MZ. W4 LT. 7 URB. PROL. BENAVIDES", + "punto_partida": "AV. ATOCONGO 1860", + "razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA SRL", + "razon_social_receptor": "DISTRIBUIDORA SANTA PATRICIA S R L", + "ruc_emisor": "20154645005", + "ruc_receptor": "20154645005", + "ruta_pdf": null, + "ruta_xml": "20154645005-31-V001-4156.xml", + "serie": "V001", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "KGM", + "vehiculo_principal": "A1Y872", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/009_correo.json b/tests/golden/009_correo.json new file mode 100644 index 0000000..61e89e7 --- /dev/null +++ b/tests/golden/009_correo.json @@ -0,0 +1,170 @@ +{ + "adjuntos": [ + "10091153136-01-FPP1-15407.pdf", + "10091153136-01-FPP1-15407.xml", + "10091153136-31-VPP1-516.pdf", + "10091153136-31-VPP1-516.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "516", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "10091153136", + "ruc_receptor": "20100029741", + "ruta_pdf": "10091153136-31-VPP1-516.pdf", + "serie": "VPP1", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [], + "monto_detraccion": "28.00", + "numero": "15407", + "porcentaje_detraccion": "4", + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "10091153136", + "ruc_receptor": "20100029741", + "ruta_pdf": "10091153136-01-FPP1-15407.pdf", + "serie": "FPP1", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "696.59" + } + ], + "pdf_cache": [ + "10091153136-01-FPP1-15407.pdf", + "10091153136-31-VPP1-516.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "516", + "serie": "VPP1", + "tipo": "31" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 520.0, + "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", + "guia_transportista": { + "numero": "516", + "serie": "VPP1", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.3396, + "total_linea": 590.33, + "valor_referencial": 696.592 + } + ], + "monto_detraccion": 28.0, + "nombre_conductor": null, + "numero": "15407", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "FERRETERÍA DEPOSITO 1° DE MAYO", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10091153136", + "ruc_receptor": "20100029741", + "ruta_pdf": "10091153136-01-FPP1-15407.pdf", + "ruta_xml": "10091153136-01-FPP1-15407.xml", + "serie": "FPP1", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 696.59, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "42327525", + "documentos_referencia": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q42327525", + "lineas": [ + { + "cantidad": 520.0, + "descripcion": "CEMENTO SOL 42.50KG", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "129749", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "LUIS AUGUSTO", + "numero": "516", + "peso_bruto": "22.1", + "porcentaje_detraccion": null, + "punto_llegada": "PQ. INDUSTRIAL-AV. 1 DE MAYO MZ. C LT. 17- ADEICOSUR- PARC. 1 -VILLA EL SALVADOR - LIMA - LIMA", + "punto_partida": "AV. ATOCONGO 1860 VILLA MARIA DE L TRIUNFO", + "razon_social_emisor": "ZAPATA ARAPA EUSEBIO", + "razon_social_receptor": "ZAPATA ARAPA EUSEBIO", + "ruc_emisor": "10091153136", + "ruc_receptor": "10091153136", + "ruta_pdf": "10091153136-31-VPP1-516.pdf", + "ruta_xml": "10091153136-31-VPP1-516.xml", + "serie": "VPP1", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "ABB758", + "vehiculo_secundario": "A6T980" + } + ] +} diff --git a/tests/golden/010_correo.json b/tests/golden/010_correo.json new file mode 100644 index 0000000..ff3dc1c --- /dev/null +++ b/tests/golden/010_correo.json @@ -0,0 +1,109 @@ +{ + "adjuntos": [ + "10154500010-01-FF01-3308.pdf", + "10154500010-31-2605-33.pdf", + "10154500010-31-EG03-216.xml", + "CDR-10154500010-01-FF01-3308.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [ + { + "cantidad": "740.00", + "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", + "guia_transportista": { + "numero": "216", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129711", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "2.14", + "total_linea": "1585.08" + } + ], + "monto_detraccion": "27.00", + "numero": "3308", + "porcentaje_detraccion": "4.00", + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10154500010", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154500010-01-FF01-3308.pdf", + "serie": "FF01", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1585.08" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "05/33/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "33", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA", + "ruc_emisor": "10154500010", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154500010-31-2605-33.pdf", + "serie": "2605", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "10154500010-01-FF01-3308.pdf", + "10154500010-31-2605-33.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": "40190692", + "documentos_referencia": [ + { + "numero": "129711", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q40190692", + "lineas": [], + "monto_detraccion": null, + "nombre_conductor": "QUINTANA QUISPE GERARDO", + "numero": "216", + "peso_bruto": "31.45", + "porcentaje_detraccion": null, + "punto_llegada": "CA. PANAMERICANA SUR MZ. A6 LT. 4 AS. EL TREBOL", + "punto_partida": "AV. ATOCONGO 1860 - LIMA - LIMA - VILLA MARIA DEL TRIUNFO", + "razon_social_emisor": "REMUZGO PISCONTI LIZ GIANNINA", + "razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA", + "ruc_emisor": "10154500010", + "ruc_receptor": "10154500010", + "ruta_pdf": null, + "ruta_xml": "10154500010-31-EG03-216.xml", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "CFW860", + "vehiculo_secundario": "BUI979" + } + ] +} diff --git a/tests/golden/011_correo.json b/tests/golden/011_correo.json new file mode 100644 index 0000000..615039f --- /dev/null +++ b/tests/golden/011_correo.json @@ -0,0 +1,164 @@ +{ + "adjuntos": [ + "20516287641-01-FF03-1100.pdf", + "20516287641-01-FF03-1100.xml", + "20516287641-31-EG03-253.pdf", + "20516287641-31-EG03-253.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "28/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "1100", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-01-FF03-1100.pdf", + "serie": "FF03", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "361.69" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "22/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "253", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA", + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-31-EG03-253.pdf", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20516287641-01-FF03-1100.pdf", + "20516287641-31-EG03-253.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "253", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "129356", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-28", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "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.", + "guia_transportista": { + "numero": "253", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129356", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 361.6936, + "total_linea": 306.52, + "valor_referencial": 361.69 + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "1100", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-01-FF03-1100.pdf", + "ruta_xml": "20516287641-01-FF03-1100.xml", + "serie": "FF03", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 361.69, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "10011751", + "documentos_referencia": [ + { + "numero": "222569", + "serie": "F001", + "tipo": "01" + } + ], + "fecha_emision": "2026-05-22", + "fecha_traslado": "2026-05-22", + "licencia_conductor": "Q10011751", + "lineas": [ + { + "cantidad": 270.0, + "descripcion": "CEMENTO TIPO I (SOL)", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "CUELLAR ALMERCO EDWIN GUIDO", + "numero": "253", + "peso_bruto": "11.475", + "porcentaje_detraccion": null, + "punto_llegada": "MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA", + "punto_partida": "AV ATOCONGO 1860", + "razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "ruc_emisor": "20516287641", + "ruc_receptor": "20516287641", + "ruta_pdf": "20516287641-31-EG03-253.pdf", + "ruta_xml": "20516287641-31-EG03-253.xml", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "D0P728", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/012_correo.json b/tests/golden/012_correo.json new file mode 100644 index 0000000..4bbbf2f --- /dev/null +++ b/tests/golden/012_correo.json @@ -0,0 +1,134 @@ +{ + "adjuntos": [ + "20220631541-01-E001-6942.pdf", + "20220631541-01-E001-6942.xml", + "20220631541-31-EG03-2502.pdf" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/05/2026", + "lineas": [ + { + "cantidad": "1.00", + "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", + "guia_transportista": { + "numero": "2502", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129610", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1203.941", + "total_linea": "0.00" + } + ], + "monto_detraccion": "57.00", + "numero": "6942", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6942.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1363.65" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "27/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "2502", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "DEPOSITO DE MATERIALES DE CONSTRUCCION JUAN PABLO II S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-31-EG03-2502.pdf", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20220631541-01-E001-6942.pdf", + "20220631541-31-EG03-2502.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "2502", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "129610", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "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", + "guia_transportista": { + "numero": "2502", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129610", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1420.65038, + "total_linea": 1203.941, + "valor_referencial": 1420.65 + } + ], + "monto_detraccion": 57.0, + "nombre_conductor": null, + "numero": "6942", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6942.pdf", + "ruta_xml": "20220631541-01-E001-6942.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1420.65, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/013_correo.json b/tests/golden/013_correo.json new file mode 100644 index 0000000..615039f --- /dev/null +++ b/tests/golden/013_correo.json @@ -0,0 +1,164 @@ +{ + "adjuntos": [ + "20516287641-01-FF03-1100.pdf", + "20516287641-01-FF03-1100.xml", + "20516287641-31-EG03-253.pdf", + "20516287641-31-EG03-253.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "28/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "1100", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-01-FF03-1100.pdf", + "serie": "FF03", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "361.69" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "22/05/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "253", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA", + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-31-EG03-253.pdf", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "20516287641-01-FF03-1100.pdf", + "20516287641-31-EG03-253.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "253", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "129356", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-28", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "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.", + "guia_transportista": { + "numero": "253", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129356", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 361.6936, + "total_linea": 306.52, + "valor_referencial": 361.69 + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "1100", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20516287641", + "ruc_receptor": "20100029741", + "ruta_pdf": "20516287641-01-FF03-1100.pdf", + "ruta_xml": "20516287641-01-FF03-1100.xml", + "serie": "FF03", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 361.69, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + }, + { + "codigo_detraccion": null, + "documento_conductor": "10011751", + "documentos_referencia": [ + { + "numero": "222569", + "serie": "F001", + "tipo": "01" + } + ], + "fecha_emision": "2026-05-22", + "fecha_traslado": "2026-05-22", + "licencia_conductor": "Q10011751", + "lineas": [ + { + "cantidad": 270.0, + "descripcion": "CEMENTO TIPO I (SOL)", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 0.0, + "total_linea": 0.0, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": "CUELLAR ALMERCO EDWIN GUIDO", + "numero": "253", + "peso_bruto": "11.475", + "porcentaje_detraccion": null, + "punto_llegada": "MZ H2 LT31 SECTOR MIGUEL GRAU PAMPLONA ALTA", + "punto_partida": "AV ATOCONGO 1860", + "razon_social_emisor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "razon_social_receptor": "FERREMAURO Y HNOS SOCIEDAD COMERCIAL DE RESPONSABILIDAD LIMITADA - FERREMAURO Y HNOS SRL", + "ruc_emisor": "20516287641", + "ruc_receptor": "20516287641", + "ruta_pdf": "20516287641-31-EG03-253.pdf", + "ruta_xml": "20516287641-31-EG03-253.xml", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "D0P728", + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/014_correo.json b/tests/golden/014_correo.json new file mode 100644 index 0000000..ff3dc1c --- /dev/null +++ b/tests/golden/014_correo.json @@ -0,0 +1,109 @@ +{ + "adjuntos": [ + "10154500010-01-FF01-3308.pdf", + "10154500010-31-2605-33.pdf", + "10154500010-31-EG03-216.xml", + "CDR-10154500010-01-FF01-3308.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "29/05/2026", + "lineas": [ + { + "cantidad": "740.00", + "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", + "guia_transportista": { + "numero": "216", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129711", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "2.14", + "total_linea": "1585.08" + } + ], + "monto_detraccion": "27.00", + "numero": "3308", + "porcentaje_detraccion": "4.00", + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10154500010", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154500010-01-FF01-3308.pdf", + "serie": "FF01", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1585.08" + }, + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "05/33/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "33", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA", + "ruc_emisor": "10154500010", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154500010-31-2605-33.pdf", + "serie": "2605", + "tiene_detraccion": false, + "tipo": "31", + "total_factura": null + } + ], + "pdf_cache": [ + "10154500010-01-FF01-3308.pdf", + "10154500010-31-2605-33.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": "40190692", + "documentos_referencia": [ + { + "numero": "129711", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-05-29", + "fecha_traslado": "2026-05-29", + "licencia_conductor": "Q40190692", + "lineas": [], + "monto_detraccion": null, + "nombre_conductor": "QUINTANA QUISPE GERARDO", + "numero": "216", + "peso_bruto": "31.45", + "porcentaje_detraccion": null, + "punto_llegada": "CA. PANAMERICANA SUR MZ. A6 LT. 4 AS. EL TREBOL", + "punto_partida": "AV. ATOCONGO 1860 - LIMA - LIMA - VILLA MARIA DEL TRIUNFO", + "razon_social_emisor": "REMUZGO PISCONTI LIZ GIANNINA", + "razon_social_receptor": "REMUZGO PISCONTI LIZ GIANNINA", + "ruc_emisor": "10154500010", + "ruc_receptor": "10154500010", + "ruta_pdf": null, + "ruta_xml": "10154500010-31-EG03-216.xml", + "serie": "EG03", + "tiene_detraccion": false, + "tipo": "31", + "tipo_descripcion": "Guía de Remisión Transportista", + "total_factura": null, + "ubigeo_partida": "150143", + "unidad_peso_bruto": "TNE", + "vehiculo_principal": "CFW860", + "vehiculo_secundario": "BUI979" + } + ] +} diff --git a/tests/golden/015_correo.json b/tests/golden/015_correo.json new file mode 100644 index 0000000..b0d87b0 --- /dev/null +++ b/tests/golden/015_correo.json @@ -0,0 +1,112 @@ +{ + "adjuntos": [ + "20552807970-01-E001-2403.pdf", + "20552807970-01-E001-2403.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "13/06/2026", + "lineas": [ + { + "cantidad": "780.00", + "descripcion": "BOLSA 001 SERVICIO DE TRANSPORTE BLS X S/ / CONF.VEH:C3S3/ CARGTN: 33.150 /PARTIDA:AV. ATOCONGO 1860 LIMA-LIMA-V.M.T./ LLEGADA: AV GUARDIA REPUBLICANA MZ N LOTE 20 SEC 4 ETAP 2 - VES / N REG MTC. 1551832 CNG/ V.R.: 1045.20/ PLACA VEH : D8X-933 / BWD979", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.34", + "total_linea": "1.135593" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 885.76", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "885.76" + } + ], + "monto_detraccion": "41.81", + "numero": "2403", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION REMITENTE : T001", + "ruc_emisor": "20552807970", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552807970-01-E001-2403.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1003.39" + } + ], + "pdf_cache": [ + "20552807970-01-E001-2403.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130229", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "608", + "serie": "0002", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-13", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 780.0, + "descripcion": "SERVICIO DE TRANSPORTE BLS X S/ 1.34 / CONF.VEH:C3S3/ CARGTN: 33.150 /PARTIDA:AV. ATOCONGO 1860 LIMA-LIMA-V.M.T./ LLEGADA: AV GUARDIA REPUBLICANA MZ N LOTE 20 SEC 4 ETAP 2 -VES / N REG MTC. 1551832 CNG/ V.R.: 1045.20/ PLACA VEH : D8X-933 / BWD979", + "guia_transportista": { + "numero": "608", + "serie": "0002", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130229", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.33999974, + "total_linea": 885.76254, + "valor_referencial": 1045.2 + } + ], + "monto_detraccion": 41.81, + "nombre_conductor": null, + "numero": "2403", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "MATERIALES DE CONSTRUCCION LOS PORTALES S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20552807970", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552807970-01-E001-2403.pdf", + "ruta_xml": "20552807970-01-E001-2403.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1045.2, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/017_correo.json b/tests/golden/017_correo.json new file mode 100644 index 0000000..15f37eb --- /dev/null +++ b/tests/golden/017_correo.json @@ -0,0 +1,528 @@ +{ + "adjuntos": [ + "20261374898-01-FF05-100429.pdf", + "20261374898-01-FF05-100429.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "03/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128374 GRT 1692.18 EG03-1967]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [290 SOL GRR T001-128454 GRT 1692.18 EG03-1969 / 500 APU GRR T001-128453 GRT EG03-1969]", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128454", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 ULTRA GRR T001-128512 GRT 1692.18 EG03-1971]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 APU GRR T001-128540 GRT 1692.18 EG03-1972]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [800 SOL GRR T001-128650 GRT 1713.60 EG03-1975]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [200 ULTRA GRR T001-128725 GRT 1713.60 EG03-1978 / 600 SOL GRR T001-128724 GRT EG03-1978]", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128681 GRT 1692.18 EG03-1976]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [246 ULTRA GRR T001-128727 GRT 1692.18 EG03-1977 / 544 SOL GRR T001-128726 GRT EG03-1977]", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [400 SOL GRR T001-128807 GRT 1713.60 EG03-1979 / 400 APU GRR T001-128808 GRT EG03-1979]", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128910 GRT 1692.18 EG03-1981] P.P: AV ATOCONGO 1860 - VILLA MARIA DEL TRIUNFO P.L: MZ B10 LT 30 URB TERCER MUNDO - SAN VICENTE DE CAÑETE V.R: S/. 26897.97 CARGA TM: 337.03 MTC: 1515956CNG CONF: T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + } + ], + "monto_detraccion": "1076.00", + "numero": "100429", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C Ruc: 20100029741", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100429.pdf", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1.00" + } + ], + "pdf_cache": [ + "20261374898-01-FF05-100429.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128454", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-03", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128454", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + } + ], + "monto_detraccion": 1076.0, + "nombre_conductor": null, + "numero": "100429", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INDUSFERR EIRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100429.pdf", + "ruta_xml": "20261374898-01-FF05-100429.xml", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 16986.06, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/018_correo.json b/tests/golden/018_correo.json new file mode 100644 index 0000000..5625fdb --- /dev/null +++ b/tests/golden/018_correo.json @@ -0,0 +1,115 @@ +{ + "adjuntos": [ + "20500864703-01-F002-20851.pdf", + "20500864703-01-F002-20851.xml", + "CDR-20500864703-01-F002-20851.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": null, + "lineas": [ + { + "cantidad": "750.000", + "descripcion": "NIU 78101802 SERVICIO DE TRANSPORTE S/ S/ Información adicional DETRACCIONES Código del Bien Sujeto a Detracción: 027 SERVICIO DE TRANSPORTE 750 BLS CEMENTO, Número de Cuenta Banco de la Nación: 00063009024 S/G.R.R: T001-129717 Monto de la Detracción: 40.00 S/G.R.T: EG04-4549, PTO. Porcentaje Detracción: 4.00 PARTIDA: AV ATOCONGO 1860- V.M.T, Servicio de transporte de Carga PTO.LLEGADA: AV 27 DE DICIEMBRE 652-V.M.T, CONFIGURACION.C3S2, Ubigeo Origen: 150143 PESO TN : 31.880, Dirección Origen: av atocongo 1860 MTC: 1510426CNG, Ubigeo Destino: 150143 VALOR REFERENCIA: 1,00470 Dirección Destino: av 27 de diciembre", + "guia_transportista": { + "numero": "4549", + "serie": "EG04", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129717", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.135254", + "total_linea": "851.44" + } + ], + "monto_detraccion": null, + "numero": "20851", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "/ Usuario", + "ruc_emisor": "20500864703", + "ruc_receptor": "20100029741", + "ruta_pdf": "20500864703-01-F002-20851.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1004.70" + } + ], + "pdf_cache": [ + "20500864703-01-F002-20851.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "129717", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4549", + "serie": "EG04", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-01", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 750.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "4549", + "serie": "EG04", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "129717", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.3396, + "total_linea": 851.44, + "valor_referencial": null + } + ], + "monto_detraccion": 40.0, + "nombre_conductor": null, + "numero": "20851", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DEPOSITOS Y FERRETERIA NICHAR S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA. S.A.C", + "ruc_emisor": "20500864703", + "ruc_receptor": "20100029741", + "ruta_pdf": "20500864703-01-F002-20851.pdf", + "ruta_xml": "20500864703-01-F002-20851.xml", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1004.7, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/019_correo.json b/tests/golden/019_correo.json new file mode 100644 index 0000000..9684987 --- /dev/null +++ b/tests/golden/019_correo.json @@ -0,0 +1,112 @@ +{ + "adjuntos": [ + "20552793499-01-E001-5506.pdf", + "20552793499-01-E001-5506.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "10/06/2026", + "lineas": [ + { + "cantidad": "780.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE 750 BLS DE CEMENTO P.P.AV.ATOCONGO 1860-LIMA-LIMA-V.M.T P.LL.AV FERMIN TANGUISMZ A LT 3-B URB JUAN JOSE-ICA-PISCOMTC 1550071CNGTN:33.15 V.R S.3371.355PLACA:F8A923 C.VEHICULAR:T3S3", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "780.00", + "total_linea": "2.085254" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,626.50", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1626.50" + } + ], + "monto_detraccion": "135.00", + "numero": "5506", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION REMITENTE : T001", + "ruc_emisor": "20552793499", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552793499-01-E001-5506.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1784.27" + } + ], + "pdf_cache": [ + "20552793499-01-E001-5506.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130266", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1941", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-10", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 780.0, + "descripcion": "SERVICIO DE TRANSPORTE 750 BLS DE CEMENTO P.P.AV.ATOCONGO 1860-LIMA-LIMA-V.M.T P.LL.AV FERMIN TANGUISMZ A LT 3-B URB JUAN JOSE-ICA-PISCOMTC 1550071CNGTN:33.15 V.R S.3371.355PLACA:F8A923 C.VEHICULAR:T3S3", + "guia_transportista": { + "numero": "1941", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130266", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 2.46059972, + "total_linea": 1626.49812, + "valor_referencial": null + } + ], + "monto_detraccion": 135.0, + "nombre_conductor": null, + "numero": "5506", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "CORPORACION AQUILES S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20552793499", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552793499-01-E001-5506.pdf", + "ruta_xml": "20552793499-01-E001-5506.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1919.27, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/020_correo.json b/tests/golden/020_correo.json new file mode 100644 index 0000000..ae709e9 --- /dev/null +++ b/tests/golden/020_correo.json @@ -0,0 +1,606 @@ +{ + "adjuntos": [ + "20261374898-01-FF05-100595.pdf", + "20261374898-01-FF05-100595.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "09/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128374 GRT EG03-1967] 1692.18", + "guia_transportista": { + "numero": "1967", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [290 SOL GRR T001-128452 GRT EG03-1969 / 1692.18 500 APU GRR T001-128453 GRT EG03-1969]", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 ULTRA GRR T001-128512 GRT EG03-1971] 1692.18", + "guia_transportista": { + "numero": "1971", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 APU GRR T001-128540 GRT EG03-1972] 1692.18", + "guia_transportista": { + "numero": "1972", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [800 SOL GRR T001-128650 GRT EG03-1975] 1713.60", + "guia_transportista": { + "numero": "1975", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [200 ULTRA GRR T001-128725 GRT EG03-1978 / 1713.60 600 SOL GRR T001-128724 GRT EG03-1978]", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128681 GRT EG03-1976] 1692.18", + "guia_transportista": { + "numero": "1976", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [246 ULTRA GRR T001-128727 GRT EG03-1977 / 1692.18 544 SOL GRR T001-128726 GRT EG03-1977]", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [400 SOL GRR T001-128807 GRT EG03-1979 / 1713.60 400 APU GRR T001-128808 GRT EG03-1979]", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128910 GRT EG03-1981] 1692.18", + "guia_transportista": { + "numero": "1981", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + } + ], + "monto_detraccion": null, + "numero": "100595", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C Ruc: 20100029741", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "serie": "FF05", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "1.00" + } + ], + "pdf_cache": [ + "20261374898-01-FF05-100595.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1967", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1971", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1972", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1975", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1976", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1981", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-09", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1967", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1971", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1972", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1975", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1976", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1981", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + } + ], + "monto_detraccion": 1076.0, + "nombre_conductor": null, + "numero": "100595", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INDUSFERR EIRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "ruta_xml": "20261374898-01-FF05-100595.xml", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 16986.06, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/021_correo.json b/tests/golden/021_correo.json new file mode 100644 index 0000000..9c79f31 --- /dev/null +++ b/tests/golden/021_correo.json @@ -0,0 +1,528 @@ +{ + "adjuntos": [ + "20261374898-01-FF05-100595.pdf", + "20261374898-01-FF05-100595.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "09/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128374 GRT 1692.18 EG03-1967]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [290 SOL GRR T001-128452 GRT 1692.18 EG03-1969 / 500 APU GRR T001-128453 GRT EG03-1969]", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 ULTRA GRR T001-128512 GRT 1692.18 EG03-1971]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 APU GRR T001-128540 GRT 1692.18 EG03-1972]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [800 SOL GRR T001-128650 GRT 1713.60 EG03-1975]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [200 ULTRA GRR T001-128725 GRT 1713.60 EG03-1978 / 600 SOL GRR T001-128724 GRT EG03-1978]", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128681 GRT 1692.18 EG03-1976]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [246 ULTRA GRR T001-128727 GRT 1692.18 EG03-1977 / 544 SOL GRR T001-128726 GRT EG03-1977]", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [400 SOL GRR T001-128807 GRT 1713.60 EG03-1979 / 400 APU GRR T001-128808 GRT EG03-1979]", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128910 GRT 1692.18 EG03-1981] P.P: AV ATOCONGO 1860 - VILLA MARIA DEL TRIUNFO P.L: MZ B10 LT 30 URB TERCER MUNDO - SAN VICENTE DE CAÑETE V.R: S/. 26897.97 CARGA TM: 337.03 MTC: 1515956CNG CONF: T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + } + ], + "monto_detraccion": "1076.00", + "numero": "100595", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C Ruc: 20100029741", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1.00" + } + ], + "pdf_cache": [ + "20261374898-01-FF05-100595.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-09", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + } + ], + "monto_detraccion": 1076.0, + "nombre_conductor": null, + "numero": "100595", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INDUSFERR EIRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "ruta_xml": "20261374898-01-FF05-100595.xml", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 16986.06, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/022_correo.json b/tests/golden/022_correo.json new file mode 100644 index 0000000..4596f77 --- /dev/null +++ b/tests/golden/022_correo.json @@ -0,0 +1,114 @@ +{ + "adjuntos": [ + "20154645005-01-F002-53135.pdf", + "20154645005-01-F002-53135.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "25/06/2026", + "lineas": [ + { + "cantidad": "1.0000", + "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-0130881 SEGÚN GRT : V001-00004245 VALOR REFERENCIAL : S/ 509.05 CONFIG. VEHICULAR : C3 CARGA TM. : 16.150 NO REGISTRO M.T.C. : 1525019 CNG NRO. DE PLACA : B7Y-942", + "guia_transportista": { + "numero": "4245", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130881", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "0.00", + "total_linea": "509.05" + } + ], + "monto_detraccion": "27.00", + "numero": "53135", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. MONEDA: SOLES", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-53135.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "20.00" + } + ], + "pdf_cache": [ + "20154645005-01-F002-53135.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130881", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4245", + "serie": "V001", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-25", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "4245", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130881", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 509.05, + "total_linea": 431.4, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "53135", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA S R L", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-53135.pdf", + "ruta_xml": "20154645005-01-F002-53135.xml", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 509.05, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/023_correo.json b/tests/golden/023_correo.json new file mode 100644 index 0000000..f28889a --- /dev/null +++ b/tests/golden/023_correo.json @@ -0,0 +1,114 @@ +{ + "adjuntos": [ + "20538637280-01-F001-70705.pdf", + "20538637280-01-F001-70705.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "0902-010001 UNDSERVICIO DE TRANSPORTE ND 1,142.79 870 BLS DE CEMENTO X 1.8116 P. PARTIDA AV ATOCONGO 1860 VMT P. LLEGADA MZ CH1 LOTE 04 A.H. OLOF PALME CHILCA-CAÑETE-LIMA SEGUN GRT EG03-1477 GRR T001-131386 PLACA BJY- 903/ AXJ-987 VALOR REFERENCIAL S/1576.09 CONFIGURACION VEHICULAR T 3S3 CARGA TN 36.98 REGISTRO MTC 1533890 CNG SON :MIL TRESCIENTOS CUARENTA Y OCHO CON 50/100 SOLES Total Gravado S/: 1,142.80", + "guia_transportista": { + "numero": "1477", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131386", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "0.00", + "total_linea": "1142.79" + } + ], + "monto_detraccion": "54.00", + "numero": "70705", + "porcentaje_detraccion": "4.00", + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20538637280", + "ruc_receptor": "20100029741", + "ruta_pdf": "20538637280-01-F001-70705.pdf", + "serie": "F001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1348.50" + } + ], + "pdf_cache": [ + "20538637280-01-F001-70705.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "1477", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "131386", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE 870 BLS DE CEMENTO X 1.8116 /P. PARTIDA AV ATOCONGO 1860 VMT /P. LLEGADA MZ CH1 LOTE 04 A.H. OLOF PALME /CHILCA-CAÑETE-LIMA /SEGUN GRT EG03-1477 GRR T001-131386 /PLACA BJY- 903/ AXJ-987 /VALOR REFERENCIAL S/1576.09 /CONFIGURACION VEHICULAR T 3S3 CARGA TN 36.98 /REGISTRO MTC 1533890 CNG /", + "guia_transportista": { + "numero": "1477", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131386", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1348.5, + "total_linea": 1142.8, + "valor_referencial": 1576.09 + } + ], + "monto_detraccion": 54.0, + "nombre_conductor": null, + "numero": "70705", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INVERSIONES LA ECONOMICA A & E S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20538637280", + "ruc_receptor": "20100029741", + "ruta_pdf": "20538637280-01-F001-70705.pdf", + "ruta_xml": "20538637280-01-F001-70705.xml", + "serie": "F001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1348.5, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/024_correo.json b/tests/golden/024_correo.json new file mode 100644 index 0000000..cb7eedb --- /dev/null +++ b/tests/golden/024_correo.json @@ -0,0 +1,11 @@ +{ + "adjuntos": [ + "20537929520-01-F002-486.pdf" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [ + "20537929520-01-F002-486.pdf" + ], + "xml": [] +} diff --git a/tests/golden/025_correo.json b/tests/golden/025_correo.json new file mode 100644 index 0000000..c3eac57 --- /dev/null +++ b/tests/golden/025_correo.json @@ -0,0 +1,11 @@ +{ + "adjuntos": [ + "20537929520-01-F002-488.pdf" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [ + "20537929520-01-F002-488.pdf" + ], + "xml": [] +} diff --git a/tests/golden/026_correo.json b/tests/golden/026_correo.json new file mode 100644 index 0000000..cb7eedb --- /dev/null +++ b/tests/golden/026_correo.json @@ -0,0 +1,11 @@ +{ + "adjuntos": [ + "20537929520-01-F002-486.pdf" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [ + "20537929520-01-F002-486.pdf" + ], + "xml": [] +} diff --git a/tests/golden/027_correo.json b/tests/golden/027_correo.json new file mode 100644 index 0000000..cb7eedb --- /dev/null +++ b/tests/golden/027_correo.json @@ -0,0 +1,11 @@ +{ + "adjuntos": [ + "20537929520-01-F002-486.pdf" + ], + "guias_completadas": 0, + "pdf": [], + "pdf_cache": [ + "20537929520-01-F002-486.pdf" + ], + "xml": [] +} diff --git a/tests/golden/028_correo.json b/tests/golden/028_correo.json new file mode 100644 index 0000000..1119fdd --- /dev/null +++ b/tests/golden/028_correo.json @@ -0,0 +1,86 @@ +{ + "adjuntos": [ + "20537929520-01-F002-486.pdf", + "20537929520-01-F002-486.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "12/06/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "486", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. Número: F002", + "ruc_emisor": "20537929520", + "ruc_receptor": "20100029741", + "ruta_pdf": "20537929520-01-F002-486.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "747.50" + } + ], + "pdf_cache": [ + "20537929520-01-F002-486.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "127773", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-12", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO TRANSPORTE : 650 BOLSAS DE CEMENTO/CARGA:27.625Tn/ Operación sujeta a spot código: 027 - 4% - S/.30 / Valor referencial 747.50/ C. VEHC:T2S3 /C.INSC: 150312420 /MTC 1546095 CNG/ PLACAS:B1L-940/A5I-978", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "127773", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 747.5, + "total_linea": 633.47, + "valor_referencial": 747.5 + } + ], + "monto_detraccion": 30.0, + "nombre_conductor": null, + "numero": "486", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "FERRETERIA Y MATERIALES", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20537929520", + "ruc_receptor": "20100029741", + "ruta_pdf": "20537929520-01-F002-486.pdf", + "ruta_xml": "20537929520-01-F002-486.xml", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 747.5, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/029_correo.json b/tests/golden/029_correo.json new file mode 100644 index 0000000..9c79f31 --- /dev/null +++ b/tests/golden/029_correo.json @@ -0,0 +1,528 @@ +{ + "adjuntos": [ + "20261374898-01-FF05-100595.pdf", + "20261374898-01-FF05-100595.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "09/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128374 GRT 1692.18 EG03-1967]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [290 SOL GRR T001-128452 GRT 1692.18 EG03-1969 / 500 APU GRR T001-128453 GRT EG03-1969]", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 ULTRA GRR T001-128512 GRT 1692.18 EG03-1971]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 APU GRR T001-128540 GRT 1692.18 EG03-1972]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [800 SOL GRR T001-128650 GRT 1713.60 EG03-1975]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [200 ULTRA GRR T001-128725 GRT 1713.60 EG03-1978 / 600 SOL GRR T001-128724 GRT EG03-1978]", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128681 GRT 1692.18 EG03-1976]", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [246 ULTRA GRR T001-128727 GRT 1692.18 EG03-1977 / 544 SOL GRR T001-128726 GRT EG03-1977]", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [400 SOL GRR T001-128807 GRT 1713.60 EG03-1979 / 400 APU GRR T001-128808 GRT EG03-1979]", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1713.60", + "total_linea": "1713.60" + }, + { + "cantidad": "1.00", + "descripcion": "Und. SERVICIO DE TRANSPORTE [790 SOL GRR T001-128910 GRT 1692.18 EG03-1981] P.P: AV ATOCONGO 1860 - VILLA MARIA DEL TRIUNFO P.L: MZ B10 LT 30 URB TERCER MUNDO - SAN VICENTE DE CAÑETE V.R: S/. 26897.97 CARGA TM: 337.03 MTC: 1515956CNG CONF: T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1692.18", + "total_linea": "1692.18" + } + ], + "monto_detraccion": "1076.00", + "numero": "100595", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C Ruc: 20100029741", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1.00" + } + ], + "pdf_cache": [ + "20261374898-01-FF05-100595.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-09", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1969", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128374", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1978", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128452", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1977", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128453", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "1979", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "128512", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128540", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128650", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128725", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128724", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128681", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1713.6, + "total_linea": 1452.2, + "valor_referencial": null + }, + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "128727", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128726", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128807", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128808", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "128910", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1692.18, + "total_linea": 1434.05, + "valor_referencial": null + } + ], + "monto_detraccion": 1076.0, + "nombre_conductor": null, + "numero": "100595", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INDUSFERR EIRL", + "razon_social_receptor": "A. BERIO Y CIA S.A.C", + "ruc_emisor": "20261374898", + "ruc_receptor": "20100029741", + "ruta_pdf": "20261374898-01-FF05-100595.pdf", + "ruta_xml": "20261374898-01-FF05-100595.xml", + "serie": "FF05", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 16986.06, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/030_correo.json b/tests/golden/030_correo.json new file mode 100644 index 0000000..9408710 --- /dev/null +++ b/tests/golden/030_correo.json @@ -0,0 +1,114 @@ +{ + "adjuntos": [ + "20154645005-01-F002-53359.pdf", + "20154645005-01-F002-53359.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "03/07/2026", + "lineas": [ + { + "cantidad": "1.0000", + "descripcion": "SERVICIO DE TRANSPORTE UND SERVICIO DE TRANSPORTE 150 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-0131496 SEGÚN GRT : V001-00004308 VALOR REFERENCIAL : S/ 200.94 CONFIG. VEHICULAR : C3 CARGA TM. : 6.375 NO REGISTRO M.T.C. : 1525019 CNG NRO. DE PLACA : A1Y-872", + "guia_transportista": { + "numero": "4308", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131496", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "0.00", + "total_linea": "200.94" + } + ], + "monto_detraccion": null, + "numero": "53359", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. MONEDA: SOLES", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-53359.pdf", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "200.94" + } + ], + "pdf_cache": [ + "20154645005-01-F002-53359.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131496", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4308", + "serie": "V001", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-03", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "4308", + "serie": "V001", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131496", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 200.94, + "total_linea": 170.29, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "53359", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DISTRIBUIDORA SANTA PATRICIA S R L", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20154645005", + "ruc_receptor": "20100029741", + "ruta_pdf": "20154645005-01-F002-53359.pdf", + "ruta_xml": "20154645005-01-F002-53359.xml", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 200.94, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/031_correo.json b/tests/golden/031_correo.json new file mode 100644 index 0000000..db1249a --- /dev/null +++ b/tests/golden/031_correo.json @@ -0,0 +1,115 @@ +{ + "adjuntos": [ + "20500864703-01-F002-21184.pdf", + "20500864703-01-F002-21184.xml", + "CDR-20500864703-01-F002-21184.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": null, + "lineas": [ + { + "cantidad": "200.000", + "descripcion": "NIU 78101802 SERVICIO DE TRANSPORTE S/ S/ Información adicional Total impuestos SERVICIO DE TRANSPORTE 200 BLS CEMENTO, Total IGV 18%: S/ 40.87 S/G.R.R: T001-131440 S/G.R.T: EG04-4640, PTO. Totales del documento PARTIDA: AV ATOCONGO 1860- V.M.T,", + "guia_transportista": { + "numero": "4640", + "serie": "EG04", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131440", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.135254", + "total_linea": "227.05" + } + ], + "monto_detraccion": null, + "numero": "21184", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "/ Usuario", + "ruc_emisor": "20500864703", + "ruc_receptor": "20100029741", + "ruta_pdf": "20500864703-01-F002-21184.pdf", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "total_factura": "267.92" + } + ], + "pdf_cache": [ + "20500864703-01-F002-21184.pdf" + ], + "xml": [ + { + "codigo_detraccion": null, + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131440", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4640", + "serie": "EG04", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-06", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 200.0, + "descripcion": "SERVICIO DE TRANSPORTE", + "guia_transportista": { + "numero": "4640", + "serie": "EG04", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131440", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.3396, + "total_linea": 227.05, + "valor_referencial": null + } + ], + "monto_detraccion": null, + "nombre_conductor": null, + "numero": "21184", + "peso_bruto": null, + "porcentaje_detraccion": null, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "DEPOSITOS Y FERRETERIA NICHAR S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA. S.A.C", + "ruc_emisor": "20500864703", + "ruc_receptor": "20100029741", + "ruta_pdf": "20500864703-01-F002-21184.pdf", + "ruta_xml": "20500864703-01-F002-21184.xml", + "serie": "F002", + "tiene_detraccion": false, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 267.92, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/032_correo.json b/tests/golden/032_correo.json new file mode 100644 index 0000000..c635b3f --- /dev/null +++ b/tests/golden/032_correo.json @@ -0,0 +1,95 @@ +{ + "adjuntos": [ + "20604034303-01-F002-3210.pdf", + "20604034303-01-F002-3210.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "02/07/2026", + "lineas": [], + "monto_detraccion": null, + "numero": "3210", + "porcentaje_detraccion": "4.00", + "razon_social_emisor": null, + "razon_social_receptor": null, + "ruc_emisor": "20604034303", + "ruc_receptor": "20100029741", + "ruta_pdf": "20604034303-01-F002-3210.pdf", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1765.80" + } + ], + "pdf_cache": [ + "20604034303-01-F002-3210.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131541", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1859", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-02", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 750.0, + "descripcion": "SERVICIO DE TRANSPORTE DE CEMENTO P.P AV.ATOCONGO 1860-V.M.T - LIMA - LIMA P.LL. OTR. PAGO DE ÑOCO BAJO 997A SEC. EL CARRIZO BRAZO TASAYCO UC 00997-A - ICA- CHINCHA- SUNAMPE- SUNAMPE- CHINCHA- ICA MTC 15109718 CNG TN 31.875 PLACA: D4H908 C.VEHC: T3S3 -V.R.S/ 2,839.74", + "guia_transportista": { + "numero": "1859", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131541", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 2.3544, + "total_linea": 1496.44, + "valor_referencial": 2839.74 + } + ], + "monto_detraccion": 114.0, + "nombre_conductor": null, + "numero": "3210", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "AQUIFAST LOGISTIC S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20604034303", + "ruc_receptor": "20100029741", + "ruta_pdf": "20604034303-01-F002-3210.pdf", + "ruta_xml": "20604034303-01-F002-3210.xml", + "serie": "F002", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1765.8, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/033_correo.json b/tests/golden/033_correo.json new file mode 100644 index 0000000..fc37388 --- /dev/null +++ b/tests/golden/033_correo.json @@ -0,0 +1,120 @@ +{ + "adjuntos": [ + "20552793499-01-E001-5554.pdf", + "20552793499-01-E001-5554.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "03/07/2026", + "lineas": [ + { + "cantidad": "800.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE 800 BLS DE CEMENTO P.P. AV.ATOCONGO 1860-LIMA-LIMA-V.M.T P.LL. AV FERMIN TANGUISMZ A LT 3-B URB JUAN JOSE - ICA - PISCOMTC", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "800.00", + "total_linea": "2.085254" + }, + { + "cantidad": "34.00", + "descripcion": "V.R S/ PLACA:CFU878 C.VEHICULAR:T3S3", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "34.00", + "total_linea": "3457.80" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,668.20", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1668.20" + } + ], + "monto_detraccion": "138.00", + "numero": "5554", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION REMITENTE : T001", + "ruc_emisor": "20552793499", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552793499-01-E001-5554.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1830.48" + } + ], + "pdf_cache": [ + "20552793499-01-E001-5554.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131601", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1984", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-03", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 800.0, + "descripcion": "SERVICIO DE TRANSPORTE 800 BLS DE CEMENTO P.P. AV.ATOCONGO 1860-LIMA-LIMA-V.M.T P.LL. AV FERMIN TANGUISMZ A LT 3-B URB JUAN JOSE - ICA - PISCOMTC 1550071CNGTN:34.00 V.R S/3457.80 PLACA:CFU878 C.VEHICULAR:T3S3", + "guia_transportista": { + "numero": "1984", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131601", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 2.46059972, + "total_linea": 1668.2032, + "valor_referencial": 3457.8 + } + ], + "monto_detraccion": 138.0, + "nombre_conductor": null, + "numero": "5554", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "CORPORACION AQUILES S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20552793499", + "ruc_receptor": "20100029741", + "ruta_pdf": "20552793499-01-E001-5554.pdf", + "ruta_xml": "20552793499-01-E001-5554.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1968.48, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/035_correo.json b/tests/golden/035_correo.json new file mode 100644 index 0000000..08950bd --- /dev/null +++ b/tests/golden/035_correo.json @@ -0,0 +1,91 @@ +{ + "adjuntos": [ + "20614715252-01-E001-737.pdf", + "20614715252-01-E001-737.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD ACCESORIOS DE SISTEMA DE EMBRAGUE SPICER 380X10X2 RODAJE DE VOLANTE, JUEGO DE PASTILLAS, COLLARIN, JUEGO DE RESORTE, FRENO DE MONTSAJE, CUBO DE EMBRAGUE", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.00", + "total_linea": "1364.4067" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,364.41", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1364.41" + } + ], + "monto_detraccion": "193.00", + "numero": "737", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20614715252", + "ruc_receptor": "20100029741", + "ruta_pdf": "20614715252-01-E001-737.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "193.00" + } + ], + "pdf_cache": [ + "20614715252-01-E001-737.pdf" + ], + "xml": [ + { + "codigo_detraccion": "020", + "documento_conductor": null, + "documentos_referencia": [], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "ACCESORIOS DE SISTEMA DE EMBRAGUE SPICER 380X10X2 RODAJE DE VOLANTE, JUEGO DE PASTILLAS, COLLARIN, JUEGO DE RESORTE, FRENO DE MONTSAJE, CUBO DE EMBRAGUE", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 1609.999906, + "total_linea": 1364.4067, + "valor_referencial": null + } + ], + "monto_detraccion": 193.0, + "nombre_conductor": null, + "numero": "737", + "peso_bruto": null, + "porcentaje_detraccion": 12.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "LENINQ EMBRAGUES S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20614715252", + "ruc_receptor": "20100029741", + "ruta_pdf": "20614715252-01-E001-737.pdf", + "ruta_xml": "20614715252-01-E001-737.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1610.0, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/036_correo.json b/tests/golden/036_correo.json new file mode 100644 index 0000000..72e2ad8 --- /dev/null +++ b/tests/golden/036_correo.json @@ -0,0 +1,130 @@ +{ + "adjuntos": [ + "20520758829-01-E001-1214.pdf", + "20520758829-01-E001-1214.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "760.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE 760 BOLSAS DE CEMENTO POR 1.339600 G.R.R: T001-00131243 G.R.T: EG03-01022 C. VEHC:", + "guia_transportista": { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "760.00", + "total_linea": "1.1352542" + }, + { + "cantidad": "1018.10", + "descripcion": "VALOR REFERENCIAL: CARGA: TN PLACA: BSS804/TLS972", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1018.10", + "total_linea": "32.300" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 862.79", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "862.79" + } + ], + "monto_detraccion": "41.00", + "numero": "1214", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20520758829", + "ruc_receptor": "20100029741", + "ruta_pdf": "20520758829-01-E001-1214.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "977.10" + } + ], + "pdf_cache": [ + "20520758829-01-E001-1214.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 760.0, + "descripcion": "SERVICIO DE TRANSPORTE 760 BOLSAS DE CEMENTO POR 1.339600 G.R.R: T001-00131243 G.R.T: EG03-01022 C. VEHC: T3S3 VALOR REFERENCIAL: 1018.10 CARGA: 32.300 TN PLACA: BSS804/TLS972", + "guia_transportista": { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339599956, + "total_linea": 862.793192, + "valor_referencial": 1018.1 + } + ], + "monto_detraccion": 41.0, + "nombre_conductor": null, + "numero": "1214", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INVERSIONES PRADA SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20520758829", + "ruc_receptor": "20100029741", + "ruta_pdf": "20520758829-01-E001-1214.pdf", + "ruta_xml": "20520758829-01-E001-1214.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1018.1, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/037_correo.json b/tests/golden/037_correo.json new file mode 100644 index 0000000..c8bd3a2 --- /dev/null +++ b/tests/golden/037_correo.json @@ -0,0 +1,122 @@ +{ + "adjuntos": [ + "20524528992-01-E001-861.pdf", + "20524528992-01-E001-861.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "750.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE DE BLS X S/ / CONF.VEH: T3S3/ CARGA: 31.875 TN/ PARTIDA: AV ATONCONGO 1860 - V.M.T. LIMA - LIMA. / LLEGADA: CARR. ANT. PAN. SUR KM. 39.5 FND SANTA GENOVEVA LURIN-LIMA-LIMA /MTC: 1530145 CNG /VALOR REFERENCIAL S/ 1004.7", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.3396", + "total_linea": "1.13525" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 851.44", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "851.44" + } + ], + "monto_detraccion": "40.00", + "numero": "861", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION TRANSPORTISTA : EG03", + "ruc_emisor": "20524528992", + "ruc_receptor": "20100029741", + "ruta_pdf": "20524528992-01-E001-861.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "964.70" + } + ], + "pdf_cache": [ + "20524528992-01-E001-861.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "204", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "131180", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "131181", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 750.0, + "descripcion": "SERVICIO DE TRANSPORTE DE BLS X S/ 1.3396 / CONF.VEH: T3S3/ CARGA: 31.875 TN/ PARTIDA: AV ATONCONGO 1860 - V.M.T. LIMA - LIMA. / LLEGADA: CARR. ANT. PAN. SUR KM. 39.5 FND SANTA GENOVEVA LURIN-LIMA-LIMA /MTC: 1530145 CNG /VALOR REFERENCIAL S/ 1004.7", + "guia_transportista": { + "numero": "204", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131180", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "131181", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339595, + "total_linea": 851.4375, + "valor_referencial": 1004.7 + } + ], + "monto_detraccion": 40.0, + "nombre_conductor": null, + "numero": "861", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TRANSPORTE A & M SEÑOR DE LUREN S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20524528992", + "ruc_receptor": "20100029741", + "ruta_pdf": "20524528992-01-E001-861.pdf", + "ruta_xml": "20524528992-01-E001-861.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1004.7, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/038_correo.json b/tests/golden/038_correo.json new file mode 100644 index 0000000..4a0e864 --- /dev/null +++ b/tests/golden/038_correo.json @@ -0,0 +1,91 @@ +{ + "adjuntos": [ + "20612674133-01-E001-2.pdf", + "20612674133-01-E001-2.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD ASESORIA CONTABLE CORRESPONDIENTE AL PERIODO T 062026,REVISION DE REGISTROS CONTABLES, REPORTES FINANCIEROS Y ORIENTACION TRIBUTARIA.", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.00", + "total_linea": "4000.00" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 4,000.00", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "4000.00" + } + ], + "monto_detraccion": "566.00", + "numero": "2", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20612674133", + "ruc_receptor": "20100029741", + "ruta_pdf": "20612674133-01-E001-2.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "566.00" + } + ], + "pdf_cache": [ + "20612674133-01-E001-2.pdf" + ], + "xml": [ + { + "codigo_detraccion": "022", + "documento_conductor": null, + "documentos_referencia": [], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "ASESORIA CONTABLE CORRESPONDIENTE AL PERIODO 062026,REVISION DE REGISTROS CONTABLES, REPORTES FINANCIEROS Y ORIENTACION TRIBUTARIA.", + "guia_transportista": null, + "guias_remision": [], + "notes_text": "", + "precio_unitario": 4720.0, + "total_linea": 4000.0, + "valor_referencial": null + } + ], + "monto_detraccion": 566.0, + "nombre_conductor": null, + "numero": "2", + "peso_bruto": null, + "porcentaje_detraccion": 12.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "HA & ASOCIADOS SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20612674133", + "ruc_receptor": "20100029741", + "ruta_pdf": "20612674133-01-E001-2.pdf", + "ruta_xml": "20612674133-01-E001-2.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 4720.0, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/039_correo.json b/tests/golden/039_correo.json new file mode 100644 index 0000000..b09b653 --- /dev/null +++ b/tests/golden/039_correo.json @@ -0,0 +1,120 @@ +{ + "adjuntos": [ + "10154250161-01-E001-858.pdf", + "10154250161-01-E001-858.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE 330 BLS DE CEMENTO SOL X 1.8116 P.PARTIDA:AV. ATOCONGO 1860 V.M.T. P.LLEGADA:MZJ LT.26 PJBENJAMIN DOIG LOSSIO P. VALOR REFERENCIAL:", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.00", + "total_linea": "506.63559322" + }, + { + "cantidad": "597.83", + "descripcion": "CONFIGURACION VEHICULAR: TN. N.REG. MTC: 152411 CNG. PLACA :D0A848/W2M972", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "597.83", + "total_linea": "14.03" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 506.64", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "506.64" + } + ], + "monto_detraccion": "23.91", + "numero": "858", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. EG03", + "ruc_emisor": "10154250161", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154250161-01-E001-858.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "573.92" + } + ], + "pdf_cache": [ + "10154250161-01-E001-858.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "687", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "131460", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE 330 BLS DE CEMENTO SOL X 1.8116 P.PARTIDA:AV. ATOCONGO 1860 V.M.T. P.LLEGADA:MZJ LT.26 PJBENJAMIN DOIG LOSSIO P. VALOR REFERENCIAL: 597.83 CONFIGURACION VEHICULAR: T2S3/CTN 14.03 TN. N.REG. MTC: 152411 CNG. PLACA :D0A848/W2M972", + "guia_transportista": { + "numero": "687", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131460", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 597.8299999996, + "total_linea": 506.63559322, + "valor_referencial": 597.83 + } + ], + "monto_detraccion": 23.91, + "nombre_conductor": null, + "numero": "858", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "PAZ URBINA MAXIMO MARCOS", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10154250161", + "ruc_receptor": "20100029741", + "ruta_pdf": "10154250161-01-E001-858.pdf", + "ruta_xml": "10154250161-01-E001-858.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 597.83, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/040_correo.json b/tests/golden/040_correo.json new file mode 100644 index 0000000..72e2ad8 --- /dev/null +++ b/tests/golden/040_correo.json @@ -0,0 +1,130 @@ +{ + "adjuntos": [ + "20520758829-01-E001-1214.pdf", + "20520758829-01-E001-1214.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "760.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE 760 BOLSAS DE CEMENTO POR 1.339600 G.R.R: T001-00131243 G.R.T: EG03-01022 C. VEHC:", + "guia_transportista": { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "760.00", + "total_linea": "1.1352542" + }, + { + "cantidad": "1018.10", + "descripcion": "VALOR REFERENCIAL: CARGA: TN PLACA: BSS804/TLS972", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1018.10", + "total_linea": "32.300" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 862.79", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "862.79" + } + ], + "monto_detraccion": "41.00", + "numero": "1214", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20520758829", + "ruc_receptor": "20100029741", + "ruta_pdf": "20520758829-01-E001-1214.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "977.10" + } + ], + "pdf_cache": [ + "20520758829-01-E001-1214.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 760.0, + "descripcion": "SERVICIO DE TRANSPORTE 760 BOLSAS DE CEMENTO POR 1.339600 G.R.R: T001-00131243 G.R.T: EG03-01022 C. VEHC: T3S3 VALOR REFERENCIAL: 1018.10 CARGA: 32.300 TN PLACA: BSS804/TLS972", + "guia_transportista": { + "numero": "1022", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131243", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339599956, + "total_linea": 862.793192, + "valor_referencial": 1018.1 + } + ], + "monto_detraccion": 41.0, + "nombre_conductor": null, + "numero": "1214", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "INVERSIONES PRADA SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20520758829", + "ruc_receptor": "20100029741", + "ruta_pdf": "20520758829-01-E001-1214.pdf", + "ruta_xml": "20520758829-01-E001-1214.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1018.1, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/041_correo.json b/tests/golden/041_correo.json new file mode 100644 index 0000000..c8bd3a2 --- /dev/null +++ b/tests/golden/041_correo.json @@ -0,0 +1,122 @@ +{ + "adjuntos": [ + "20524528992-01-E001-861.pdf", + "20524528992-01-E001-861.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "30/06/2026", + "lineas": [ + { + "cantidad": "750.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE DE BLS X S/ / CONF.VEH: T3S3/ CARGA: 31.875 TN/ PARTIDA: AV ATONCONGO 1860 - V.M.T. LIMA - LIMA. / LLEGADA: CARR. ANT. PAN. SUR KM. 39.5 FND SANTA GENOVEVA LURIN-LIMA-LIMA /MTC: 1530145 CNG /VALOR REFERENCIAL S/ 1004.7", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "1.3396", + "total_linea": "1.13525" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 851.44", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "851.44" + } + ], + "monto_detraccion": "40.00", + "numero": "861", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION TRANSPORTISTA : EG03", + "ruc_emisor": "20524528992", + "ruc_receptor": "20100029741", + "ruta_pdf": "20524528992-01-E001-861.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "964.70" + } + ], + "pdf_cache": [ + "20524528992-01-E001-861.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "204", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "131180", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "131181", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-30", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 750.0, + "descripcion": "SERVICIO DE TRANSPORTE DE BLS X S/ 1.3396 / CONF.VEH: T3S3/ CARGA: 31.875 TN/ PARTIDA: AV ATONCONGO 1860 - V.M.T. LIMA - LIMA. / LLEGADA: CARR. ANT. PAN. SUR KM. 39.5 FND SANTA GENOVEVA LURIN-LIMA-LIMA /MTC: 1530145 CNG /VALOR REFERENCIAL S/ 1004.7", + "guia_transportista": { + "numero": "204", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "131180", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "131181", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339595, + "total_linea": 851.4375, + "valor_referencial": 1004.7 + } + ], + "monto_detraccion": 40.0, + "nombre_conductor": null, + "numero": "861", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TRANSPORTE A & M SEÑOR DE LUREN S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20524528992", + "ruc_receptor": "20100029741", + "ruta_pdf": "20524528992-01-E001-861.pdf", + "ruta_xml": "20524528992-01-E001-861.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1004.7, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/042_correo.json b/tests/golden/042_correo.json new file mode 100644 index 0000000..c7c30f8 --- /dev/null +++ b/tests/golden/042_correo.json @@ -0,0 +1,109 @@ +{ + "adjuntos": [ + "20220631541-01-E001-6994.pdf", + "20220631541-01-E001-6994.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "13/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:0001-28559 Y G.R.R: T001- 130612 DEL 12.06.26 F9V-838/C4E-990 CATEGORIA:T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.00", + "total_linea": "1203.941" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,203.94", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1203.94" + } + ], + "monto_detraccion": "57.00", + "numero": "6994", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6994.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1363.65" + } + ], + "pdf_cache": [ + "20220631541-01-E001-6994.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-13", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:0001-28559 Y G.R.R: T001-130612 DEL 12.06.26 F9V-838/C4E-990 CATEGORIA:T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1420.65038, + "total_linea": 1203.941, + "valor_referencial": 1420.65 + } + ], + "monto_detraccion": 57.0, + "nombre_conductor": null, + "numero": "6994", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6994.pdf", + "ruta_xml": "20220631541-01-E001-6994.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1420.65, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/043_correo.json b/tests/golden/043_correo.json new file mode 100644 index 0000000..1dd5716 --- /dev/null +++ b/tests/golden/043_correo.json @@ -0,0 +1,130 @@ +{ + "adjuntos": [ + "20525144951-01-E001-15679.pdf", + "20525144951-01-E001-15679.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "13/06/2026", + "lineas": [ + { + "cantidad": "350.00", + "descripcion": "BOLSA SERVICIO DE TRANSPORTE 350 BOLSAS DE CEMENTO X 1.339600 G.R.R:T001-130329 G.R.T: EG03-004473 C.VEHC: C3", + "guia_transportista": { + "numero": "4473", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130329", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "350.00", + "total_linea": "1.1352542" + }, + { + "cantidad": "468.86", + "descripcion": "VALOR REFERENCIAL: CARGA: TN PLACA: ACE891", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "468.86", + "total_linea": "14.875" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 397.34", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "397.34" + } + ], + "monto_detraccion": "19.00", + "numero": "15679", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20525144951", + "ruc_receptor": "20100029741", + "ruta_pdf": "20525144951-01-E001-15679.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "449.86" + } + ], + "pdf_cache": [ + "20525144951-01-E001-15679.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130329", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4473", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-06-13", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 350.0, + "descripcion": "SERVICIO DE TRANSPORTE 350 BOLSAS DE CEMENTO X 1.339600 G.R.R:T001-130329 G.R.T: EG03-004473 C.VEHC: C3 VALOR REFERENCIAL: 468.86 CARGA: 14.875 TN PLACA: ACE891", + "guia_transportista": { + "numero": "4473", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "130329", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339599956, + "total_linea": 397.33897, + "valor_referencial": 468.86 + } + ], + "monto_detraccion": 19.0, + "nombre_conductor": null, + "numero": "15679", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TRANSPORTES Y NEGOCIACIONES PRADA S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20525144951", + "ruc_receptor": "20100029741", + "ruta_pdf": "20525144951-01-E001-15679.pdf", + "ruta_xml": "20525144951-01-E001-15679.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 468.86, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/044_correo.json b/tests/golden/044_correo.json new file mode 100644 index 0000000..c7c30f8 --- /dev/null +++ b/tests/golden/044_correo.json @@ -0,0 +1,109 @@ +{ + "adjuntos": [ + "20220631541-01-E001-6994.pdf", + "20220631541-01-E001-6994.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "13/06/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:0001-28559 Y G.R.R: T001- 130612 DEL 12.06.26 F9V-838/C4E-990 CATEGORIA:T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.00", + "total_linea": "1203.941" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,203.94", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1203.94" + } + ], + "monto_detraccion": "57.00", + "numero": "6994", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6994.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1363.65" + } + ], + "pdf_cache": [ + "20220631541-01-E001-6994.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-06-13", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 750 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT:0001-28559 Y G.R.R: T001-130612 DEL 12.06.26 F9V-838/C4E-990 CATEGORIA:T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "130612", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1420.65038, + "total_linea": 1203.941, + "valor_referencial": 1420.65 + } + ], + "monto_detraccion": 57.0, + "nombre_conductor": null, + "numero": "6994", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-6994.pdf", + "ruta_xml": "20220631541-01-E001-6994.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1420.65, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/045_correo.json b/tests/golden/045_correo.json new file mode 100644 index 0000000..c0d49d4 --- /dev/null +++ b/tests/golden/045_correo.json @@ -0,0 +1,112 @@ +{ + "adjuntos": [ + "10075211215-01-E001-7266.pdf", + "10075211215-01-E001-7266.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "11/07/2026", + "lineas": [ + { + "cantidad": "720.00", + "descripcion": "BOLSA SERV DE TRANSP: 720 BOL CEMENTO PTO DE PDA: AV ATOCONGO 1860 VMT PTO DE LLEGADA AV DEFENSORES DE LIMA MZA A LTE 5 SJM CONF VEHICULAR: T3 S3. PLACAS :B3E887 / F4S714 NRO DE REGISTRO 1536131CNG CARGA TN 30.600. V.R. S/964.51 CTA BN: 00-063-055972 COD:", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "720.00", + "total_linea": "1.135254" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 817.38", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "817.38" + } + ], + "monto_detraccion": "38.58", + "numero": "7266", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C. GUIA DE REMISION REMITENTE : T001", + "ruc_emisor": "10075211215", + "ruc_receptor": "20100029741", + "ruta_pdf": "10075211215-01-E001-7266.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "925.93" + } + ], + "pdf_cache": [ + "10075211215-01-E001-7266.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "132215", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "3144", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-11", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 720.0, + "descripcion": "SERV DE TRANSP: 720 BOL CEMENTO PTO DE PDA: AV ATOCONGO 1860 VMT PTO DE LLEGADA AV DEFENSORES DE LIMA MZA A LTE 5 SJM CONF VEHICULAR: T3 S3. PLACAS :B3E887 / F4S714 NRO DE REGISTRO 1536131CNG CARGA TN 30.600. V.R. S/964.51 CTA BN: 00-063-055972 COD:", + "guia_transportista": { + "numero": "3144", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "132215", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.33959972, + "total_linea": 817.38288, + "valor_referencial": 964.51 + } + ], + "monto_detraccion": 38.58, + "nombre_conductor": null, + "numero": "7266", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "FERRETERIA DEPOSITO FABIAN", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "10075211215", + "ruc_receptor": "20100029741", + "ruta_pdf": "10075211215-01-E001-7266.pdf", + "ruta_xml": "10075211215-01-E001-7266.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 964.51, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/046_correo.json b/tests/golden/046_correo.json new file mode 100644 index 0000000..e5dbe22 --- /dev/null +++ b/tests/golden/046_correo.json @@ -0,0 +1,130 @@ +{ + "adjuntos": [ + "20525144951-01-E001-15864.pdf", + "20525144951-01-E001-15864.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "11/07/2026", + "lineas": [ + { + "cantidad": "350.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE 350 BOLSAS DE CEMENTO X 1.339600 G.R.R:T001-132131 G.R.T: EG03-004643 C.VEHC: C3", + "guia_transportista": { + "numero": "4643", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "132131", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "350.00", + "total_linea": "1.1352542" + }, + { + "cantidad": "468.86", + "descripcion": "VALOR REFERENCIAL: CARGA: TN PLACA: A1Z889", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "468.86", + "total_linea": "14.875" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 397.34", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "397.34" + } + ], + "monto_detraccion": "19.00", + "numero": "15864", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20525144951", + "ruc_receptor": "20100029741", + "ruta_pdf": "20525144951-01-E001-15864.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "449.86" + } + ], + "pdf_cache": [ + "20525144951-01-E001-15864.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "132131", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "4643", + "serie": "EG03", + "tipo": "31" + } + ], + "fecha_emision": "2026-07-11", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 350.0, + "descripcion": "SERVICIO DE TRANSPORTE 350 BOLSAS DE CEMENTO X 1.339600 G.R.R:T001-132131 G.R.T: EG03-004643 C.VEHC: C3 VALOR REFERENCIAL: 468.86 CARGA: 14.875 TN PLACA: A1Z889", + "guia_transportista": { + "numero": "4643", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "132131", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1.339599956, + "total_linea": 397.33897, + "valor_referencial": 468.86 + } + ], + "monto_detraccion": 19.0, + "nombre_conductor": null, + "numero": "15864", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TRANSPORTES Y NEGOCIACIONES PRADA S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20525144951", + "ruc_receptor": "20100029741", + "ruta_pdf": "20525144951-01-E001-15864.pdf", + "ruta_xml": "20525144951-01-E001-15864.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 468.86, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/047_correo.json b/tests/golden/047_correo.json new file mode 100644 index 0000000..e1831fb --- /dev/null +++ b/tests/golden/047_correo.json @@ -0,0 +1,122 @@ +{ + "adjuntos": [ + "20603551151-01-E001-3915.pdf", + "20603551151-01-E001-3915.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "11/07/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:15157277-CNG 850 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT: EG03-130 Y G.R.R: T001- 132078 DEL 09.07.26 F0I-756/BUT-978 CATEGORIA: T3S3", + "guia_transportista": { + "numero": "130", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "132078", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.00", + "total_linea": "1364.466" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,364.47", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1364.47" + } + ], + "monto_detraccion": "64.00", + "numero": "3915", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20603551151", + "ruc_receptor": "20100029741", + "ruta_pdf": "20603551151-01-E001-3915.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1546.07" + } + ], + "pdf_cache": [ + "20603551151-01-E001-3915.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "130", + "serie": "EG03", + "tipo": "31" + }, + { + "numero": "132078", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-07-11", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:15157277-CNG 850 BLS RUTA: LIMA-(LIMA)- MALA (CAÑETE) S/GRT: EG03-130 Y G.R.R: T001-132078 DEL 09.07.26 F0I-756/BUT-978 CATEGORIA: T3S3", + "guia_transportista": { + "numero": "130", + "serie": "EG03", + "tipo": "31" + }, + "guias_remision": [ + { + "numero": "132078", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1610.06988, + "total_linea": 1364.466, + "valor_referencial": 1610.07 + } + ], + "monto_detraccion": 64.0, + "nombre_conductor": null, + "numero": "3915", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "TRANSPORTE Y LOGISTICA JUAN PABLO II S.A.C.", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20603551151", + "ruc_receptor": "20100029741", + "ruta_pdf": "20603551151-01-E001-3915.pdf", + "ruta_xml": "20603551151-01-E001-3915.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1610.07, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/golden/048_correo.json b/tests/golden/048_correo.json new file mode 100644 index 0000000..ce5eb9b --- /dev/null +++ b/tests/golden/048_correo.json @@ -0,0 +1,119 @@ +{ + "adjuntos": [ + "20220631541-01-E001-7055.pdf", + "20220631541-01-E001-7055.xml" + ], + "guias_completadas": 0, + "pdf": [ + { + "codigo_detraccion": null, + "documentos_referencia": [], + "fecha_emision": "11/07/2026", + "lineas": [ + { + "cantidad": "1.00", + "descripcion": "UNIDAD SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 867 BLS RUTA: LIMA-(LIMA)- SAN VICENTE DE CAÑETE (CAÑETE) S/GRT:0001- 28642 Y G.R.R: T001-132098,132099 DEL 09.07.26 F6G-856/ASU- 978 CATEGORIA: T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "132098", + "serie": "T001", + "tipo": "09" + } + ], + "precio_unitario": "1.00", + "total_linea": "1573.825" + }, + { + "cantidad": "0.00", + "descripcion": "Valor de Venta de Operaciones Gratuitas : S/ Sub Total Ventas : S/ Anticipos : S/ 0.00 Descuentos : S/ 0.00 Valor Venta : S/ 1,573.83", + "guia_transportista": null, + "guias_remision": [], + "precio_unitario": "0.00", + "total_linea": "1573.83" + } + ], + "monto_detraccion": "118.00", + "numero": "7055", + "porcentaje_detraccion": null, + "razon_social_emisor": null, + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-7055.pdf", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "total_factura": "1739.11" + } + ], + "pdf_cache": [ + "20220631541-01-E001-7055.pdf" + ], + "xml": [ + { + "codigo_detraccion": "027", + "documento_conductor": null, + "documentos_referencia": [ + { + "numero": "132098", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "132099", + "serie": "T001", + "tipo": "09" + } + ], + "fecha_emision": "2026-07-11", + "fecha_traslado": null, + "licencia_conductor": null, + "lineas": [ + { + "cantidad": 1.0, + "descripcion": "SERVICIO DE TRANSPORTE DE CARGA DE MERCANCIAS CERTIFICADO DE INSCRIPCION:157935-CNG 867 BLS RUTA: LIMA-(LIMA)- SAN VICENTE DE CAÑETE (CAÑETE) S/GRT:0001-28642 Y G.R.R: T001-132098,132099 DEL 09.07.26 F6G-856/ASU-978 CATEGORIA: T3S3", + "guia_transportista": null, + "guias_remision": [ + { + "numero": "132098", + "serie": "T001", + "tipo": "09" + }, + { + "numero": "132099", + "serie": "T001", + "tipo": "09" + } + ], + "notes_text": "", + "precio_unitario": 1857.1135, + "total_linea": 1573.825, + "valor_referencial": 2940.8 + } + ], + "monto_detraccion": 118.0, + "nombre_conductor": null, + "numero": "7055", + "peso_bruto": null, + "porcentaje_detraccion": 4.0, + "punto_llegada": null, + "punto_partida": null, + "razon_social_emisor": "EMPRESA DE TRANSPORTE DE CARGA JUAN PABLO II SAC", + "razon_social_receptor": "A. BERIO Y CIA S.A.C.", + "ruc_emisor": "20220631541", + "ruc_receptor": "20100029741", + "ruta_pdf": "20220631541-01-E001-7055.pdf", + "ruta_xml": "20220631541-01-E001-7055.xml", + "serie": "E001", + "tiene_detraccion": true, + "tipo": "01", + "tipo_descripcion": "Factura", + "total_factura": 1857.11, + "ubigeo_partida": null, + "unidad_peso_bruto": null, + "vehiculo_principal": null, + "vehiculo_secundario": null + } + ] +} diff --git a/tests/test_config_validator.py b/tests/test_config_validator.py new file mode 100644 index 0000000..2c5229c --- /dev/null +++ b/tests/test_config_validator.py @@ -0,0 +1,76 @@ +import logging + +import pytest + +import config_validator as cv + +OBLIGATORIAS = [v for grupo in cv.OBLIGATORIAS.values() for v in grupo] +OPCIONALES = ["RUTA_RED_FACTURACION", "RUC_EMPRESA", "LOG_LEVEL", *cv.VERIFICACION_SSL] + + +@pytest.fixture +def env_completo(monkeypatch): + """Entorno válido y sin variables opcionales (para partir de un estado conocido).""" + for v in OBLIGATORIAS: + monkeypatch.setenv(v, "valor") + for v in OPCIONALES: + monkeypatch.delenv(v, raising=False) + + +def test_entorno_completo_no_tiene_errores(env_completo): + errores, _ = cv.validar_configuracion() + assert errores == [] + + +def test_faltantes_se_agrupan_por_servicio(env_completo, monkeypatch): + monkeypatch.delenv("CLIENT_ID") + monkeypatch.setenv("HANA_USER", " ") # solo espacios cuenta como vacío + errores, _ = cv.validar_configuracion() + + assert len(errores) == 2 + assert any(e.startswith("Microsoft Graph") and "CLIENT_ID" in e for e in errores) + assert any(e.startswith("SAP HANA") and "HANA_USER" in e for e in errores) + + +def test_ruta_de_red_sin_ruc_es_error(env_completo, monkeypatch): + monkeypatch.setenv("RUTA_RED_FACTURACION", "//srv/facturas") + errores, _ = cv.validar_configuracion() + assert any("RUC_EMPRESA" in e for e in errores) + + +def test_sin_ruta_de_red_solo_advierte(env_completo): + errores, advertencias = cv.validar_configuracion() + assert errores == [] + assert any("RUTA_RED_FACTURACION" in a for a in advertencias) + + +def test_advertencias_de_ssl(env_completo, monkeypatch): + _, advertencias = cv.validar_configuracion() + assert sum("Verificación SSL" in a for a in advertencias) == 2 + + monkeypatch.setenv("VERIFY_SSL", "TRUE") # no distingue mayúsculas + _, advertencias = cv.validar_configuracion() + assert not any("Microsoft Graph" in a and "SSL" in a for a in advertencias) + assert any("SAP B1" in a and "SSL" in a for a in advertencias) + + +def test_log_level_invalido_advierte(env_completo, monkeypatch): + monkeypatch.setenv("LOG_LEVEL", "CHISME") + _, advertencias = cv.validar_configuracion() + assert any("LOG_LEVEL" in a for a in advertencias) + + monkeypatch.setenv("LOG_LEVEL", "debug") + _, advertencias = cv.validar_configuracion() + assert not any("LOG_LEVEL" in a for a in advertencias) + + +def test_verificar_termina_con_codigo_1_si_hay_errores(env_completo, monkeypatch, caplog): + monkeypatch.delenv("EMAIL") + with caplog.at_level(logging.ERROR), pytest.raises(SystemExit) as salida: + cv.verificar_configuracion() + assert salida.value.code == 1 + assert "EMAIL" in caplog.text + + +def test_verificar_no_termina_si_todo_esta_bien(env_completo): + cv.verificar_configuracion() # no debe lanzar SystemExit diff --git a/tests/test_documentos.py b/tests/test_documentos.py new file mode 100644 index 0000000..efcbdbd --- /dev/null +++ b/tests/test_documentos.py @@ -0,0 +1,123 @@ +import logging +import os + +import adjuntos +import documentos + + +# ============================================================================ +# completar_guias +# ============================================================================ +def test_completar_guias_desde_pdf_normaliza_strings(): + xml_doc = { + "ruc_emisor": "20537929520", "tipo": "01", "serie": "F002", "numero": "486", + "lineas": [{"guias_remision": []}, {"guias_remision": [{"tipo": "09", "serie": "T001", "numero": "5"}]}], + } + pdf_cache = {"20537929520-01-F002-486.pdf": {"items": [ + {"guias_remision": ["T001-00123"], "guia_transportista": "V002-0011"}, + {"guias_remision": ["T001-999"]}, + ]}} + + copiadas = documentos.completar_guias([xml_doc], pdf_cache) + + assert copiadas == 1 + assert xml_doc["lineas"][0]["guias_remision"] == [{"tipo": "09", "serie": "T001", "numero": "123"}] + assert xml_doc["lineas"][0]["guia_transportista"] == {"tipo": "31", "serie": "V002", "numero": "11"} + assert xml_doc["lineas"][1]["guias_remision"][0]["numero"] == "5" # la que ya tenía no se toca + + +def test_completar_guias_sin_pdf_no_hace_nada(): + doc = {"ruc_emisor": "1", "tipo": "01", "serie": "F", "numero": "1", "lineas": [{"guias_remision": []}]} + assert documentos.completar_guias([doc], {}) == 0 + assert doc["lineas"][0]["guias_remision"] == [] + + +# ============================================================================ +# validar_guias +# ============================================================================ +def test_validar_guias_advierte_solo_las_invalidas(caplog): + doc = {"serie": "F002", "numero": "1", "lineas": [{ + "guias_remision": [{"tipo": "09", "serie": "T001", "numero": "1"}, {"tipo": "09", "serie": "T001"}], + "guia_transportista": {"tipo": "31", "serie": "", "numero": "2"}, + }]} + + with caplog.at_level(logging.WARNING, logger="pipeline"): + documentos.validar_guias([doc]) + + mensajes = [r.getMessage() for r in caplog.records] + assert len(mensajes) == 2 + assert any("guias_remision[1] inválida" in m for m in mensajes) + assert any("guia_transportista inválida" in m for m in mensajes) + assert all(r.levelno == logging.WARNING for r in caplog.records) + + +def test_validar_guias_sin_problemas_no_registra(caplog): + doc = {"serie": "F", "numero": "1", "lineas": [{"guias_remision": [{"tipo": "09", "serie": "T001", "numero": "1"}]}]} + with caplog.at_level(logging.WARNING, logger="pipeline"): + documentos.validar_guias([doc]) + assert caplog.records == [] + + +# ============================================================================ +# copiar_a_red +# ============================================================================ +def _comprobante(tmp_path, fecha="2026-03-05"): + xml = tmp_path / "a.xml" + pdf = tmp_path / "a.pdf" + xml.write_text("") + pdf.write_bytes(b"%PDF") + return {"ruc_emisor": "20111", "tipo": "01", "serie": "F002", "numero": "7", + "fecha_emision": fecha, "ruta_xml": str(xml), "ruta_pdf": str(pdf)} + + +def test_copiar_a_red_arma_la_estructura(tmp_path, monkeypatch): + red = tmp_path / "red" + monkeypatch.setenv("RUTA_RED_FACTURACION", str(red)) + monkeypatch.setenv("RUC_EMPRESA", "20999") + data = _comprobante(tmp_path) + + documentos.copiar_a_red(data) + + destino = red / "2026" / "3" / "5" / "01" / "20999" / "20111" # mes y día sin ceros + assert (destino / "20999-01-F002-7.xml").exists() + assert (destino / "20999-01-F002-7_FormatoImpreso.pdf").exists() + assert data["ruta_red_xml"].endswith("\\20999-01-F002-7.xml") # estilo UNC con backslash + assert data["ruta_red_pdf"].endswith("\\20999-01-F002-7_FormatoImpreso.pdf") + + +def test_copiar_a_red_deshabilitada_si_no_hay_ruta(tmp_path, monkeypatch): + monkeypatch.setenv("RUTA_RED_FACTURACION", "") + data = _comprobante(tmp_path) + documentos.copiar_a_red(data) + assert "ruta_red_xml" not in data and "ruta_red_pdf" not in data + + +def test_copiar_a_red_fecha_invalida_no_falla(tmp_path, monkeypatch): + red = tmp_path / "red" + monkeypatch.setenv("RUTA_RED_FACTURACION", str(red)) + monkeypatch.setenv("RUC_EMPRESA", "20999") + data = _comprobante(tmp_path, fecha="no-es-fecha") + documentos.copiar_a_red(data) + assert not red.exists() and "ruta_red_xml" not in data + + +# ============================================================================ +# adjuntos.filtrar_y_limpiar +# ============================================================================ +def test_filtrar_conserva_pdf_xml_y_borra_el_resto(tmp_path): + for nombre in ("a.pdf", "B.XML", "c.png"): + (tmp_path / nombre).write_text("x") + email = {"adjuntos": ["a.pdf", "B.XML", "c.png"]} + + assert adjuntos.filtrar_y_limpiar(email, str(tmp_path)) is True + assert email["adjuntos"] == ["a.pdf", "B.XML"] + assert sorted(os.listdir(tmp_path)) == ["B.XML", "a.pdf"] + + +def test_filtrar_sin_pdf_ni_xml_borra_todo(tmp_path): + for nombre in ("c.png", "d.docx"): + (tmp_path / nombre).write_text("x") + email = {"adjuntos": ["c.png", "d.docx"]} + + assert adjuntos.filtrar_y_limpiar(email, str(tmp_path)) is False + assert os.listdir(tmp_path) == [] diff --git a/tests/test_draft_sap.py b/tests/test_draft_sap.py new file mode 100644 index 0000000..f895f9b --- /dev/null +++ b/tests/test_draft_sap.py @@ -0,0 +1,232 @@ +import math +from datetime import datetime, timedelta + +import pytest + +import draft_sap + + +# ============================================================================ +# calcular_fecha_vencimiento +# ============================================================================ +@pytest.mark.parametrize("condicion, esperado", [ + (None, "2026-01-10"), + ({"NumberOfAdditionalDays": 30, "NumberOfAdditionalMonths": 0}, "2026-02-09"), + ({"NumberOfAdditionalDays": 0, "NumberOfAdditionalMonths": 2}, "2026-03-11"), # 2 meses = 60 días + ({"NumberOfAdditionalDays": None, "NumberOfAdditionalMonths": None}, "2026-01-10"), + ({"NumberOfAdditionalDays": 15, "NumberOfAdditionalMonths": 3}, "2026-01-25"), # los días priman +]) +def test_calcular_fecha_vencimiento(condicion, esperado): + assert draft_sap.calcular_fecha_vencimiento("2026-01-10", condicion) == esperado + + +# ============================================================================ +# validate_prices +# ============================================================================ +def _delivery_note(line_total=100.0, pav=1.5, qty=10, almacen="A-X"): + return [{ + "Series": "1", "DocNum": "9", "U_IDC_DESTINO": "Z1", + "DocumentLines": [ + {"ItemCode": "FL10007", "LineTotal": line_total, "PriceAfterVAT": pav, + "Quantity": qty, "WarehouseCode": almacen, "Weight1": 5}, + {"ItemCode": "OTRO", "LineTotal": 999, "PriceAfterVAT": 9, "Quantity": 9}, # no FL\d: se ignora + ], + }] + + +def _guia(numero="1"): + return {"tipo": "09", "serie": "T001", "numero": numero} + + +@pytest.fixture +def sap(monkeypatch): + """SAP simulado: devuelve la misma DeliveryNote para toda guía.""" + estado = {"dn": _delivery_note()} + monkeypatch.setattr(draft_sap.sapb1_manager, "get_zonas", lambda: [{"Code": "Z1", "Name": "ZONA1"}]) + monkeypatch.setattr(draft_sap.sapb1_manager, "get_delivery_notes", lambda **k: estado["dn"]) + return estado + + +def test_precios_coinciden_usa_valores_de_sap(sap): + factura = {"lineas": [{"cantidad": 1, "total_linea": 100.0, "guias_remision": [_guia()]}]} + ok, resultados = draft_sap.validate_prices(factura) + + assert ok is True + item = resultados[0]["guias_lt"][0] + assert resultados[0]["ok"] is True + assert (item["draft_quantity"], item["draft_price"]) == (10, 1.5) # de SAP, no del XML + assert item["zona"] == "ZONA1" + assert item["warehouse_code"] == "A-X" + assert item["weight1"] == 5.0 + + +def test_precios_no_coinciden_usa_valores_del_xml(sap): + factura = {"lineas": [{"cantidad": 4, "total_linea": 90.0, "guias_remision": [_guia()]}]} + ok, resultados = draft_sap.validate_prices(factura) + + assert ok is False + item = resultados[0]["guias_lt"][0] + assert (item["draft_quantity"], item["draft_price"]) == (4, 22.5) # 90 / 4 + + +def test_varias_guias_de_una_linea_se_suman(sap): + sap["dn"] = _delivery_note(line_total=60.0) + factura = {"lineas": [{"cantidad": 1, "total_linea": 120.0, "guias_remision": [_guia("1"), _guia("2")]}]} + ok, resultados = draft_sap.validate_prices(factura) + + assert ok is True + assert resultados[0]["sap_price"] == 120.0 + assert len(resultados[0]["guias_lt"]) == 2 + + +def test_tolerancia_de_un_centimo(sap): + factura = {"lineas": [{"cantidad": 1, "total_linea": 100.005, "guias_remision": [_guia()]}]} + assert draft_sap.validate_prices(factura)[0] is True + factura["lineas"][0]["total_linea"] = 100.02 + assert draft_sap.validate_prices(factura)[0] is False + + +def test_cantidad_cero_no_se_valida(sap): + factura = {"lineas": [{"cantidad": 0, "total_linea": 100.0, "guias_remision": [_guia()]}]} + ok, resultados = draft_sap.validate_prices(factura) + assert ok is False + assert resultados[0]["label"] == "Cantidad cero, sin validar" + assert resultados[0]["guias_lt"] == [] + + +def test_linea_sin_guia_no_se_valida(sap): + factura = {"lineas": [{"cantidad": 1, "total_linea": 100.0, "guias_remision": []}]} + ok, resultados = draft_sap.validate_prices(factura) + assert ok is False + assert resultados[0]["label"] == "Sin guía de referencia" + + +def test_guia_inexistente_en_sap_queda_sin_validar(sap): + sap["dn"] = [] + factura = {"lineas": [{"cantidad": 1, "total_linea": 100.0, "guias_remision": [_guia()]}]} + ok, resultados = draft_sap.validate_prices(factura) + assert ok is False + assert resultados[0]["label"] == "Sin guías SAP" + + +def test_error_consultando_sap_invalida_la_linea(monkeypatch, sap): + def falla(**k): + raise RuntimeError("sin conexión") + monkeypatch.setattr(draft_sap.sapb1_manager, "get_delivery_notes", falla) + factura = {"lineas": [{"cantidad": 1, "total_linea": 0.0, "guias_remision": [_guia()]}]} + ok, resultados = draft_sap.validate_prices(factura) + assert ok is False # aunque 0 == 0, el error obliga a ok=False + assert resultados[0]["guias_lt"][0]["line_total"] == 0.0 + + +# ============================================================================ +# build_sap_draft +# ============================================================================ +def _factura(fecha_emision, **extra): + base = { + "serie": "F002", "numero": "486", "tipo": "01", "total_factura": 118.0, + "fecha_emision": fecha_emision, "ruc_emisor": "20537929520", + "razon_social_emisor": "TRANSPORTES SA", "tiene_detraccion": False, + "ruta_red_pdf": "\\\\srv\\a.pdf", "ruta_red_xml": "\\\\srv\\a.xml", + "lineas": [ + {"descripcion": "Servicio A", "valor_referencial": 10.5}, + {"descripcion": "Servicio B", "valor_referencial": 4.5}, + ], + } + base.update(extra) + return base + + +def _resultados(draft_price=1.23456789, draft_quantity=3): + item = {"guia": {"tipo": "09", "serie": "T001", "numero": "100"}, + "draft_price": draft_price, "draft_quantity": draft_quantity, "warehouse_code": "A-X"} + return [{"guias_lt": [item]}, {"guias_lt": []}] + + +@pytest.fixture +def condicion_pago(monkeypatch): + monkeypatch.setattr(draft_sap.sapb1_manager, "obtener_condicion_pago", + lambda card_code: {"NumberOfAdditionalDays": 30}) + + +def test_draft_cabecera_y_linea(condicion_pago): + hoy = datetime.now() + draft = draft_sap.build_sap_draft(_factura(hoy.strftime("%Y-%m-%d")), _resultados()) + + assert draft["CardCode"] == "PL20537929520" + assert draft["NumAtCard"] == "01F002-486" + assert draft["DocDate"] == hoy.strftime("%Y-%m-%d") + assert draft["DocDueDate"] == (hoy + timedelta(days=30)).strftime("%Y-%m-%d") + assert draft["U_IDC_VALREF"] == 15.0 # suma del XML + assert draft["U_IDC_NUMGR"] == "09T001-100" + assert draft["U_VS_ANEXO_PDF"] == "\\\\srv\\a.pdf" + assert len(draft["DocumentLines"]) == 1 # la línea sin guías se omite + + linea = draft["DocumentLines"][0] + assert linea["Quantity"] == 3 + assert linea["PriceAfterVAT"] == math.trunc(1.23456789 * 1_000_000) / 1_000_000 == 1.234567 + assert linea["U_IDC_GRFLETE"] == "09T001-100" + assert linea["WarehouseCode"] == "A-X" + + assert draft["DocumentInstallments"] == [ + {"DueDate": hoy.strftime("%Y-%m-%d"), "Total": 118.0, "InstallmentId": 1, + "U_VS_TIPOCUOTA": "N", "U_VS_TIPOSERVICIO": ""}, + ] + + +def test_item_code_segun_mes_de_emision(condicion_pago): + hoy = datetime.now() + mes_anterior = (hoy.replace(day=1) - timedelta(days=1)).strftime("%Y-%m-%d") + + actual = draft_sap.build_sap_draft(_factura(hoy.strftime("%Y-%m-%d")), _resultados()) + anterior = draft_sap.build_sap_draft(_factura(mes_anterior), _resultados()) + + assert actual["DocumentLines"][0]["ItemCode"] == "C103002" + assert anterior["DocumentLines"][0]["ItemCode"] == "C103002-A" + + +def test_draft_con_detraccion_genera_dos_cuotas(condicion_pago): + fecha = datetime.now().strftime("%Y-%m-%d") + factura = _factura(fecha, tiene_detraccion=True, codigo_detraccion="004", + porcentaje_detraccion=12, monto_detraccion=11.2) + draft = draft_sap.build_sap_draft(factura, _resultados()) + + detraccion, neto = draft["DocumentInstallments"] + assert (detraccion["Total"], detraccion["U_VS_TIPOCUOTA"], detraccion["U_VS_TIPOSERVICIO"]) == (12, "D", "00402") + assert (neto["Total"], neto["U_VS_TIPOCUOTA"]) == (106.0, "N") # 118 - ceil(11.2) + assert draft["U_VS_AFEDET"] == "Y" + assert draft["U_VS_CODSER"] == "00402" + assert draft["U_VS_PORDET"] == 12 + + +def test_draft_sin_guias_validadas_queda_sin_lineas(condicion_pago): + fecha = datetime.now().strftime("%Y-%m-%d") + draft = draft_sap.build_sap_draft(_factura(fecha), [{"guias_lt": []}, {"guias_lt": []}]) + assert draft["DocumentLines"] == [] + assert draft["U_IDC_NUMGR"] == "" + + +def test_draft_sin_condicion_de_pago_vence_el_dia_de_contabilizacion(monkeypatch): + monkeypatch.setattr(draft_sap.sapb1_manager, "obtener_condicion_pago", lambda c: None) + fecha = datetime.now().strftime("%Y-%m-%d") + draft = draft_sap.build_sap_draft(_factura(fecha), _resultados()) + assert draft["DocDueDate"] == draft["DocDate"] + + +# ============================================================================ +# obtener_valor_referencial_sap +# ============================================================================ +def test_valor_referencial_consulta_una_vez_por_guia(monkeypatch): + llamadas = [] + monkeypatch.setattr(draft_sap.hana_manager, "obtener_valor_referencial", + lambda serie, numero: llamadas.append((serie, numero)) or 7.5) + g = {"tipo": "09", "serie": "T001", "numero": "1"} + factura = {"lineas": [ + {"guias_remision": [g]}, + {"guias_remision": [g, {"tipo": "09", "serie": "T001", "numero": "2"}]}, + ]} + + resultado = draft_sap.obtener_valor_referencial_sap(factura) + + assert llamadas == [("T001", "1"), ("T001", "2")] + assert [r["valor_sap"] for r in resultado] == [7.5, 7.5] diff --git a/tests/test_extraccion_correos.py b/tests/test_extraccion_correos.py new file mode 100644 index 0000000..e1dde9a --- /dev/null +++ b/tests/test_extraccion_correos.py @@ -0,0 +1,85 @@ +""" +Pruebas de caracterización: ejecuta la extracción real (PDF → XML → guías → +JSON) sobre cada correo de ``tests/fixtures/correos_prueba`` y compara con el +resultado esperado en ``tests/golden/.json``. + +Los resultados esperados fijan el comportamiento actual; no prueban que sea +correcto. Si cambias la extracción a propósito, revisa el diff y regenéralos con:: + + UPDATE_GOLDEN=1 pytest tests/test_extraccion_correos.py +""" +import json +import os +import re +import shutil + +import pytest + +import adjuntos +import documentos +import persistencia +from conftest import FIXTURES, GOLDEN + +CASOS = sorted(d for d in os.listdir(FIXTURES) if re.fullmatch(r"\d{3}_correo", d)) + + +def _sin_rutas_absolutas(obj): + """Deja solo el nombre de archivo en ``ruta_xml``/``ruta_pdf`` (dependen de la máquina).""" + if isinstance(obj, dict): + return { + k: os.path.basename(v) if k in ("ruta_xml", "ruta_pdf") and isinstance(v, str) else _sin_rutas_absolutas(v) + for k, v in obj.items() + } + if isinstance(obj, list): + return [_sin_rutas_absolutas(x) for x in obj] + return obj + + +def _cargar_json(ruta: str): + with open(ruta, encoding="utf-8") as f: + return json.load(f) + + +def _extraer(caso: str, tmp_path, monkeypatch) -> dict: + monkeypatch.setenv("RUTA_RED_FACTURACION", "") # sin copia a la red + descarga = tmp_path / "descarga" + salida = tmp_path / "salida" + shutil.copytree(os.path.join(FIXTURES, caso), descarga) + + email = {"adjuntos": sorted(os.listdir(descarga))} + adjuntos.filtrar_y_limpiar(email, str(descarga)) + pdf_cache = documentos.procesar_pdfs(email, str(descarga)) + docs = documentos.procesar_xmls(email, str(descarga), pdf_cache) + completadas = documentos.completar_guias(docs, pdf_cache) + guardados = persistencia.guardar_resultado(docs, email.get("datos_pdf", []), str(salida)) + + resultado = { + "adjuntos": sorted(email["adjuntos"]), + "pdf_cache": sorted(pdf_cache), + "guias_completadas": completadas, + "xml": [], + "pdf": [], + } + for ruta in guardados: + clave = "xml" if os.path.basename(ruta).startswith("xml_") else "pdf" + resultado[clave] = _sin_rutas_absolutas(_cargar_json(ruta)) + return resultado + + +@pytest.mark.parametrize("caso", CASOS) +def test_extraccion_coincide_con_golden(caso, tmp_path, monkeypatch, actualizar_golden): + resultado = _extraer(caso, tmp_path, monkeypatch) + ruta_golden = os.path.join(GOLDEN, f"{caso}.json") + + if actualizar_golden: + with open(ruta_golden, "w", encoding="utf-8") as f: + json.dump(resultado, f, ensure_ascii=False, indent=2, sort_keys=True) + f.write("\n") + return + + assert os.path.exists(ruta_golden), f"Falta {ruta_golden}; genéralo con UPDATE_GOLDEN=1" + assert resultado == _cargar_json(ruta_golden) + + +def test_hay_correos_de_prueba(): + assert len(CASOS) >= 40 diff --git a/tests/test_notificaciones.py b/tests/test_notificaciones.py new file mode 100644 index 0000000..491412f --- /dev/null +++ b/tests/test_notificaciones.py @@ -0,0 +1,46 @@ +import notificaciones as n + +FACTURA = {"serie": "F002", "numero": "486", "razon_social_emisor": "TRANSPORTES SA"} + + +def test_cuerpo_draft_creado(): + html = n.build_notification_body("created", FACTURA, "", "", doc_entry=2021) + assert "✅" in html and "DocEntry: 2021" in html + assert "F002-486" in html and "TRANSPORTES SA" in html + assert "" in html and "" in html + + +def test_cuerpo_error(): + html = n.build_notification_body("error", FACTURA, "", "", error=ValueError("boom")) + assert "❌ Error al crear Draft" in html and "boom" in html + + +def test_cuerpo_precios_no_coinciden(): + html = n.build_notification_body("skipped", FACTURA, "", "") + assert "Draft NO creado" in html and "no coinciden" in html + + +def test_tabla_de_validacion(): + resultados = [ + {"grflete": "09T001-1", "ok": True, "draft_price": 100.0, "sap_price": 100.0, + "warehouse_code": "A-X", "label": "LineTotal"}, + {"grflete": "-", "ok": False, "draft_price": None, "sap_price": None, + "warehouse_code": "-", "label": "Sin guía de referencia"}, + ] + html = n.build_validation_html(resultados) + assert "09T001-1" in html and "100.000000" in html + assert html.count("✅") == 1 and html.count("❌") == 1 + assert "Sin guía de referencia" in html + + +def test_valor_referencial_coincide(): + factura = {"lineas": [{"valor_referencial": 10.0}, {"valor_referencial": 5.0}]} + guias = [{"serie": "T001", "numero": "1", "valor_sap": 9.0}, {"serie": "T001", "numero": "2", "valor_sap": 6.0}] + html = n.build_valor_referencial_html(factura, guias) + assert "✅ Coincide" in html and "15.00" in html + + +def test_valor_referencial_no_coincide(): + factura = {"lineas": [{"valor_referencial": 10.0}]} + html = n.build_valor_referencial_html(factura, [{"serie": "T001", "numero": "1", "valor_sap": 9.0}]) + assert "❌ No coincide" in html diff --git a/tests/test_pipeline_flujo.py b/tests/test_pipeline_flujo.py new file mode 100644 index 0000000..d73a23a --- /dev/null +++ b/tests/test_pipeline_flujo.py @@ -0,0 +1,146 @@ +""" +Flujo completo de ``pipeline._procesar_un_correo`` con SAP, HANA, Outlook y la +BD simulados. Usa el correo de prueba 001 (factura F002-2450, una línea de +624.38 con la guía T001-128912). +""" +import glob +import os +import shutil + +import pytest + +import database_utilities +import hana_manager +import outlook_utilities +import pipeline +import sapb1_manager +from conftest import FIXTURES + +CASO = "001_correo" +TOTAL_LINEA = 624.38 + + +class Entorno: + """Registra lo que el pipeline le pide a los servicios externos.""" + + def __init__(self): + self.line_total_sap = TOTAL_LINEA + self.error_al_crear = None + self.drafts = [] + self.correos = [] + self.descargas = 0 + + +@pytest.fixture +def entorno(tmp_path, monkeypatch): + e = Entorno() + monkeypatch.setenv("RUTA_RED_FACTURACION", "") + + monkeypatch.setattr(database_utilities, "get_existing_ids", lambda ids: []) + monkeypatch.setattr(database_utilities, "save_emails", lambda emails: None) + + def descargar(addr, id_, token, carpeta): + e.descargas += 1 + os.makedirs(carpeta, exist_ok=True) # como el download_attachments real + nombres = [] + for ruta in glob.glob(os.path.join(FIXTURES, CASO, "*")): + if ruta.lower().endswith((".pdf", ".xml")): + shutil.copy(ruta, carpeta) + nombres.append(os.path.basename(ruta)) + return nombres + + def enviar(token, desde, para, asunto, html, adjuntos=None, cc_recipients=None): + e.correos.append({"para": para, "asunto": asunto, "html": html, "cc": cc_recipients, "adjuntos": adjuntos}) + return True + + def crear_draft(draft): + if e.error_al_crear: + raise e.error_al_crear + e.drafts.append(draft) + return {"DocEntry": 777} + + def delivery_notes(**k): + return [{"Series": "1", "DocNum": "9", "U_IDC_DESTINO": "Z1", "DocumentLines": [ + {"ItemCode": "FL10007", "LineTotal": e.line_total_sap, "PriceAfterVAT": 1.3396, + "Quantity": 466, "WarehouseCode": "A-CENTRA", "Weight1": 1}]}] + + monkeypatch.setattr(outlook_utilities, "download_attachments", descargar) + monkeypatch.setattr(outlook_utilities, "send_email", enviar) + monkeypatch.setattr(sapb1_manager, "get_zonas", lambda: [{"Code": "Z1", "Name": "ZONA1"}]) + monkeypatch.setattr(sapb1_manager, "get_delivery_notes", delivery_notes) + monkeypatch.setattr(sapb1_manager, "obtener_condicion_pago", lambda c: {"NumberOfAdditionalDays": 30}) + monkeypatch.setattr(sapb1_manager, "create_draft", crear_draft) + monkeypatch.setattr(hana_manager, "obtener_valor_referencial", lambda s, n: 0.0) + + e.descarga = tmp_path / "descarga" + e.salida = tmp_path / "salida" + return e + + +def _procesar(e, sender="proveedor@empresa.com"): + email = {"id": "abc", "fecha": "2026-10-14 10:00:00", "subject": "Factura", "sender": sender} + pipeline._procesar_un_correo(email, "token", "buzon@aberio.com", str(e.descarga), str(e.salida)) + return email + + +def test_precios_coinciden_crea_draft_y_notifica(entorno): + _procesar(entorno) + + assert len(entorno.drafts) == 1 + draft = entorno.drafts[0] + assert draft["CardCode"] == "PL10060028686" + assert draft["NumAtCard"] == "01F002-2450" + assert draft["DocumentLines"][0]["U_IDC_GRFLETE"] == "09T001-128912" + + assert len(entorno.correos) == 1 + correo = entorno.correos[0] + assert correo["para"] == ["proveedor@empresa.com"] + assert correo["asunto"] == "Draft SAP B1 - F002-2450" + assert "creado exitosamente" in correo["html"] and "777" in correo["html"] + assert correo["cc"] # siempre se copia al equipo + assert any(a.endswith(".xml") for a in correo["adjuntos"]) + + +def test_precios_no_coinciden_no_crea_draft_pero_notifica(entorno): + entorno.line_total_sap = TOTAL_LINEA + 50 + + _procesar(entorno) + + assert entorno.drafts == [] + assert len(entorno.correos) == 1 + assert "Draft NO creado" in entorno.correos[0]["html"] + + +def test_error_al_crear_draft_se_notifica(entorno): + entorno.error_al_crear = RuntimeError("Service Layer caído") + + _procesar(entorno) + + assert entorno.drafts == [] + assert len(entorno.correos) == 1 + assert "Error al crear Draft" in entorno.correos[0]["html"] + assert "Service Layer caído" in entorno.correos[0]["html"] + + +def test_remitente_desconocido_no_envia_correo(entorno): + _procesar(entorno, sender="Desconocido") + + assert len(entorno.drafts) == 1 # el draft se crea igual + assert entorno.correos == [] + + +def test_correo_ya_procesado_se_salta(entorno, monkeypatch): + monkeypatch.setattr(database_utilities, "get_existing_ids", lambda ids: ["abc"]) + + _procesar(entorno) + + assert entorno.descargas == 0 + assert entorno.drafts == [] and entorno.correos == [] + + +def test_guarda_resultados_y_draft_en_disco(entorno): + _procesar(entorno) + + nombres = os.listdir(entorno.salida) + assert any(n.startswith("xml_resultado_F002-2450") for n in nombres) + assert any(n.startswith("draft_sapb1_F002-2450") for n in nombres) diff --git a/tests/completar_guias_pipeline.py b/tools/completar_guias_pipeline.py similarity index 95% rename from tests/completar_guias_pipeline.py rename to tools/completar_guias_pipeline.py index e1cfcba..45f5bb8 100644 --- a/tests/completar_guias_pipeline.py +++ b/tools/completar_guias_pipeline.py @@ -2,7 +2,7 @@ import json import os from glob import glob -CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba") +CARPETA_BASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tests", "fixtures", "correos_prueba") def _doc_key(d): diff --git a/tests/descargar_correos_prueba.py b/tools/descargar_correos_prueba.py similarity index 96% rename from tests/descargar_correos_prueba.py rename to tools/descargar_correos_prueba.py index 5ad9990..8b9bb4b 100644 --- a/tests/descargar_correos_prueba.py +++ b/tools/descargar_correos_prueba.py @@ -11,7 +11,7 @@ import outlook_utilities import email_utilities -CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba") +CARPETA_BASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tests", "fixtures", "correos_prueba") def limpiar_carpetas(): diff --git a/tests/explorar_notes_xml.py b/tools/explorar_notes_xml.py similarity index 92% rename from tests/explorar_notes_xml.py rename to tools/explorar_notes_xml.py index f159326..3f0602e 100644 --- a/tests/explorar_notes_xml.py +++ b/tools/explorar_notes_xml.py @@ -9,7 +9,7 @@ from sunat_schema import NAMESPACES, _find_text ns = NAMESPACES ns["cbc"] = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" -CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba") +CARPETA_BASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tests", "fixtures", "correos_prueba") def explorar_notes(ruta_carpeta): diff --git a/tests/procesar_pdfs_prueba.py b/tools/procesar_pdfs_prueba.py similarity index 97% rename from tests/procesar_pdfs_prueba.py rename to tools/procesar_pdfs_prueba.py index e6f8856..4a2732a 100644 --- a/tests/procesar_pdfs_prueba.py +++ b/tools/procesar_pdfs_prueba.py @@ -9,7 +9,7 @@ from pdf_utilities import extraer_datos_pdf, TIPO_MAP, renombrar_pdf from sunat_schema import split_serie_numero -CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba") +CARPETA_BASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tests", "fixtures", "correos_prueba") def normalizar_datos_pdf(data: dict) -> Optional[dict]: diff --git a/tests/procesar_xmls_prueba.py b/tools/procesar_xmls_prueba.py similarity index 97% rename from tests/procesar_xmls_prueba.py rename to tools/procesar_xmls_prueba.py index 4c66c40..a8d6f1f 100644 --- a/tests/procesar_xmls_prueba.py +++ b/tools/procesar_xmls_prueba.py @@ -22,7 +22,7 @@ def renombrar_xml(ruta_actual: str, data: dict, carpeta: str) -> str | None: return destino -CARPETA_BASE = os.path.join(os.path.dirname(__file__), "correos_prueba") +CARPETA_BASE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "tests", "fixtures", "correos_prueba") def procesar_carpetas():