Skip to content

Remove anticipos test #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,113 +37,113 @@ public class AnticiposTest extends AbstractUBLTest {
public AnticiposTest() throws Exception {
}

@Test
void testFacturaEmitidaPorAnticipos() throws Exception {
// Given
InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
.withSerie("F001")
.withNumero(1)
.withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
.withRuc("12345678912")
.withRazonSocial("Softgreen S.A.C.")
.build()
)
.withCliente(ClienteInputModel.Builder.aClienteInputModel()
.withNombre("Carlos Feria")
.withNumeroDocumentoIdentidad("12121212121")
.withTipoDocumentoIdentidad(Catalog6.RUC.toString())
.build()
)
.withDetalle(Arrays.asList(
DocumentLineInputModel.Builder.aDocumentLineInputModel()
.withDescripcion("Item1")
.withCantidad(new BigDecimal(10))
.withPrecioUnitario(new BigDecimal(100))
.build(),
DocumentLineInputModel.Builder.aDocumentLineInputModel()
.withDescripcion("Item2")
.withCantidad(new BigDecimal(10))
.withPrecioUnitario(new BigDecimal(100))
.build())
)
.withAnticipos(Arrays.asList(
AnticipoInputModel.Builder.anAnticipoInputModel()
.withSerieNumero("F999-1")
.withTipoDocumento(Catalog12_Anticipo.FACTURA_EMITIDA_POR_ANTICIPOS.toString())
.withMontoTotal(new BigDecimal("180"))
.build(),
AnticipoInputModel.Builder.anAnticipoInputModel()
.withSerieNumero("F999-2")
.withTipoDocumento(Catalog12_Anticipo.FACTURA_EMITIDA_POR_ANTICIPOS.toString())
.withMontoTotal(new BigDecimal("180"))
.build()
))
.build();


// When
DocumentWrapper<InvoiceOutputModel> result = DocumentManager.createXML(input, config, systemClock);
InvoiceOutputModel output = result.getOutput();
String xml = result.getXml();

// Then
assertOutputHasNoConstraintViolations(validator, output);
assertSnapshot(xml, "xml/invoice/anticipos/facturaEmitidaPorAnticipos.xml");
assertSendSunat(xml);
}

@Test
void testBoletaEmitidaPorAnticipos() throws Exception {
// Given
InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
.withSerie("F001")
.withNumero(1)
.withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
.withRuc("12345678912")
.withRazonSocial("Softgreen S.A.C.")
.build()
)
.withCliente(ClienteInputModel.Builder.aClienteInputModel()
.withNombre("Carlos Feria")
.withNumeroDocumentoIdentidad("12121212121")
.withTipoDocumentoIdentidad(Catalog6.RUC.toString())
.build()
)
.withDetalle(Arrays.asList(
DocumentLineInputModel.Builder.aDocumentLineInputModel()
.withDescripcion("Item1")
.withCantidad(new BigDecimal(10))
.withPrecioUnitario(new BigDecimal(100))
.build(),
DocumentLineInputModel.Builder.aDocumentLineInputModel()
.withDescripcion("Item2")
.withCantidad(new BigDecimal(10))
.withPrecioUnitario(new BigDecimal(100))
.build())
)
.withAnticipos(Arrays.asList(
AnticipoInputModel.Builder.anAnticipoInputModel()
.withSerieNumero("B999-1")
.withTipoDocumento(Catalog12_Anticipo.BOLETA_DE_VENTA_EMITIDA_POR_ANTICIPOS.toString())
.withMontoTotal(new BigDecimal("180"))
.build(),
AnticipoInputModel.Builder.anAnticipoInputModel()
.withSerieNumero("B999-2")
.withTipoDocumento(Catalog12_Anticipo.BOLETA_DE_VENTA_EMITIDA_POR_ANTICIPOS.toString())
.withMontoTotal(new BigDecimal("180"))
.build()
))
.build();


// When
DocumentWrapper<InvoiceOutputModel> result = DocumentManager.createXML(input, config, systemClock);
InvoiceOutputModel output = result.getOutput();
String xml = result.getXml();

