Skip to content

Commit 8e05992

Browse files
Homologacion add tests (#188)
1 parent b3efe9d commit 8e05992

File tree

8 files changed

+2395
-0
lines changed

8 files changed

+2395
-0
lines changed
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package e2e.homologacion;
18+
19+
import e2e.AbstractTest;
20+
import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote;
21+
import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote;
22+
import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle;
23+
import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice;
24+
import org.junit.jupiter.api.Order;
25+
import org.junit.jupiter.api.Test;
26+
27+
import java.math.BigDecimal;
28+
29+
public class Group5Test extends AbstractTest {
30+
31+
@Order(1)
32+
@Test
33+
public void factura1Con5Items() throws Exception {
34+
Invoice input = Invoice.builder()
35+
.serie("FF30")
36+
.numero(1)
37+
.proveedor(HomologacionConstants.proveedor)
38+
.cliente(HomologacionConstants.cliente)
39+
.detalle(DocumentoVentaDetalle.builder()
40+
.descripcion("Item1")
41+
.cantidad(new BigDecimal("1"))
42+
.precio(new BigDecimal("100"))
43+
.tasaIsc(new BigDecimal("0.1"))
44+
.build()
45+
)
46+
.detalle(DocumentoVentaDetalle.builder()
47+
.descripcion("Item2")
48+
.cantidad(new BigDecimal("2"))
49+
.precio(new BigDecimal("200"))
50+
.tasaIsc(new BigDecimal("0.1"))
51+
.build()
52+
)
53+
.detalle(DocumentoVentaDetalle.builder()
54+
.descripcion("Item3")
55+
.cantidad(new BigDecimal("3"))
56+
.precio(new BigDecimal("300"))
57+
.tasaIsc(new BigDecimal("0.1"))
58+
.build()
59+
)
60+
.detalle(DocumentoVentaDetalle.builder()
61+
.descripcion("Item4")
62+
.cantidad(new BigDecimal("4"))
63+
.precio(new BigDecimal("400"))
64+
.tasaIsc(new BigDecimal("0.1"))
65+
.build()
66+
)
67+
.detalle(DocumentoVentaDetalle.builder()
68+
.descripcion("Item5")
69+
.cantidad(new BigDecimal("5"))
70+
.precio(new BigDecimal("500"))
71+
.tasaIsc(new BigDecimal("0.1"))
72+
.build()
73+
)
74+
.build();
75+
76+
assertInput(input, "factura1Con5Items.xml");
77+
}
78+
79+
//
80+
81+
@Order(2)
82+
@Test
83+
public void notaDeCreditoDeFactura1() throws Exception {
84+
CreditNote input = CreditNote.builder()
85+
.serie("FF30")
86+
.numero(1)
87+
.comprobanteAfectadoSerieNumero("FF30-1")
88+
.sustentoDescripcion("Homologacion")
89+
.proveedor(HomologacionConstants.proveedor)
90+
.cliente(HomologacionConstants.cliente)
91+
.detalle(DocumentoVentaDetalle.builder()
92+
.descripcion("Item1")
93+
.cantidad(new BigDecimal("1"))
94+
.precio(new BigDecimal("100"))
95+
.tasaIsc(new BigDecimal("0.1"))
96+
.build()
97+
)
98+
.detalle(DocumentoVentaDetalle.builder()
99+
.descripcion("Item2")
100+
.cantidad(new BigDecimal("2"))
101+
.precio(new BigDecimal("200"))
102+
.tasaIsc(new BigDecimal("0.1"))
103+
.build()
104+
)
105+
.detalle(DocumentoVentaDetalle.builder()
106+
.descripcion("Item3")
107+
.cantidad(new BigDecimal("3"))
108+
.precio(new BigDecimal("300"))
109+
.tasaIsc(new BigDecimal("0.1"))
110+
.build()
111+
)
112+
.detalle(DocumentoVentaDetalle.builder()
113+
.descripcion("Item4")
114+
.cantidad(new BigDecimal("4"))
115+
.precio(new BigDecimal("400"))
116+
.tasaIsc(new BigDecimal("0.1"))
117+
.build()
118+
)
119+
.detalle(DocumentoVentaDetalle.builder()
120+
.descripcion("Item5")
121+
.cantidad(new BigDecimal("5"))
122+
.precio(new BigDecimal("500"))
123+
.tasaIsc(new BigDecimal("0.1"))
124+
.build()
125+
)
126+
.build();
127+
128+
assertInput(input, "notaDeCreditoDeFactura1.xml");
129+
}
130+
131+
@Order(3)
132+
@Test
133+
public void notaDeDebitoDeFactura1() throws Exception {
134+
DebitNote input = DebitNote.builder()
135+
.serie("FF30")
136+
.numero(1)
137+
.comprobanteAfectadoSerieNumero("FF30-1")
138+
.sustentoDescripcion("Homologacion")
139+
.proveedor(HomologacionConstants.proveedor)
140+
.cliente(HomologacionConstants.cliente)
141+
.detalle(DocumentoVentaDetalle.builder()
142+
.descripcion("Item1")
143+
.cantidad(new BigDecimal("1"))
144+
.precio(new BigDecimal("100"))
145+
.tasaIsc(new BigDecimal("0.1"))
146+
.build()
147+
)
148+
.detalle(DocumentoVentaDetalle.builder()
149+
.descripcion("Item2")
150+
.cantidad(new BigDecimal("2"))
151+
.precio(new BigDecimal("200"))
152+
.tasaIsc(new BigDecimal("0.1"))
153+
.build()
154+
)
155+
.detalle(DocumentoVentaDetalle.builder()
156+
.descripcion("Item3")
157+
.cantidad(new BigDecimal("3"))
158+
.precio(new BigDecimal("300"))
159+
.tasaIsc(new BigDecimal("0.1"))
160+
.build()
161+
)
162+
.detalle(DocumentoVentaDetalle.builder()
163+
.descripcion("Item4")
164+
.cantidad(new BigDecimal("4"))
165+
.precio(new BigDecimal("400"))
166+
.tasaIsc(new BigDecimal("0.1"))
167+
.build()
168+
)
169+
.detalle(DocumentoVentaDetalle.builder()
170+
.descripcion("Item5")
171+
.cantidad(new BigDecimal("5"))
172+
.precio(new BigDecimal("500"))
173+
.tasaIsc(new BigDecimal("0.1"))
174+
.build()
175+
)
176+
.build();
177+
178+
assertInput(input, "notaDeDebitoDeFactura2.xml");
179+
}
180+
181+
}
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
/*
2+
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License - 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package e2e.homologacion;
18+
19+
import e2e.AbstractTest;
20+
import io.github.project.openubl.xbuilder.content.models.standard.general.CreditNote;
21+
import io.github.project.openubl.xbuilder.content.models.standard.general.DebitNote;
22+
import io.github.project.openubl.xbuilder.content.models.standard.general.DocumentoVentaDetalle;
23+
import io.github.project.openubl.xbuilder.content.models.standard.general.Invoice;
24+
import org.junit.jupiter.api.Order;
25+
import org.junit.jupiter.api.Test;
26+
27+
import java.math.BigDecimal;
28+
29+
public class Group7Test extends AbstractTest {
30+
31+
@Order(1)
32+
@Test
33+
public void factura1Con5Items() throws Exception {
34+
Invoice input = Invoice.builder()
35+
.serie("FF50")
36+
.numero(1)
37+
.moneda("USD")
38+
.proveedor(HomologacionConstants.proveedor)
39+
.cliente(HomologacionConstants.cliente)
40+
.detalle(DocumentoVentaDetalle.builder()
41+
.descripcion("Item1")
42+
.cantidad(new BigDecimal("1"))
43+
.precio(new BigDecimal("100"))
44+
.tasaIsc(new BigDecimal("0.1"))
45+
.build()
46+
)
47+
.detalle(DocumentoVentaDetalle.builder()
48+
.descripcion("Item2")
49+
.cantidad(new BigDecimal("2"))
50+
.precio(new BigDecimal("200"))
51+
.tasaIsc(new BigDecimal("0.1"))
52+
.build()
53+
)
54+
.detalle(DocumentoVentaDetalle.builder()
55+
.descripcion("Item3")
56+
.cantidad(new BigDecimal("3"))
57+
.precio(new BigDecimal("300"))
58+
.tasaIsc(new BigDecimal("0.1"))
59+
.build()
60+
)
61+
.detalle(DocumentoVentaDetalle.builder()
62+
.descripcion("Item4")
63+
.cantidad(new BigDecimal("4"))
64+
.precio(new BigDecimal("400"))
65+
.tasaIsc(new BigDecimal("0.1"))
66+
.build()
67+
)
68+
.detalle(DocumentoVentaDetalle.builder()
69+
.descripcion("Item5")
70+
.cantidad(new BigDecimal("5"))
71+
.precio(new BigDecimal("500"))
72+
.tasaIsc(new BigDecimal("0.1"))
73+
.build()
74+
)
75+
.build();
76+
77+
assertInput(input, "factura1Con5Items.xml");
78+
}
79+
80+
@Order(2)
81+
@Test
82+
public void notaDeCreditoDeFactura1() throws Exception {
83+
CreditNote input = CreditNote.builder()
84+
.serie("FF50")
85+
.numero(1)
86+
.moneda("USD")
87+
.comprobanteAfectadoSerieNumero("FF50-1")
88+
.sustentoDescripcion("Homologacion")
89+
.proveedor(HomologacionConstants.proveedor)
90+
.cliente(HomologacionConstants.cliente)
91+
.detalle(DocumentoVentaDetalle.builder()
92+
.descripcion("Item1")
93+
.cantidad(new BigDecimal("1"))
94+
.precio(new BigDecimal("100"))
95+
.tasaIsc(new BigDecimal("0.1"))
96+
.build()
97+
)
98+
.detalle(DocumentoVentaDetalle.builder()
99+
.descripcion("Item2")
100+
.cantidad(new BigDecimal("2"))
101+
.precio(new BigDecimal("200"))
102+
.tasaIsc(new BigDecimal("0.1"))
103+
.build()
104+
)
105+
.detalle(DocumentoVentaDetalle.builder()
106+
.descripcion("Item3")
107+
.cantidad(new BigDecimal("3"))
108+
.precio(new BigDecimal("300"))
109+
.tasaIsc(new BigDecimal("0.1"))
110+
.build()
111+
)
112+
.detalle(DocumentoVentaDetalle.builder()
113+
.descripcion("Item4")
114+
.cantidad(new BigDecimal("4"))
115+
.precio(new BigDecimal("400"))
116+
.tasaIsc(new BigDecimal("0.1"))
117+
.build()
118+
)
119+
.detalle(DocumentoVentaDetalle.builder()
120+
.descripcion("Item5")
121+
.cantidad(new BigDecimal("5"))
122+
.precio(new BigDecimal("500"))
123+
.tasaIsc(new BigDecimal("0.1"))
124+
.build()
125+
)
126+
.build();
127+
128+
assertInput(input, "notaDeCreditoDeFactura1.xml");
129+
}
130+
131+
@Order(3)
132+
@Test
133+
public void notaDeDebitoDeFactura1() throws Exception {
134+
DebitNote input = DebitNote.builder()
135+
.serie("FF50")
136+
.numero(1)
137+
.moneda("USD")
138+
.comprobanteAfectadoSerieNumero("FF50-1")
139+
.sustentoDescripcion("Homologacion")
140+
.proveedor(HomologacionConstants.proveedor)
141+
.cliente(HomologacionConstants.cliente)
142+
.detalle(DocumentoVentaDetalle.builder()
143+
.descripcion("Item1")
144+
.cantidad(new BigDecimal("1"))
145+
.precio(new BigDecimal("100"))
146+
.tasaIsc(new BigDecimal("0.1"))
147+
.build()
148+
)
149+
.detalle(DocumentoVentaDetalle.builder()
150+
.descripcion("Item2")
151+
.cantidad(new BigDecimal("2"))
152+
.precio(new BigDecimal("200"))
153+
.tasaIsc(new BigDecimal("0.1"))
154+
.build()
155+
)
156+
.detalle(DocumentoVentaDetalle.builder()
157+
.descripcion("Item3")
158+
.cantidad(new BigDecimal("3"))
159+
.precio(new BigDecimal("300"))
160+
.tasaIsc(new BigDecimal("0.1"))
161+
.build()
162+
)
163+
.detalle(DocumentoVentaDetalle.builder()
164+
.descripcion("Item4")
165+
.cantidad(new BigDecimal("4"))
166+
.precio(new BigDecimal("400"))
167+
.tasaIsc(new BigDecimal("0.1"))
168+
.build()
169+
)
170+
.detalle(DocumentoVentaDetalle.builder()
171+
.descripcion("Item5")
172+
.cantidad(new BigDecimal("5"))
173+
.precio(new BigDecimal("500"))
174+
.tasaIsc(new BigDecimal("0.1"))
175+
.build()
176+
)
177+
.build();
178+
179+
assertInput(input, "notaDeDebitoDeFactura2.xml");
180+
}
181+
182+
}

0 commit comments

Comments
 (0)