diff --git a/xbuilder/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/mappers/SummaryDocumentsMapper.java b/xbuilder/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/mappers/SummaryDocumentsMapper.java
index c28dbc7a..8149de85 100644
--- a/xbuilder/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/mappers/SummaryDocumentsMapper.java
+++ b/xbuilder/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/mappers/SummaryDocumentsMapper.java
@@ -119,7 +119,7 @@ default ComprobanteImpuestos mapLineComprobanteImpuestos(XMLSummaryDocumentsLine
.flatMap(taxScheme -> Optional.ofNullable(taxScheme.getId()))
.flatMap(code -> Catalog.valueOfCode(Catalog5.class, code))
.orElse(null),
- XMLSummaryDocumentsLine.TaxTotal::getTaxAmount
+ taxTotal -> Optional.ofNullable(taxTotal.getTaxAmount()).orElse(BigDecimal.ZERO)
));
return ComprobanteImpuestos.builder()
diff --git a/xbuilder/core/src/main/resources/templates/Renderer/summaryDocuments.xml b/xbuilder/core/src/main/resources/templates/Renderer/summaryDocuments.xml
index b2eda8cf..7f1b4a10 100644
--- a/xbuilder/core/src/main/resources/templates/Renderer/summaryDocuments.xml
+++ b/xbuilder/core/src/main/resources/templates/Renderer/summaryDocuments.xml
@@ -72,7 +72,6 @@
{it.comprobante.valorVenta.otrosCargos}
{/if}
- {#if it.comprobante.impuestos.igv}
{it.comprobante.impuestos.igv}
@@ -86,7 +85,6 @@
- {/if}
{#if it.comprobante.impuestos.icb}
{it.comprobante.impuestos.icb}
diff --git a/xbuilder/core/src/test/java/e2e/renderer/summarydocuments/SummaryDocumentsTest.java b/xbuilder/core/src/test/java/e2e/renderer/summarydocuments/SummaryDocumentsTest.java
index 4d0a35fc..3a3cdc7e 100644
--- a/xbuilder/core/src/test/java/e2e/renderer/summarydocuments/SummaryDocumentsTest.java
+++ b/xbuilder/core/src/test/java/e2e/renderer/summarydocuments/SummaryDocumentsTest.java
@@ -105,4 +105,44 @@ public void testMultipleVoidedDocuments() throws Exception {
assertInput(input, "summaryDocuments.xml");
}
+ @Test
+ public void testVoidedDocument_anularBoletaExonerada() throws Exception {
+ // Given
+ SummaryDocuments input = SummaryDocuments.builder()
+ .numero(1)
+ .fechaEmisionComprobantes(dateProvider.now().minusDays(2))
+ .proveedor(Proveedor.builder()
+ .ruc("12345678912")
+ .razonSocial("Softgreen S.A.C.")
+ .build()
+ )
+ .comprobante(SummaryDocumentsItem.builder()
+ .tipoOperacion(Catalog19.ANULADO.toString())
+ .comprobante(Comprobante.builder()
+ .tipoComprobante(Catalog1_Invoice.BOLETA.getCode())//
+ .serieNumero("B001-1")
+ .cliente(Cliente.builder()
+ .nombre("Carlos Feria")
+ .numeroDocumentoIdentidad("12345678")
+ .tipoDocumentoIdentidad(Catalog6.DNI.getCode())
+ .build()
+ )
+ .impuestos(ComprobanteImpuestos.builder()
+ .igv(new BigDecimal("0"))
+ .build()
+ )
+ .valorVenta(ComprobanteValorVenta.builder()
+ .importeTotal(new BigDecimal("100"))
+ .gravado(new BigDecimal("0"))
+ .exonerado(new BigDecimal("0"))
+ .build()
+ )
+ .build()
+ )
+ .build()
+ )
+ .build();
+
+ assertInput(input, "summaryDocuments_anularBoletaExonerada.xml");
+ }
}
diff --git a/xbuilder/core/src/test/resources/e2e/renderer/summarydocuments/SummaryDocumentsTest/summaryDocuments_anularBoletaExonerada.xml b/xbuilder/core/src/test/resources/e2e/renderer/summarydocuments/SummaryDocumentsTest/summaryDocuments_anularBoletaExonerada.xml
new file mode 100644
index 00000000..daead507
--- /dev/null
+++ b/xbuilder/core/src/test/resources/e2e/renderer/summarydocuments/SummaryDocumentsTest/summaryDocuments_anularBoletaExonerada.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ 2.0
+ 1.1
+ RC-20191224-1
+ 2019-12-22
+ 2019-12-24
+
+ 12345678912
+
+
+ 12345678912
+
+
+
+
+
+
+
+ #PROJECT-OPENUBL-SIGN
+
+
+
+
+ 12345678912
+ 6
+
+
+
+
+
+
+
+ 1
+ 03
+ B001-1
+
+ 12345678
+ 1
+
+
+ 3
+
+ 100
+
+ 0
+
+ 0
+
+
+ 1000
+ IGV
+ VAT
+
+
+
+
+
+