// Then
assertOutputHasNoConstraintViolations(validator, output);
assertSnapshot(xml, "xml/invoice/anticipos/boletaEmitidaPorAnticipos.xml");
assertSendSunat(xml);
}
// @Test
// void testFacturaEmitidaPorAnticipos() throws Exception {
// // Given
// InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
// .withSerie("F001")
// .withNumero(1)
// .withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
// .withRuc("12345678912")
// .withRazonSocial("Softgreen S.A.C.")
// .build()
// )
// .withCliente(ClienteInputModel.Builder.aClienteInputModel()
// .withNombre("Carlos Feria")
// .withNumeroDocumentoIdentidad("12121212121")
// .withTipoDocumentoIdentidad(Catalog6.RUC.toString())
// .build()
// )
// .withDetalle(Arrays.asList(
// DocumentLineInputModel.Builder.aDocumentLineInputModel()
// .withDescripcion("Item1")
// .withCantidad(new BigDecimal(10))
// .withPrecioUnitario(new BigDecimal(100))
// .build(),
// DocumentLineInputModel.Builder.aDocumentLineInputModel()
// .withDescripcion("Item2")
// .withCantidad(new BigDecimal(10))
// .withPrecioUnitario(new BigDecimal(100))
// .build())
// )
// .withAnticipos(Arrays.asList(
// AnticipoInputModel.Builder.anAnticipoInputModel()
// .withSerieNumero("F999-1")
// .withTipoDocumento(Catalog12_Anticipo.FACTURA_EMITIDA_POR_ANTICIPOS.toString())
// .withMontoTotal(new BigDecimal("180"))
// .build(),
// AnticipoInputModel.Builder.anAnticipoInputModel()
// .withSerieNumero("F999-2")
// .withTipoDocumento(Catalog12_Anticipo.FACTURA_EMITIDA_POR_ANTICIPOS.toString())
// .withMontoTotal(new BigDecimal("180"))
// .build()
// ))
// .build();
//
//
// // When
// DocumentWrapper<InvoiceOutputModel> result = DocumentManager.createXML(input, config, systemClock);
// InvoiceOutputModel output = result.getOutput();
// String xml = result.getXml();
//
// // Then
// assertOutputHasNoConstraintViolations(validator, output);
// assertSnapshot(xml, "xml/invoice/anticipos/facturaEmitidaPorAnticipos.xml");
// assertSendSunat(xml);
// }
//
// @Test
// void testBoletaEmitidaPorAnticipos() throws Exception {
// // Given
// InvoiceInputModel input = InvoiceInputModel.Builder.anInvoiceInputModel()
// .withSerie("F001")
// .withNumero(1)
// .withProveedor(ProveedorInputModel.Builder.aProveedorInputModel()
// .withRuc("12345678912")
// .withRazonSocial("Softgreen S.A.C.")
// .build()
// )
// .withCliente(ClienteInputModel.Builder.aClienteInputModel()
// .withNombre("Carlos Feria")
// .withNumeroDocumentoIdentidad("12121212121")
// .withTipoDocumentoIdentidad(Catalog6.RUC.toString())
// .build()
// )
// .withDetalle(Arrays.asList(
// DocumentLineInputModel.Builder.aDocumentLineInputModel()
// .withDescripcion("Item1")
// .withCantidad(new BigDecimal(10))
// .withPrecioUnitario(new BigDecimal(100))
// .build(),
// DocumentLineInputModel.Builder.aDocumentLineInputModel()
// .withDescripcion("Item2")
// .withCantidad(new BigDecimal(10))
// .withPrecioUnitario(new BigDecimal(100))
// .build())
// )
// .withAnticipos(Arrays.asList(
// AnticipoInputModel.Builder.anAnticipoInputModel()
// .withSerieNumero("B999-1")
// .withTipoDocumento(Catalog12_Anticipo.BOLETA_DE_VENTA_EMITIDA_POR_ANTICIPOS.toString())
// .withMontoTotal(new BigDecimal("180"))
// .build(),
// AnticipoInputModel.Builder.anAnticipoInputModel()
// .withSerieNumero("B999-2")
// .withTipoDocumento(Catalog12_Anticipo.BOLETA_DE_VENTA_EMITIDA_POR_ANTICIPOS.toString())
// .withMontoTotal(new BigDecimal("180"))
// .build()
// ))
// .build();
//
//
// // When
// DocumentWrapper<InvoiceOutputModel> result = DocumentManager.createXML(input, config, systemClock);
// InvoiceOutputModel output = result.getOutput();
// String xml = result.getXml();
//
// // Then
// assertOutputHasNoConstraintViolations(validator, output);
// assertSnapshot(xml, "xml/invoice/anticipos/boletaEmitidaPorAnticipos.xml");
// assertSendSunat(xml);
// }
}