State Internal Taxes

Hello my query is the following:
In my country there is a tax return format, the cuel must be sent in xml format, my question is if there is any way to generate a monthly report that throw the results in this format xml.

Yes, Data Exports support formatting data in nearly any fashion, including XML.

Not going to read up on your local tax but scripts have ability to post in xml format if your looking to sync with gov portal or something like that.
You will undoubtably be able to do something for this but you will be better off posting a sample/example xml as expected by your gov and details on how your tax is setup in samba.

1 Like

schema_libro_bol.zip (3,4 KB)

Can’t open zip on phone.
I meant copy and paste sample and use the code tool to keep formatting on forum.
XML is just another formatting code so it will be something fairly standard.
As I said scripts have XML post helper so if what your trying to do is post to gov portal can do that way.
If nothing else a script could be used to save to text file but sure whatever you need is likely sortable but you didn’t answer the question as to how you want to use the XML

Ok the xml is very long and i can’t post entire code, but this is a part of it

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema targetNamespace="http://www.sii.cl/SiiDte" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SiiDte="http://www.sii.cl/SiiDte" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:SiiLce="http://www.sii.cl/SiiLce" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!--  Modificacion 31/10/2007 11:18 	 Restricciones a FchDoc (rango de validez 2000 al 2050)
	       Modificación 08/01/2008   9:17     CdgSIISucur de 8 a 9 digitos
	       Modificación 21/08/2008  15:08    FolioNotificacion de 18 a 10 digitos
              Modificación 19/03/2010 12:10     Se agrega al impuesto (53) retenido a los suplementeros
              Modificación 11/06/2010 10:05	 Se incrementa caracteres de NumId de 15 a 20 (receptor extranjero)
              Modificación 30/07/10     15:00 	  Se limita a 30.000 documentos el máximo por envio o sobre (de 											   acuerdo a publicación)
		Modificación 14/02/2011 10:50	 Se incorpora la Factura de Inicio (TpoDoc = 29)
		Modificación 02/03/2011 12:40	 Se elimina limitacion a 30.000 documentos (detalles).
 -->
	<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsignature_v10.xsd"/>
	<xs:import namespace="http://www.sii.cl/SiiLce" schemaLocation="LceCoCertif_v10.xsd"/>
	<xs:element name="LibroCompraVenta">
		<xs:annotation>
			<xs:documentation>Informacion Electronica de Libros de Compra y Venta</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="EnvioLibro">
					<xs:annotation>
						<xs:documentation>Identificacion, Resumen y Detalles del Libro Electronico</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Caratula">
								<xs:annotation>
									<xs:documentation>Identificacion del Envio del Libro Electronico</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="RutEmisorLibro" type="SiiDte:RUTType">
											<xs:annotation>
												<xs:documentation>RUT del Emisor del Libro Electronico</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="RutEnvia" type="SiiDte:RUTType">
											<xs:annotation>
												<xs:documentation>RUT que Realiza el Envio del Libro Electronico</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="PeriodoTributario" type="xs:gYearMonth">
											<xs:annotation>
												<xs:documentation>Periodo Tributario del Libro Electronico (AAAA-MM)</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="FchResol" type="xs:date">
											<xs:annotation>
												<xs:documentation>Fecha de Resolucion que Autoriza el Envio de Libros (AAAA-MM-DD)</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="NroResol">
											<xs:annotation>
												<xs:documentation>Numero de Resolucion que Autoriza el Envio de Libros</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:nonNegativeInteger">
													<xs:totalDigits value="6"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="TipoOperacion">
											<xs:annotation>
												<xs:documentation>Tipo de Operacion Declarada en el Libro</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:enumeration value="COMPRA"/>
													<xs:enumeration value="VENTA"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="TipoLibro">
											<xs:annotation>
												<xs:documentation>Tipo de Libro de Compra o Venta Enviado</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:enumeration value="MENSUAL"/>
													<xs:enumeration value="ESPECIAL"/>
													<xs:enumeration value="RECTIFICA"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="TipoEnvio">
											<xs:annotation>
												<xs:documentation>Tipo de Envio del Libro Electronico</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:minLength value="5"/>
													<xs:enumeration value="PARCIAL">
														<xs:annotation>
															<xs:documentation>Indica que es un Envio Parcial del Libro y que Faltan Otros para Completar el Libro</xs:documentation>
														</xs:annotation>
													</xs:enumeration>
													<xs:enumeration value="FINAL">
														<xs:annotation>
															<xs:documentation>Indica que es el Ultimo Envio Parcial. Con Esto se Completa el Libro.</xs:documentation>
														</xs:annotation>
													</xs:enumeration>
													<xs:enumeration value="TOTAL">
														<xs:annotation>
															<xs:documentation>Indica que es el Unico Envio que Compone el Libro</xs:documentation>
														</xs:annotation>
													</xs:enumeration>
													<xs:enumeration value="AJUSTE">
														<xs:annotation>
															<xs:documentation>Indica que es un Envio con Informacion para Corregir un Libro Previamente Enviado</xs:documentation>
														</xs:annotation>
													</xs:enumeration>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="NroSegmento" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Correlativo del Segmento de Libro</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:positiveInteger">
													<xs:totalDigits value="6"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="FolioNotificacion" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Folio de la Notificacion con que se Solicita el Libro Especial</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:positiveInteger">
													<xs:totalDigits value="10"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="CodAutRec" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Codigo de Autorización de Rectificación</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:maxLength value="10"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="ResumenSegmento" minOccurs="0">
								<xs:annotation>
