diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/general/DocumentoVentaDetalle.java b/core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/general/DocumentoVentaDetalle.java index 5d053413..eef4add0 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/general/DocumentoVentaDetalle.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/content/models/standard/general/DocumentoVentaDetalle.java @@ -51,6 +51,9 @@ public class DocumentoVentaDetalle { private String precioReferenciaTipo; // Impuestos + @Schema(description = "Ejemplo: 0.18", minimum = "0", maximum = "1") + private BigDecimal tasaIgv; + @Schema(description = "Monto total de IGV", minimum = "0") private BigDecimal igv; diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/IgvTipoRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/IgvTipoRule.java index 9d0c188d..3c5c6c12 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/IgvTipoRule.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/IgvTipoRule.java @@ -42,8 +42,7 @@ public void modify(Object object) { if (detalle.getIgvTipo() == null) { catalog7 = Catalog7.GRAVADO_OPERACION_ONEROSA; } else { - catalog7 = - Catalog.valueOfCode(Catalog7.class, detalle.getIgvTipo()).orElseThrow(Catalog.invalidCatalogValue); + catalog7 = Catalog.valueOfCode(Catalog7.class, detalle.getIgvTipo()).orElseThrow(Catalog.invalidCatalogValue); } detalle.setIgvTipo(catalog7.getCode()); diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/TasaIgvRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/TasaIgvRule.java new file mode 100644 index 00000000..99251fec --- /dev/null +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/body/detalle/TasaIgvRule.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.detalle; + +import io.github.project.openubl.xbuilder.content.catalogs.Catalog; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.enricher.kie.AbstractBodyRule; +import io.github.project.openubl.xbuilder.enricher.kie.RulePhase; + +import java.math.BigDecimal; +import java.util.function.Consumer; + +import static io.github.project.openubl.xbuilder.enricher.kie.rules.utils.Helpers.isSalesDocumentItem; +import static io.github.project.openubl.xbuilder.enricher.kie.rules.utils.Helpers.whenSalesDocumentItem; + +@RulePhase(type = RulePhase.PhaseType.ENRICH) +public class TasaIgvRule extends AbstractBodyRule { + + @Override + public boolean test(Object object) { + return (isSalesDocumentItem.test(object) && whenSalesDocumentItem.apply(object) + .map(documento -> documento.getTasaIgv() == null && documento.getIgvTipo() != null) + .orElse(false) + ); + } + + @Override + public void modify(Object object) { + Consumer consumer = detalle -> { + BigDecimal igvTasa; + Catalog7 catalog7 = Catalog.valueOfCode(Catalog7.class, detalle.getIgvTipo()).orElseThrow(Catalog.invalidCatalogValue); + switch (catalog7.getGrupo()) { + case EXPORTACION: + case EXONERADO: + case INAFECTO: { + igvTasa = BigDecimal.ZERO; + break; + } + default: { + igvTasa = getRuleContext().getTasaIgv(); + break; + } + } + detalle.setTasaIgv(igvTasa); + }; + whenSalesDocumentItem.apply(object).ifPresent(consumer); + } +} diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/header/TasaIgvRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/header/TasaIgvRule.java index 21fcd296..8f089812 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/header/TasaIgvRule.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/enrich/header/TasaIgvRule.java @@ -30,9 +30,9 @@ public class TasaIgvRule extends AbstractHeaderRule { @Override public boolean test(Object object) { - return ( - isSalesDocument.test(object) && - whenSalesDocument.apply(object).map(documento -> documento.getTasaIgv() == null).orElse(false) + return (isSalesDocument.test(object) && whenSalesDocument.apply(object) + .map(documento -> documento.getTasaIgv() == null) + .orElse(false) ); } diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvBaseImponibleRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvBaseImponibleRule.java index 5875beb3..2c4b3657 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvBaseImponibleRule.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvBaseImponibleRule.java @@ -16,6 +16,8 @@ */ package io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; import io.github.project.openubl.xbuilder.enricher.kie.AbstractBodyRule; import io.github.project.openubl.xbuilder.enricher.kie.RulePhase; @@ -31,26 +33,28 @@ public class IgvBaseImponibleRule extends AbstractBodyRule { @Override public boolean test(Object object) { - return ( - isSalesDocumentItem.test(object) && - whenSalesDocumentItem - .apply(object) - .map(documento -> - documento.getIgvBaseImponible() == null && - documento.getCantidad() != null && - documento.getPrecio() != null && - documento.getPrecioReferencia() != null - ) - .orElse(false) + return (isSalesDocumentItem.test(object) && whenSalesDocumentItem.apply(object) + .map(documento -> documento.getIgvBaseImponible() == null && + documento.getIgvTipo() != null && + documento.getCantidad() != null && + documento.getPrecio() != null && + documento.getPrecioReferencia() != null + ) + .orElse(false) ); } @Override public void modify(Object object) { Consumer consumer = detalle -> { - BigDecimal baseImponible = !detalle.isPrecioConImpuestos() - ? detalle.getCantidad().multiply(detalle.getPrecio()) - : detalle.getCantidad().multiply(detalle.getPrecioReferencia()); + Catalog7 catalog7 = Catalog.valueOfCode(Catalog7.class, detalle.getIgvTipo()).orElseThrow(Catalog.invalidCatalogValue); + + BigDecimal baseImponible; + if (catalog7.isOperacionOnerosa()) { + baseImponible = detalle.getCantidad().multiply(detalle.getPrecio()); + } else { + baseImponible = detalle.getCantidad().multiply(detalle.getPrecioReferencia()); + } detalle.setIgvBaseImponible(baseImponible); }; whenSalesDocumentItem.apply(object).ifPresent(consumer); diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvRule.java index f95fd30f..363f8c00 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvRule.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/IgvRule.java @@ -31,19 +31,19 @@ public class IgvRule extends AbstractBodyRule { @Override public boolean test(Object object) { - return ( - isSalesDocumentItem.test(object) && - whenSalesDocumentItem - .apply(object) - .map(documento -> documento.getIgv() == null && documento.getIgvBaseImponible() != null) - .orElse(false) + return (isSalesDocumentItem.test(object) && whenSalesDocumentItem.apply(object) + .map(documento -> documento.getIgv() == null && + documento.getIgvBaseImponible() != null && + documento.getTasaIgv() != null + ) + .orElse(false) ); } @Override public void modify(Object object) { Consumer consumer = detalle -> { - BigDecimal igv = detalle.getIgvBaseImponible().multiply(getRuleContext().getTasaIgv()); + BigDecimal igv = detalle.getIgvBaseImponible().multiply(detalle.getTasaIgv()); detalle.setIgv(igv); }; whenSalesDocumentItem.apply(object).ifPresent(consumer); diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioDeReferenciaRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioDeReferenciaRule.java index 0c94ce50..acdd55fd 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioDeReferenciaRule.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioDeReferenciaRule.java @@ -23,7 +23,6 @@ import io.github.project.openubl.xbuilder.enricher.kie.RulePhase; import java.math.BigDecimal; -import java.math.RoundingMode; import java.util.function.Consumer; import static io.github.project.openubl.xbuilder.enricher.kie.rules.utils.Helpers.isSalesDocumentItem; @@ -34,16 +33,13 @@ public class PrecioDeReferenciaRule extends AbstractBodyRule { @Override public boolean test(Object object) { - return ( - isSalesDocumentItem.test(object) && - whenSalesDocumentItem - .apply(object) - .map(documento -> - documento.getPrecioReferencia() == null && - documento.getPrecio() != null && - documento.getIgvTipo() != null - ) - .orElse(false) + return (isSalesDocumentItem.test(object) && whenSalesDocumentItem.apply(object) + .map(documento -> documento.getPrecioReferencia() == null && + documento.getPrecio() != null && + documento.getTasaIgv() != null && + documento.getIgvTipo() != null + ) + .orElse(false) ); } @@ -55,18 +51,14 @@ public void modify(Object object) { .orElseThrow(Catalog.invalidCatalogValue); BigDecimal precioReferencia; - if (detalle.isPrecioConImpuestos()) { - precioReferencia = - catalog7.isOperacionOnerosa() - ? detalle - .getPrecio() - .divide(getRuleContext().getTasaIgv().add(BigDecimal.ONE), 10, RoundingMode.HALF_EVEN) - : detalle.getPrecio(); + if (catalog7.isOperacionOnerosa()) { + if (detalle.isPrecioConImpuestos()) { + precioReferencia = detalle.getPrecio(); + } else { + precioReferencia = detalle.getPrecio().multiply(detalle.getTasaIgv().add(BigDecimal.ONE)); + } } else { - precioReferencia = - catalog7.isOperacionOnerosa() - ? detalle.getPrecio().multiply(getRuleContext().getTasaIgv().add(BigDecimal.ONE)) - : detalle.getPrecio(); + precioReferencia = detalle.getPrecio(); } detalle.setPrecioReferencia(precioReferencia); diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioRule.java b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioRule.java new file mode 100644 index 00000000..844b5be6 --- /dev/null +++ b/core/src/main/java/io/github/project/openubl/xbuilder/enricher/kie/rules/process/body/detalle/PrecioRule.java @@ -0,0 +1,63 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle; + +import io.github.project.openubl.xbuilder.content.catalogs.Catalog; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.enricher.kie.AbstractBodyRule; +import io.github.project.openubl.xbuilder.enricher.kie.RulePhase; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.function.Consumer; + +import static io.github.project.openubl.xbuilder.enricher.kie.rules.utils.Helpers.isSalesDocumentItem; +import static io.github.project.openubl.xbuilder.enricher.kie.rules.utils.Helpers.whenSalesDocumentItem; + +@RulePhase(type = RulePhase.PhaseType.PROCESS) +public class PrecioRule extends AbstractBodyRule { + + @Override + public boolean test(Object object) { + return (isSalesDocumentItem.test(object) && whenSalesDocumentItem.apply(object) + .map(documento -> documento.getPrecioReferencia() != null && documento.getIgvTipo() != null) + .orElse(false) + ); + } + + @Override + public void modify(Object object) { + Consumer consumer = detalle -> { + Catalog7 catalog7 = Catalog.valueOfCode(Catalog7.class, detalle.getIgvTipo()).orElseThrow(Catalog.invalidCatalogValue); + + BigDecimal precio; + if (catalog7.isOperacionOnerosa()) { + if (detalle.isPrecioConImpuestos()) { + precio = detalle.getPrecioReferencia().divide(detalle.getTasaIgv().add(BigDecimal.ONE), 10, RoundingMode.HALF_EVEN);; + } else { + precio = detalle.getPrecio(); + } + } else { + precio = BigDecimal.ZERO; + } + + detalle.setPrecio(precio); + }; + whenSalesDocumentItem.apply(object).ifPresent(consumer); + } +} diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/renderer/EngineProducer.java b/core/src/main/java/io/github/project/openubl/xbuilder/renderer/EngineProducer.java index ca5ec320..bf21994c 100644 --- a/core/src/main/java/io/github/project/openubl/xbuilder/renderer/EngineProducer.java +++ b/core/src/main/java/io/github/project/openubl/xbuilder/renderer/EngineProducer.java @@ -48,87 +48,70 @@ public class EngineProducer { private final Locale defaultLocale = Locale.ENGLISH; private final Charset defaultCharset = StandardCharsets.UTF_8; - private final Engine engine = Engine - .builder() + private final Engine engine = Engine.builder() .addDefaults() .addLocator(this::locate) .removeStandaloneLines(true) .addResultMapper(new HtmlEscaper(List.of("text/html", "text/xml", "application/xml", "application/xhtml+xml"))) .addValueResolver(new ReflectionValueResolver()) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(LocalDate.class) - .applyToName("format") - .resolveSync(ctx -> { - DateTimeFormatter dtf = DateTimeFormatter.ofPattern((String) ctx.getParams().get(0).getLiteral()); - return ((LocalDate) ctx.getBase()).format(dtf); - }) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(LocalDate.class) + .applyToName("format") + .resolveSync(ctx -> { + DateTimeFormatter dtf = DateTimeFormatter.ofPattern((String) ctx.getParams().get(0).getLiteral()); + return ((LocalDate) ctx.getBase()).format(dtf); + }) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(LocalTime.class) - .applyToName("format") - .resolveSync(ctx -> { - DateTimeFormatter dtf = DateTimeFormatter.ofPattern((String) ctx.getParams().get(0).getLiteral()); - return ((LocalTime) ctx.getBase()).format(dtf); - }) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(LocalTime.class) + .applyToName("format") + .resolveSync(ctx -> { + DateTimeFormatter dtf = DateTimeFormatter.ofPattern((String) ctx.getParams().get(0).getLiteral()); + return ((LocalTime) ctx.getBase()).format(dtf); + }) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(BigDecimal.class) - .applyToName("scale") - .applyToParameters(1) - .resolveSync(ctx -> - ((BigDecimal) ctx.getBase()).setScale( - (Integer) ctx.getParams().get(0).getLiteral(), - RoundingMode.HALF_EVEN - ) - ) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(BigDecimal.class) + .applyToName("scale") + .applyToParameters(1) + .resolveSync(ctx -> ((BigDecimal) ctx.getBase()).setScale( + (Integer) ctx.getParams().get(0).getLiteral(), + RoundingMode.HALF_EVEN + )) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(BigDecimal.class) - .applyToName("multiply") - .resolveSync(ctx -> - ((BigDecimal) ctx.getBase()).multiply(new BigDecimal((Integer) ctx.getParams().get(0).getLiteral())) - .setScale(2, RoundingMode.HALF_EVEN) - ) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(BigDecimal.class) + .applyToName("multiply") + .resolveSync(ctx -> ((BigDecimal) ctx.getBase()) + .multiply(new BigDecimal((Integer) ctx.getParams().get(0).getLiteral())) + .setScale(2, RoundingMode.HALF_EVEN) + ) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(Integer.class) - .applyToName("add") - .applyToParameters(1) - .resolveSync(ctx -> (Integer) ctx.getBase() + (Integer) ctx.getParams().get(0).getLiteral()) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(Integer.class) + .applyToName("add") + .applyToParameters(1) + .resolveSync(ctx -> (Integer) ctx.getBase() + (Integer) ctx.getParams().get(0).getLiteral()) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(Integer.class) - .applyToName("format") - .applyToParameters(1) - .resolveSync(ctx -> String.format((String) ctx.getParams().get(0).getLiteral(), ctx.getBase())) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(Integer.class) + .applyToName("format") + .applyToParameters(1) + .resolveSync(ctx -> String.format((String) ctx.getParams().get(0).getLiteral(), ctx.getBase())) + .build() ) - .addValueResolver( - ValueResolver - .builder() - .applyToBaseClass(String.class) - .applyToName("toCatalog7") - .resolveSync(ctx -> - Catalog.valueOfCode(Catalog7.class, (String) ctx.getBase()).orElseThrow(Catalog.invalidCatalogValue) - ) - .build() + .addValueResolver(ValueResolver.builder() + .applyToBaseClass(String.class) + .applyToName("toCatalog7") + .resolveSync(ctx -> + Catalog.valueOfCode(Catalog7.class, (String) ctx.getBase()).orElseThrow(Catalog.invalidCatalogValue) + ) + .build() ) .build(); diff --git a/core/src/main/resources/META-INF/services/io.github.project.openubl.xbuilder.enricher.kie.RuleFactory b/core/src/main/resources/META-INF/services/io.github.project.openubl.xbuilder.enricher.kie.RuleFactory index b0397eba..bbd272f4 100644 --- a/core/src/main/resources/META-INF/services/io.github.project.openubl.xbuilder.enricher.kie.RuleFactory +++ b/core/src/main/resources/META-INF/services/io.github.project.openubl.xbuilder.enricher.kie.RuleFactory @@ -39,6 +39,7 @@ io.github.project.openubl.xbuilder.enricher.kie.rules.summary.header.note.TotalI io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.detalle.UnidadDeMedidaRule io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.detalle.IgvTipoRule io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.detalle.PrecioDeReferenciaTipoRule +io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.detalle.TasaIgvRule ## Enrich - Anticipos io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.anticipo.TipoAnticipoRule @@ -46,6 +47,7 @@ io.github.project.openubl.xbuilder.enricher.kie.rules.enrich.body.anticipo.Compr ## Process - Detalle io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle.PrecioDeReferenciaRule +io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle.PrecioRule io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle.IcbRule io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle.IcbAplicaRule io.github.project.openubl.xbuilder.enricher.kie.rules.process.body.detalle.IgvBaseImponibleRule diff --git a/core/src/main/resources/templates/ubl/standard/include/document-line.xml b/core/src/main/resources/templates/ubl/standard/include/document-line.xml index 81155f49..3545c299 100644 --- a/core/src/main/resources/templates/ubl/standard/include/document-line.xml +++ b/core/src/main/resources/templates/ubl/standard/include/document-line.xml @@ -1,7 +1,7 @@ {item.igvBaseImponible.scale(2)} - {item.precioConImpuestos ? item.precio.scale(2) : item.precioReferencia.scale(2)} + {item.precioReferencia.scale(2)} {item.precioReferenciaTipo} @@ -12,7 +12,7 @@ {item.igv.scale(2)} {item.igvTipo.toCatalog7.taxCategory.categoria} - {tasaIgv.multiply(100)} + {item.tasaIgv.multiply(100)} {item.igvTipo.toCatalog7.code} {item.igvTipo.toCatalog7.taxCategory.code} @@ -40,5 +40,5 @@ - {item.precioConImpuestos ? item.precioReferencia.scale(2) : item.precio.scale(2)} + {item.precio.scale(2)} diff --git a/core/src/main/resources/templates/ubl/standard/include/tax-total.xml b/core/src/main/resources/templates/ubl/standard/include/tax-total.xml index 5b6e6c46..5b1dc637 100644 --- a/core/src/main/resources/templates/ubl/standard/include/tax-total.xml +++ b/core/src/main/resources/templates/ubl/standard/include/tax-total.xml @@ -1,6 +1,6 @@ {totalImpuestos.total.scale(2)} - {#if totalImpuestos.gravadoImporte} + {#if totalImpuestos.gravadoBaseImponible} {totalImpuestos.gravadoBaseImponible.scale(2)} {totalImpuestos.gravadoImporte.scale(2)} @@ -14,7 +14,7 @@ {/if} - {#if totalImpuestos.inafectoImporte} + {#if totalImpuestos.inafectoBaseImponible} {totalImpuestos.inafectoBaseImponible.scale(2)} {totalImpuestos.inafectoImporte.scale(2)} @@ -28,7 +28,7 @@ {/if} - {#if totalImpuestos.exoneradoImporte} + {#if totalImpuestos.exoneradoBaseImponible} {totalImpuestos.exoneradoBaseImponible.scale(2)} {totalImpuestos.exoneradoImporte.scale(2)} @@ -42,7 +42,7 @@ {/if} - {#if totalImpuestos.gratuitoImporte} + {#if totalImpuestos.gratuitoBaseImponible} {totalImpuestos.gratuitoBaseImponible.scale(2)} {totalImpuestos.gratuitoImporte.scale(2)} @@ -56,7 +56,7 @@ {/if} - {#if totalImpuestos.ivapImporte} + {#if totalImpuestos.ivapBaseImponible} {totalImpuestos.ivapBaseImponible.scale(2)} {totalImpuestos.ivapImporte.scale(2)} diff --git a/core/src/test/java/e2e/AbstractTest.java b/core/src/test/java/e2e/AbstractTest.java index e1933133..3786904b 100644 --- a/core/src/test/java/e2e/AbstractTest.java +++ b/core/src/test/java/e2e/AbstractTest.java @@ -16,16 +16,22 @@ */ package e2e; +import e2e.renderer.XMLAssertUtils; +import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice; +import io.github.project.openubl.xbuilder.enricher.ContentEnricher; import io.github.project.openubl.xbuilder.enricher.config.DateProvider; import io.github.project.openubl.xbuilder.enricher.config.Defaults; +import io.github.project.openubl.xbuilder.renderer.TemplateProducer; +import io.quarkus.qute.Template; import java.math.BigDecimal; import java.time.LocalDate; public class AbstractTest { - protected static final Defaults defaults = Defaults - .builder() + protected static final Defaults defaults = Defaults.builder() .moneda("PEN") .unidadMedida("NIU") .icbTasa(new BigDecimal("0.2")) @@ -33,4 +39,43 @@ public class AbstractTest { .build(); protected static final DateProvider dateProvider = () -> LocalDate.of(2019, 12, 24); + + protected void assertInput(Invoice input, String snapshot) throws Exception { + ContentEnricher enricher = new ContentEnricher(defaults, dateProvider); + enricher.enrich(input); + + // When + Template template = TemplateProducer.getInstance().getInvoice(); + String xml = template.data(input).render(); + + // Then + XMLAssertUtils.assertSnapshot(xml, getClass(), snapshot); + XMLAssertUtils.assertSendSunat(xml, XMLAssertUtils.INVOICE_XSD); + } + + protected void assertInput(CreditNote input, String snapshot) throws Exception { + ContentEnricher enricher = new ContentEnricher(defaults, dateProvider); + enricher.enrich(input); + + // When + Template template = TemplateProducer.getInstance().getCreditNote(); + String xml = template.data(input).render(); + + // Then + XMLAssertUtils.assertSnapshot(xml, getClass(), snapshot); + XMLAssertUtils.assertSendSunat(xml, XMLAssertUtils.CREDIT_NOTE_XSD); + } + + protected void assertInput(DebitNote input, String snapshot) throws Exception { + ContentEnricher enricher = new ContentEnricher(defaults, dateProvider); + enricher.enrich(input); + + // When + Template template = TemplateProducer.getInstance().getDebitNote(); + String xml = template.data(input).render(); + + // Then + XMLAssertUtils.assertSnapshot(xml, getClass(), snapshot); + XMLAssertUtils.assertSendSunat(xml, XMLAssertUtils.DEBIT_NOTE_XSD); + } } diff --git a/core/src/test/java/e2e/enricher/process/DetalleTest.java b/core/src/test/java/e2e/enricher/process/DetalleTest.java index 37f7eaac..7d4e2a2e 100644 --- a/core/src/test/java/e2e/enricher/process/DetalleTest.java +++ b/core/src/test/java/e2e/enricher/process/DetalleTest.java @@ -98,7 +98,8 @@ public void testEnrichPrecioDeReferencia_precioSinImpuestos_OperacionOnerosa() { input .getDetalles() .forEach(detalle -> { - assertEquals(0, BigDecimal.TEN.compareTo(detalle.getPrecioReferencia())); + assertEquals(0, BigDecimal.TEN.compareTo(detalle.getPrecio())); + assertEquals(0, new BigDecimal("11.80").compareTo(detalle.getPrecioReferencia())); }); } diff --git a/core/src/test/java/e2e/homologacion/Group1Test.java b/core/src/test/java/e2e/homologacion/Group1Test.java new file mode 100644 index 00000000..6b2f695d --- /dev/null +++ b/core/src/test/java/e2e/homologacion/Group1Test.java @@ -0,0 +1,371 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package e2e.homologacion; + +import e2e.AbstractTest; +import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +public class Group1Test extends AbstractTest { + + @Order(1) + @Test + public void factura1Con3Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF11") + .numero(1) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .build() + ) + .build(); + + assertInput(input, "factura1Con3Items.xml"); + } + + @Order(2) + @Test + public void factura2Con2Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF11") + .numero(2) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .build(); + + assertInput(input, "factura2Con2Items.xml"); + } + + @Order(3) + @Test + public void factura3Con1Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF11") + .numero(3) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .build(); + + assertInput(input, "factura3Con1Items.xml"); + } + + @Order(4) + @Test + public void factura4Con5Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF11") + .numero(4) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .build() + ) + .build(); + + assertInput(input, "factura4Con5Items.xml"); + } + + @Order(5) + @Test + public void factura5Con4Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF11") + .numero(5) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .build() + ) + .build(); + + assertInput(input, "factura5Con4Items.xml"); + } + + @Order(6) + @Test + public void notaDeCreditoDeFactura2() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF11") + .numero(1) + .comprobanteAfectadoSerieNumero("FF11-2") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura2.xml"); + } + + @Order(7) + @Test + public void notaDeCreditoDeFactura3() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF11") + .numero(2) + .comprobanteAfectadoSerieNumero("FF11-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura3.xml"); + } + + @Order(8) + @Test + public void notaDeCreditoDeFactura4() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF11") + .numero(3) + .comprobanteAfectadoSerieNumero("FF11-4") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura4.xml"); + } + + @Order(9) + @Test + public void notaDeDebitoDeFactura2() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF11") + .numero(1) + .comprobanteAfectadoSerieNumero("FF11-2") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura2.xml"); + } + + @Order(10) + @Test + public void notaDeDebitoDeFactura3() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF11") + .numero(2) + .comprobanteAfectadoSerieNumero("FF11-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura3.xml"); + } + + @Order(11) + @Test + public void notaDeDebitoDeFactura4() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF11") + .numero(3) + .comprobanteAfectadoSerieNumero("FF11-4") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura4.xml"); + } +} diff --git a/core/src/test/java/e2e/homologacion/Group2ExoneradoTest.java b/core/src/test/java/e2e/homologacion/Group2ExoneradoTest.java new file mode 100644 index 00000000..fb629b35 --- /dev/null +++ b/core/src/test/java/e2e/homologacion/Group2ExoneradoTest.java @@ -0,0 +1,536 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package e2e.homologacion; + +import e2e.AbstractTest; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; +import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +public class Group2ExoneradoTest extends AbstractTest { + + @Order(1) + @Test + public void factura1Con1Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(1) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura1Con1Items.xml"); + } + + @Order(2) + @Test + public void factura2Con4Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(2) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura2Con4Items.xml"); + } + + @Order(3) + @Test + public void factura3Con7Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(3) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura3Con7Items.xml"); + } + + @Order(4) + @Test + public void factura4Con5Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(4) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura4Con5Items.xml"); + } + + @Order(5) + @Test + public void factura5Con6Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(5) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura5Con6Items.xml"); + } + + @Order(6) + @Test + public void notaDeCreditoDeFactura1() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(1) + .comprobanteAfectadoSerieNumero("FF12-1") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura1.xml"); + } + + @Order(7) + @Test + public void notaDeCreditoDeFactura3() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(2) + .comprobanteAfectadoSerieNumero("FF12-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura3.xml"); + } + + @Order(8) + @Test + public void notaDeCreditoDeFactura5() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(3) + .comprobanteAfectadoSerieNumero("FF12-5") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura5.xml"); + } + + @Order(9) + @Test + public void notaDeDebitoDeFactura1() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(1) + .comprobanteAfectadoSerieNumero("FF12-1") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura1.xml"); + } + + @Order(10) + @Test + public void notaDeDebitoDeFactura3() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(2) + .comprobanteAfectadoSerieNumero("FF12-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura3.xml"); + } + + @Order(11) + @Test + public void notaDeDebitoDeFactura5() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(3) + .comprobanteAfectadoSerieNumero("FF12-5") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.EXONERADO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura5.xml"); + } +} diff --git a/core/src/test/java/e2e/homologacion/Group2InafectoTest.java b/core/src/test/java/e2e/homologacion/Group2InafectoTest.java new file mode 100644 index 00000000..5b40b988 --- /dev/null +++ b/core/src/test/java/e2e/homologacion/Group2InafectoTest.java @@ -0,0 +1,536 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package e2e.homologacion; + +import e2e.AbstractTest; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; +import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +public class Group2InafectoTest extends AbstractTest { + + @Order(1) + @Test + public void factura1Con1Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(1) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura1Con1Items.xml"); + } + + @Order(2) + @Test + public void factura2Con4Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(2) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura2Con4Items.xml"); + } + + @Order(3) + @Test + public void factura3Con7Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(3) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura3Con7Items.xml"); + } + + @Order(4) + @Test + public void factura4Con5Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(4) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura4Con5Items.xml"); + } + + @Order(5) + @Test + public void factura5Con6Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF12") + .numero(5) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura5Con6Items.xml"); + } + + @Order(6) + @Test + public void notaDeCreditoDeFactura1() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(1) + .comprobanteAfectadoSerieNumero("FF12-1") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura1.xml"); + } + + @Order(7) + @Test + public void notaDeCreditoDeFactura3() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(2) + .comprobanteAfectadoSerieNumero("FF12-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura3.xml"); + } + + @Order(8) + @Test + public void notaDeCreditoDeFactura5() throws Exception { + CreditNote input = CreditNote.builder() + .serie("FF12") + .numero(3) + .comprobanteAfectadoSerieNumero("FF12-5") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeCreditoDeFactura5.xml"); + } + + @Order(9) + @Test + public void notaDeDebitoDeFactura1() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(1) + .comprobanteAfectadoSerieNumero("FF12-1") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura1.xml"); + } + + @Order(10) + @Test + public void notaDeDebitoDeFactura3() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(2) + .comprobanteAfectadoSerieNumero("FF12-3") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PUBLICIDAD.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura3.xml"); + } + + @Order(11) + @Test + public void notaDeDebitoDeFactura5() throws Exception { + DebitNote input = DebitNote.builder() + .serie("FF12") + .numero(3) + .comprobanteAfectadoSerieNumero("FF12-5") + .sustentoDescripcion("Homologacion") + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.INAFECTO_OPERACION_ONEROSA.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_CONVENIO_COLECTIVO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .build(); + + assertInput(input, "notaDeDebitoDeFactura5.xml"); + } +} diff --git a/core/src/test/java/e2e/homologacion/Group3Test.java b/core/src/test/java/e2e/homologacion/Group3Test.java new file mode 100644 index 00000000..8d1205a5 --- /dev/null +++ b/core/src/test/java/e2e/homologacion/Group3Test.java @@ -0,0 +1,249 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package e2e.homologacion; + +import e2e.AbstractTest; +import io.github.project.openubl.xbuilder.content.catalogs.Catalog7; +import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote; +import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle; +import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +public class Group3Test extends AbstractTest { + + @Order(1) + @Test + public void factura1Con7Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF13") + .numero(1) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_DONACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.GRAVADO_RETIRO.getCode()) + .build() + ) + + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item6") + .cantidad(new BigDecimal("6")) + .precio(new BigDecimal("600")) + .igvTipo(Catalog7.INAFECTO_RETIRO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item7") + .cantidad(new BigDecimal("7")) + .precio(new BigDecimal("700")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_MUESTRAS_MEDICAS.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura1Con7Items.xml"); + } + + @Order(2) + @Test + public void factura2Con2Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF13") + .numero(2) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_DONACION.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura2Con2Items.xml"); + } + + @Order(3) + @Test + public void factura3Con5Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF13") + .numero(3) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_DONACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.GRAVADO_RETIRO.getCode()) + .build() + ) + + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item5") + .cantidad(new BigDecimal("5")) + .precio(new BigDecimal("500")) + .igvTipo(Catalog7.INAFECTO_RETIRO_POR_BONIFICACION.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura3Con5Items.xml"); + } + + @Order(4) + @Test + public void factura4Con4Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF13") + .numero(4) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_DONACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.GRAVADO_RETIRO.getCode()) + .build() + ) + + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item4") + .cantidad(new BigDecimal("4")) + .precio(new BigDecimal("400")) + .igvTipo(Catalog7.EXONERADO_TRANSFERENCIA_GRATUITA.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura4Con4Items.xml"); + } + + @Order(5) + @Test + public void factura5Con3Items() throws Exception { + Invoice input = Invoice.builder() + .serie("FF13") + .numero(5) + .proveedor(HomologacionConstants.proveedor) + .cliente(HomologacionConstants.cliente) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item1") + .cantidad(new BigDecimal("1")) + .precio(new BigDecimal("100")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_PREMIO.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item2") + .cantidad(new BigDecimal("2")) + .precio(new BigDecimal("200")) + .igvTipo(Catalog7.GRAVADO_RETIRO_POR_DONACION.getCode()) + .build() + ) + .detalle(DocumentoVentaDetalle.builder() + .descripcion("Item3") + .cantidad(new BigDecimal("3")) + .precio(new BigDecimal("300")) + .igvTipo(Catalog7.GRAVADO_RETIRO.getCode()) + .build() + ) + .build(); + + assertInput(input, "factura5Con3Items.xml"); + } + +} diff --git a/core/src/test/java/e2e/homologacion/HomologacionConstants.java b/core/src/test/java/e2e/homologacion/HomologacionConstants.java new file mode 100644 index 00000000..89af9aef --- /dev/null +++ b/core/src/test/java/e2e/homologacion/HomologacionConstants.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Project OpenUBL, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License - 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package e2e.homologacion; + +import io.github.project.openubl.xbuilder.content.catalogs.Catalog6; +import io.github.project.openubl.xbuilder.content.models.common.Cliente; +import io.github.project.openubl.xbuilder.content.models.common.Proveedor; + +public class HomologacionConstants { + + public static final Proveedor proveedor = Proveedor.builder() + .ruc("12345678912") + .razonSocial("Softgreen S.A.C.") + .build(); + public static final Cliente cliente = Cliente.builder() + .nombre("Carlos Feria") + .numeroDocumentoIdentidad("12121212121") + .tipoDocumentoIdentidad(Catalog6.RUC.toString()) + .build(); +} diff --git "a/core/src/test/java/e2e/homologacion/ManualDeHomologaci\303\263n_Version_3_0.pdf" "b/core/src/test/java/e2e/homologacion/ManualDeHomologaci\303\263n_Version_3_0.pdf" new file mode 100644 index 00000000..83d72b9a Binary files /dev/null and "b/core/src/test/java/e2e/homologacion/ManualDeHomologaci\303\263n_Version_3_0.pdf" differ diff --git a/core/src/test/java/e2e/renderer/XMLAssertUtils.java b/core/src/test/java/e2e/renderer/XMLAssertUtils.java index 656eda10..4ed8a955 100644 --- a/core/src/test/java/e2e/renderer/XMLAssertUtils.java +++ b/core/src/test/java/e2e/renderer/XMLAssertUtils.java @@ -73,15 +73,13 @@ public class XMLAssertUtils { public static final String PERCEPTION_XSD = "xsd/2.0/maindoc/UBLPE-Perception-1.0.xsd"; public static final String RETENTION_XSD = "xsd/2.0/maindoc/UBLPE-Retention-1.0.xsd"; - public static final CompanyURLs companyURLs = CompanyURLs - .builder() + public static final CompanyURLs companyURLs = CompanyURLs.builder() .invoice("https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService") .despatch("https://e-beta.sunat.gob.pe/ol-ti-itemision-otroscpe-gem-beta/billService") .perceptionRetention("https://e-beta.sunat.gob.pe/ol-ti-itemision-otroscpe-gem-beta/billService") .build(); - public static final CompanyCredentials credentials = CompanyCredentials - .builder() + public static final CompanyCredentials credentials = CompanyCredentials.builder() .username("12345678959MODDATOS") .password("MODDATOS") .build(); diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/factura1Con3Items.xml b/core/src/test/resources/e2e/homologacion/Group1Test/factura1Con3Items.xml new file mode 100644 index 00000000..5ed388f8 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/factura1Con3Items.xml @@ -0,0 +1,191 @@ + + + + + + + + 2.1 + 2.0 + FF11-1 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 252.00 + + 1400.00 + 252.00 + + S + + 1000 + IGV + VAT + + + + + + 1400.00 + 1652.00 + 0 + 1652.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + + 3 + 3 + 900.00 + + + 354.00 + 01 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 300.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/factura2Con2Items.xml b/core/src/test/resources/e2e/homologacion/Group1Test/factura2Con2Items.xml new file mode 100644 index 00000000..02264612 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/factura2Con2Items.xml @@ -0,0 +1,157 @@ + + + + + + + + 2.1 + 2.0 + FF11-2 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 90.00 + + 500.00 + 90.00 + + S + + 1000 + IGV + VAT + + + + + + 500.00 + 590.00 + 0 + 590.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/factura3Con1Items.xml b/core/src/test/resources/e2e/homologacion/Group1Test/factura3Con1Items.xml new file mode 100644 index 00000000..4f3d0999 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/factura3Con1Items.xml @@ -0,0 +1,123 @@ + + + + + + + + 2.1 + 2.0 + FF11-3 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 18.00 + + 100.00 + 18.00 + + S + + 1000 + IGV + VAT + + + + + + 100.00 + 118.00 + 0 + 118.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/factura4Con5Items.xml b/core/src/test/resources/e2e/homologacion/Group1Test/factura4Con5Items.xml new file mode 100644 index 00000000..26b64ade --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/factura4Con5Items.xml @@ -0,0 +1,259 @@ + + + + + + + + 2.1 + 2.0 + FF11-4 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 990.00 + + 5500.00 + 990.00 + + S + + 1000 + IGV + VAT + + + + + + 5500.00 + 6490.00 + 0 + 6490.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + + 3 + 3 + 900.00 + + + 354.00 + 01 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 300.00 + + + + 4 + 4 + 1600.00 + + + 472.00 + 01 + + + + 288.00 + + 1600.00 + 288.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 400.00 + + + + 5 + 5 + 2500.00 + + + 590.00 + 01 + + + + 450.00 + + 2500.00 + 450.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 500.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/factura5Con4Items.xml b/core/src/test/resources/e2e/homologacion/Group1Test/factura5Con4Items.xml new file mode 100644 index 00000000..3101218f --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/factura5Con4Items.xml @@ -0,0 +1,225 @@ + + + + + + + + 2.1 + 2.0 + FF11-5 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 540.00 + + 3000.00 + 540.00 + + S + + 1000 + IGV + VAT + + + + + + 3000.00 + 3540.00 + 0 + 3540.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + + 3 + 3 + 900.00 + + + 354.00 + 01 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 300.00 + + + + 4 + 4 + 1600.00 + + + 472.00 + 01 + + + + 288.00 + + 1600.00 + 288.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 400.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura2.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura2.xml new file mode 100644 index 00000000..8d15c791 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura2.xml @@ -0,0 +1,162 @@ + + + + + + + + 2.1 + 2.0 + FF11-1 + 2019-12-24 + PEN + + FF11-2 + 01 + + + + + FF11-2 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 90.00 + + 500.00 + 90.00 + + S + + 1000 + IGV + VAT + + + + + + 500.00 + 590.00 + 590.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura3.xml new file mode 100644 index 00000000..4dedef01 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura3.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF11-2 + 2019-12-24 + PEN + + FF11-3 + 01 + + + + + FF11-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 18.00 + + 100.00 + 18.00 + + S + + 1000 + IGV + VAT + + + + + + 100.00 + 118.00 + 118.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura4.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura4.xml new file mode 100644 index 00000000..62023e6f --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeCreditoDeFactura4.xml @@ -0,0 +1,264 @@ + + + + + + + + 2.1 + 2.0 + FF11-3 + 2019-12-24 + PEN + + FF11-4 + 01 + + + + + FF11-4 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 990.00 + + 5500.00 + 990.00 + + S + + 1000 + IGV + VAT + + + + + + 5500.00 + 6490.00 + 6490.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + + 3 + 3 + 900.00 + + + 354.00 + 01 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 300.00 + + + + 4 + 4 + 1600.00 + + + 472.00 + 01 + + + + 288.00 + + 1600.00 + 288.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 400.00 + + + + 5 + 5 + 2500.00 + + + 590.00 + 01 + + + + 450.00 + + 2500.00 + 450.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 500.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura2.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura2.xml new file mode 100644 index 00000000..94d5b411 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura2.xml @@ -0,0 +1,162 @@ + + + + + + + + 2.1 + 2.0 + FF11-1 + 2019-12-24 + PEN + + FF11-2 + 01 + + + + + FF11-2 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 90.00 + + 500.00 + 90.00 + + S + + 1000 + IGV + VAT + + + + + + 500.00 + 590.00 + 590.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura3.xml new file mode 100644 index 00000000..0de4a979 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura3.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF11-2 + 2019-12-24 + PEN + + FF11-3 + 01 + + + + + FF11-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 18.00 + + 100.00 + 18.00 + + S + + 1000 + IGV + VAT + + + + + + 100.00 + 118.00 + 118.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura4.xml b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura4.xml new file mode 100644 index 00000000..4fee01b6 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group1Test/notaDeDebitoDeFactura4.xml @@ -0,0 +1,264 @@ + + + + + + + + 2.1 + 2.0 + FF11-3 + 2019-12-24 + PEN + + FF11-4 + 01 + + + + + FF11-4 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 990.00 + + 5500.00 + 990.00 + + S + + 1000 + IGV + VAT + + + + + + 5500.00 + 6490.00 + 6490.00 + + + 1 + 1 + 100.00 + + + 118.00 + 01 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 236.00 + 01 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 200.00 + + + + 3 + 3 + 900.00 + + + 354.00 + 01 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 300.00 + + + + 4 + 4 + 1600.00 + + + 472.00 + 01 + + + + 288.00 + + 1600.00 + 288.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 400.00 + + + + 5 + 5 + 2500.00 + + + 590.00 + 01 + + + + 450.00 + + 2500.00 + 450.00 + + S + 18.00 + 10 + + 1000 + IGV + VAT + + + + + + + + + 500.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura1Con1Items.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura1Con1Items.xml new file mode 100644 index 00000000..ede1f10b --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura1Con1Items.xml @@ -0,0 +1,123 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura2Con4Items.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura2Con4Items.xml new file mode 100644 index 00000000..1a3c37f7 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura2Con4Items.xml @@ -0,0 +1,237 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 2900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura3Con7Items.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura3Con7Items.xml new file mode 100644 index 00000000..c8222527 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura3Con7Items.xml @@ -0,0 +1,339 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura4Con5Items.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura4Con5Items.xml new file mode 100644 index 00000000..c59522c1 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura4Con5Items.xml @@ -0,0 +1,271 @@ + + + + + + + + 2.1 + 2.0 + FF12-4 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 5400.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura5Con6Items.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura5Con6Items.xml new file mode 100644 index 00000000..f2d9bb23 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/factura5Con6Items.xml @@ -0,0 +1,305 @@ + + + + + + + + 2.1 + 2.0 + FF12-5 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 9000.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura1.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura1.xml new file mode 100644 index 00000000..834d4ac3 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura1.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + PEN + + FF12-1 + 01 + + + + + FF12-1 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura3.xml new file mode 100644 index 00000000..e631219a --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura3.xml @@ -0,0 +1,344 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + PEN + + FF12-3 + 01 + + + + + FF12-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura5.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura5.xml new file mode 100644 index 00000000..c8310aa6 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeCreditoDeFactura5.xml @@ -0,0 +1,276 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + PEN + + FF12-5 + 01 + + + + + FF12-5 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 5400.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura1.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura1.xml new file mode 100644 index 00000000..fdfd6b49 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura1.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + PEN + + FF12-1 + 01 + + + + + FF12-1 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura3.xml new file mode 100644 index 00000000..b87221a5 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura3.xml @@ -0,0 +1,344 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + PEN + + FF12-3 + 01 + + + + + FF12-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura5.xml b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura5.xml new file mode 100644 index 00000000..4c6380d3 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2ExoneradoTest/notaDeDebitoDeFactura5.xml @@ -0,0 +1,310 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + PEN + + FF12-5 + 01 + + + + + FF12-5 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9997 + EXO + VAT + + + + + 9000.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 20 + + 9997 + EXO + VAT + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura1Con1Items.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura1Con1Items.xml new file mode 100644 index 00000000..171ac48b --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura1Con1Items.xml @@ -0,0 +1,123 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura2Con4Items.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura2Con4Items.xml new file mode 100644 index 00000000..bb9bea15 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura2Con4Items.xml @@ -0,0 +1,237 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 2900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura3Con7Items.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura3Con7Items.xml new file mode 100644 index 00000000..f6123ada --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura3Con7Items.xml @@ -0,0 +1,339 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura4Con5Items.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura4Con5Items.xml new file mode 100644 index 00000000..e38f5451 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura4Con5Items.xml @@ -0,0 +1,271 @@ + + + + + + + + 2.1 + 2.0 + FF12-4 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 5400.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura5Con6Items.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura5Con6Items.xml new file mode 100644 index 00000000..17f7f88e --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/factura5Con6Items.xml @@ -0,0 +1,305 @@ + + + + + + + + 2.1 + 2.0 + FF12-5 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 9000.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 0 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura1.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura1.xml new file mode 100644 index 00000000..c922df27 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura1.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + PEN + + FF12-1 + 01 + + + + + FF12-1 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura3.xml new file mode 100644 index 00000000..6af2bb6f --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura3.xml @@ -0,0 +1,344 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + PEN + + FF12-3 + 01 + + + + + FF12-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura5.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura5.xml new file mode 100644 index 00000000..ad05dc91 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeCreditoDeFactura5.xml @@ -0,0 +1,276 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + PEN + + FF12-5 + 01 + + + + + FF12-5 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 5400.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura1.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura1.xml new file mode 100644 index 00000000..b19514fb --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura1.xml @@ -0,0 +1,128 @@ + + + + + + + + 2.1 + 2.0 + FF12-1 + 2019-12-24 + PEN + + FF12-1 + 01 + + + + + FF12-1 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura3.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura3.xml new file mode 100644 index 00000000..c092595b --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura3.xml @@ -0,0 +1,344 @@ + + + + + + + + 2.1 + 2.0 + FF12-2 + 2019-12-24 + PEN + + FF12-3 + 01 + + + + + FF12-3 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 13900.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 36 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura5.xml b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura5.xml new file mode 100644 index 00000000..ad5c0c1c --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group2InafectoTest/notaDeDebitoDeFactura5.xml @@ -0,0 +1,310 @@ + + + + + + + + 2.1 + 2.0 + FF12-3 + 2019-12-24 + PEN + + FF12-5 + 01 + + + + + FF12-5 + 01 + + + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + 0.00 + + 100.00 + 0.00 + + S + + 9998 + INA + FRE + + + + + 9000.00 + 0.00 + + S + + 9996 + GRA + FRE + + + + + + 100.00 + 100.00 + 100.00 + + + 1 + 1 + 100.00 + + + 100.00 + 01 + + + + 0.00 + + 100.00 + 0.00 + + S + 0.00 + 30 + + 9998 + INA + FRE + + + + + + + + + 100.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 0.00 + + 400.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 0.00 + + 900.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 34 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 35 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group3Test/factura1Con7Items.xml b/core/src/test/resources/e2e/homologacion/Group3Test/factura1Con7Items.xml new file mode 100644 index 00000000..d124b5fb --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group3Test/factura1Con7Items.xml @@ -0,0 +1,327 @@ + + + + + + + + 2.1 + 2.0 + FF13-1 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 14000.00 + 252.00 + + S + + 9996 + GRA + FRE + + + + + + 0.00 + 0.00 + 0 + 0.00 + + + 1 + 1 + 100.00 + + + 100.00 + 02 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 11 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 12 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 13 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 6 + 6 + 3600.00 + + + 600.00 + 02 + + + + 0.00 + + 3600.00 + 0.00 + + S + 0.00 + 32 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 7 + 7 + 4900.00 + + + 700.00 + 02 + + + + 0.00 + + 4900.00 + 0.00 + + S + 0.00 + 33 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group3Test/factura2Con2Items.xml b/core/src/test/resources/e2e/homologacion/Group3Test/factura2Con2Items.xml new file mode 100644 index 00000000..1f3aa575 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group3Test/factura2Con2Items.xml @@ -0,0 +1,157 @@ + + + + + + + + 2.1 + 2.0 + FF13-2 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 500.00 + 90.00 + + S + + 9996 + GRA + FRE + + + + + + 0.00 + 0.00 + 0 + 0.00 + + + 1 + 1 + 100.00 + + + 100.00 + 02 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 11 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 12 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group3Test/factura3Con5Items.xml b/core/src/test/resources/e2e/homologacion/Group3Test/factura3Con5Items.xml new file mode 100644 index 00000000..cdc626a3 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group3Test/factura3Con5Items.xml @@ -0,0 +1,259 @@ + + + + + + + + 2.1 + 2.0 + FF13-3 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 5500.00 + 252.00 + + S + + 9996 + GRA + FRE + + + + + + 0.00 + 0.00 + 0 + 0.00 + + + 1 + 1 + 100.00 + + + 100.00 + 02 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 11 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 12 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 13 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 5 + 5 + 2500.00 + + + 500.00 + 02 + + + + 0.00 + + 2500.00 + 0.00 + + S + 0.00 + 31 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group3Test/factura4Con4Items.xml b/core/src/test/resources/e2e/homologacion/Group3Test/factura4Con4Items.xml new file mode 100644 index 00000000..ac6df0f0 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group3Test/factura4Con4Items.xml @@ -0,0 +1,225 @@ + + + + + + + + 2.1 + 2.0 + FF13-4 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 3000.00 + 252.00 + + S + + 9996 + GRA + FRE + + + + + + 0.00 + 0.00 + 0 + 0.00 + + + 1 + 1 + 100.00 + + + 100.00 + 02 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 11 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 12 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 13 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 4 + 4 + 1600.00 + + + 400.00 + 02 + + + + 0.00 + + 1600.00 + 0.00 + + S + 0.00 + 21 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + diff --git a/core/src/test/resources/e2e/homologacion/Group3Test/factura5Con3Items.xml b/core/src/test/resources/e2e/homologacion/Group3Test/factura5Con3Items.xml new file mode 100644 index 00000000..984aff17 --- /dev/null +++ b/core/src/test/resources/e2e/homologacion/Group3Test/factura5Con3Items.xml @@ -0,0 +1,191 @@ + + + + + + + + 2.1 + 2.0 + FF13-5 + 2019-12-24 + 01 + PEN + + 12345678912 + + + 12345678912 + + + + + + + + #PROJECT-OPENUBL-SIGN + + + + + + + 12345678912 + + + + + 0000 + + + + + + + + 12121212121 + + + + + + + + FormaPago + Contado + + + 0.00 + + 1400.00 + 252.00 + + S + + 9996 + GRA + FRE + + + + + + 0.00 + 0.00 + 0 + 0.00 + + + 1 + 1 + 100.00 + + + 100.00 + 02 + + + + 18.00 + + 100.00 + 18.00 + + S + 18.00 + 11 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 2 + 2 + 400.00 + + + 200.00 + 02 + + + + 72.00 + + 400.00 + 72.00 + + S + 18.00 + 12 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + + + 3 + 3 + 900.00 + + + 300.00 + 02 + + + + 162.00 + + 900.00 + 162.00 + + S + 18.00 + 13 + + 9996 + GRA + FRE + + + + + + + + + 0.00 + + +