Skip to content
Open
Show file tree
Hide file tree
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ A diferencia de otras soluciones, Project OpenUBL está orientado a ayudarte a c

## Mantente informado

- [Facebook](https://www.facebook.com/Openubl/)
- [Twitter](https://twitter.com/openubl)
- [Blog](/blog)

Expand Down
2 changes: 1 addition & 1 deletion docs/02-design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: Criterios de diseño

- **Fácil integración** - Podrás empezar a usar las herramientas ofrecidas por Project OpenUBL fácilmente ya que no tendrás que aprender todo lo ya implementado dentro de las herramientas.

- **Bajo acoplamiento al lenguaje de programación** - Project OpenUBL ofrece librerias en Java; sin embargo, también ofrece un conjunto de microservicios para que puedas usarlos sin importar el lenguaje de programación que uses.
- **Bajo acoplamiento al lenguaje de programación** - Project OpenUBL ofrece librerias; sin embargo, también ofrece un conjunto de microservicios para que puedas usarlos sin importar el lenguaje de programación que uses.
27 changes: 27 additions & 0 deletions docs/04-xhandler/01-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Introducción
description: Crea, firma, y envia XMLs (comprobantes electrónicos) basados en UBL y según lo requerido por la SUNAT
keywords:
- xhandler
- crea xml
- firma xml
- envia xml
image: img/xbuilder-logo.svg
slug: /xhandler
---

Crea, firma, y envía XMLs

## Documentos soportados

| | Java | Rust |
| ----------------------------------- | ---- | ---- |
| Boleta (Invoice) | ✔ | ✔ |
| Factura (Invoice) | ✔ | ✔ |
| Nota de crédito (CreditNote) | ✔ | ✔ |
| Nota de crédito (CreditNote) | ✔ | ✔ |
| Baja (VoidedDocuments) | ✔ | |
| Resumen diario (SummaryDocuments) | ✔ | |
| Percepción (Perception) | ✔ | |
| Retención (Retention) | ✔ | |
| Guía de remisión (DespatchDocument) | ✔ | |
58 changes: 58 additions & 0 deletions docs/04-xhandler/02-installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Instalación
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<Tabs>
<TabItem value="java" label="Java" default>

## Maven

```xml
<dependency>
<groupId>io.github.project-openubl</groupId>
<artifactId>xhandler</artifactId>
<version>VERSION</version>
</dependency>
```

## Gradle

```java
compile group: 'io.github.project-openubl', name: 'xbuilder', version: 'VERSION'
```

</TabItem>
<TabItem value="rust" label="Rust">

## Crates

Ejecuta el comando Cargo:

```shell
cargo add xbuilder
```

O agrega la siguiente linea a tu Cargo.toml:

```shell
xbuilder = "VERSION"
```

</TabItem>
</Tabs>

## Versión actual

| | |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Java | [![Maven Central](https://img.shields.io/maven-central/v/io.github.project-openubl/xhandler)](https://search.maven.org/artifact/io.github.project-openubl/xhandler/) |
| Rust | [![Crates.io Version](https://img.shields.io/crates/v/xhandler)](https://crates.io/crates/xhandler) |

:::info
Para ver documentación de versiones anteriores visite:

[Previous versions](https://github.com/project-openubl/website/tree/master/archived/docs)
:::
107 changes: 107 additions & 0 deletions docs/04-xhandler/03-create-xml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: Crear XML
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Define el comprobante

<Tabs groupId="code">
<TabItem value="java" label="Java" default>

```java
Invoice input = Invoice
.builder()
.serie("F001")
.numero(1)
.proveedor(Proveedor.builder().ruc("12345678912").razonSocial("Softgreen S.A.C.").build())
.cliente(Cliente.builder()
.nombre("Carlos Feria")
.numeroDocumentoIdentidad("12121212121")
.tipoDocumentoIdentidad(Catalog6.RUC.toString())
.build()
)
.detalle(DocumentoVentaDetalle.builder()
.descripcion("Item1")
.cantidad(new BigDecimal("10"))
.precio(new BigDecimal("100"))
.build()
)
.detalle(DocumentoVentaDetalle.builder()
.descripcion("Item2")
.cantidad(new BigDecimal("10"))
.precio(new BigDecimal("100"))
.build()
)
.build();
```

</TabItem>
<TabItem value="rust" label="Rust">

```rust
let mut invoice = Invoice {
serie_numero: "F001-1",
proveedor: Proveedor {
ruc: "12345678912",
razon_social: "Softgreen S.A.C.",
..Default::default()
},
cliente: Cliente {
tipo_documento_identidad: Catalog6::RUC.code(),
numero_documento_identidad: "12121212121",
nombre: "Carlos Feria",
..Default::default()
},
detalles: vec![
Detalle {
descripcion: "Item1",
cantidad: dec!(10),
precio: Some(dec!(100)),
..Default::default()
},
Detalle {
descripcion: "Item2",
cantidad: dec!(10),
precio: Some(dec!(100)),
..Default::default()
},
],
..Default::default()
};
```

</TabItem>
</Tabs>

## Ejecuta los cálculos automáticos

Configura los valores globales por defecto:

```java
Defaults defaults = Defaults.builder()
.icbTasa(new BigDecimal("0.2"))
.igvTasa(new BigDecimal("0.18"))
.build();
```

Configura el reloj del sistema:

```java
DateProvider dateProvider = () -> LocalDate.of(2019, 12, 24);
```

Ejecuta los calculos automáticos:

```java
ContentEnricher enricher = new ContentEnricher(defaults, dateProvider);
enricher.enrich(input);
```

### Crea el XML

```java
Template template = TemplateProducer.getInstance().getInvoice();
String xml = template.data(input).render();
```
1 change: 1 addition & 0 deletions docs/04-xhandler/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: "XHandler"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const config = {
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ["bash", "java", "scala", "php"],
additionalLanguages: ["bash", "java", "scala", "php", "rust"],
},
algolia: {
appId: "T6D5AOPGJ0",
Expand Down
60 changes: 46 additions & 14 deletions src/components/HomepageFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,14 @@ export default function HomepageFeatures() {
<div className="py-8 px-4 mx-auto max-w-screen-xl sm:py-16 lg:px-6">
<div className="max-w-screen-lg mb-8 lg:mb-16">
<h2 className="mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white">
Librerias Java
Librerias
</h2>
<p className="text-gray-500 sm:text-xl dark:text-gray-400">
Importa las librerias Java en tu propio software, sin importar las
características de tu software (Desktop, Web, etc.). Solo
necesitas utilizar Maven o Gradle.
Importa las librerias en tu propio software, sin importar las
características de tu software (Desktop, Web, etc.).
</p>
</div>
<div className="space-y-8 md:grid md:grid-cols-2 lg:grid-cols-2 md:gap-12 md:space-y-0">
<div className="space-y-8 md:grid md:grid-cols-3 lg:grid-cols-3 md:gap-12 md:space-y-0">
<div>
<div className="flex justify-center items-center mb-4 w-10 h-10 rounded-full bg-primary-100 lg:h-12 lg:w-12 dark:bg-primary-900">
<svg
Expand All @@ -154,13 +153,48 @@ export default function HomepageFeatures() {
></path>
</svg>
</div>
<h3 className="mb-2 text-xl font-bold dark:text-white">
XBuilder
</h3>
<h3 className="mb-2 text-xl font-bold dark:text-white">Crea</h3>
<p className="text-gray-500 dark:text-gray-400">
Crea y firma electrónicamente archivos XMLs basados en UBL y los
estándares de la SUNAT. Soporte para boletas, facturas, notas de
crédito, notas de débito, etc.
Crea archivos XMLs basados en UBL y los estándares de la SUNAT.
</p>
<Link
to="/docs/xbuilder"
className="inline-flex items-center text-xl text-primary-600 hover:text-primary-800 dark:text-primary-500 dark:hover:text-primary-600"
>
Leer más
<svg
className="w-6 h-6"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"
></path>
</svg>
</Link>
</div>
<div>
<div className="flex justify-center items-center mb-4 w-10 h-10 rounded-full bg-primary-100 lg:h-12 lg:w-12 dark:bg-primary-900">
<svg
className="w-5 h-5 text-primary-600 lg:w-6 lg:h-6 dark:text-primary-300"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 0l-2 2a1 1 0 101.414 1.414L8 10.414l1.293 1.293a1 1 0 001.414 0l4-4z"
clip-rule="evenodd"
></path>
</svg>
</div>
<h3 className="mb-2 text-xl font-bold dark:text-white">Firma</h3>
<p className="text-gray-500 dark:text-gray-400">
Firma tus archivos XML usando tus propios certificados
digitales.
</p>
<Link
to="/docs/xbuilder"
Expand Down Expand Up @@ -192,9 +226,7 @@ export default function HomepageFeatures() {
<path d="M10.394 2.08a1 1 0 00-.788 0l-7 3a1 1 0 000 1.84L5.25 8.051a.999.999 0 01.356-.257l4-1.714a1 1 0 11.788 1.838L7.667 9.088l1.94.831a1 1 0 00.787 0l7-3a1 1 0 000-1.838l-7-3zM3.31 9.397L5 10.12v4.102a8.969 8.969 0 00-1.05-.174 1 1 0 01-.89-.89 11.115 11.115 0 01.25-3.762zM9.3 16.573A9.026 9.026 0 007 14.935v-3.957l1.818.78a3 3 0 002.364 0l5.508-2.361a11.026 11.026 0 01.25 3.762 1 1 0 01-.89.89 8.968 8.968 0 00-5.35 2.524 1 1 0 01-1.4 0zM6 18a1 1 0 001-1v-2.065a8.935 8.935 0 00-2-.712V17a1 1 0 001 1z"></path>
</svg>
</div>
<h3 className="mb-2 text-xl font-bold dark:text-white">
XSender
</h3>
<h3 className="mb-2 text-xl font-bold dark:text-white">Envía</h3>
<p className="text-gray-500 dark:text-gray-400">
Envía tus comprobantes electrónicos (archivos XML) a la
SUNAT/OSE de manera sensilla y segura.
Expand Down