se extrae libreria de etrivial

FossilOrigin-Name: 5cae2a8c5985850e97b3d416ba14a90c66e2c05e3a4f9c28fdbc767d6c29748f
This commit is contained in:
2020-05-23 18:56:22 +00:00
parent 6f9aa80527
commit 10f021d0fd
73 changed files with 33116 additions and 615 deletions

9
facho/__init__.py Normal file
View File

@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# This file is part of facho. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
"""Top-level package for facho."""
__author__ = """Jovany Leandro G.C"""
__email__ = 'bit4bit@riseup.net'
__version__ = '0.1.0'

49
facho/cli.py Normal file
View File

@@ -0,0 +1,49 @@
import sys
import click
import logging.config
logging.config.dictConfig({
'version': 1,
'formatters': {
'verbose': {
'format': '%(name)s: %(message)s'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'loggers': {
'zeep.transports': {
'level': 'DEBUG',
'propagate': True,
'handlers': ['console'],
},
}
})
@click.command()
@click.option('--nit', required=True)
@click.option('--nit-proveedor', required=True)
@click.option('--id-software', required=True)
@click.option('--username', required=True)
@click.option('--password', required=True)
def consultaResolucionesFacturacion(nit, nit_proveedor, id_software, username, password):
from facho.fe.client import dian
client_dian = dian.DianClient(username,
password)
resp = client_dian.request(dian.ConsultaResolucionesFacturacionPeticion(
nit, nit_proveedor, id_software
))
print(str(resp))
@click.group()
def main():
pass
main.add_command(consultaResolucionesFacturacion)

193
facho/facho.py Normal file
View File

@@ -0,0 +1,193 @@
# This file is part of facho. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from lxml import etree
from lxml.etree import Element, SubElement, tostring
import re
class LXMLBuilder:
"""
extrae la manipulacion de XML
"""
# TODO buscar el termino mas adecuado
# ya que son varios lo procesos que se
# exponen en la misma clase
# * creacion
# * busquedad
# * comparacion
def __init__(self, nsmap):
self.nsmap = nsmap
self._re_node_expr = re.compile(r'^(?P<path>((?P<ns>\w+):)?(?P<tag>[a-zA-Z0-9_-]+))(?P<attrs>\[.+\])?')
self._re_attrs = re.compile(r'(\w+)\s*=\s*\"?(\w+)\"?')
def match_expression(self, node_expr):
match = re.search(self._re_node_expr, node_expr)
return match.groupdict()
@classmethod
def from_string(cls, content, clean_namespaces=False):
if clean_namespaces:
content = re.sub(r'\<\s*[a-zA-Z\-0-9]+\s*:', '<', content)
content = re.sub(r'\<\/\s*[a-zA-Z\-0-9]+\s*:', '</', content)
return etree.fromstring(content)
@classmethod
def build_element_from_string(cls, string, nsmap):
return Element(string, nsmap=nsmap)
def build_element(self, tag, ns=None, attribs={}):
attribs['nsmap'] = ns
if ns:
tag = '{%s}%s' % (self.nsmap[ns], tag)
return Element(tag, **attribs)
def build_from_expression(self, node_expr):
match = re.search(self._re_node_expr, node_expr)
expr = match.groupdict()
attrs = dict(re.findall(self._re_attrs, expr['attrs'] or ''))
attrs['nsmap'] = None
if expr['ns'] and expr['tag']:
ns = expr['ns']
tag = expr['tag']
if self.nsmap:
node = Element('{%s}%s' % (self.nsmap[ns], tag), **attrs)
else:
node = Element(tag, **attrs)
return node
return Element(expr['tag'], **attrs)
def _normalize_tag(self, tag):
return re.sub(r'^(\{.+\}|.+:)', '', tag)
def get_tag(self, elem):
return self._normalize_tag(elem.tag)
def same_tag(self, a, b):
return self._normalize_tag(a) \
== self._normalize_tag(b)
def find_relative(self, elem, xpath, ns):
return elem.find(xpath, ns)
def append(self, elem, child):
elem.append(child)
def set_text(self, elem, text):
elem.text = text
def get_text(self, elem):
return elem.text
def set_attribute(self, elem, key, value):
elem.attrib[key] = value
def tostring(self, elem):
return tostring(elem).decode('utf-8')
class FachoXML:
"""
Decora XML con funciones de consulta XPATH de un solo elemento
"""
def __init__(self, root, builder=None, nsmap=None):
if builder is None:
self.builder = LXMLBuilder(nsmap)
else:
self.builder = builder
self.nsmap = nsmap
if isinstance(root, str):
self.root = self.builder.build_element_from_string(root, nsmap)
else:
self.root = root
self.xpath_for = {}
self.extensions = []
def add_extension(self, extension):
self.extensions.append(extension)
def attach_extensions(self):
root_tag = self.builder.get_tag(self.root)
# construir las extensiones o adicionar en caso de indicar
for extension in self.extensions:
xpath, elements = extension.build(self)
for new_element in elements:
elem = self.find_or_create_element('/'+ root_tag + xpath)
self.builder.append(elem, new_element)
def fragment(self, xpath, append=False):
parent = self.find_or_create_element(xpath, append=append)
return FachoXML(parent, nsmap=self.nsmap)
def register_alias_xpath(self, alias, xpath):
self.xpath_for[alias] = xpath
def _normalize_xpath(self, xpath):
return xpath.replace('//', '/')
def find_or_create_element(self, xpath, append=False):
"""
@param xpath ruta xpath para crear o consultar de un solo elemendo
@param append True si se debe adicionar en la ruta xpath indicada
@return elemento segun self.builder
"""
xpath = self._normalize_xpath(xpath)
if xpath in self.xpath_for:
xpath = self.xpath_for[xpath]
node_paths = xpath.split('/')
node_paths.pop(0) #remove empty /
root_node = self.builder.build_from_expression(node_paths[0])
if not self.builder.same_tag(root_node.tag, self.root.tag):
raise ValueError('xpath %s must be absolute to /%s' % (xpath, self.root.tag))
else:
node_paths.pop(0)
# crea jerarquia segun xpath indicado
parent = None
current_elem = self.root
for node_path in node_paths:
node_expr = self.builder.match_expression(node_path)
node = self.builder.build_from_expression(node_path)
child = self.builder.find_relative(current_elem, node_expr['path'], self.nsmap)
parent = current_elem
if child is not None:
current_elem = child
else:
self.builder.append(current_elem, node)
current_elem = node
# se fuerza la adicion como un nuevo elemento
if append:
node = self.builder.build_from_expression(node_paths[-1])
self.builder.append(parent, node)
return node
return current_elem
def set_element(self, xpath, content, **attrs):
xpath = self._normalize_xpath(xpath)
format_ = attrs.pop('format_', '%s')
elem = self.find_or_create_element(xpath)
if content:
self.builder.set_text(elem, format_ % content)
for k, v in attrs.items():
self.builder.set_attribute(elem, k, v)
return elem
def get_element_text(self, xpath, format_=str):
xpath = self._normalize_xpath(xpath)
text = self.builder.get_text(self.find_or_create_element(xpath))
return format_(text)
def tostring(self):
return self.builder.tostring(self.root)

3
facho/fe/__init__.py Normal file
View File

@@ -0,0 +1,3 @@
from .fe import DianXMLExtensionSigner
from .fe import FeXML
from .fe import NAMESPACES

View File

@@ -0,0 +1,2 @@
# This file is part of facho. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

107
facho/fe/client/dian.py Normal file
View File

@@ -0,0 +1,107 @@
from facho import facho
import zeep
from zeep.wsse.username import UsernameToken
import urllib.request
from datetime import datetime
from dataclasses import dataclass, asdict, field
from typing import List
import http.client
import hashlib
import secrets
import base64
__all__ = ['DianClient',
'ConsultaResolucionesFacturacionPeticion',
'ConsultaResolucionesFacturacionRespuesta']
class SOAPService:
def get_wsdl(self):
raise NotImplementedError()
def get_service(self):
raise NotImplementedError()
def builder_response(self, as_dict):
raise NotImplementedError()
def todict(self):
return asdict(self)
@dataclass
class ConsultaResolucionesFacturacionRespuesta:
@dataclass
class RangoFacturacion:
NumeroResolucion: str
FechaResolucion: datetime
Prefijo: str
RangoInicial: int
RangoFinal: int
FechaVigenciaDesde: datetime
FechaVigenciaHasta: datetime
ClaveTecnica: str
CodigoOperacion: str
DescripcionOperacion: str
IdentificadorOperacion: str
RangoFacturacion: List[RangoFacturacion]
@classmethod
def fromdict(cls, data):
return cls(
data['CodigoOperacion'],
data['DescripcionOperacion'],
data['IdentificadorOperacion'],
data['RangoFacturacion']
)
@dataclass
class ConsultaResolucionesFacturacionPeticion(SOAPService):
NITObligadoFacturarElectronicamente: str
NITProveedorTecnologico: str
IdentificadorSoftware: str
def get_wsdl(self):
return 'https://facturaelectronica.dian.gov.co/servicios/B2BIntegrationEngine-servicios/FacturaElectronica/consultaResolucionesFacturacion.wsdl'
def get_service(self):
return 'ConsultaResolucionesFacturacion'
def build_response(self, as_dict):
return ConsultaResolucionesFacturacionRespuesta.fromdict(as_dict)
class DianClient:
def __init__(self, user, password):
self._username = user
self._password = password
def _open(self, service):
return zeep.Client(service.get_wsdl(), wsse=UsernameToken(self._username, self._password))
def _remote_service(self, conn, service):
return conn.service[service.get_service()]
def _close(self, conn):
return
def request(self, service):
if not isinstance(service, SOAPService):
raise TypeError('service not type SOAPService')
client = self._open(service)
method = self._remote_service(client, service)
resp = method(**service.todict())
self._close(client)
return service.build_response(resp)

View File

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>AlgoritmoCUFE</ShortName>
<LongName xml:lang="es">Algoritmo de encriptado del CUFE</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:AlgoritmoCUFE</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:AlgoritmoCUFE-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/AlgoritmoCUFE-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>CUDE-SHA384</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Algoritmo SHA-384</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>AlgoritmoCUFE</ShortName>
<LongName xml:lang="es">Algoritmo de encriptado del CUFE</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:AlgoritmoCUFE</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:AlgoritmoCUFE-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/AlgoritmoCUFE-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>CUFE-SHA384</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Algoritmo SHA-384</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>CodigoDescuento</ShortName>
<LongName xml:lang="es">Codigos de descuentos</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:CodigoDescuento</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:CodigoDescuento-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/CodigoDescuento-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Descuento no condicionado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>01</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Descuento condicionado</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>CodigoPrecioReferencia</ShortName>
<LongName xml:lang="es">Lista de códigos para precios de referencia</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:CodigoPrecioReferencia</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:CodigoPrecioReferencia-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/CodigoPrecioReferencia-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>01</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Valor comercial</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>02</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Valor en inventarios</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>03</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Otro valor</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>ConceptoNotaCredito</ShortName>
<LongName xml:lang="es">Concepto de Correción para Notas crédito</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:ConceptoNotaCredito</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:ConceptoNotaCredito-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/ConceptoNotaCredito-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Devolución parcial de los bienes y/o no aceptación parcial del servicio</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Anulación de factura electrónica</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Rebaja o descuento parcial o total</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Ajuste de precio</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>5</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Otros</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>ConceptoNotaDebito</ShortName>
<LongName xml:lang="es">Concepto de Correción para Notas débito</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:ConceptoNotaDebito</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:ConceptoNotaDebito-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/ConceptoNotaDebito-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Intereses</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Gastos por cobrar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cambio del valor</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Otro</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,298 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>Departamentos</ShortName>
<LongName xml:lang="es">Departamentos</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:Departamentos</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:Departamentos-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/Departamentos-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>91</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Amazonas</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>05</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Antioquia</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>81</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Arauca</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>08</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Atlántico</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>11</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Bogotá</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>13</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Bolívar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>15</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Boyacá</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>17</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Caldas</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>18</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Caquetá</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>85</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Casanare</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>19</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cauca</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>20</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cesar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>27</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Chocó</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>23</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Córdoba</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>25</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cundinamarca</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>94</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Guainía</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>95</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Guaviare</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>41</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Huila</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>44</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>La Guajira</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>47</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Magdalena</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Meta</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>52</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nariño</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>54</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Norte de Santander</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>86</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Putumayo</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>63</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Quindío</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>66</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Risaralda</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>88</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>San Andrés y Providencia</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>68</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Santander</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>70</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Sucre</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>73</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Tolima</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>76</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Valle del Cauca</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>97</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Vaupés</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>99</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Vichada</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>EventoDocumento</ShortName>
<LongName xml:lang="es">Eventos de un Documento Electrónico</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:EventoDocumento</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:EventoDocumento-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/EventoDocumento-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>02</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Uso Autorizado por la DIAN</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>030</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Solicitación de Corrección en Documento</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>031</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Rechazo de Documento</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>032</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Recibimiento de los Bienes</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>033</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Aceptación de Documento</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>040</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Factura Ofrecida para Negociación como Título Valor</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>041</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Factura Negociada como Título Valor</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>FormasPago</ShortName>
<LongName xml:lang="es">Tipos de Formas de Pago</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:FormasPago</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:FormasPago-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/FormasPago-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Contado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,634 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>MediosPago</ShortName>
<LongName xml:lang="es">Medios de Pago</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:MediosPago</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:MediosPago-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/MediosPago-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Instrumento no definido</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito ACH</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito ACH</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Reversión débito de demanda ACH</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>5</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Reversión crédito de demanda ACH </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>6</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito de demanda ACH</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>7</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito de demanda ACH</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>8</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Mantener</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>9</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Clearing Nacional o Regional</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>10</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Efectivo</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>11</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Reversión Crédito Ahorro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>12</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Reversión Débito Ahorro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>13</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito Ahorro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>14</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito Ahorro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>15</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Bookentry Crédito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>16</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Bookentry Débito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>17</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración de la demanda en efectivo /Desembolso Crédito (CCD)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>18</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración de la demanda en efectivo / Desembolso (CCD) débito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>19</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito Pago negocio corporativo (CTP)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>20</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cheque</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>21</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Poyecto bancario</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>22</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Proyecto bancario certificado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>23</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cheque bancario</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>24</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota cambiaria esperando aceptación</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>25</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cheque certificado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>26</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cheque Local</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>27</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito Pago Neogcio Corporativo (CTP)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>28</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito Negocio Intercambio Corporativo (CTX)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>29</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito Negocio Intercambio Corporativo (CTX)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>30</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transferecia Crédito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>31</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transferencia Débito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>32</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración Efectivo / Desembolso Crédito plus (CCD+)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>33</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración Efectivo / Desembolso Débito plus (CCD+)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>34</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pago y depósito pre acordado (PPD)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>35</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración efectivo ahorros / Desembolso Crédito (CCD)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>36</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración efectivo ahorros / Desembolso Drédito (CCD)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>37</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pago Negocio Corporativo Ahorros Crédito (CTP)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>38</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pago Neogcio Corporativo Ahorros Débito (CTP)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>39</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Crédito Negocio Intercambio Corporativo (CTX)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>40</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Débito Negocio Intercambio Corporativo (CTX)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>41</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración efectivo/Desembolso Crédito plus (CCD+) </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>42</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Consiganción bancaria</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>43</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Concentración efectivo / Desembolso Débito plus (CCD+)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>44</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota cambiaria</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>45</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transferencia Crédito Bancario</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>46</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transferencia Débito Interbancario</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>47</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transferencia Débito Bancaria</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>48</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Tarjeta Crédito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>49</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Tarjeta Débito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Postgiro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>51</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Telex estándar bancario francés</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>52</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pago comercial urgente</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>53</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pago Tesorería Urgente</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>60</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>61</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada por el acreedor</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>62</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada por el acreedor, avalada por el banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>63</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada por el acreedor, avalada por un tercero</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>64</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada pro el banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>65</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada por un banco avalada por otro banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>66</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>67</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota promisoria firmada por un tercero avalada por un banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>70</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de nota por el por el acreedor</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>74</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de nota por el por el acreedor sobre un banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>75</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de nota por el acreedor, avalada por otro banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>76</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de nota por el acreedor, sobre un banco avalada por un tercero</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>77</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de una nota por el acreedor sobre un tercero</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>78</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Retiro de una nota por el acreedor sobre un tercero avalada por un banco</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>91</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota bancaria tranferible</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>92</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cheque local traferible</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>93</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Giro referenciado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>94</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Giro urgente</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>95</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Giro formato abierto</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>96</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Método de pago solicitado no usuado</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>97</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Clearing entre partners</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>ZZZ</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Acuerdo mutuo</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de validacion :: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TarifaImpuestoINC</ShortName>
<LongName xml:lang="es">Tarifas por Impuesto</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestoINC</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestoINC-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TarifaImpuestoINC-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Column Id="description" Use="required">
<ShortName>Description</ShortName>
<LongName xml:lang="es">Descripcion</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INC</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Tarifa especial</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INC</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Tarifa especial</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>8.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INC</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Tarifa general</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>16.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INC</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Tarifa especial</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de validacion :: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TarifaImpuestoIVA</ShortName>
<LongName xml:lang="es">Tarifas por Impuesto IVA</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestoIVA</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestoIVA-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TarifaImpuestoIVA-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Column Id="description" Use="required">
<ShortName>Description</ShortName>
<LongName xml:lang="es">Descripcion</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>0.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IVA</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Exento</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>5.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IVA</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Bienes / Servicios al 5</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>16.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IVA</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Contratos firmados con el estado antes de ley 1819</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>19.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IVA</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Tarifa general</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,479 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de validacion :: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TarifaImpuestoReteFuente</ShortName>
<LongName xml:lang="es">Tarifas por Impuesto</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestos</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestos-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TarifaImpuestos-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Column Id="description" Use="required">
<ShortName>Description</ShortName>
<LongName xml:lang="es">Descripcion</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras generales (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras generales (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras con tarjeta débito o crédito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de bienes o productos agrícolas o pecuarios sin procesamiento industrial</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de bienes o productos agrícolas o pecuarios con procesamiento industrial (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de bienes o productos agrícolas o pecuarios con procesamiento industrial declarantes (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>0.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de café pergamino o cereza</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>0.10</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de combustibles derivados del petróleo</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Enajenación de activos fijos de personas naturales (notarías y tránsito son agentes retenedores)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de vehículos</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras de bienes raíces cuya destinación y uso sea vivienda de habitación (por las primeras 20.000 UVT, es decir hasta $637.780.000)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras  de bienes raíces cuya destinación y uso sea vivienda de habitación (exceso de las primeras 20.000 UVT, es decir superior a $637.780.000)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Compras  de bienes raíces cuya destinación y uso sea distinto a vivienda de habitación</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios generales (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>6.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios generales (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Por emolumentos eclesiásticos (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Por emolumentos eclesiásticos (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de transporte de carga</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de  transporte nacional de pasajeros por vía terrestre (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de  transporte nacional de pasajeros por vía terrestre (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de  transporte nacional de pasajeros por vía aérea o marítima</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>1.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios prestados por empresas de servicios temporales (sobre AIU)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios prestados por empresas de vigilancia y aseo (sobre AIU)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios integrales de salud prestados por IPS</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de hoteles y restaurantes (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de hoteles y restaurantes (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Arrendamiento de bienes muebles</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Arrendamiento de bienes inmuebles (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Arrendamiento de bienes inmuebles (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Otros ingresos tributarios (declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Otros ingresos tributarios (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>11.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Honorarios y comisiones (personas jurídicas)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>11.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Honorarios y comisiones personas naturales que suscriban contrato o cuya sumatoria de los pagos o abonos en cuenta superen las 3.300 UVT ($105.135.000)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>10.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Honorarios y comisiones (no declarantes)</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Servicios de licenciamiento o derecho de uso de software</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>7.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Intereses o rendimientos financieros</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>4.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Rendimientos financieros provenientes de títulos de renta fija</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>20.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Loterías, rifas, apuestas y similares</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>3.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Retención en colocación independiente de juegos de suerte y azar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>Contratos de construcción  y urbanización</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de validacion :: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TarifaImpuestos</ShortName>
<LongName xml:lang="es">Tarifas por Impuesto</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestos</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TarifaImpuestos-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TarifaImpuestos-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Column Id="description" Use="required">
<ShortName>Description</ShortName>
<LongName xml:lang="es">Descripcion</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>15.00</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteIVA</SimpleValue>
</Value>
<Value ColumnRef="description">
<SimpleValue>ReteIVA</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoAmbiente</ShortName>
<LongName xml:lang="es">Ambiente de destino</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoAmbiente</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoAmbiente-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoAmbiente-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Producción</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pruebas</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Asociacion lista de codigos :: Author : Eric Van Boxsom :: Ultima modificación 05-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoCodigoProducto</ShortName>
<LongName xml:lang="es">Eventos de un documento electronico</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoCodigoProducto</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoCodigoProducto-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoCodigoProducto-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Nombre</ShortName>
<Data Type="normalizedString"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>001</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>UNSPSC</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>010</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>GTIN</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>999</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Estándar de adopción del contribuyente</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoDocumento</ShortName>
<LongName xml:lang="es">Tipo de Documento</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoDocumento</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoDocumento-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoDocumento-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>01</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Factura de Venta Nacional</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>02</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Factura de Exportación </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>03</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Factura de Contingencia</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>91</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Crédito</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>92</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Débito</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoEntrega</ShortName>
<LongName xml:lang="es">Condiciones de Entrega</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoEntrega</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoEntrega-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoEntrega-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>CFR</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Costo y flete</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>CIF</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Costo, flete y seguro</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>CIP</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transporte y Seguro Pagados hasta</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>CPT</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Transporte Pagado Hasta</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>DAP</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Entregado en un Lugar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>DAT</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Entregado en Terminal</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>DDP</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Entregado con Pago de Derechos</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>EXW</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>En Fábrica</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>FAS</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Franco al costado del buque</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>FCA</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Franco transportista</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>FOB</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Franco a bordo</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoIdFiscal</ShortName>
<LongName xml:lang="es">Tipo de Identificador Fiscal</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoIdFiscal</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoIdFiscal-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoIdFiscal-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>11</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Registro civil </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>12</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Tarjeta de identidad </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>13</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cédula de ciudadanía </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>21</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Tarjeta de extranjería </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>22</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Cédula de extranjería </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>31</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>NIT</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>41</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Pasaporte </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>42</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Documento de identificación extranjero </SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>50</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>NIT de otro país</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>91</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>NUIP * </SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoImpuesto</ShortName>
<LongName xml:lang="es">Tipo de Tributos</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoImpuesto</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoImpuesto-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoImpuesto-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>01</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IVA</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>02</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>IC</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>03</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ICA</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>04</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INC</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>05</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteIVA</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>06</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteFuente</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>07</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteICA</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>08</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>ReteCREE</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>20</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>FtoHorticultura</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>21</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Timbre</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>22</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Bolsas</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>23</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INCarbono</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>24</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>INCombustibles</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>25</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Sobretasa Combustibles</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>26</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Sordicom</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>ZZ</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nombre de la figura tributaria</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoOperacion</ShortName>
<LongName xml:lang="es">Tipo de operacion del documento</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoOperacion-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Nombre</ShortName>
<Data Type="normalizedString"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>10</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Estandar</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>09</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>AIU</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>11</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Mandatos</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoOperacion</ShortName>
<LongName xml:lang="es">Tipo de operacion del documento</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoOperacion-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Nombre</ShortName>
<Data Type="normalizedString"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>20</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Crédito que referencia una factura electrónica.</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>22</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Crédito sin referencia a facturas*.</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>23</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Crédito para facturación electrónica V1 (Decreto 2242).</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoOperacion</ShortName>
<LongName xml:lang="es">Tipo de operacion del documento</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOperacion-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoOperacion-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Nombre</ShortName>
<Data Type="normalizedString"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>30</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Débito que referencia una factura electrónica.</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>32</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Débito sin referencia a facturas.</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>33</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Nota Débito para facturación electrónica V1 (Decreto 2242).</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoOrganizacion</ShortName>
<LongName xml:lang="es">Tipo de organización jurídica (Personas)</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOrganizacion</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoOrganizacion-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoOrganizacion-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>1</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Persona Jurídica</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>2</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Persona Natural</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de valores:: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TipoResponsabilidad</ShortName>
<LongName xml:lang="es">Responsabilidades fiscales; Régimen fiscal</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoResponsabilidad</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TipoResponsabilidad-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TipoResponsabilidad-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
<Key Id="codeKey">
<ShortName>CodeKey</ShortName>
<ColumnRef Ref="code"/>
</Key>
</ColumnSet>
<SimpleCodeList>
<Row>
<Value ColumnRef="code">
<SimpleValue>O-13</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Gran contribuyente</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>O-15</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Autorretenedor</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>O-23</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Agente de retención IVA</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>O-47</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>Régimen simple de tributación</SimpleValue>
</Value>
</Row>
<Row>
<Value ColumnRef="code">
<SimpleValue>ZZ</SimpleValue>
</Value>
<Value ColumnRef="name">
<SimpleValue>No aplica</SimpleValue>
</Value>
</Row>
</SimpleCodeList>
</gc:CodeList>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DIAN Genericode listas de validacion :: Ultima modificación 18-02-2019 - evb-->
<gc:CodeList xmlns:gc="http://docs.oasis-open.org/codelist/ns/genericode/1.0/">
<Identification>
<ShortName>TiposEventos</ShortName>
<LongName xml:lang="es">Tarifas por Impuesto</LongName>
<Version>1</Version>
<CanonicalUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TiposEventos</CanonicalUri>
<CanonicalVersionUri>urn:dian:names:especificacion:ubl:listacodigos:gc:TiposEventos-2.1</CanonicalVersionUri>
<LocationUri>http://dian.gov.co/ubl/os-ubl-2.0/cl/gc/default/TiposEventos-2.1.gc</LocationUri>
<Agency>
<LongName xml:lang="es">DIAN (Dirección de Impuestos y Aduanas Nacionales)</LongName>
<Identifier>195</Identifier>
</Agency>
</Identification>
<ColumnSet>
<Column Id="code" Use="required">
<ShortName>Code</ShortName>
<LongName xml:lang="es">Codigo Comun</LongName>
<Data Type="normalizedString"/>
</Column>
<Column Id="name" Use="required">
<ShortName>Name</ShortName>
<LongName xml:lang="es">Nombre</LongName>
<Data Type="string"/>
</Column>
</ColumnSet>
<SimpleCodeList>
<Row><Value ColumnRef="code"><SimpleValue>02</SimpleValue></Value><Value ColumnRef="name"><SimpleValue>Documento validado por la DIANSimpleValue></Value></Row>
<Row><Value ColumnRef="code"><SimpleValue>04</SimpleValue></Value><Value ColumnRef="name"><SimpleValue>Documento rechazado por la DIANSimpleValue></Value></Row>
<Row><Value ColumnRef="code"><SimpleValue>031</SimpleValue></Value><Value ColumnRef="name"><SimpleValue>Rechazo de DocumentoSimpleValue></Value></Row>
<Row><Value ColumnRef="code"><SimpleValue>032</SimpleValue></Value><Value ColumnRef="name"><SimpleValue>Recepción de mercacías y/o serviciosSimpleValue></Value></Row>
<Row><Value ColumnRef="code"><SimpleValue>033</SimpleValue></Value><Value ColumnRef="name"><SimpleValue>Aceptación de DocumentoSimpleValue></Value></Row>
</SimpleCodeList>
</gc:CodeList>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
import os.path
from lxml import etree
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
class CodeList:
def __init__(self, filename, primary_column):
self.short_name = ''
self.long_name = ''
self.version = 1
self.canonical_uri = ''
self.canonical_version_uri = ''
self.location_uri = ''
self.rows = {}
self._load(filename, primary_column)
def _load(self, filename, primary_column):
tree = etree.parse(filename)
#obtener identificadores...
self.short_name = tree.find('./Identification/ShortName').text
self.long_name = tree.find('./Identification/LongName').text
self.version = tree.find('./Identification/Version').text
self.canonical_uri = tree.find('./Identification/CanonicalUri').text
self.canonical_version_uri = tree.find('./Identification/CanonicalVersionUri').text
self.location_uri = tree.find('./Identification/LocationUri').text
#obtener registros...
for row in tree.findall('./SimpleCodeList/Row'):
new_row = self.xmlrow_to_dict(row)
primary_key = new_row[primary_column]
self.rows[primary_key] = new_row.copy()
def xmlrow_to_dict(self, xmlrow):
row = {}
#construir registro...
for value in xmlrow.getchildren():
row[value.attrib['ColumnRef']] = value.getchildren()[0].text
return row
def __getitem__(self, key):
return self.rows[str(key)]
# nombres de variables igual a ./Identification/ShortName
# TODO: garantizar unica carga en python
__all__ = ['TipoOrganizacion',
'TipoResponsabilidad',
'TipoAmbiente']
TipoOrganizacion = CodeList(os.path.join(DATA_DIR, 'TipoOrganizacion-2.1.gc'), 'name')
TipoResponsabilidad = CodeList(os.path.join(DATA_DIR, 'TipoResponsabilidad-2.1.gc'), 'name')
TipoAmbiente = CodeList(os.path.join(DATA_DIR, 'TipoAmbiente-2.1.gc'), 'name')

126
facho/fe/fe.py Normal file
View File

@@ -0,0 +1,126 @@
# This file is part of facho. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from ..facho import FachoXML
import xmlsig
import xades
from datetime import datetime
import OpenSSL
import warnings
NAMESPACES = {
'fe': 'http://www.dian.gov.co/contratos/facturaelectronica/v1',
'cac': 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',
'cbc': 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',
'cdt': 'urn:DocumentInformation:names:specification:ubl:colombia:schema:xsd:DocumentInformationAggregateComponents-1',
'clm54217': 'urn:un:unece:uncefact:codelist:specification:54217:2001',
'clmIANAMIMEMediaType': 'urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003',
'ext': 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2',
'qdt': 'urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2',
'sts': 'http://www.dian.gov.co/contratos/facturaelectronica/v1/Structures',
'udt': 'urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2',
'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xades': 'http://uri.etsi.org/01903/v1.3.2#',
'ds': 'http://www.w3.org/2000/09/xmldsig#',
}
class FeXML(FachoXML):
def __init__(self, root, namespace):
super().__init__("{%s}%s" % (namespace, root),
nsmap=NAMESPACES)
self._cn = root.rstrip('/')
#self.find_or_create_element(self._cn)
class DianXMLExtensionSigner:
POLICY_ID = 'https://facturaelectronica.dian.gov.co/politicadefirma/v2/politicadefirmav2.pdf'
POLICY_NAME = 'Dian'
def __init__(self, pkcs12_path, passphrase=None):
self._pkcs12_path = pkcs12_path
self._passphrase = None
if passphrase:
self._passphrase = passphrase.encode('utf-8')
@classmethod
def from_pkcs12(self, filepath, password=None):
p12 = OpenSSL.crypto.load_pkcs12(open(filepath, 'rb').read(), password)
# return (xpath, xml.Element)
def build(self, fachoxml):
dian_path = '/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent'
signature = xmlsig.template.create(
xmlsig.constants.TransformInclC14N,
xmlsig.constants.TransformRsaSha256,
"Signature",
)
ref = xmlsig.template.add_reference(
signature, xmlsig.constants.TransformSha256, uri="", name="R1"
)
xmlsig.template.add_transform(ref, xmlsig.constants.TransformEnveloped)
xmlsig.template.add_reference(
signature, xmlsig.constants.TransformSha256, uri="#KI", name="RKI"
)
ki = xmlsig.template.ensure_key_info(signature, name="KI")
data = xmlsig.template.add_x509_data(ki)
xmlsig.template.x509_data_add_certificate(data)
serial = xmlsig.template.x509_data_add_issuer_serial(data)
xmlsig.template.x509_issuer_serial_add_issuer_name(serial)
xmlsig.template.x509_issuer_serial_add_serial_number(serial)
xmlsig.template.add_key_value(ki)
qualifying = xades.template.create_qualifying_properties(signature)
xades.utils.ensure_id(qualifying)
xades.utils.ensure_id(qualifying)
# TODO assert with http://www.sic.gov.co/hora-legal-colombiana
props = xades.template.create_signed_properties(qualifying, datetime=datetime.now())
xades.template.add_claimed_role(props, "supplier")
#signed_do = xades.template.ensure_signed_data_object_properties(props)
#xades.template.add_data_object_format(
# signed_do, "#R1",
# identifier=xades.ObjectIdentifier("Idenfitier0", "Description")
#)
#xades.template.add_commitment_type_indication(
# signed_do,
# xades.ObjectIdentifier("Idenfitier0", "Description"),
# qualifiers_type=["Tipo"],
#)
#xades.template.add_commitment_type_indication(
# signed_do,
# xades.ObjectIdentifier("Idenfitier1", references=["#R1"]),
# references=["#R1"],
#)
#xades.template.add_data_object_format(
# signed_do,
# "#RKI",
# description="Desc",
# mime_type="application/xml",
# encoding="UTF-8",
#)
fachoxml.root.append(signature)
policy = xades.policy.GenericPolicyId(
self.POLICY_ID,
self.POLICY_NAME,
xmlsig.constants.TransformSha256)
ctx = xades.XAdESContext(policy)
ctx.load_pkcs12(OpenSSL.crypto.load_pkcs12(open(self._pkcs12_path, 'rb').read(),
self._passphrase))
ctx.sign(signature)
ctx.verify(signature)
#xmlsig take parent root
fachoxml.root.remove(signature)
return (dian_path, [signature])

295
facho/fe/form.py Normal file
View File

@@ -0,0 +1,295 @@
# This file is part of facho. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import hashlib
from functools import reduce
import copy
from dataclasses import dataclass
from datetime import datetime
from .data import dian
from . import fe
class DataError(Exception):
def __init__(self, errors):
self._errors = errors
class DataValidator:
# valida y retorna errores [(key, error)..]
def validate(self) -> []:
raise NotImplementedError()
def try_validate(self):
errors = self.validate()
if errors:
raise DataError(errors)
@dataclass
class Party(DataValidator):
name: str
ident: str
responsability_code: str
organization_code: str
phone: str = ''
address: str = ''
email: str = ''
legal_name: str = ''
legal_company_ident: str = ''
legal_address: str = ''
def validate(self):
errors = []
try:
dian.TipoResponsabilidad[self.responsability_code]
except KeyError:
errors.append(('responsability_code', 'not found'))
try:
dian.TipoOrganizacion[self.organization_code]
except KeyError:
errors.append(('organization_code', 'not found'))
return errors
@dataclass
class TaxSubTotal:
percent: float
tax_scheme_ident: str = '01'
tax_amount: float = 0.0
taxable_amount: float = 0.0
def calculate(self, invline):
self.tax_amount = invline.total_amount * (self.percent / 100)
self.taxable_amount = invline.total_amount
@dataclass
class TaxTotal:
subtotals: list
tax_amount: float = 0.0
taxable_amount: float = 0.0
def calculate(self, invline):
for subtax in self.subtotals:
subtax.calculate(invline)
self.tax_amount += subtax.tax_amount
self.taxable_amount += subtax.taxable_amount
@dataclass
class InvoiceLine:
quantity: int
description: str
item_ident: int
price_amount: float
tax: TaxTotal
@property
def total_amount(self):
return self.quantity * self.price_amount
@property
def total_tax_inclusive_amount(self):
return self.tax.taxable_amount
@property
def total_tax_exclusive_amount(self):
return self.tax.tax_amount
def calculate(self):
self.tax.calculate(self)
@dataclass
class LegalMonetaryTotal:
line_extension_amount: float = 0.0
tax_exclusive_amount: float = 0.0
tax_inclusive_amount: float = 0.0
charge_total_amount: float = 0.0
payable_amount: float = 0.0
class Invoice(DataValidator):
def __init__(self):
self.invoice_period_start = None
self.invoice_period_end = None
self.invoice_issue = None
self.invoice_ident = None
self.invoice_cufe = None
self.invoice_legal_monetary_total = LegalMonetaryTotal(0, 0, 0, 0, 0)
self.invoice_customer = None
self.invoice_supplier = None
self.invoice_lines = []
def set_period(self, startdate, enddate):
self.invoice_period_start = startdate
self.invoice_period_end = enddate
def set_issue(self, dtime: datetime):
self.invoice_issue = dtime
def set_ident(self, ident: str):
self.invoice_ident = ident
def set_supplier(self, party: Party):
self.invoice_supplier = party
def set_customer(self, party: Party):
self.invoice_customer = party
def add_invoice_line(self, line: InvoiceLine):
self.invoice_lines.append(line)
def validate(self):
errors_customer = [('customer.%s' % (field), err) for field, err in self.invoice_customer.validate()]
errors_supplier = [('supplier.%s' % (field), err) for field, err in self.invoice_customer.validate()]
return errors_customer + errors_supplier
def _calculate_legal_monetary_total(self):
for invline in self.invoice_lines:
self.invoice_legal_monetary_total.line_extension_amount += invline.total_amount
self.invoice_legal_monetary_total.tax_exclusive_amount += invline.total_amount
self.invoice_legal_monetary_total.charge_total_amount += invline.total_amount
self.invoice_legal_monetary_total.payable_amount = self.invoice_legal_monetary_total.tax_exclusive_amount \
+ self.invoice_legal_monetary_total.line_extension_amount \
+ self.invoice_legal_monetary_total.tax_inclusive_amount
def calculate(self):
self._calculate_legal_monetary_total()
for invline in self.invoice_lines:
invline.calculate()
class DIANInvoiceXML(fe.FeXML):
def __init__(self, invoice, TipoAmbiente = 'Pruebas'):
super().__init__('Invoice', 'http://www.dian.gov.co/contratos/facturaelectronica/v1')
self.attach_invoice(invoice, TipoAmbiente)
def attach_invoice(self, invoice, TipoAmbiente):
"""adiciona etiquetas a FEXML y retorna FEXML
en caso de fallar validacion retorna None"""
fexml = self
invoice.try_validate()
invoice.calculate()
cufe = self._generate_cufe(invoice, TipoAmbiente)
fexml.set_element('/fe:Invoice/cbc:ID', invoice.invoice_ident)
fexml.set_element('/fe:Invoice/cbc:UUID[schemaName="CUFE-SHA384"]', cufe)
fexml.set_element('/fe:Invoice/cbc:IssueDate', invoice.invoice_issue.strftime('%Y-%m-%d'))
fexml.set_element('/fe:Invoice/cbc:IssueTime', invoice.invoice_issue.strftime('%H:%M:%S'))
fexml.set_element('/fe:Invoice/cac:InvoicePeriod/cbc:StartDate', invoice.invoice_period_start.strftime('%Y-%m-%d'))
fexml.set_element('/fe:Invoice/cac:InvoicePeriod/cbc:EndDate', invoice.invoice_period_end.strftime('%Y-%m-%d'))
fexml.set_element('/fe:Invoice/cbc:LineCountNumeric', len(invoice.invoice_lines))
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/cac:PartyIdentification/cbc:ID',
invoice.invoice_supplier.ident)
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyTaxScheme/cbc:TaxLevelCode',
invoice.invoice_supplier.responsability_code)
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/cbc:AdditionalAccountID',
invoice.invoice_supplier.organization_code)
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/cac:PartyName/cbc:Name',
invoice.invoice_supplier.name)
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
invoice.invoice_supplier.legal_name)
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
invoice.invoice_supplier.address)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/cac:PartyIdentification/cbc:ID',
invoice.invoice_customer.ident)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyTaxScheme/cbc:TaxLevelCode',
invoice.invoice_customer.responsability_code)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/cbc:AdditionalAccountID',
invoice.invoice_customer.organization_code)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/cac:PartyName/cbc:Name',
invoice.invoice_customer.name)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
invoice.invoice_customer.legal_name)
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
invoice.invoice_customer.address)
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:LineExtensionAmount',
invoice.invoice_legal_monetary_total.line_extension_amount,
currencyID='COP')
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:TaxExclusiveAmount',
invoice.invoice_legal_monetary_total.tax_exclusive_amount,
currencyID='COP')
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:TaxInclusiveAmount',
invoice.invoice_legal_monetary_total.tax_inclusive_amount,
currencyID='COP')
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:ChargeTotalAmount',
invoice.invoice_legal_monetary_total.charge_total_amount,
currencyID='COP')
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:PayableAmount',
invoice.invoice_legal_monetary_total.payable_amount,
currencyID='COP')
for index, invoice_line in enumerate(invoice.invoice_lines):
line = fexml.fragment('/fe:Invoice/fe:InvoiceLine', append=True)
line.set_element('/fe:InvoiceLine/cbc:ID', index)
line.set_element('/fe:InvoiceLine/cbc:InvoicedQuantity', invoice_line.quantity, unitCode = 'NAR')
line.set_element('/fe:InvoiceLine/cbc:LineExtensionAmount', invoice_line.total_amount, currencyID="COP")
line.set_element('/fe:InvoiceLine/fe:Price/cbc:PriceAmount', invoice_line.price_amount, currencyID="COP")
line.set_element('/fe:InvoiceLine/fe:Item/cbc:Description', invoice_line.description)
return fexml
def _generate_cufe(self, invoice, TipoAmbiente = 'Pruebas'):
NumFac = invoice.invoice_ident
FecFac = invoice.invoice_issue.strftime('%Y-%m-%d')
HoraFac = invoice.invoice_issue.strftime('%H:%H:%S')
ValorBruto = invoice.invoice_legal_monetary_total.line_extension_amount
ValorTotalPagar = invoice.invoice_legal_monetary_total.payable_amount
ValorImpuestoPara = {}
ValorImpuesto1 = 0.0
CodImpuesto1 = 1
ValorImpuesto2 = 0.0
CodImpuesto2 = 4
ValorImpuesto3 = 0.0
CodImpuesto3 = 3
for invoice_line in invoice.invoice_lines:
for subtotal in invoice_line.tax.subtotals:
# TODO cual es la naturaleza de tax_scheme_ident?
codigo_impuesto = int(subtotal.tax_scheme_ident)
ValorImpuestoPara.setdefault(codigo_impuesto, 0.0)
ValorImpuestoPara[codigo_impuesto] += subtotal.tax_amount
NitOFE = invoice.invoice_supplier.ident
NumAdq = invoice.invoice_customer.ident
TipoAmb = int(dian.TipoAmbiente[TipoAmbiente]['code'])
formatVars = {
'%s': NumFac,
'%s': FecFac,
'%.02f': HoraFac,
'%.02f': ValorBruto,
'%.02f': ValorTotalPagar,
'%.02f': ValorImpuestoPara.get(CodImpuesto1, 0.0),
'%02d': CodImpuesto1,
'%.02f': ValorImpuestoPara.get(CodImpuesto2, 0.0),
'%02d': CodImpuesto2,
'%.02f': ValorImpuestoPara.get(CodImpuesto3, 0.0),
'%02d': CodImpuesto3,
'%s': NitOFE,
'%s': NumAdq,
'%d': TipoAmb,
}
cufe = "".join(formatVars.keys()) % tuple(formatVars.values())
# crear hash...
h = hashlib.sha384()
h.update(cufe.encode('utf-8'))
return h.hexdigest()