Skip to content

Feature/gre remitente transportista improvements#220

Open
muglerman wants to merge 9 commits intoproject-openubl:mainfrom
muglerman:feature/gre-remitente-transportista-improvements
Open

Feature/gre remitente transportista improvements#220
muglerman wants to merge 9 commits intoproject-openubl:mainfrom
muglerman:feature/gre-remitente-transportista-improvements

Conversation

@muglerman
Copy link
Copy Markdown
Contributor

Resumen

Mejora en el soporte para la Guía de Remisión Electrónica (GRE) tanto Remitente (tipo 09) como Transportista (tipo 31).

Cambios principales

Nuevos modelos

  • GRERemitente — modelo de usuario para GRE tipo 09 con validate() + toDespatchAdvice(). Maneja automáticamente las reglas de modalidad privada/pública (conductor+vehículo vs transportista contratado) e indicador M1/L.
  • GRETransportista — modelo para GRE tipo 31 con serie V*. Usa Transportista (no Remitente) como tipo del emisor para respetar la distinción semántica SUNAT entre sujetos. Inyecta conductor y vehículo en el envío automáticamente.
  • DespatchAdviceValidator — validador compartido para reglas comunes de envío y modalidad.

Nuevos catálogos

  • Catalog20 — reescrito con los 19 motivos de traslado vigentes (antes solo 11).
  • Catalog21 — ampliado con documentos relacionados (DAM, DS, manifiesto, SCOP, etc.).
  • Catalog61 — Tipo de documento adicional de transporte.
  • Catalog62 — Bienes normalizados SPOT/IVAP.
  • Catalog63 — Tipo de puerto/aeropuerto.
  • Catalog64 — Tipo de precinto de contenedor.
  • IndicadorEnvio — 7 indicadores cbc:SpecialInstructions (traslado total DAM/DS, bien normalizado, M1/L, transbordo programado, retorno vehículo, zona primaria comext).
  • TipoConductor — enum Principal/Secundario para cbc:JobTitle del conductor.

Nuevos modelos de datos

  • Contenedor — número + precinto (reemplaza el antiguo List<String>).
  • DeclaracionAduanera — tipo, número y RUC emisor para DAM/DS.

Modelos modificados

  • Envio — campos para contenedores tipados, puerto, aeropuerto, declaraciones aduaneras, indicadores, número de manifiesto.
  • DespatchAdvice — campos tercero, comprador, tipoComprobante, métodos isGRERemitente()/isGRETransportista().
  • DespatchAdviceMapper — mapeo round-trip de contenedores tipados.
  • despatchAdvice.xml — template Qute actualizado para contenedores, precintos, indicadores, declaraciones aduaneras, tercero y comprador.

Ejemplo Spring Boot

  • XBuilderController — 2 nuevos endpoints: POST /api/create-xml/gre-remitente y POST /api/create-xml/gre-transportista.

@muglerman muglerman closed this Mar 28, 2026
@muglerman muglerman force-pushed the feature/gre-remitente-transportista-improvements branch from 1bef5fa to 9b0af74 Compare March 28, 2026 19:23
- Created multiple XML test cases for DespatchAdvice under GRETransportistaCasuisticasTest, including:
  - vehiculoM1L.xml
  - transportistaBasico.xml
  - transportistaComercioExterior.xml
  - transportistaConCarreta.xml
  - transportistaMultiplesConductores.xml
- Updated summaryDocuments.xml and summaryDocuments_anularBoletaExonerada.xml to include TaxPercent elements for tax subtotals.

Signed-off-by: Edwin Luis Barboza Pinedo <ibarboza27498@gmail.com>
@muglerman muglerman reopened this Mar 28, 2026
muglerman and others added 8 commits March 28, 2026 15:01
Signed-off-by: Edwin Luis Barboza Pinedo <ibarboza27498@gmail.com>
…date dependencies and Java version

- Changed XBuilderConfig from a class to an interface and applied ConfigMapping for better configuration handling.
- Updated method calls in DefaultXBuilder to use the new configuration method signatures.
- Refactored XSenderConfig to use ConfigMapping and added a default value for enableLoggingFeature.
- Updated dependency versions in xsender/core/pom.xml for commons-codec, junit-jupiter-engine, mockito-core, and cxf-codegen-plugin.
- Changed Java version in xsender/spring-boot-extension/integration-tests/pom.xml to 21 for compatibility with newer features.

Signed-off-by: Edwin Luis Barboza Pinedo <ibarboza27498@gmail.com>
…nd GRETransportista

- Implemented ValidationCoherenceTest to ensure consistent validation results across GRERemitente, GRETransportista, and DespatchAdviceValidator.
- Added tests for valid and invalid scenarios, including series and RUC validation.
- Verified that validate() and validateDetailed() methods produce consistent results.
- Ensured that warnings and errors are uniformly handled across all validators.

Signed-off-by: Edwin Luis Barboza Pinedo <ibarboza27498@gmail.com>
…ency in builder patterns

Signed-off-by: Edwin Luis Barboza Pinedo <ibarboza27498@gmail.com>
… notes

- Added InvoiceValidator for validating electronic invoices (01) and sales receipts (03) according to SUNAT guidelines.
- Introduced NoteValidator for validating credit and debit notes, ensuring compliance with SUNAT regulations.
- Created SalesDocumentValidator for shared validation logic between invoices and notes.
- Developed unit tests for InvoiceValidator and NoteValidator to ensure correctness of validation rules.
- Updated XML test resources to reflect changes in tax tier range.
- Refactored RestSunatResponseProcessor for improved readability and structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant