From 1236b6cc09d6099b4974008ea1db3797b3836d87 Mon Sep 17 00:00:00 2001 From: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com> Date: Sun, 11 Aug 2024 22:56:43 -0500 Subject: [PATCH] feat: add rust --- .../docs/xbuilder/v5}/01-introduction.md | 0 .../docs/xbuilder/v5}/02-installation.md | 0 .../docs/xbuilder/v5}/03-create-xml.md | 0 .../docs/xbuilder/v5}/04-read-xml.md | 0 .../docs/xbuilder/v5}/05-sign-xml.md | 0 .../docs/xbuilder/v5}/06-qa.md | 0 .../xbuilder/v5}/07-examples/01-invoice.md | 0 .../v5}/07-examples/02-credit-note.md | 0 .../xbuilder/v5}/07-examples/03-debit-note.md | 0 .../v5}/07-examples/04-voided-document.md | 0 .../v5}/07-examples/05-summary-document.md | 0 .../xbuilder/v5}/07-examples/06-perception.md | 0 .../xbuilder/v5}/07-examples/07-retention.md | 0 .../xbuilder/v5}/07-examples/_category_.yml | 0 .../docs/xbuilder/v5}/_category_.yml | 0 .../docs/xsender/v5}/01-introduction.md | 0 .../docs/xsender/v5}/02-installation.md | 0 .../docs/xsender/v5}/03-send-xml.md | 0 .../docs/xsender/v5}/04-validate-and-check.md | 0 .../docs/xsender/v5}/_category_.yml | 0 docs/01-introduction.md | 1 - docs/02-design-principles.md | 2 +- docs/04-xhandler/01-introduction.md | 27 +++++ docs/04-xhandler/02-installation.mdx | 58 ++++++++++ docs/04-xhandler/03-create-xml.mdx | 107 ++++++++++++++++++ docs/04-xhandler/_category_.yml | 1 + .../01-introduction.md | 0 .../02-getting-started.md | 0 .../03-installation/_category_.yml | 0 .../03-installation/java.md | 0 .../03-installation/kubernetes.md | 0 .../04-web-console.md | 0 .../05-security.mdx | 0 .../06-api-integration.mdx | 0 .../_category_.yml | 0 .../01-introduction.md | 0 .../02-getting-started.md | 0 .../03-installation/_category_.yml | 0 .../03-installation/java.md | 0 .../03-installation/kubernetes.md | 0 .../04-web-console.md | 0 docs/{07-ublhub => 06-ublhub}/05-security.mdx | 0 .../06-api-integration.mdx | 0 docs/{07-ublhub => 06-ublhub}/_category_.yml | 0 docusaurus.config.js | 2 +- src/components/HomepageFeatures.js | 60 +++++++--- 46 files changed, 241 insertions(+), 17 deletions(-) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/01-introduction.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/02-installation.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/03-create-xml.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/04-read-xml.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/05-sign-xml.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/06-qa.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/01-invoice.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/02-credit-note.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/03-debit-note.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/04-voided-document.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/05-summary-document.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/06-perception.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/07-retention.md (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/07-examples/_category_.yml (100%) rename {docs/04-xbuilder => archived/docs/xbuilder/v5}/_category_.yml (100%) rename {docs/05-xsender => archived/docs/xsender/v5}/01-introduction.md (100%) rename {docs/05-xsender => archived/docs/xsender/v5}/02-installation.md (100%) rename {docs/05-xsender => archived/docs/xsender/v5}/03-send-xml.md (100%) rename {docs/05-xsender => archived/docs/xsender/v5}/04-validate-and-check.md (100%) rename {docs/05-xsender => archived/docs/xsender/v5}/_category_.yml (100%) create mode 100644 docs/04-xhandler/01-introduction.md create mode 100644 docs/04-xhandler/02-installation.mdx create mode 100644 docs/04-xhandler/03-create-xml.mdx create mode 100644 docs/04-xhandler/_category_.yml rename docs/{06-searchpe => 05-searchpe}/01-introduction.md (100%) rename docs/{06-searchpe => 05-searchpe}/02-getting-started.md (100%) rename docs/{06-searchpe => 05-searchpe}/03-installation/_category_.yml (100%) rename docs/{06-searchpe => 05-searchpe}/03-installation/java.md (100%) rename docs/{06-searchpe => 05-searchpe}/03-installation/kubernetes.md (100%) rename docs/{06-searchpe => 05-searchpe}/04-web-console.md (100%) rename docs/{06-searchpe => 05-searchpe}/05-security.mdx (100%) rename docs/{06-searchpe => 05-searchpe}/06-api-integration.mdx (100%) rename docs/{06-searchpe => 05-searchpe}/_category_.yml (100%) rename docs/{07-ublhub => 06-ublhub}/01-introduction.md (100%) rename docs/{07-ublhub => 06-ublhub}/02-getting-started.md (100%) rename docs/{07-ublhub => 06-ublhub}/03-installation/_category_.yml (100%) rename docs/{07-ublhub => 06-ublhub}/03-installation/java.md (100%) rename docs/{07-ublhub => 06-ublhub}/03-installation/kubernetes.md (100%) rename docs/{07-ublhub => 06-ublhub}/04-web-console.md (100%) rename docs/{07-ublhub => 06-ublhub}/05-security.mdx (100%) rename docs/{07-ublhub => 06-ublhub}/06-api-integration.mdx (100%) rename docs/{07-ublhub => 06-ublhub}/_category_.yml (100%) diff --git a/docs/04-xbuilder/01-introduction.md b/archived/docs/xbuilder/v5/01-introduction.md similarity index 100% rename from docs/04-xbuilder/01-introduction.md rename to archived/docs/xbuilder/v5/01-introduction.md diff --git a/docs/04-xbuilder/02-installation.md b/archived/docs/xbuilder/v5/02-installation.md similarity index 100% rename from docs/04-xbuilder/02-installation.md rename to archived/docs/xbuilder/v5/02-installation.md diff --git a/docs/04-xbuilder/03-create-xml.md b/archived/docs/xbuilder/v5/03-create-xml.md similarity index 100% rename from docs/04-xbuilder/03-create-xml.md rename to archived/docs/xbuilder/v5/03-create-xml.md diff --git a/docs/04-xbuilder/04-read-xml.md b/archived/docs/xbuilder/v5/04-read-xml.md similarity index 100% rename from docs/04-xbuilder/04-read-xml.md rename to archived/docs/xbuilder/v5/04-read-xml.md diff --git a/docs/04-xbuilder/05-sign-xml.md b/archived/docs/xbuilder/v5/05-sign-xml.md similarity index 100% rename from docs/04-xbuilder/05-sign-xml.md rename to archived/docs/xbuilder/v5/05-sign-xml.md diff --git a/docs/04-xbuilder/06-qa.md b/archived/docs/xbuilder/v5/06-qa.md similarity index 100% rename from docs/04-xbuilder/06-qa.md rename to archived/docs/xbuilder/v5/06-qa.md diff --git a/docs/04-xbuilder/07-examples/01-invoice.md b/archived/docs/xbuilder/v5/07-examples/01-invoice.md similarity index 100% rename from docs/04-xbuilder/07-examples/01-invoice.md rename to archived/docs/xbuilder/v5/07-examples/01-invoice.md diff --git a/docs/04-xbuilder/07-examples/02-credit-note.md b/archived/docs/xbuilder/v5/07-examples/02-credit-note.md similarity index 100% rename from docs/04-xbuilder/07-examples/02-credit-note.md rename to archived/docs/xbuilder/v5/07-examples/02-credit-note.md diff --git a/docs/04-xbuilder/07-examples/03-debit-note.md b/archived/docs/xbuilder/v5/07-examples/03-debit-note.md similarity index 100% rename from docs/04-xbuilder/07-examples/03-debit-note.md rename to archived/docs/xbuilder/v5/07-examples/03-debit-note.md diff --git a/docs/04-xbuilder/07-examples/04-voided-document.md b/archived/docs/xbuilder/v5/07-examples/04-voided-document.md similarity index 100% rename from docs/04-xbuilder/07-examples/04-voided-document.md rename to archived/docs/xbuilder/v5/07-examples/04-voided-document.md diff --git a/docs/04-xbuilder/07-examples/05-summary-document.md b/archived/docs/xbuilder/v5/07-examples/05-summary-document.md similarity index 100% rename from docs/04-xbuilder/07-examples/05-summary-document.md rename to archived/docs/xbuilder/v5/07-examples/05-summary-document.md diff --git a/docs/04-xbuilder/07-examples/06-perception.md b/archived/docs/xbuilder/v5/07-examples/06-perception.md similarity index 100% rename from docs/04-xbuilder/07-examples/06-perception.md rename to archived/docs/xbuilder/v5/07-examples/06-perception.md diff --git a/docs/04-xbuilder/07-examples/07-retention.md b/archived/docs/xbuilder/v5/07-examples/07-retention.md similarity index 100% rename from docs/04-xbuilder/07-examples/07-retention.md rename to archived/docs/xbuilder/v5/07-examples/07-retention.md diff --git a/docs/04-xbuilder/07-examples/_category_.yml b/archived/docs/xbuilder/v5/07-examples/_category_.yml similarity index 100% rename from docs/04-xbuilder/07-examples/_category_.yml rename to archived/docs/xbuilder/v5/07-examples/_category_.yml diff --git a/docs/04-xbuilder/_category_.yml b/archived/docs/xbuilder/v5/_category_.yml similarity index 100% rename from docs/04-xbuilder/_category_.yml rename to archived/docs/xbuilder/v5/_category_.yml diff --git a/docs/05-xsender/01-introduction.md b/archived/docs/xsender/v5/01-introduction.md similarity index 100% rename from docs/05-xsender/01-introduction.md rename to archived/docs/xsender/v5/01-introduction.md diff --git a/docs/05-xsender/02-installation.md b/archived/docs/xsender/v5/02-installation.md similarity index 100% rename from docs/05-xsender/02-installation.md rename to archived/docs/xsender/v5/02-installation.md diff --git a/docs/05-xsender/03-send-xml.md b/archived/docs/xsender/v5/03-send-xml.md similarity index 100% rename from docs/05-xsender/03-send-xml.md rename to archived/docs/xsender/v5/03-send-xml.md diff --git a/docs/05-xsender/04-validate-and-check.md b/archived/docs/xsender/v5/04-validate-and-check.md similarity index 100% rename from docs/05-xsender/04-validate-and-check.md rename to archived/docs/xsender/v5/04-validate-and-check.md diff --git a/docs/05-xsender/_category_.yml b/archived/docs/xsender/v5/_category_.yml similarity index 100% rename from docs/05-xsender/_category_.yml rename to archived/docs/xsender/v5/_category_.yml diff --git a/docs/01-introduction.md b/docs/01-introduction.md index 435d548..2f5155d 100644 --- a/docs/01-introduction.md +++ b/docs/01-introduction.md @@ -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) diff --git a/docs/02-design-principles.md b/docs/02-design-principles.md index 3d36320..8fe1dfc 100644 --- a/docs/02-design-principles.md +++ b/docs/02-design-principles.md @@ -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. diff --git a/docs/04-xhandler/01-introduction.md b/docs/04-xhandler/01-introduction.md new file mode 100644 index 0000000..2b5edda --- /dev/null +++ b/docs/04-xhandler/01-introduction.md @@ -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) | ✔ | | diff --git a/docs/04-xhandler/02-installation.mdx b/docs/04-xhandler/02-installation.mdx new file mode 100644 index 0000000..6550086 --- /dev/null +++ b/docs/04-xhandler/02-installation.mdx @@ -0,0 +1,58 @@ +--- +title: Instalación +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + +## Maven + +```xml + + io.github.project-openubl + xhandler + VERSION + +``` + +## Gradle + +```java +compile group: 'io.github.project-openubl', name: 'xbuilder', version: 'VERSION' +``` + + + + +## Crates + +Ejecuta el comando Cargo: + +```shell +cargo add xbuilder +``` + +O agrega la siguiente linea a tu Cargo.toml: + +```shell +xbuilder = "VERSION" +``` + + + + +## 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) +::: diff --git a/docs/04-xhandler/03-create-xml.mdx b/docs/04-xhandler/03-create-xml.mdx new file mode 100644 index 0000000..1b97c60 --- /dev/null +++ b/docs/04-xhandler/03-create-xml.mdx @@ -0,0 +1,107 @@ +--- +title: Crear XML +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +## Define el comprobante + + + + +```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(); +``` + + + + +```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() +}; +``` + + + + +## 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(); +``` diff --git a/docs/04-xhandler/_category_.yml b/docs/04-xhandler/_category_.yml new file mode 100644 index 0000000..02bbc9c --- /dev/null +++ b/docs/04-xhandler/_category_.yml @@ -0,0 +1 @@ +label: "XHandler" diff --git a/docs/06-searchpe/01-introduction.md b/docs/05-searchpe/01-introduction.md similarity index 100% rename from docs/06-searchpe/01-introduction.md rename to docs/05-searchpe/01-introduction.md diff --git a/docs/06-searchpe/02-getting-started.md b/docs/05-searchpe/02-getting-started.md similarity index 100% rename from docs/06-searchpe/02-getting-started.md rename to docs/05-searchpe/02-getting-started.md diff --git a/docs/06-searchpe/03-installation/_category_.yml b/docs/05-searchpe/03-installation/_category_.yml similarity index 100% rename from docs/06-searchpe/03-installation/_category_.yml rename to docs/05-searchpe/03-installation/_category_.yml diff --git a/docs/06-searchpe/03-installation/java.md b/docs/05-searchpe/03-installation/java.md similarity index 100% rename from docs/06-searchpe/03-installation/java.md rename to docs/05-searchpe/03-installation/java.md diff --git a/docs/06-searchpe/03-installation/kubernetes.md b/docs/05-searchpe/03-installation/kubernetes.md similarity index 100% rename from docs/06-searchpe/03-installation/kubernetes.md rename to docs/05-searchpe/03-installation/kubernetes.md diff --git a/docs/06-searchpe/04-web-console.md b/docs/05-searchpe/04-web-console.md similarity index 100% rename from docs/06-searchpe/04-web-console.md rename to docs/05-searchpe/04-web-console.md diff --git a/docs/06-searchpe/05-security.mdx b/docs/05-searchpe/05-security.mdx similarity index 100% rename from docs/06-searchpe/05-security.mdx rename to docs/05-searchpe/05-security.mdx diff --git a/docs/06-searchpe/06-api-integration.mdx b/docs/05-searchpe/06-api-integration.mdx similarity index 100% rename from docs/06-searchpe/06-api-integration.mdx rename to docs/05-searchpe/06-api-integration.mdx diff --git a/docs/06-searchpe/_category_.yml b/docs/05-searchpe/_category_.yml similarity index 100% rename from docs/06-searchpe/_category_.yml rename to docs/05-searchpe/_category_.yml diff --git a/docs/07-ublhub/01-introduction.md b/docs/06-ublhub/01-introduction.md similarity index 100% rename from docs/07-ublhub/01-introduction.md rename to docs/06-ublhub/01-introduction.md diff --git a/docs/07-ublhub/02-getting-started.md b/docs/06-ublhub/02-getting-started.md similarity index 100% rename from docs/07-ublhub/02-getting-started.md rename to docs/06-ublhub/02-getting-started.md diff --git a/docs/07-ublhub/03-installation/_category_.yml b/docs/06-ublhub/03-installation/_category_.yml similarity index 100% rename from docs/07-ublhub/03-installation/_category_.yml rename to docs/06-ublhub/03-installation/_category_.yml diff --git a/docs/07-ublhub/03-installation/java.md b/docs/06-ublhub/03-installation/java.md similarity index 100% rename from docs/07-ublhub/03-installation/java.md rename to docs/06-ublhub/03-installation/java.md diff --git a/docs/07-ublhub/03-installation/kubernetes.md b/docs/06-ublhub/03-installation/kubernetes.md similarity index 100% rename from docs/07-ublhub/03-installation/kubernetes.md rename to docs/06-ublhub/03-installation/kubernetes.md diff --git a/docs/07-ublhub/04-web-console.md b/docs/06-ublhub/04-web-console.md similarity index 100% rename from docs/07-ublhub/04-web-console.md rename to docs/06-ublhub/04-web-console.md diff --git a/docs/07-ublhub/05-security.mdx b/docs/06-ublhub/05-security.mdx similarity index 100% rename from docs/07-ublhub/05-security.mdx rename to docs/06-ublhub/05-security.mdx diff --git a/docs/07-ublhub/06-api-integration.mdx b/docs/06-ublhub/06-api-integration.mdx similarity index 100% rename from docs/07-ublhub/06-api-integration.mdx rename to docs/06-ublhub/06-api-integration.mdx diff --git a/docs/07-ublhub/_category_.yml b/docs/06-ublhub/_category_.yml similarity index 100% rename from docs/07-ublhub/_category_.yml rename to docs/06-ublhub/_category_.yml diff --git a/docusaurus.config.js b/docusaurus.config.js index 17468e1..ec81615 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -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", diff --git a/src/components/HomepageFeatures.js b/src/components/HomepageFeatures.js index be7c9a3..3bead0e 100644 --- a/src/components/HomepageFeatures.js +++ b/src/components/HomepageFeatures.js @@ -130,15 +130,14 @@ export default function HomepageFeatures() {

- Librerias Java + Librerias

- 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.).

-
+
-

- XBuilder -

+

Crea

- 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. +

+ + Leer más + + + + +
+
+
+ + + +
+

Firma

+

+ Firma tus archivos XML usando tus propios certificados + digitales.

-

- XSender -

+

Envía

Envía tus comprobantes electrónicos (archivos XML) a la SUNAT/OSE de manera sensilla y segura.