From 51d288a8d27857519dbd83becf1ba29b4cb5e97e Mon Sep 17 00:00:00 2001
From: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com>
Date: Sun, 16 Apr 2023 16:52:15 +0200
Subject: [PATCH 1/2] XML CDATA set raw content
---
.../main/resources/templates/Renderer/creditNote.xml | 2 +-
.../main/resources/templates/Renderer/debitNote.xml | 2 +-
.../resources/templates/Renderer/despatchAdvice.xml | 12 ++++++------
.../main/resources/templates/Renderer/invoice.xml | 4 ++--
.../main/resources/templates/Renderer/perception.xml | 2 +-
.../main/resources/templates/Renderer/retention.xml | 2 +-
.../resources/templates/ubl/common/signature.xml | 2 +-
.../templates/ubl/standard/include/address.xml | 2 +-
.../templates/ubl/standard/include/customer.xml | 2 +-
.../templates/ubl/standard/include/document-line.xml | 4 ++--
.../ubl/standard/include/note/invoice-reference.xml | 2 +-
.../templates/ubl/standard/include/supplier.xml | 2 +-
.../templates/ubl/sunat/include/agent-party.xml | 4 ++--
.../templates/ubl/sunat/include/receiver-party.xml | 2 +-
.../templates/ubl/sunat/include/supplier.xml | 2 +-
15 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/core/src/main/resources/templates/Renderer/creditNote.xml b/core/src/main/resources/templates/Renderer/creditNote.xml
index a268d348..91d0f406 100644
--- a/core/src/main/resources/templates/Renderer/creditNote.xml
+++ b/core/src/main/resources/templates/Renderer/creditNote.xml
@@ -5,7 +5,7 @@
{#include ubl/standard/include/ubl-extensions.xml /}
{#include ubl/standard/include/general-data.xml item=this /}
{#for key in leyendas.keySet}
-
+
{/for}
{moneda}
{#include "ubl/standard/include/note/invoice-reference.xml" item=this /}
diff --git a/core/src/main/resources/templates/Renderer/debitNote.xml b/core/src/main/resources/templates/Renderer/debitNote.xml
index bc4fdaeb..f0e8fdfe 100644
--- a/core/src/main/resources/templates/Renderer/debitNote.xml
+++ b/core/src/main/resources/templates/Renderer/debitNote.xml
@@ -5,7 +5,7 @@
{#include ubl/standard/include/ubl-extensions.xml /}
{#include ubl/standard/include/general-data.xml item=this /}
{#for key in leyendas.keySet}
-
+
{/for}
{moneda}
{#include "ubl/standard/include/note/invoice-reference.xml" item=this /}
diff --git a/core/src/main/resources/templates/Renderer/despatchAdvice.xml b/core/src/main/resources/templates/Renderer/despatchAdvice.xml
index 3d220ca4..a37cf7ef 100644
--- a/core/src/main/resources/templates/Renderer/despatchAdvice.xml
+++ b/core/src/main/resources/templates/Renderer/despatchAdvice.xml
@@ -9,7 +9,7 @@
{#include ubl/standard/include/general-data.xml item=this /}
{tipoComprobante}
{#if observaciones}
-
+
{/if}
{#if documentoBaja}
@@ -31,7 +31,7 @@
{remitente.ruc}
-
+
@@ -41,7 +41,7 @@
{destinatario.numeroDocumentoIdentidad}
-
+
@@ -50,7 +50,7 @@
{proveedor.ruc}
-
+
@@ -77,7 +77,7 @@
{envio.transportista.numeroDocumentoIdentidad}
-
+
@@ -123,7 +123,7 @@
{it_index.add(1)}
-
+
{it.codigo}
diff --git a/core/src/main/resources/templates/Renderer/invoice.xml b/core/src/main/resources/templates/Renderer/invoice.xml
index fa3ac8d4..2e037f0d 100644
--- a/core/src/main/resources/templates/Renderer/invoice.xml
+++ b/core/src/main/resources/templates/Renderer/invoice.xml
@@ -10,11 +10,11 @@
{tipoComprobante}
{#if leyendas}
{#for key in leyendas.keySet}
-
+
{/for}
{/if}
{#if observaciones}
-
+
{/if}
{moneda}
{#if ordenDeCompra}
diff --git a/core/src/main/resources/templates/Renderer/perception.xml b/core/src/main/resources/templates/Renderer/perception.xml
index d923ef08..653c7606 100644
--- a/core/src/main/resources/templates/Renderer/perception.xml
+++ b/core/src/main/resources/templates/Renderer/perception.xml
@@ -24,7 +24,7 @@
{tipoRegimen}
{tipoRegimenPorcentaje}
{#if observacion}
-
+
{/if}
{importeTotalPercibido}
{importeTotalCobrado}
diff --git a/core/src/main/resources/templates/Renderer/retention.xml b/core/src/main/resources/templates/Renderer/retention.xml
index 1a44f28e..b78f7497 100644
--- a/core/src/main/resources/templates/Renderer/retention.xml
+++ b/core/src/main/resources/templates/Renderer/retention.xml
@@ -24,7 +24,7 @@
{tipoRegimen}
{tipoRegimenPorcentaje}
{#if observacion}
-
+
{/if}
{importeTotalRetenido}
{importeTotalPagado}
diff --git a/core/src/main/resources/templates/ubl/common/signature.xml b/core/src/main/resources/templates/ubl/common/signature.xml
index 96109f95..18dc6461 100644
--- a/core/src/main/resources/templates/ubl/common/signature.xml
+++ b/core/src/main/resources/templates/ubl/common/signature.xml
@@ -5,7 +5,7 @@
{firmante.ruc}
-
+
diff --git a/core/src/main/resources/templates/ubl/standard/include/address.xml b/core/src/main/resources/templates/ubl/standard/include/address.xml
index d9866108..27368e0f 100644
--- a/core/src/main/resources/templates/ubl/standard/include/address.xml
+++ b/core/src/main/resources/templates/ubl/standard/include/address.xml
@@ -18,7 +18,7 @@
{/if}
{#if direccion.direccion}
-
+
{/if}
{#if direccion.codigoPais}
diff --git a/core/src/main/resources/templates/ubl/standard/include/customer.xml b/core/src/main/resources/templates/ubl/standard/include/customer.xml
index ae7bb59c..a17b9b9b 100644
--- a/core/src/main/resources/templates/ubl/standard/include/customer.xml
+++ b/core/src/main/resources/templates/ubl/standard/include/customer.xml
@@ -4,7 +4,7 @@
{cliente.numeroDocumentoIdentidad}
-
+
{#if cliente.direccion}
{#include ubl/standard/include/address.xml direccion=cliente.direccion /}
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 762dafc4..90c9db0d 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
@@ -16,7 +16,7 @@
{item.iscBaseImponible.scale(2)}
{item.isc.scale(2)}
- {item.tasaIsc.multiply(100)}
+ {item.tasaIsc.multiplyByInt(100).scale(2)}
{item.iscTipo}
2000
@@ -56,7 +56,7 @@
{/if}
-
+
{item.precio.scale(2)}
diff --git a/core/src/main/resources/templates/ubl/standard/include/note/invoice-reference.xml b/core/src/main/resources/templates/ubl/standard/include/note/invoice-reference.xml
index 26d35a10..de08fff8 100644
--- a/core/src/main/resources/templates/ubl/standard/include/note/invoice-reference.xml
+++ b/core/src/main/resources/templates/ubl/standard/include/note/invoice-reference.xml
@@ -1,7 +1,7 @@
{item.comprobanteAfectadoSerieNumero}
{item.comprobanteAfectadoTipo}
-
+
{#if item.ordenDeCompra}
diff --git a/core/src/main/resources/templates/ubl/standard/include/supplier.xml b/core/src/main/resources/templates/ubl/standard/include/supplier.xml
index da6265ac..44337fbf 100644
--- a/core/src/main/resources/templates/ubl/standard/include/supplier.xml
+++ b/core/src/main/resources/templates/ubl/standard/include/supplier.xml
@@ -9,7 +9,7 @@
{/if}
-
+
{#if proveedor.direccion}
{#include ubl/standard/include/address.xml direccion=proveedor.direccion /}
diff --git a/core/src/main/resources/templates/ubl/sunat/include/agent-party.xml b/core/src/main/resources/templates/ubl/sunat/include/agent-party.xml
index 1c801657..4d887f11 100644
--- a/core/src/main/resources/templates/ubl/sunat/include/agent-party.xml
+++ b/core/src/main/resources/templates/ubl/sunat/include/agent-party.xml
@@ -4,10 +4,10 @@
{#if proveedor.nombreComercial}
-
+
{/if}
-
+
diff --git a/core/src/main/resources/templates/ubl/sunat/include/receiver-party.xml b/core/src/main/resources/templates/ubl/sunat/include/receiver-party.xml
index 442200a5..0521d8bd 100644
--- a/core/src/main/resources/templates/ubl/sunat/include/receiver-party.xml
+++ b/core/src/main/resources/templates/ubl/sunat/include/receiver-party.xml
@@ -3,6 +3,6 @@
{cliente.numeroDocumentoIdentidad}
-
+
diff --git a/core/src/main/resources/templates/ubl/sunat/include/supplier.xml b/core/src/main/resources/templates/ubl/sunat/include/supplier.xml
index 7f433137..6d72d7f7 100644
--- a/core/src/main/resources/templates/ubl/sunat/include/supplier.xml
+++ b/core/src/main/resources/templates/ubl/sunat/include/supplier.xml
@@ -3,7 +3,7 @@
6
-
+
From 05e2d6c07bbfe2170520715bbbcedb619cabfbdb Mon Sep 17 00:00:00 2001
From: carlosthe19916 <2582866+carlosthe19916@users.noreply.github.com>
Date: Sun, 16 Apr 2023 16:54:30 +0200
Subject: [PATCH 2/2] Fix XMLTypes
---
.../openubl/xbuilder/content/jaxb/models/XMLDebitNoteLine.java | 2 +-
.../openubl/xbuilder/content/jaxb/models/XMLSalesDocument.java | 1 +
.../openubl/xbuilder/content/jaxb/models/XMLSunatDocument.java | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLDebitNoteLine.java b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLDebitNoteLine.java
index eac67db3..9541618d 100644
--- a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLDebitNoteLine.java
+++ b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLDebitNoteLine.java
@@ -38,7 +38,7 @@ public class XMLDebitNoteLine extends XMLSalesDocumentLine {
private Quantity quantity;
@XmlAccessorType(XmlAccessType.NONE)
- @XmlType(name = "DebitnOTEDocumentLine.Quantity")
+ @XmlType(name = "DebitNoteDocumentLine.Quantity")
@Data
@NoArgsConstructor
public static class Quantity {
diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSalesDocument.java b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSalesDocument.java
index 67a998a1..972867d4 100644
--- a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSalesDocument.java
+++ b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSalesDocument.java
@@ -33,6 +33,7 @@
import java.time.LocalTime;
import java.util.List;
+@XmlType(name = "SalesDocument")
@XmlAccessorType(XmlAccessType.NONE)
@Data
@NoArgsConstructor
diff --git a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSunatDocument.java b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSunatDocument.java
index 4eec3327..5c437281 100644
--- a/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSunatDocument.java
+++ b/core/src/main/java/io/github/project/openubl/xbuilder/content/jaxb/models/XMLSunatDocument.java
@@ -23,9 +23,11 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.time.LocalDate;
+@XmlType(name = "SunatDocument")
@XmlAccessorType(XmlAccessType.NONE)
@Data
@NoArgsConstructor