Ok the xml is very long and i can't post entire code, but this is a part of it


    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xs:schema targetNamespace="http://www.sii.cl/SiiDte" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SiiDte="http://www.sii.cl/SiiDte" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:SiiLce="http://www.sii.cl/SiiLce" elementFormDefault="qualified" attributeFormDefault="unqualified">
    	<!--  Modificacion 31/10/2007 11:18 	 Restricciones a FchDoc (rango de validez 2000 al 2050)
    	       Modificación 08/01/2008   9:17     CdgSIISucur de 8 a 9 digitos
    	       Modificación 21/08/2008  15:08    FolioNotificacion de 18 a 10 digitos
                  Modificación 19/03/2010 12:10     Se agrega al impuesto (53) retenido a los suplementeros
                  Modificación 11/06/2010 10:05	 Se incrementa caracteres de NumId de 15 a 20 (receptor extranjero)
                  Modificación 30/07/10     15:00 	  Se limita a 30.000 documentos el máximo por envio o sobre (de 											   acuerdo a publicación)
    		Modificación 14/02/2011 10:50	 Se incorpora la Factura de Inicio (TpoDoc = 29)
    		Modificación 02/03/2011 12:40	 Se elimina limitacion a 30.000 documentos (detalles).
     -->
    	<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsignature_v10.xsd"/>
    	<xs:import namespace="http://www.sii.cl/SiiLce" schemaLocation="LceCoCertif_v10.xsd"/>
    	<xs:element name="LibroCompraVenta">
    		<xs:annotation>
    			<xs:documentation>Informacion Electronica de Libros de Compra y Venta</xs:documentation>
    		</xs:annotation>
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="EnvioLibro">
    					<xs:annotation>
    						<xs:documentation>Identificacion, Resumen y Detalles del Libro Electronico</xs:documentation>
    					</xs:annotation>
    					<xs:complexType>
    						<xs:sequence>
    							<xs:element name="Caratula">
    								<xs:annotation>
    									<xs:documentation>Identificacion del Envio del Libro Electronico</xs:documentation>
    								</xs:annotation>
    								<xs:complexType>
    									<xs:sequence>
    										<xs:element name="RutEmisorLibro" type="SiiDte:RUTType">
    											<xs:annotation>
    												<xs:documentation>RUT del Emisor del Libro Electronico</xs:documentation>
    											</xs:annotation>
    										</xs:element>
    										<xs:element name="RutEnvia" type="SiiDte:RUTType">
    											<xs:annotation>
    												<xs:documentation>RUT que Realiza el Envio del Libro Electronico</xs:documentation>
    											</xs:annotation>
    										</xs:element>
    										<xs:element name="PeriodoTributario" type="xs:gYearMonth">
    											<xs:annotation>
    												<xs:documentation>Periodo Tributario del Libro Electronico (AAAA-MM)</xs:documentation>
    											</xs:annotation>
    										</xs:element>
    										<xs:element name="FchResol" type="xs:date">
    											<xs:annotation>
    												<xs:documentation>Fecha de Resolucion que Autoriza el Envio de Libros (AAAA-MM-DD)</xs:documentation>
    											</xs:annotation>
    										</xs:element>
    										<xs:element name="NroResol">
    											<xs:annotation>
    												<xs:documentation>Numero de Resolucion que Autoriza el Envio de Libros</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:nonNegativeInteger">
    													<xs:totalDigits value="6"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="TipoOperacion">
    											<xs:annotation>
    												<xs:documentation>Tipo de Operacion Declarada en el Libro</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:string">
    													<xs:enumeration value="COMPRA"/>
    													<xs:enumeration value="VENTA"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="TipoLibro">
    											<xs:annotation>
    												<xs:documentation>Tipo de Libro de Compra o Venta Enviado</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:string">
    													<xs:enumeration value="MENSUAL"/>
    													<xs:enumeration value="ESPECIAL"/>
    													<xs:enumeration value="RECTIFICA"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="TipoEnvio">
    											<xs:annotation>
    												<xs:documentation>Tipo de Envio del Libro Electronico</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:string">
    													<xs:minLength value="5"/>
    													<xs:enumeration value="PARCIAL">
    														<xs:annotation>
    															<xs:documentation>Indica que es un Envio Parcial del Libro y que Faltan Otros para Completar el Libro</xs:documentation>
    														</xs:annotation>
    													</xs:enumeration>
    													<xs:enumeration value="FINAL">
    														<xs:annotation>
    															<xs:documentation>Indica que es el Ultimo Envio Parcial. Con Esto se Completa el Libro.</xs:documentation>
    														</xs:annotation>
    													</xs:enumeration>
    													<xs:enumeration value="TOTAL">
    														<xs:annotation>
    															<xs:documentation>Indica que es el Unico Envio que Compone el Libro</xs:documentation>
    														</xs:annotation>
    													</xs:enumeration>
    													<xs:enumeration value="AJUSTE">
    														<xs:annotation>
    															<xs:documentation>Indica que es un Envio con Informacion para Corregir un Libro Previamente Enviado</xs:documentation>
    														</xs:annotation>
    													</xs:enumeration>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="NroSegmento" minOccurs="0">
    											<xs:annotation>
    												<xs:documentation>Correlativo del Segmento de Libro</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:positiveInteger">
    													<xs:totalDigits value="6"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="FolioNotificacion" minOccurs="0">
    											<xs:annotation>
    												<xs:documentation>Folio de la Notificacion con que se Solicita el Libro Especial</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:positiveInteger">
    													<xs:totalDigits value="10"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    										<xs:element name="CodAutRec" minOccurs="0">
    											<xs:annotation>
    												<xs:documentation>Codigo de Autorización de Rectificación</xs:documentation>
    											</xs:annotation>
    											<xs:simpleType>
    												<xs:restriction base="xs:string">
    													<xs:maxLength value="10"/>
    												</xs:restriction>
    											</xs:simpleType>
    										</xs:element>
    									</xs:sequence>
    								</xs:complexType>
    							</xs:element>
    							<xs:element name="ResumenSegmento" minOccurs="0">
    								<xs:annotation>

A Data Export is mostly the same as a Report.

You use Report Tags in Data Exports, and format the output of the Report to be XML, CSV, YAML, etc.

1 Like