Compare commits

..

5 Commits

Author SHA1 Message Date
El Mau 9f6e22c6ce Tablas para borrar 2022-03-10 11:42:39 -06:00
El Mau 482e016fcd Timbrado de Complemento de Pagos 2.0 2022-02-22 22:52:47 -06:00
El Mau acdb8f291e Agregar xlst para pagos 2.0 2022-02-22 14:53:44 -06:00
El Mau 66de6da21e Primer timbrado CFDI v4 2022-02-21 20:45:34 -06:00
El Mau 7ea28963f4 Agregar cadena para Cfdi 4 2022-02-18 14:59:19 -06:00
53 changed files with 995 additions and 4201 deletions

3
.gitignore vendored
View File

@ -2,7 +2,6 @@
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
*$py.class *$py.class
Pipfile*
# Django stuff: # Django stuff:
*.log *.log
@ -23,7 +22,6 @@ vedev/
# Virtualenv # Virtualenv
.env/ .env/
virtual/ virtual/
env
docs/build docs/build
cache/ cache/
@ -34,5 +32,4 @@ credenciales.conf
*.orig *.orig
rfc.db rfc.db
Dockerfile Dockerfile
chuletas/

View File

@ -1,129 +1,9 @@
v 2.3.2 [10-Abr-2024] v 2.0.0 [28-Feb-2022]
- Fix: En las mercancias en la Carta Porte al generar el PDF.
v 2.3.1 [02-Abr-2024]
- Fix: En la cantidad de la mercancia en la Carta Porte.
v 2.3.0 [01-Abr-2024]
- Mejora: Soporte para complemento Carta Porte 3.0
- **IMPORTANTE**: Aunque no lo uses, esto afecta al JS de facturación, por
lo que tienes que forzar el refresco (CTRL+F5) si tienes algún problema.
v 2.2.0 [24-Ene-2024]
- Mejora: Soporte para complemento Comercio Exterior 2.0
- **IMPORTANTE**: Aunque no lo uses, esto afecta al JS de facturación, por
lo que tienes que forzar el refresco (CTRL+F5) si tienes algún problema.
v 2.1.0 [26-Dic-2023]
- Mejora: Se agrega filtro por día en facturas.
v 2.0.9 [20-Dic-2023]
- Fix: Issue 98 y 107
v 2.0.8 [30-Oct-2023]
---------------------
- Fix: Permitir generar CFDI de egreso para facturas globales sin datos globales.
- Fix: Permitir cambiar la zona horaria para cuando se usa en servidor.
Es necesario hacer una migración:
```
cd /opt/empresa-libre
git pull origin master
cd source/app/models
python main.py -bk
python main.py -m -r RFC
```
v 2.0.7 [06-Ju1-2023]
---------------------
- Fix: En tasa de retención de un Resico a una Persona Moral.
v 2.0.6 [14-Jun-2023]
---------------------
- Fix: Al generar complementos de pago con facturas con retención de impuestos.
v 2.0.5 [05-Jun-2023]
---------------------
- Fix: Al generar complementos de pago con facturas con varios impuestos.
- Fix: ticket #103, hay que usar {receptor.correo_facturas} y {receptor.telefonos}
v 2.0.2 [01-Abr-2023]
---------------------
- Fix: Obtener la clave del sat al facturar por lote.
v 2.0.1 [29-Mar-2023]
---------------------
- Fix ticket #97
Es necesario hacer una migración:
```
cd /opt/empresa-libre
git pull origin master
cd source/app/models
python main.py -bk
python main.py -m -r RFC
```
v 2.0.0 [08-Ene-2023]
----------------------
- Liberamos para todos la versión CFDI 4.0
- **IMPORTANTE** NO intentes timbrar si **antes** no has validado en nuestro demo que puedes timbrar tus CFDIs habituales.
* IMPORTANTE:
Es necesario hacer una migración:
```
cd /opt/empresa-libre
git pull origin master
cd source/app/models
python main.py -bk
python main.py -m -r RFC
```
Y reiniciar todo. IMPORTANTE: dependiendo desde que versión actualices, tal vez debas de hacer algún prodecimiento extra. Siempre revisa este historial.
v 2.0.0 [31-Mar-2022]
---------------------- ----------------------
- Primera versión de timbrado con CFDI4 - Primera versión de timbrado con CFDI4
- **IMPORTANTE** NO intentes timbrar si **antes** no has validado en nuestro demo que puedes timbrar tus CFDIs habituales. - **IMPORTANTE** NO intentes timbrar si **antes** no has validado en nuestro demo que puedes timbrar tus CFDIs habituales.
v 1.47.0 [28-Mar-2022]
----------------------
- Mejora: Soporte basico para complemento Comercio Exterior.
v 1.46.5 [10-Mar-2022]
----------------------
- Error: Al timbrar nómina con Comercio Digital
v 1.46.4 [18-Feb-2022] v 1.46.4 [18-Feb-2022]
---------------------- ----------------------
- Error: Issue #54 - Error: Issue #54
@ -254,7 +134,7 @@ v 1.42.2 [14-Sep-2021]
- Los productos pueden no llevar ningún impuesto. - Los productos pueden no llevar ningún impuesto.
v 1.42.1 [01-Jun-2021] v 1.42.1 [31-May-2021]
---------------------- ----------------------
- Error - Ticket #5 - Error - Ticket #5

View File

@ -12,4 +12,3 @@
* Crea nueva documentación * Crea nueva documentación
* Propon nuevas funcionalidades * Propon nuevas funcionalidades
* Difunde Empresa Libre * Difunde Empresa Libre

View File

@ -15,11 +15,12 @@ contratar: administracion ARROBA empresalibre.net
G1: `A5DdXxCKPw3QKWVdDVs7CzkNugNUW1sHu5zDJFWxCU2h` G1: `A5DdXxCKPw3QKWVdDVs7CzkNugNUW1sHu5zDJFWxCU2h`
BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d` BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d`
## Requerimientos:
### Requerimientos:
* Servidor web, recomendado Nginx * Servidor web, recomendado Nginx
* uwsgi * uwsgi
* python 3.8 * python3.7+
* xsltproc * xsltproc
* openssl * openssl
* xmlsec * xmlsec
@ -36,25 +37,5 @@ aplicaciones Python.
El sistema tiene soporte solo para PostgreSQL, debes de instalar el servidor de El sistema tiene soporte solo para PostgreSQL, debes de instalar el servidor de
la base de datos y su driver respectivo. la base de datos y su driver respectivo.
## Configuración para desarrollo local
* Crea un entorno virtual con python 3.8 y actívalo. Por ejemplo con virtualenv:
virtualenv .venv
source .venv/bin/activate
* Instala las dependencias
pip install -r requirements.txt
* Copia y ajusta algunos archivos necesarios.
- `source/app/conf.py`
- `source/app/controllers/pacs/comerciodigital/conf.py.example`
- `source/app/controllers/pacs/finkok/conf.py.example`
* Finalmente ejecutamos la aplicación. Para esto vamos a necesitar un servidor
wsgi como uwsgi:
pip install uwsgi
cd source/app
uwsgi main_debug.ini
* Ahora puedes ver la aplicación en http://localhost:8000

View File

@ -1,3 +0,0 @@
[ ] Permitir más de un remolque en la Carta Porte
[ ] Campos de captura de Comercio Exterior
[ ] Representación impresa de Comercio Exterior

View File

@ -1 +1,2 @@
2.3.2 2.0.0

20
docs/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

18
docs/delete tables.md Normal file
View File

@ -0,0 +1,18 @@
prefacturasdetalle;
prefacturasimpuestos;
prefacturas;
ticketsimpuestos;
ticketsdetalle;
tickets;
facturasrelacionadas;
facturaspersonalizados;
facturaspagos;
facturasimpuestos;
facturasdetalle;
facturascomplementos;
facturas;
cfdipagos;
movimientosbanco;

35
docs/make.bat Normal file
View File

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

21
docs/source/index.rst Normal file
View File

@ -0,0 +1,21 @@
.. Documentación de Empresa Libre documentation master file, created by
sphinx-quickstart on Sat Oct 23 21:49:03 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Documentación de Empresa Libre
==============================
.. toctree::
:maxdepth: 2
:caption: Contents:
inicio
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

39
docs/source/inicio.rst Normal file
View File

@ -0,0 +1,39 @@
Introducción
============
Acerca de Empresa Libre
-----------------------
**Empresa Libre** es un sistema de facturación electrónica especialmente diseñado
para la legislación mexicana.
**Empresa Libre** es 100% Software Libre, recuerda, **Software Libre, NO gratis.**
Requerimientos
--------------
* Servidor web Nginx
* Servidor de bases de datos PostgreSQL
* uwsgi
* python3.7+
* xsltproc
* openssl
* xmlsec
y los requerimientos del archivo *requirements.txt*
También es necesario un certificado de sellos vigente para facturar.
Repositorio
-----------
En el `repositorio del proyecto`_, puedes usar el sistema de tickets para solicitar soporte gratuito.
Contratar soporte de pago ayuda al desarrollo y mantenimiento de **Empresa Libre**.
.. _repositorio del proyecto: https://git.cuates.net/elmau/empresa-libre

View File

@ -14,4 +14,9 @@ cryptography==3.4.8
xmlsec xmlsec
segno segno
# pyqrcode
# pypng
# python-escpos # python-escpos
# pyusb
# pyserial
# qrcode

View File

@ -27,8 +27,6 @@ from logbook import Logger
log = Logger('XML') log = Logger('XML')
CFDI_ACTUAL = 'cfdi40' CFDI_ACTUAL = 'cfdi40'
NOMINA_ACTUAL = 'nomina12' NOMINA_ACTUAL = 'nomina12'
PUBLIC = 'PUBLICO EN GENERAL'
CFDI_EGRESO = 'E'
DEFAULT = { DEFAULT = {
'exportacion': '01', 'exportacion': '01',
@ -111,16 +109,10 @@ SAT = {
'schema': ' http://www.sat.gob.mx/leyendasFiscales http://www.sat.gob.mx/sitio_internet/cfd/leyendasFiscales/leyendasFisc.xsd', 'schema': ' http://www.sat.gob.mx/leyendasFiscales http://www.sat.gob.mx/sitio_internet/cfd/leyendasFiscales/leyendasFisc.xsd',
}, },
'cartaporte': { 'cartaporte': {
'version': '3.0',
'prefix': 'cartaporte30',
'xmlns': 'http://www.sat.gob.mx/CartaPorte30',
'schema': ' http://www.sat.gob.mx/CartaPorte30 http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte30.xsd',
},
'comercioe': {
'version': '2.0', 'version': '2.0',
'prefix': 'cce20', 'prefix': 'cartaporte20',
'xmlns': 'http://www.sat.gob.mx/ComercioExterior20', 'xmlns': 'http://www.sat.gob.mx/CartaPorte20',
'schema': ' http://www.sat.gob.mx/ComercioExterior20 http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior20/ComercioExterior20.xsd', 'schema': ' http://www.sat.gob.mx/CartaPorte20 http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte20.xsd',
} }
} }
@ -141,10 +133,7 @@ class CFDI(object):
self._is_nomina = False self._is_nomina = False
self._leyendas = False self._leyendas = False
self._carta_porte = False self._carta_porte = False
self._comercio_exterior = False
self._divisas = '' self._divisas = ''
self._tipo_de_comprobante = ''
self._exportacion = DEFAULT['exportacion']
self.error = '' self.error = ''
def _now(self): def _now(self):
@ -155,8 +144,6 @@ class CFDI(object):
return '' return ''
self._comprobante(datos['comprobante']) self._comprobante(datos['comprobante'])
if 'global' in datos:
self._informacion_global(datos['global'])
self._relacionados(datos['relacionados']) self._relacionados(datos['relacionados'])
self._emisor(datos['emisor']) self._emisor(datos['emisor'])
self._receptor(datos['receptor']) self._receptor(datos['receptor'])
@ -169,9 +156,7 @@ class CFDI(object):
if 'nomina' in datos: if 'nomina' in datos:
self._nomina(datos['nomina']) self._nomina(datos['nomina'])
xml = self._to_pretty_xml(ET.tostring(self._cfdi, encoding='utf-8')) return self._to_pretty_xml(ET.tostring(self._cfdi, encoding='utf-8'))
return xml
def add_sello(self, sello, cert_txt): def add_sello(self, sello, cert_txt):
self._cfdi.attrib['Sello'] = sello self._cfdi.attrib['Sello'] = sello
@ -200,9 +185,6 @@ class CFDI(object):
self._pagos = bool(datos['complementos'].get('pagos', False)) self._pagos = bool(datos['complementos'].get('pagos', False))
self._leyendas = bool(datos['complementos'].get('leyendas', False)) self._leyendas = bool(datos['complementos'].get('leyendas', False))
self._carta_porte = bool(datos['complementos'].get('cartaporte', False)) self._carta_porte = bool(datos['complementos'].get('cartaporte', False))
self._comercio_exterior = bool(datos['complementos'].get('comercioe', False))
if self._comercio_exterior:
self._exportacion = datos['complementos']['comercioe'].pop('Exportacion')
self._divisas = datos['comprobante'].pop('divisas', '') self._divisas = datos['comprobante'].pop('divisas', '')
@ -274,16 +256,10 @@ class CFDI(object):
attributes[name] = SAT['cartaporte']['xmlns'] attributes[name] = SAT['cartaporte']['xmlns']
schema_carta_porte = SAT['cartaporte']['schema'] schema_carta_porte = SAT['cartaporte']['schema']
schema_comercioe = ''
if self._comercio_exterior:
name = 'xmlns:{}'.format(SAT['comercioe']['prefix'])
attributes[name] = SAT['comercioe']['xmlns']
schema_carta_porte = SAT['comercioe']['schema']
attributes['xsi:schemaLocation'] = self._sat_cfdi['schema'] + \ attributes['xsi:schemaLocation'] = self._sat_cfdi['schema'] + \
schema_locales + schema_donativo + schema_ine + schema_edu + \ schema_locales + schema_donativo + schema_ine + schema_edu + \
schema_divisas + schema_nomina + schema_pagos + schema_leyendas + \ schema_divisas + schema_nomina + schema_pagos + schema_leyendas + \
schema_carta_porte + schema_comercioe schema_carta_porte
attributes.update(datos) attributes.update(datos)
if not 'Version' in attributes: if not 'Version' in attributes:
@ -293,21 +269,11 @@ class CFDI(object):
# ~ cfdi4 # ~ cfdi4
if not 'Exportacion' in attributes: if not 'Exportacion' in attributes:
attributes['Exportacion'] = self._exportacion attributes['Exportacion'] = DEFAULT['exportacion']
self._tipo_de_comprobante = attributes['TipoDeComprobante']
self._cfdi = ET.Element('{}:Comprobante'.format(self._pre), attributes) self._cfdi = ET.Element('{}:Comprobante'.format(self._pre), attributes)
return return
def _informacion_global(self, datos):
if not datos:
return
node_name = '{}:InformacionGlobal'.format(self._pre)
node = ET.SubElement(self._cfdi, node_name, datos)
return
def _relacionados(self, datos): def _relacionados(self, datos):
if not datos or not datos['tipo'] or not datos['cfdis']: if not datos or not datos['tipo'] or not datos['cfdis']:
return return
@ -327,10 +293,6 @@ class CFDI(object):
return return
def _receptor(self, datos): def _receptor(self, datos):
receptor_name = datos['Nombre'].upper()
if receptor_name == PUBLIC and self._tipo_de_comprobante == CFDI_EGRESO:
receptor_name = datos['Nombre']
datos['Nombre'] = receptor_name
node_name = '{}:Receptor'.format(self._pre) node_name = '{}:Receptor'.format(self._pre)
emisor = ET.SubElement(self._cfdi, node_name, datos) emisor = ET.SubElement(self._cfdi, node_name, datos)
return return
@ -400,10 +362,6 @@ class CFDI(object):
for field in fields: for field in fields:
if field in datos: if field in datos:
attributes[field] = datos[field] attributes[field] = datos[field]
if not attributes:
return
node_name = '{}:Impuestos'.format(self._pre) node_name = '{}:Impuestos'.format(self._pre)
impuestos = ET.SubElement(self._cfdi, node_name, attributes) impuestos = ET.SubElement(self._cfdi, node_name, attributes)
@ -520,47 +478,6 @@ class CFDI(object):
return return
def _complemento_comercio_exterior(self, datos):
prefix = SAT['comercioe']['prefix']
emisor = datos.pop('emisor')
propietarios = datos.pop('propietarios', {})
receptor = datos.pop('receptor')
destinatario = datos.pop('destinatario', {})
mercancias = datos.pop('mercancias')
attr = {'Version': SAT['comercioe']['version']}
attr.update(datos)
ce = ET.SubElement(
self._complemento, f'{prefix}:ComercioExterior', attr)
attributes = {}
if 'Curp' in emisor:
attributes = {'Curp': emisor.pop('Curp')}
node = ET.SubElement(ce, '{}:Emisor'.format(prefix), attributes)
ET.SubElement(node, '{}:Domicilio'.format(prefix), emisor)
attributes = {}
if 'NumRegIdTrib' in receptor:
attributes = {'NumRegIdTrib': receptor.pop('NumRegIdTrib')}
node = ET.SubElement(ce, '{}:Receptor'.format(prefix), attributes)
ET.SubElement(node, '{}:Domicilio'.format(prefix), receptor)
node = ET.SubElement(ce, '{}:Mercancias'.format(prefix))
fields = ('Marca', 'Modelo', 'SubModelo', 'NumeroSerie')
for row in mercancias:
detalle = {}
for f in fields:
if f in row and row[f]:
detalle[f] = row[f]
row.pop(f)
concepto = ET.SubElement(node, '{}:Mercancia'.format(prefix), row)
if detalle:
ET.SubElement(
concepto, '{}:DescripcionesEspecificas'.format(prefix), detalle)
return
def _complementos(self, datos): def _complementos(self, datos):
if not datos: if not datos:
return return
@ -575,11 +492,6 @@ class CFDI(object):
mercancias = datos.pop('mercancias', ()) mercancias = datos.pop('mercancias', ())
tiposfigura = datos.pop('tiposfigura', ()) tiposfigura = datos.pop('tiposfigura', ())
autotransporte = datos.pop('autotransporte', {})
identificacion = autotransporte.pop('identificacion')
seguros = autotransporte.pop('seguros')
remolques = autotransporte.pop('remolques')
atributos = {'Version': SAT['cartaporte']['version']} atributos = {'Version': SAT['cartaporte']['version']}
atributos.update(datos) atributos.update(datos)
@ -597,6 +509,10 @@ class CFDI(object):
attr = mercancias attr = mercancias
mercancias = attr.pop('mercancias') mercancias = attr.pop('mercancias')
autotransporte = attr.pop('autotransporte')
identificacion = autotransporte.pop('identificacion')
seguros = autotransporte.pop('seguros')
remolque = autotransporte.pop('remolque')
node = ET.SubElement(node_carta, f'{prefix}:Mercancias', attr) node = ET.SubElement(node_carta, f'{prefix}:Mercancias', attr)
for mercancia in mercancias: for mercancia in mercancias:
@ -605,10 +521,10 @@ class CFDI(object):
sub_node = ET.SubElement(node, f'{prefix}:Autotransporte', autotransporte) sub_node = ET.SubElement(node, f'{prefix}:Autotransporte', autotransporte)
ET.SubElement(sub_node, f'{prefix}:IdentificacionVehicular', identificacion) ET.SubElement(sub_node, f'{prefix}:IdentificacionVehicular', identificacion)
ET.SubElement(sub_node, f'{prefix}:Seguros', seguros) ET.SubElement(sub_node, f'{prefix}:Seguros', seguros)
if remolques: if 'SubTipoRem' in remolque and 'Placa' in remolque \
node_remolques = ET.SubElement(sub_node, f'{prefix}:Remolques') and remolque['SubTipoRem'] and remolque['Placa']:
for remolque in remolques: tmp = ET.SubElement(sub_node, f'{prefix}:Remolques')
ET.SubElement(node_remolques, f'{prefix}:Remolque', remolque) ET.SubElement(tmp, f'{prefix}:Remolque', remolque)
if tiposfigura: if tiposfigura:
sub_node = ET.SubElement(node_carta, f'{prefix}:FiguraTransporte') sub_node = ET.SubElement(node_carta, f'{prefix}:FiguraTransporte')
@ -631,9 +547,7 @@ class CFDI(object):
atributos.update(datos['ine']) atributos.update(datos['ine'])
node_ine = ET.SubElement(self._complemento, 'ine:INE', atributos) node_ine = ET.SubElement(self._complemento, 'ine:INE', atributos)
if ine_key_entidad: if ine_key_entidad:
attr = {'ClaveEntidad': ine_key_entidad} attr = {'ClaveEntidad': ine_key_entidad, 'Ambito': ine_ambito}
if ine_ambito:
attr['Ambito'] = ine_ambito
node_entidad = ET.SubElement(node_ine, 'ine:Entidad', attr) node_entidad = ET.SubElement(node_ine, 'ine:Entidad', attr)
attr = {'IdContabilidad': ine_id_conta} attr = {'IdContabilidad': ine_id_conta}
ET.SubElement(node_entidad, 'ine:Contabilidad', attr) ET.SubElement(node_entidad, 'ine:Contabilidad', attr)
@ -655,11 +569,9 @@ class CFDI(object):
for row in relacionados: for row in relacionados:
taxes = row.pop('taxes') taxes = row.pop('taxes')
node = ET.SubElement(node_pago, f'{pre}:DoctoRelacionado', row) node = ET.SubElement(node_pago, f'{pre}:DoctoRelacionado', row)
nodex_tax = None node_tax = ET.SubElement(node, f'{pre}:ImpuestosDR')
if taxes['traslados'] or taxes['retenciones']:
node_tax = ET.SubElement(node, f'{pre}:ImpuestosDR')
if taxes['retenciones']: if taxes['retenciones']:
node = ET.SubElement(node_tax, f'{pre}:RetencionesDR') node = ET.SubElement(node_tax, f'{pre}:RetencionsDR')
for tax in taxes['retenciones']: for tax in taxes['retenciones']:
ET.SubElement(node, f'{pre}:RetencionDR', tax) ET.SubElement(node, f'{pre}:RetencionDR', tax)
if taxes['traslados']: if taxes['traslados']:
@ -667,10 +579,9 @@ class CFDI(object):
for tax in taxes['traslados']: for tax in taxes['traslados']:
ET.SubElement(node, f'{pre}:TrasladoDR', tax) ET.SubElement(node, f'{pre}:TrasladoDR', tax)
if taxes_pay['traslados'] or taxes_pay['retenciones']: node_tax = ET.SubElement(node_pago, f'{pre}:ImpuestosP')
node_tax = ET.SubElement(node_pago, f'{pre}:ImpuestosP')
if taxes_pay['retenciones']: if taxes_pay['retenciones']:
node = ET.SubElement(node_tax, f'{pre}:RetencionesP') node = ET.SubElement(node_tax, f'{pre}:RetencionsP')
for key, importe in taxes_pay['retenciones'].items(): for key, importe in taxes_pay['retenciones'].items():
attr = {'ImpuestoP': key, 'ImporteP': importe} attr = {'ImpuestoP': key, 'ImporteP': importe}
ET.SubElement(node, f'{pre}:RetencionP', attr) ET.SubElement(node, f'{pre}:RetencionP', attr)
@ -687,8 +598,57 @@ class CFDI(object):
for leyend in datos['leyendas']: for leyend in datos['leyendas']:
ET.SubElement(node_leyend, '{}:Leyenda'.format(pre), leyend) ET.SubElement(node_leyend, '{}:Leyenda'.format(pre), leyend)
if self._comercio_exterior: if 'ce' in datos:
datos = datos.pop('comercioe') pre = 'cce11'
self._complemento_comercio_exterior(datos) datos = datos.pop('ce')
emisor = datos.pop('emisor')
propietario = datos.pop('propietario')
receptor = datos.pop('receptor')
destinatario = datos.pop('destinatario')
conceptos = datos.pop('conceptos')
attributes = {}
attributes['xmlns:{}'.format(pre)] = \
'http://www.sat.gob.mx/ComercioExterior11'
attributes['xsi:schemaLocation'] = \
'http://www.sat.gob.mx/ComercioExterior11 ' \
'http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior11/ComercioExterior11.xsd'
attributes.update(datos)
ce = ET.SubElement(
complemento, '{}:ComercioExterior'.format(pre), attributes)
attributes = {}
if 'Curp' in emisor:
attributes = {'Curp': emisor.pop('Curp')}
node = ET.SubElement(ce, '{}:Emisor'.format(pre), attributes)
ET.SubElement(node, '{}:Domicilio'.format(pre), emisor)
if propietario:
ET.SubElement(ce, '{}:Propietario'.format(pre), propietario)
attributes = {}
if 'NumRegIdTrib' in receptor:
attributes = {'NumRegIdTrib': receptor.pop('NumRegIdTrib')}
node = ET.SubElement(ce, '{}:Receptor'.format(pre), attributes)
ET.SubElement(node, '{}:Domicilio'.format(pre), receptor)
attributes = {}
if 'NumRegIdTrib' in destinatario:
attributes = {'NumRegIdTrib': destinatario.pop('NumRegIdTrib')}
if 'Nombre' in destinatario:
attributes.update({'Nombre': destinatario.pop('Nombre')})
node = ET.SubElement(ce, '{}:Destinatario'.format(pre), attributes)
ET.SubElement(node, '{}:Domicilio'.format(pre), destinatario)
node = ET.SubElement(ce, '{}:Mercancias'.format(pre))
fields = ('Marca', 'Modelo', 'SubModelo', 'NumeroSerie')
for row in conceptos:
detalle = {}
for f in fields:
if f in row:
detalle[f] = row.pop(f)
concepto = ET.SubElement(node, '{}:Mercancia'.format(pre), row)
if detalle:
ET.SubElement(
concepto, '{}:DescripcionesEspecificas'.format(pre), detalle)
return return

View File

@ -542,16 +542,12 @@ class AppDocumentos(object):
self._db = db self._db = db
def on_get(self, req, resp, type_doc, id_doc): def on_get(self, req, resp, type_doc, id_doc):
# ~ print('TD', type_doc)
session = req.env['beaker.session'] session = req.env['beaker.session']
req.context['result'], file_name, content_type = \ req.context['result'], file_name, content_type = \
self._db.get_doc(type_doc, id_doc, session['rfc']) self._db.get_doc(type_doc, id_doc, session['rfc'])
if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html', 'nompdf'): if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html'):
resp.append_header('Content-Disposition', resp.append_header('Content-Disposition',
'attachment; filename={}'.format(file_name)) 'attachment; filename={}'.format(file_name))
if type_doc in ('pdf', 'nompdf', 'pdfpago'):
resp.append_header('Content-Disposition',
'inline; filename={}'.format(file_name))
resp.content_type = content_type resp.content_type = content_type
resp.status = falcon.HTTP_200 resp.status = falcon.HTTP_200
@ -813,15 +809,3 @@ class AppSATRegimenes(object):
user = req.env['beaker.session']['userobj'] user = req.env['beaker.session']['userobj']
req.context['result'] = self._db.sat_regimenes_get(values, user) req.context['result'] = self._db.sat_regimenes_get(values, user)
resp.status = falcon.HTTP_200 resp.status = falcon.HTTP_200
class AppSociosRegimenes(object):
def __init__(self, db):
self._db = db
def on_get(self, req, resp):
values = req.params
user = req.env['beaker.session']['userobj']
req.context['result'] = self._db.socios_regimenes_get(values, user)
resp.status = falcon.HTTP_200

View File

@ -41,12 +41,6 @@ logging.getLogger('requests').setLevel(logging.ERROR)
TIMEOUT = 10 TIMEOUT = 10
NAMESPACES = {
'3.3': 'http://www.sat.gob.mx/cfd/3',
'4.0': 'http://www.sat.gob.mx/cfd/4',
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
}
def pretty_print_POST(req): def pretty_print_POST(req):
""" """
@ -69,7 +63,7 @@ class PACComercioDigital(object):
ws = 'https://{}.comercio-digital.mx/{}' ws = 'https://{}.comercio-digital.mx/{}'
api = 'https://app2.comercio-digital.mx/{}' api = 'https://app2.comercio-digital.mx/{}'
URL = { URL = {
'timbra': ws.format('ws', 'timbre4/timbrarV5'), 'timbra': ws.format('ws', 'timbre/timbrarV5.aspx'),
'cancel': ws.format('cancela', 'cancela4/cancelarUuid'), 'cancel': ws.format('cancela', 'cancela4/cancelarUuid'),
'cancelxml': ws.format('cancela', 'cancela4/cancelarXml'), 'cancelxml': ws.format('cancela', 'cancela4/cancelarXml'),
'status': ws.format('cancela', 'arws/consultaEstatus'), 'status': ws.format('cancela', 'arws/consultaEstatus'),
@ -84,7 +78,7 @@ class PACComercioDigital(object):
'702': '702 Error rfc/empresa invalido', '702': '702 Error rfc/empresa invalido',
} }
NS_CFDI = { NS_CFDI = {
'cfdi': 'http://www.sat.gob.mx/cfd/4', 'cfdi': 'http://www.sat.gob.mx/cfd/3',
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital', 'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
} }
@ -92,7 +86,7 @@ class PACComercioDigital(object):
ws = 'https://pruebas.comercio-digital.mx/{}' ws = 'https://pruebas.comercio-digital.mx/{}'
ws6 = 'https://pruebas6.comercio-digital.mx/arws/{}' ws6 = 'https://pruebas6.comercio-digital.mx/arws/{}'
URL = { URL = {
'timbra': ws.format('timbre4/timbrarV5'), 'timbra': ws.format('timbre/timbrarV5.aspx'),
'cancel': ws.format('cancela4/cancelarUuid'), 'cancel': ws.format('cancela4/cancelarUuid'),
'cancelxml': ws.format('cancela4/cancelarXml'), 'cancelxml': ws.format('cancela4/cancelarXml'),
'status': ws6.format('consultaEstatus'), 'status': ws6.format('consultaEstatus'),
@ -132,10 +126,10 @@ class PACComercioDigital(object):
""" """
Comercio Digital solo soporta la declaración con doble comilla Comercio Digital solo soporta la declaración con doble comilla
""" """
# ~ tree = ET.fromstring(xml.encode()) tree = ET.fromstring(xml.encode())
# ~ xml = ET.tostring(tree, xml = ET.tostring(tree,
# ~ pretty_print=True, doctype='<?xml version="1.0" encoding="utf-8"?>') pretty_print=True, doctype='<?xml version="1.0" encoding="utf-8"?>')
return xml.encode('utf-8') return xml
def stamp(self, cfdi, auth): def stamp(self, cfdi, auth):
# ~ if DEBUG or not auth: # ~ if DEBUG or not auth:
@ -181,29 +175,26 @@ class PACComercioDigital(object):
info['key'] = base64.b64encode(info['key_enc']).decode() info['key'] = base64.b64encode(info['key_enc']).decode()
info['cer'] = base64.b64encode(info['cer_ori']).decode() info['cer'] = base64.b64encode(info['cer_ori']).decode()
tree = ET.fromstring(cfdi.encode()) NS_CFDI = {
version = tree.attrib['Version'] 'cfdi': 'http://www.sat.gob.mx/cfd/3',
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
namespaces = {
'cfdi': NAMESPACES[version],
'tdf': NAMESPACES['tdf'],
} }
tree = ET.fromstring(cfdi.encode())
tipo = tree.xpath( tipo = tree.xpath(
'string(//cfdi:Comprobante/@TipoDeComprobante)', 'string(//cfdi:Comprobante/@TipoDeComprobante)',
namespaces=namespaces) namespaces=NS_CFDI)
total = tree.xpath( total = tree.xpath(
'string(//cfdi:Comprobante/@Total)', 'string(//cfdi:Comprobante/@Total)',
namespaces=namespaces) namespaces=NS_CFDI)
rfc_emisor = tree.xpath( rfc_emisor = tree.xpath(
'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)', 'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)',
namespaces=namespaces) namespaces=NS_CFDI)
rfc_receptor = tree.xpath( rfc_receptor = tree.xpath(
'string(//cfdi:Comprobante/cfdi:Receptor/@Rfc)', 'string(//cfdi:Comprobante/cfdi:Receptor/@Rfc)',
namespaces=namespaces) namespaces=NS_CFDI)
uid = tree.xpath( uid = tree.xpath(
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)', 'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
namespaces=namespaces) namespaces=NS_CFDI)
data = ( data = (
f"USER={auth['user']}", f"USER={auth['user']}",
f"PWDW={auth['pass']}", f"PWDW={auth['pass']}",

View File

@ -47,7 +47,7 @@ logging.getLogger('zeep').setLevel(logging.ERROR)
TIMEOUT = 10 TIMEOUT = 10
DEBUG_SOAP = False DEBUG_SOAP = True
class DebugPlugin(Plugin): class DebugPlugin(Plugin):
@ -74,7 +74,7 @@ class PACFinkok(object):
WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl' WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
NS_TYPE = 'ns1' NS_TYPE = 'ns1'
if DEBUG: if DEBUG:
WS = 'https://demo-facturacion.finkok.com/servicios/soap/{}.wsdl' WS = 'http://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
NS_TYPE = 'ns0' NS_TYPE = 'ns0'
URL = { URL = {
'quick_stamp': False, 'quick_stamp': False,
@ -190,18 +190,11 @@ class PACFinkok(object):
return data return data
def _get_data_cancel(self, cfdi): def _get_data_cancel(self, cfdi):
VERSIONS = {
'3.3': 'http://www.sat.gob.mx/cfd/3',
'4.0': 'http://www.sat.gob.mx/cfd/4',
}
NS_CFDI = { NS_CFDI = {
'cfdi': 'http://www.sat.gob.mx/cfd/3',
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital', 'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
} }
tree = ET.fromstring(cfdi.encode()) tree = ET.fromstring(cfdi.encode())
version = tree.attrib['Version']
NS_CFDI['cfdi'] = VERSIONS[version]
rfc_emisor = tree.xpath( rfc_emisor = tree.xpath(
'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)', 'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)',
namespaces=NS_CFDI) namespaces=NS_CFDI)
@ -230,7 +223,6 @@ class PACFinkok(object):
'Motivo': info['args']['reason'], 'Motivo': info['args']['reason'],
} }
# ~ 'UUIDS': uuid_type(uuids=sa(string=cfdi_uuid)), # ~ 'UUIDS': uuid_type(uuids=sa(string=cfdi_uuid)),
args = { args = {
'UUIDS': uuid_type(ns1_uuid(**data_uuid)), 'UUIDS': uuid_type(ns1_uuid(**data_uuid)),
'username': auth['user'], 'username': auth['user'],

View File

@ -30,7 +30,6 @@ import requests
import sqlite3 import sqlite3
import socket import socket
import subprocess import subprocess
import sys
import tempfile import tempfile
import textwrap import textwrap
import threading import threading
@ -45,6 +44,7 @@ from pathlib import Path
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
from xml.dom.minidom import parseString from xml.dom.minidom import parseString
try: try:
import uno import uno
from com.sun.star.beans import PropertyValue from com.sun.star.beans import PropertyValue
@ -52,20 +52,9 @@ try:
from com.sun.star.view.PaperFormat import LETTER from com.sun.star.view.PaperFormat import LETTER
APP_LIBO = True APP_LIBO = True
except ImportError: except ImportError:
path_fun = '/usr/lib/libreoffice/program/fundamentalrc' APP_LIBO = False
path_uno = '/usr/lib/libreoffice/program/'
os.environ['URE_BOOTSTRAP'] = f'vnd.sun.star.pathname:{path_fun}'
os.environ['UNO_PATH'] = path_uno
sys.path.append(path_uno)
try:
import uno
from com.sun.star.beans import PropertyValue
from com.sun.star.awt import Size
from com.sun.star.view.PaperFormat import LETTER
APP_LIBO = True
except ImportError:
APP_LIBO = False
# ~ import pyqrcode
from dateutil import parser from dateutil import parser
from lxml import etree from lxml import etree
@ -80,6 +69,7 @@ from settings import DEBUG, MV, log, template_lookup, COMPANIES, DB_SAT, \
PATH_XMLSEC, TEMPLATE_CANCEL, DEFAULT_SAT_PRODUCTO, DECIMALES, DIR_FACTURAS PATH_XMLSEC, TEMPLATE_CANCEL, DEFAULT_SAT_PRODUCTO, DECIMALES, DIR_FACTURAS
from settings import USAR_TOKEN, API, DECIMALES_TAX from settings import USAR_TOKEN, API, DECIMALES_TAX
# ~ from .configpac import AUTH
from .utils import get_qr from .utils import get_qr
@ -92,7 +82,6 @@ from settings import (
EXT, EXT,
MXN, MXN,
PATHS, PATHS,
PRE_DEFAULT,
) )
@ -303,8 +292,7 @@ def get_sat_productos(key):
def now(): def now():
n = datetime.datetime.now().replace(microsecond=0) return datetime.datetime.now().replace(microsecond=0)
return n
def today(): def today():
@ -649,12 +637,6 @@ class LIBO(object):
self._set_cell('{cfdi.%s}' % k, v) self._set_cell('{cfdi.%s}' % k, v)
return return
def _informacion_global(self, data):
for k, v in data.items():
print(k, v)
self._set_cell('{cfdi.%s}' % k, v)
return
def _emisor(self, data): def _emisor(self, data):
for k, v in data.items(): for k, v in data.items():
self._set_cell('{emisor.%s}' % k, v) self._set_cell('{emisor.%s}' % k, v)
@ -752,12 +734,7 @@ class LIBO(object):
if pakings: if pakings:
col8.append((pakings[i],)) col8.append((pakings[i],))
self._total_cantidades += float(cantidad) self._total_cantidades += float(cantidad)
if not count: if not count:
if not cell_5 is None:
cell_5.CellStyle = self._get_style(cell_5)
if not cell_6 is None:
cell_6.CellStyle = self._get_style(cell_6)
return return
style_5 = self._get_style(cell_5) style_5 = self._get_style(cell_5)
@ -897,6 +874,8 @@ class LIBO(object):
image = self._template.createInstance('com.sun.star.drawing.GraphicObjectShape') image = self._template.createInstance('com.sun.star.drawing.GraphicObjectShape')
gp = self._create_instance('com.sun.star.graphic.GraphicProvider') gp = self._create_instance('com.sun.star.graphic.GraphicProvider')
pd.add(image) pd.add(image)
# ~ image.GraphicURL = data['path_cbb']
# ~ properties = self._set_properties({'URL': self._path_url(data['path_cbb'])})
instance = 'com.sun.star.io.SequenceInputStream' instance = 'com.sun.star.io.SequenceInputStream'
stream = self._create_instance(instance) stream = self._create_instance(instance)
@ -905,11 +884,11 @@ class LIBO(object):
image.Graphic = gp.queryGraphic(properties) image.Graphic = gp.queryGraphic(properties)
s = Size() s = Size()
s.Width = 4000 s.Width = 4150
s.Height = 4000 s.Height = 4500
image.setSize(s) image.setSize(s)
image.Anchor = self._set_cell('{timbre.cbb}') image.Anchor = self._set_cell('{timbre.cbb}')
# ~ _kill(data['path_cbb'])
return return
def _donataria(self, data): def _donataria(self, data):
@ -961,7 +940,6 @@ class LIBO(object):
return return
# ~ print(data) # ~ print(data)
qr = data.pop('qr', False)
figuras = data.pop('figuras') figuras = data.pop('figuras')
mercancias = data.pop('mercancias') mercancias = data.pop('mercancias')
detalle = mercancias.pop('detalle') detalle = mercancias.pop('detalle')
@ -1020,10 +998,6 @@ class LIBO(object):
cell_3 = self._set_cell('{cp.ClaveUnidad}', unidad) cell_3 = self._set_cell('{cp.ClaveUnidad}', unidad)
cell_4 = self._set_cell('{cp.Cantidad}', cantidad) cell_4 = self._set_cell('{cp.Cantidad}', cantidad)
cell_5 = self._set_cell('{cp.PesoEnKg}', peso) cell_5 = self._set_cell('{cp.PesoEnKg}', peso)
if cell_1 is None:
break
if count > 0: if count > 0:
row = cell_1.CellAddress.Row + 1 row = cell_1.CellAddress.Row + 1
self._sheet.getRows().insertByIndex(row, count) self._sheet.getRows().insertByIndex(row, count)
@ -1034,72 +1008,7 @@ class LIBO(object):
cell_3 = self._set_cell(v=unidad, cell=cell_3) cell_3 = self._set_cell(v=unidad, cell=cell_3)
cell_4 = self._set_cell(v=cantidad, cell=cell_4) cell_4 = self._set_cell(v=cantidad, cell=cell_4)
cell_5 = self._set_cell(v=peso, cell=cell_5) cell_5 = self._set_cell(v=peso, cell=cell_5)
if qr:
self._timbre_carta(qr)
return
def _timbre_carta(self, qr):
pd = self._sheet.getDrawPage()
image = self._template.createInstance('com.sun.star.drawing.GraphicObjectShape')
gp = self._create_instance('com.sun.star.graphic.GraphicProvider')
pd.add(image)
instance = 'com.sun.star.io.SequenceInputStream'
stream = self._create_instance(instance)
stream.initialize((uno.ByteSequence(qr.getvalue()),))
properties = self._set_properties({'InputStream': stream})
image.Graphic = gp.queryGraphic(properties)
s = Size()
s.Width = 4000
s.Height = 4000
image.setSize(s)
image.Anchor = self._set_cell('{cp.qr}')
return
def _comercio_exterior(self, data):
if not data:
return
emisor = data.pop('emisor')
receptor = data.pop('receptor')
mercancias = data.pop('mercancias')
for k, v in data.items():
self._set_cell(f'{{cce.{k}}}', v)
for k, v in emisor.items():
self._set_cell(f'{{cce.emisor.{k}}}', v)
for k, v in receptor.items():
self._set_cell(f'{{cce.receptor.{k}}}', v)
first = True
count = len(mercancias) - 1
for i, mercancia in enumerate(mercancias):
no_identificacion = mercancia['NoIdentificacion']
fraccion = mercancia['FraccionArancelaria']
unidad = mercancia['UnidadAduana']
cantidad = mercancia['CantidadAduana']
valor_unitario = mercancia['ValorUnitarioAduana']
valor_dolares = mercancia['ValorDolares']
if first:
first = False
cell_1 = self._set_cell('{cce.mercancia.noidentificacion}', no_identificacion)
cell_2 = self._set_cell('{cce.mercancia.fraccionarancelaria}', fraccion)
cell_3 = self._set_cell('{cce.mercancia.unidadaduana}', unidad)
cell_4 = self._set_cell('{cce.mercancia.cantidadaduana}', cantidad)
cell_5 = self._set_cell('{cce.mercancia.valorunitarioaduana}', valor_unitario)
cell_6 = self._set_cell('{cce.mercancia.valordolares}', valor_dolares)
if count > 0:
row = cell_1.CellAddress.Row + 1
self._sheet.getRows().insertByIndex(row, count)
self._copy_paste_rows(cell_1, count)
else:
cell_1 = self._set_cell(v=no_identificacion, cell=cell_1)
cell_2 = self._set_cell(v=fraccion, cell=cell_2)
cell_3 = self._set_cell(v=unidad, cell=cell_3)
cell_4 = self._set_cell(v=cantidad, cell=cell_4)
cell_5 = self._set_cell(v=valor_unitario, cell=cell_5)
cell_6 = self._set_cell(v=valor_dolares, cell=cell_6)
return return
def _nomina(self, data): def _nomina(self, data):
@ -1211,9 +1120,6 @@ class LIBO(object):
return return
def _cfdipays(self, data): def _cfdipays(self, data):
VERSION2 = '2.0'
version = data['Version']
related = data.pop('related', []) related = data.pop('related', [])
for k, v in data.items(): for k, v in data.items():
if k.lower() in ('monto',): if k.lower() in ('monto',):
@ -1245,8 +1151,7 @@ class LIBO(object):
cell_1 = self._set_cell('{doc.uuid}', uuid) cell_1 = self._set_cell('{doc.uuid}', uuid)
cell_2 = self._set_cell('{doc.serie}', serie) cell_2 = self._set_cell('{doc.serie}', serie)
cell_3 = self._set_cell('{doc.folio}', folio) cell_3 = self._set_cell('{doc.folio}', folio)
if version != VERSION2: cell_4 = self._set_cell('{doc.metodopago}', metodo_pago)
cell_4 = self._set_cell('{doc.metodopago}', metodo_pago)
cell_5 = self._set_cell('{doc.moneda}', moneda) cell_5 = self._set_cell('{doc.moneda}', moneda)
cell_6 = self._set_cell('{doc.parcialidad}', parcialidad) cell_6 = self._set_cell('{doc.parcialidad}', parcialidad)
cell_7 = self._set_cell('{doc.saldoanterior}', saldo_anterior, value=True) cell_7 = self._set_cell('{doc.saldoanterior}', saldo_anterior, value=True)
@ -1256,8 +1161,7 @@ class LIBO(object):
col1.append((uuid,)) col1.append((uuid,))
col2.append((serie,)) col2.append((serie,))
col3.append((folio,)) col3.append((folio,))
if version != VERSION2: col4.append((metodo_pago,))
col4.append((metodo_pago,))
col5.append((moneda,)) col5.append((moneda,))
col6.append((parcialidad,)) col6.append((parcialidad,))
col7.append((float(saldo_anterior),)) col7.append((float(saldo_anterior),))
@ -1283,9 +1187,8 @@ class LIBO(object):
target2 = self._sheet.getCellRangeByPosition(col, row1, col, row2) target2 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
col = cell_3.getCellAddress().Column col = cell_3.getCellAddress().Column
target3 = self._sheet.getCellRangeByPosition(col, row1, col, row2) target3 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
if version != VERSION2: col = cell_4.getCellAddress().Column
col = cell_4.getCellAddress().Column target4 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
target4 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
col = cell_5.getCellAddress().Column col = cell_5.getCellAddress().Column
target5 = self._sheet.getCellRangeByPosition(col, row1, col, row2) target5 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
col = cell_6.getCellAddress().Column col = cell_6.getCellAddress().Column
@ -1300,8 +1203,7 @@ class LIBO(object):
target1.setFormulaArray(tuple(col1)) target1.setFormulaArray(tuple(col1))
target2.setDataArray(tuple(col2)) target2.setDataArray(tuple(col2))
target3.setFormulaArray(tuple(col3)) target3.setFormulaArray(tuple(col3))
if version != VERSION2: target4.setDataArray(tuple(col4))
target4.setDataArray(tuple(col4))
target5.setDataArray(tuple(col5)) target5.setDataArray(tuple(col5))
target6.setDataArray(tuple(col6)) target6.setDataArray(tuple(col6))
target7.setDataArray(tuple(col7)) target7.setDataArray(tuple(col7))
@ -1320,7 +1222,6 @@ class LIBO(object):
pakings = data.pop('pakings', []) pakings = data.pop('pakings', [])
self._comprobante(data['comprobante']) self._comprobante(data['comprobante'])
self._informacion_global(data.get('informacion_global', {}))
self._emisor(data['emisor']) self._emisor(data['emisor'])
self._receptor(data['receptor']) self._receptor(data['receptor'])
self._conceptos(data['conceptos'], pakings) self._conceptos(data['conceptos'], pakings)
@ -1338,7 +1239,6 @@ class LIBO(object):
self._divisas(data.get('divisas', {})) self._divisas(data.get('divisas', {}))
self._leyendas(data.get('leyendas', '')) self._leyendas(data.get('leyendas', ''))
self._carta_porte(data.get('carta_porte', {})) self._carta_porte(data.get('carta_porte', {}))
self._comercio_exterior(data.get('comercio_exterior', {}))
self._timbre(data['timbre']) self._timbre(data['timbre'])
@ -1390,7 +1290,6 @@ class LIBO(object):
except KeyError: except KeyError:
msg = 'Hoja no existe' msg = 'Hoja no existe'
return (), msg return (), msg
return cursor.getDataArray(), '' return cursor.getDataArray(), ''
def products(self, path): def products(self, path):
@ -1460,7 +1359,6 @@ class LIBO(object):
'codigo_postal', 'codigo_postal',
'notas', 'notas',
'correo', 'correo',
'regimen_fiscal',
) )
rows = tuple([dict(zip(fields, r)) for r in data[1:]]) rows = tuple([dict(zip(fields, r)) for r in data[1:]])
msg = 'Empleados importados correctamente' msg = 'Empleados importados correctamente'
@ -1651,105 +1549,41 @@ class LIBO(object):
return (), msg return (), msg
rows = tuple(data[1:]) rows = tuple(data[1:])
return rows, '' return rows, ''
def _data_to_dict(self, rows):
data = {k: v for k, v in rows if v}
return data
def _current_region_to_tuple(self, cursor):
data = []
cursor.collapseToCurrentRegion()
rows = cursor.getDataArray()[1:]
if len(rows) == 1:
return data
keys = rows[0]
data = [dict(zip(keys, values)) for values in rows[1:]]
return data
def _get_data_ce(self, doc):
msg = ''
data = {}
try:
sheet = doc.Sheets[0]
rango = sheet['A2:B10']
data = self._data_to_dict(rango.DataArray)
rango = sheet['A13:B23']
data['emisor'] = self._data_to_dict(rango.DataArray)
rango = sheet['A26:B36']
data['receptor'] = self._data_to_dict(rango.DataArray)
rango = sheet['A39:B50']
data['destinatario'] = self._data_to_dict(rango.DataArray)
cursor = sheet.createCursorByRange(sheet['E12'])
data['propietarios'] = self._current_region_to_tuple(cursor)
cursor = sheet.createCursorByRange(sheet['A53'])
data['mercancias'] = self._current_region_to_tuple(cursor)
except Exception as e:
msg = str(e)
return data, msg
def get_ce(self, path):
options = {'AsTemplate': True, 'Hidden': True}
doc = self._doc_open(path, options)
if doc is None:
return (), 'No se pudo abrir la plantilla'
data, msg = self._get_data_ce(doc)
doc.close(True)
if len(data) == 1:
msg = 'Sin datos para importar'
return (), msg
return data, ''
def to_pdf(data, emisor_rfc, ods=False, pdf_from='1'): def to_pdf(data, emisor_rfc, ods=False, pdf_from='1'):
rfc = data['emisor']['rfc'] rfc = data['emisor']['rfc']
default = 'plantilla_factura.ods'
if DEBUG: if DEBUG:
rfc = emisor_rfc rfc = emisor_rfc
version = data['comprobante']['version'] version = data['comprobante']['version']
default = f'plantilla_factura_{version}.ods'
if 'nomina' in data and data['nomina']:
default = 'plantilla_nomina.ods'
version = '{}_{}'.format(data['nomina']['version'], version)
if 'carta_porte' in data:
default = 'plantilla_factura_cp.ods'
version = '{}_cp_{}'.format(version, data['carta_porte']['version'])
pagos = ''
if data.get('pagos', False):
version = '1.0'
pagos = 'pagos_'
if pdf_from == '2': if pdf_from == '2':
return to_pdf_from_json(rfc, version, data) return to_pdf_from_json(rfc, version, data)
if 'nomina' in data and data['nomina']:
version_nomina = data['nomina']['version']
default = f'plantilla_nomina_{version}_{version_nomina}.ods'
version = f'{version}_cn_{version_nomina}'
if 'carta_porte' in data:
default = 'plantilla_ccp.ods'
version = '{}_ccp_{}'.format(version, data['carta_porte']['version'])
if data.get('pagos', False):
version_pagos = data['pays']['version']
default = f'plantilla_pagos_{version}_{version_pagos}.ods'
version = f'{version}_cp_{version_pagos}'
if data['donativo']:
version_donatarias = data['donataria']['version']
default = f'plantilla_donatarias_{version}_{version_donatarias}.ods'
version = f'{version}_cd_{version_donatarias}'
if 'comercio_exterior' in data:
version_cce = data['comercio_exterior']['version']
default = f'plantilla_cce_{version}_{version_cce}.ods'
version = f'{version}_cce_{version_cce}'
template_name = f'{rfc.lower()}_{version}.ods'
# ~ print('\nT', template_name, default)
if APP_LIBO: if APP_LIBO:
app = LIBO() app = LIBO()
if app.is_running: if app.is_running:
path = get_template_ods(template_name, default) donativo = ''
if data['donativo']:
donativo = '_donativo'
name = '{}_{}{}{}.ods'.format(rfc.lower(), pagos, version, donativo)
path = get_template_ods(name, default)
if path: if path:
return app.pdf(path, data, ods) return app.pdf(path, data, ods)
@ -1759,7 +1593,6 @@ def to_pdf(data, emisor_rfc, ods=False, pdf_from='1'):
def to_pdf_from_json(rfc, version, data): def to_pdf_from_json(rfc, version, data):
rfc = rfc.lower() rfc = rfc.lower()
name = '{}_{}.json'.format(rfc, version) name = '{}_{}.json'.format(rfc, version)
print('name', name)
custom_styles = get_custom_styles(name) custom_styles = get_custom_styles(name)
path_logo = _join(PATHS['LOGOS'], f"{rfc}.png") path_logo = _join(PATHS['LOGOS'], f"{rfc}.png")
@ -1830,11 +1663,10 @@ def html_to_pdf(data):
def import_employees(rfc): def import_employees(rfc):
msg = 'No se pudo cargar el archivo'
name = '{}_employees.ods'.format(rfc.lower()) name = '{}_employees.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'tmp', name) path = _join(PATH_MEDIA, 'tmp', name)
if not is_file(path): if not is_file(path):
return (), msg return ()
msg = 'LibreOffice no se pudo iniciar' msg = 'LibreOffice no se pudo iniciar'
if APP_LIBO: if APP_LIBO:
@ -1879,6 +1711,24 @@ def to_letters(value, currency):
return NumLet(value, currency).letras return NumLet(value, currency).letras
# ~ def get_qr(data, p=True):
# ~ qr = pyqrcode.create(data, mode='binary')
# ~ if p:
# ~ path = get_path_temp('.qr')
# ~ qr.png(path, scale=7)
# ~ return path
# ~ buffer = io.BytesIO()
# ~ qr.png(buffer, scale=8)
# ~ return base64.b64encode(buffer.getvalue()).decode()
# ~ def get_qr2(data, kind='svg'):
# ~ buffer = io.BytesIO()
# ~ segno.make(data).save(buffer, kind=kind, scale=8, border=2)
# ~ return buffer
def _get_relacionados(doc, version): def _get_relacionados(doc, version):
node = doc.find('{}CfdiRelacionados'.format(PRE[version])) node = doc.find('{}CfdiRelacionados'.format(PRE[version]))
if node is None: if node is None:
@ -1990,7 +1840,7 @@ def _receptor(doc, version, values):
return data return data
data['usocfdi'] = values['usocfdi'] data['usocfdi'] = values['usocfdi']
# ~ data.update(values['receptor']) data.update(values['receptor'])
return data return data
@ -2073,14 +1923,11 @@ def _totales(doc, cfdi, version):
for n in list(node): for n in list(node):
tmp = CaseInsensitiveDict(n.attrib.copy()) tmp = CaseInsensitiveDict(n.attrib.copy())
if version in CFDI_VERSIONS: if version in CFDI_VERSIONS:
tasa = '' tasa = round(float(tmp['tasaocuota']), DECIMALES)
if 'tasaocuota' in tmp:
tasa = round(float(tmp['tasaocuota']), DECIMALES)
title = 'Traslado {} {}'.format(tn.get(tmp['impuesto']), tasa) title = 'Traslado {} {}'.format(tn.get(tmp['impuesto']), tasa)
else: else:
title = 'Traslado {} {}'.format(tmp['impuesto'], tmp['tasa']) title = 'Traslado {} {}'.format(tmp['impuesto'], tmp['tasa'])
if 'importe' in tmp: traslados.append((title, float(tmp['importe'])))
traslados.append((title, float(tmp['importe'])))
node = imp.find('{}Retenciones'.format(PRE[version])) node = imp.find('{}Retenciones'.format(PRE[version]))
if node is not None: if node is not None:
@ -2249,54 +2096,19 @@ def _nomina(doc, data, values, version_cfdi):
return info return info
def _get_info_pays_2(node):
pre_pays = PRE_DEFAULT['PAGOS']['PRE']
data = CaseInsensitiveDict(node.attrib.copy())
path = f"{pre_pays}Totales"
totales = node.find(path)
data.update(CaseInsensitiveDict(totales.attrib.copy()))
path = f"{pre_pays}Pago"
node_pay = node.find(path)
data.update(CaseInsensitiveDict(node_pay.attrib.copy()))
related = []
for n in node_pay:
attr = CaseInsensitiveDict(n.attrib.copy())
if attr:
attr['metododepagodr'] = ''
related.append(attr)
data['related'] = related
return data
def _cfdipays(doc, data, version): def _cfdipays(doc, data, version):
pre_pays = PRE_DEFAULT['PAGOS']['PRE'] node = doc.find('{}Complemento/{}Pagos'.format(PRE[version], PRE['pagos']))
path = f"{PRE[version]}Complemento/{pre_pays}Pagos"
node = doc.find(path)
if node is None: if node is None:
pre_pays = PRE['PAGOS']['1.0']
path = f"{PRE[version]}Complemento/{pre_pays}Pagos"
node = doc.find(path)
if node is None:
log.error('Node pays not found...')
return {} return {}
if version == '4.0': info = CaseInsensitiveDict(node.attrib.copy())
info = _get_info_pays_2(node) related = []
else: for n1 in node:
info = CaseInsensitiveDict(node.attrib.copy()) info.update(CaseInsensitiveDict(n1.attrib.copy()))
related = [] for n2 in n1:
for n1 in node: related.append(CaseInsensitiveDict(n2.attrib.copy()))
info.update(CaseInsensitiveDict(n1.attrib.copy()))
for n2 in n1:
related.append(CaseInsensitiveDict(n2.attrib.copy()))
info['related'] = related info['related'] = related
data['comprobante']['totalenletras'] = to_letters( data['comprobante']['totalenletras'] = to_letters(
float(info['monto']), info['monedap']) float(info['monto']), info['monedap'])
@ -2309,7 +2121,6 @@ def get_data_from_xml(invoice, values, pdf_from='1'):
data = {'cancelada': invoice.cancelada, 'donativo': False} data = {'cancelada': invoice.cancelada, 'donativo': False}
if hasattr(invoice, 'donativo'): if hasattr(invoice, 'donativo'):
data['donativo'] = invoice.donativo data['donativo'] = invoice.donativo
doc = parse_xml(invoice.xml) doc = parse_xml(invoice.xml)
data['comprobante'] = _comprobante(doc, values) data['comprobante'] = _comprobante(doc, values)
version = data['comprobante']['version'] version = data['comprobante']['version']
@ -2416,37 +2227,11 @@ class UpFile(object):
return return
def save_template(rfc, opt, file_obj):
result = {'status': 'error', 'ok': False}
name_template = f'{rfc}{opt}'
path_template = _join(PATH_MEDIA, 'templates', name_template)
if save_file(path_template, file_obj.file.read()):
result = {'status': 'server', 'name': file_obj.filename, 'ok': True}
return result
def upload_file(rfc, opt, file_obj): def upload_file(rfc, opt, file_obj):
rfc = rfc.lower() rfc = rfc.lower()
tmp = file_obj.filename.split('.') tmp = file_obj.filename.split('.')
ext = tmp[-1].lower() ext = tmp[-1].lower()
versions = ('_3.2.ods',
'_3.3.ods', '_3.3_cd_1.1.ods', '_3.3_cp_1.0.ods', '_3.3_cn_1.2.ods', '_3.3_ccp_2.0.ods', '_3.3.json',
'_4.0.ods',
'_4.0_cn_1.2.ods',
'_4.0_cp_2.0.ods',
'_4.0_ccp_2.0.ods',
'_4.0_ccp_3.0.ods',
'_4.0_cd_1.1.ods',
'_4.0_cce_2.0.ods',
'_4.0.json',
)
if opt in versions:
return save_template(rfc, opt, file_obj)
EXTENSIONS = { EXTENSIONS = {
'txt_plantilla_factura_32': EXT['ODS'], 'txt_plantilla_factura_32': EXT['ODS'],
'txt_plantilla_factura_33': EXT['ODS'], 'txt_plantilla_factura_33': EXT['ODS'],
@ -2563,15 +2348,6 @@ def upload_file(rfc, opt, file_obj):
name = '{}_nomina.ods'.format(rfc.lower()) name = '{}_nomina.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'tmp', name) path = _join(PATH_MEDIA, 'tmp', name)
elif opt == 'ceods':
tmp = file_obj.filename.split('.')
ext = tmp[-1].lower()
if ext != 'ods':
msg = 'Extensión de archivo incorrecta, selecciona un archivo ODS'
return {'status': 'server', 'name': msg, 'ok': False}
name = '{}_ce.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'tmp', name)
if save_file(path, file_obj.file.read()): if save_file(path, file_obj.file.read()):
return {'status': 'server', 'name': file_obj.filename, 'ok': True} return {'status': 'server', 'name': file_obj.filename, 'ok': True}
@ -3049,20 +2825,6 @@ def import_invoice(rfc):
return (), 'No se encontro LibreOffice' return (), 'No se encontro LibreOffice'
def import_ceods(rfc):
name = '{}_ce.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'tmp', name)
if not is_file(path):
return (), 'No se encontró la plantilla'
if APP_LIBO:
app = LIBO()
if app.is_running:
return app.get_ce(path)
return (), 'No se encontro LibreOffice'
def calc_to_date(value): def calc_to_date(value):
return datetime.date.fromordinal(int(value) + 693594) return datetime.date.fromordinal(int(value) + 693594)
@ -3162,8 +2924,4 @@ def parse_xml2(xml_str):
return etree.fromstring(xml_str.encode('utf-8')) return etree.fromstring(xml_str.encode('utf-8'))
def get_idccp():
uuid4 = str(uuid.uuid4()).upper()
custom_uuid_str = f'CCC{uuid4[3:]}'
return custom_uuid_str

View File

@ -55,7 +55,7 @@ from dateutil import parser
from .cfdi_xml import CFDI from .cfdi_xml import CFDI
from settings import DEBUG, DB_COMPANIES, PATHS, TEMPLATE_CANCEL, RFCS, PRE from settings import DEBUG, DB_COMPANIES, PATHS, TEMPLATE_CANCEL, RFCS
from .pacs.cfdi_cert import SATCertificate from .pacs.cfdi_cert import SATCertificate
from .pacs import PACComercioDigital from .pacs import PACComercioDigital
@ -88,7 +88,6 @@ PACS = {
'finkok': PACFinkok, 'finkok': PACFinkok,
'comercio': PACComercioDigital, 'comercio': PACComercioDigital,
} }
NS_CFDI = { NS_CFDI = {
'cfdi': 'http://www.sat.gob.mx/cfd/3', 'cfdi': 'http://www.sat.gob.mx/cfd/3',
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital', 'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
@ -261,13 +260,9 @@ class CfdiToDict(object):
'cfdi4.0': 'http://www.sat.gob.mx/cfd/4', 'cfdi4.0': 'http://www.sat.gob.mx/cfd/4',
} }
NS = { NS = {
'tfd': 'http://www.sat.gob.mx/TimbreFiscalDigital',
'divisas': 'http://www.sat.gob.mx/divisas', 'divisas': 'http://www.sat.gob.mx/divisas',
'leyendasFisc': 'http://www.sat.gob.mx/leyendasFiscales', 'leyendasFisc': 'http://www.sat.gob.mx/leyendasFiscales',
'cartaporte20': 'http://www.sat.gob.mx/CartaPorte20', 'cartaporte20': 'http://www.sat.gob.mx/CartaPorte20',
'cartaporte30': 'http://www.sat.gob.mx/CartaPorte30',
'nomina12': 'http://www.sat.gob.mx/nomina12',
'cce20': 'http://www.sat.gob.mx/ComercioExterior20',
} }
tipo_figura = { tipo_figura = {
'01': '[01] Operador', '01': '[01] Operador',
@ -275,54 +270,6 @@ class CfdiToDict(object):
'03': '[03] Arrendador', '03': '[03] Arrendador',
'04': '[04] Notificado', '04': '[04] Notificado',
} }
REGIMEN_FISCAL = {
'601': '[601] General de Ley Personas Morales',
'603': '[603] Personas Morales con Fines no Lucrativos',
'605': '[605] Sueldos y Salarios e Ingresos Asimilados a Salarios',
'606': '[606] Arrendamiento',
'607': '[607] Régimen de Enajenación o Adquisición de Bienes',
'608': '[608] Demás ingresos',
'610': '[610] Residentes en el Extranjero sin Establecimiento Permanente en México',
'611': '[611] Ingresos por Dividendos (socios y accionistas)',
'612': '[612] Personas Físicas con Actividades Empresariales y Profesionales',
'614': '[614] Ingresos por intereses',
'615': '[615] Régimen de los ingresos por obtención de premios',
'616': '[616] Sin obligaciones fiscales',
'620': '[620] Sociedades Cooperativas de Producción que optan por diferir sus ingresos',
'621': '[621] Incorporación Fiscal',
'622': '[622] Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras',
'623': '[623] Opcional para Grupos de Sociedades',
'624': '[624] Coordinados',
'625': '[625] Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas',
'626': '[626] Régimen Simplificado de Confianza',
}
USO_CFDI = {
'G01': '[G01] Adquisición de mercancías.',
'G02': '[G02] Devoluciones, descuentos o bonificaciones.',
'G03': '[G03] Gastos en general.',
'I01': '[I01] Construcciones.',
'I02': '[I02] Mobiliario y equipo de oficina por inversiones.',
'I03': '[I03] Equipo de transporte.',
'I04': '[I04] Equipo de computo y accesorios.',
'I05': '[I05] Dados, troqueles, moldes, matrices y herramental.',
'I06': '[I06] Comunicaciones telefónicas.',
'I07': '[I07] Comunicaciones satelitales.',
'I08': '[I08] Otra maquinaria y equipo.',
'D01': '[D01] Honorarios médicos, dentales y gastos hospitalarios.',
'D02': '[D02] Gastos médicos por incapacidad o discapacidad.',
'D03': '[D03] Gastos funerales.',
'D04': '[D04] Donativos.',
'D05': '[D05] Intereses reales efectivamente pagados por créditos hipotecarios (casa habitación).',
'D06': '[D06] Aportaciones voluntarias al SAR.',
'D07': '[D07] Primas por seguros de gastos médicos.',
'D08': '[D08] Gastos de transportación escolar obligatoria.',
'D09': '[D09] Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones.',
'D10': '[D10] Pagos por servicios educativos (colegiaturas).',
'S01': '[S01] Sin efectos fiscales.',
'CP01': '[CP01] Pagos',
'CN01': '[CN01] Nómina',
'P01': '[P01] Por definir',
}
PAISES = { PAISES = {
'MEX': 'México', 'MEX': 'México',
} }
@ -361,30 +308,8 @@ class CfdiToDict(object):
'YUC': 'Yucatán', 'YUC': 'Yucatán',
'ZAC': 'Zacatecas', 'ZAC': 'Zacatecas',
} }
PERIODICIDAD = {
'01': '[01] Diario',
'02': '[02] Semanal',
'03': '[03] Quincenal',
'04': '[04] Mensual',
'05': '[05] Bimestral',
}
MESES = {
'01': '[01] Enero',
'02': '[02] Febrero',
'03': '[03] Marzo',
'04': '[04] Abril',
'05': '[05] Mayo',
'06': '[06] Junio',
'07': '[07] Julio',
'08': '[08] Agosto',
'09': '[09] Septiembre',
'10': '[10] Octubre',
'11': '[11] Noviembre',
'12': '[12] Diciembre',
}
def __init__(self, xml): def __init__(self, xml):
self.version = ''
self._values = { self._values = {
'leyendas': (), 'leyendas': (),
} }
@ -396,54 +321,12 @@ class CfdiToDict(object):
return self._values return self._values
def _get_values(self): def _get_values(self):
self.version = self._root.attrib['Version'] version = self._root.attrib['Version']
ns = f'cfdi{self.version}' ns = f'cfdi{version}'
self.NS['cfdi'] = self.NS_VERSION[ns] self.NS['cfdi'] = self.NS_VERSION[ns]
self._timbre_fiscal()
self._informacion_global()
self._receptor()
self._complementos() self._complementos()
return return
def _timbre_fiscal(self):
path = '//tfd:TimbreFiscalDigital'
data = self._root.xpath(path, namespaces=self.NS)
if not data:
return
data = data[0]
attr = CaseInsensitiveDict(data.attrib)
self._fecha_timbrado = attr['FechaTimbrado']
return
def _informacion_global(self):
self._values['informacion_global'] = {}
path = '//cfdi:InformacionGlobal'
data = self._root.xpath(path, namespaces=self.NS)
if not data:
return
data = data[0]
attr = CaseInsensitiveDict(data.attrib)
value = f"Periodicidad Factura Global: {self.PERIODICIDAD[attr['Periodicidad']]} "
value += f"del mes {self.MESES[attr['Meses']]} "
value += f"del año {attr['Año']}"
self._values['informacion_global'] = {'informacion_global': value}
return
def _receptor(self):
path = '//cfdi:Receptor'
receptor = self._root.xpath(path, namespaces=self.NS)[0]
attr = CaseInsensitiveDict(receptor.attrib)
attr['usocfdi'] = self.USO_CFDI[attr['UsoCFDI']]
if self.version == '4.0':
attr['domiciliofiscal'] = attr['DomicilioFiscalReceptor']
attr['regimenfiscal'] = self.REGIMEN_FISCAL[attr['RegimenFiscalReceptor']]
self._values['receptor'] = attr
return
def _set_carta_porte_domicilio(self, data): def _set_carta_porte_domicilio(self, data):
municipio = data['Municipio'] municipio = data['Municipio']
estado = self.ESTADOS[data['Estado']] estado = self.ESTADOS[data['Estado']]
@ -455,14 +338,6 @@ class CfdiToDict(object):
path = '//cfdi:Complemento' path = '//cfdi:Complemento'
complemento = self._root.xpath(path, namespaces=self.NS)[0] complemento = self._root.xpath(path, namespaces=self.NS)[0]
path = '//nomina12:Nomina'
nomina = complemento.xpath(path, namespaces=self.NS)
if nomina:
for node in nomina[0]:
if 'Receptor' in node.tag:
attr = CaseInsensitiveDict(node.attrib)
self._values['receptor'].update(attr)
path = '//divisas:Divisas' path = '//divisas:Divisas'
divisas = complemento.xpath(path, namespaces=self.NS) divisas = complemento.xpath(path, namespaces=self.NS)
if divisas: if divisas:
@ -528,94 +403,6 @@ class CfdiToDict(object):
self._values['carta_porte'] = values self._values['carta_porte'] = values
self._complemento_carta_porte(complemento)
self._complemento_comercio_exterior(complemento)
return
def _complemento_carta_porte(self, complemento):
path = '//cartaporte30:CartaPorte'
carta_porte = complemento.xpath(path, namespaces=self.NS)
if carta_porte:
self._get_carta_porte_3(carta_porte)
return
def _get_carta_porte_3(self, carta_porte):
URL = 'https://verificacfdi.facturaelectronica.sat.gob.mx/verificaccp/default.aspx'
PRE = '//cartaporte30'
values = CaseInsensitiveDict(carta_porte[0].attrib)
idccp = values['idccp']
for node in carta_porte[0]:
if 'FiguraTransporte' in node.tag:
figuras = CaseInsensitiveDict(node[0].attrib)
figuras['TipoFigura'] = self.tipo_figura[figuras['TipoFigura']]
values['figuras'] = figuras
elif 'Mercancias' in node.tag:
mercancias = CaseInsensitiveDict(node.attrib)
detalle = [CaseInsensitiveDict(n.attrib)
for n in node if 'Mercancia' in n.tag]
values['mercancias'] = {
'mercancias': mercancias,
'detalle': detalle,
}
path = f'{PRE}:Autotransporte'
node_auto = node.xpath(path, namespaces=self.NS)[0]
values_auto = CaseInsensitiveDict(node_auto.attrib)
values['autotransporte'] = values_auto
path = f'{PRE}:IdentificacionVehicular'
node_tmp = node_auto.xpath(path, namespaces=self.NS)[0]
values_auto = CaseInsensitiveDict(node_tmp.attrib)
values['autotransporte'].update(values_auto)
path = f'{PRE}:Seguros'
node_tmp = node_auto.xpath(path, namespaces=self.NS)[0]
values_auto = CaseInsensitiveDict(node_tmp.attrib)
values['autotransporte'].update(values_auto)
path = f'{PRE}:Remolques'
try:
node_tmp = node_auto.xpath(path, namespaces=self.NS)[0][0]
values_auto = CaseInsensitiveDict(node_tmp.attrib)
values['autotransporte'].update(values_auto)
except IndexError:
pass
elif 'Ubicaciones' in node.tag:
ubicaciones = []
for n in node:
ubicacion = CaseInsensitiveDict(n.attrib)
if ubicacion['TipoUbicacion'] == 'Origen':
fecha_origen = ubicacion['FechaHoraSalidaLlegada']
ubicacion['domicilio'] = self._set_carta_porte_domicilio(
CaseInsensitiveDict(n[0].attrib))
ubicaciones.append(ubicacion)
values['FechaOrigen'] = fecha_origen
values['ubicaciones'] = ubicaciones
qr_data = f'{URL}?IdCCP={idccp}&FechaOrig={fecha_origen}&FechaTimb={self._fecha_timbrado}'
values['qr'] = get_qr(qr_data, 'png')
self._values['carta_porte'] = values
return
def _complemento_comercio_exterior(self, complemento):
path = '//cce20:ComercioExterior'
comercio_exterior = complemento.xpath(path, namespaces=self.NS)
if comercio_exterior:
values = CaseInsensitiveDict(comercio_exterior[0].attrib)
for node in comercio_exterior[0]:
if 'Emisor' in node.tag:
values['emisor'] = CaseInsensitiveDict(node.attrib)
values['emisor'].update(CaseInsensitiveDict(node[0].attrib))
elif 'Receptor' in node.tag:
values['receptor'] = CaseInsensitiveDict(node.attrib)
values['receptor'].update(CaseInsensitiveDict(node[0].attrib))
elif 'Mercancias' in node.tag:
mercancias = [
CaseInsensitiveDict(m.attrib) for m in node]
values['mercancias'] = mercancias
self._values['comercio_exterior'] = values
return return
@ -875,8 +662,7 @@ def db_backup_local():
def now(): def now():
n = datetime.datetime.now().replace(microsecond=0) return datetime.datetime.now().replace(microsecond=0)
return n
def get_days(date): def get_days(date):
@ -945,9 +731,6 @@ def xml_cancel(xml, auth, cert, name):
def get_client_balance(auth, rfc=''): def get_client_balance(auth, rfc=''):
if not auth:
return 'p/c'
pac = PACS[auth['pac']]() pac = PACS[auth['pac']]()
balance = pac.client_balance(auth, rfc) balance = pac.client_balance(auth, rfc)
if pac.error: if pac.error:
@ -964,6 +747,9 @@ def get_cert(args):
def make_xml(data, certificado): def make_xml(data, certificado):
cert = SATCertificate(certificado.cer, certificado.key_enc.encode()) cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
# ~ if DEBUG:
# ~ data['emisor']['Rfc'] = certificado.rfc
# ~ data['emisor']['RegimenFiscal'] = '603'
cfdi = CFDI() cfdi = CFDI()
xml = ET.parse(BytesIO(cfdi.get_xml(data).encode())) xml = ET.parse(BytesIO(cfdi.get_xml(data).encode()))
@ -980,10 +766,8 @@ def make_xml(data, certificado):
def get_pac_by_rfc(cfdi): def get_pac_by_rfc(cfdi):
tree = ET.fromstring(cfdi.encode()) tree = ET.fromstring(cfdi.encode())
version = tree.attrib['Version']
namespaces = {'cfdi': PRE[version][1:-1], 'tdf': PRE['TIMBRE'][1:-1]}
path = 'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@RfcProvCertif)' path = 'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@RfcProvCertif)'
rfc_pac = tree.xpath(path, namespaces=namespaces) rfc_pac = tree.xpath(path, namespaces=NS_CFDI)
return RFCS[rfc_pac] return RFCS[rfc_pac]
@ -1049,20 +833,17 @@ def cancel_xml_sign(invoice, args, auth, certificado):
def _get_data_sat(xml): def _get_data_sat(xml):
BF = 'string(//*[local-name()="{}"]/@{})' BF = 'string(//*[local-name()="{}"]/@{})'
# ~ NS_CFDI = {'cfdi': 'http://www.sat.gob.mx/cfd/3'} NS_CFDI = {'cfdi': 'http://www.sat.gob.mx/cfd/3'}
try: try:
tree = ET.fromstring(xml.encode()) tree = ET.fromstring(xml.encode())
version = tree.attrib['Version']
namespaces = {'cfdi': PRE[version][1:-1]}
emisor = escape( emisor = escape(
tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=namespaces) or tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=NS_CFDI) or
tree.xpath('string(//cfdi:Emisor/@Rfc)', namespaces=namespaces) tree.xpath('string(//cfdi:Emisor/@Rfc)', namespaces=NS_CFDI)
) )
receptor = escape( receptor = escape(
tree.xpath('string(//cfdi:Receptor/@rfc)', namespaces=namespaces) or tree.xpath('string(//cfdi:Receptor/@rfc)', namespaces=NS_CFDI) or
tree.xpath('string(//cfdi:Receptor/@Rfc)', namespaces=namespaces) tree.xpath('string(//cfdi:Receptor/@Rfc)', namespaces=NS_CFDI)
) )
total = tree.get('total') or tree.get('Total') total = tree.get('total') or tree.get('Total')
uuid = tree.xpath(BF.format('TimbreFiscalDigital', 'UUID')) uuid = tree.xpath(BF.format('TimbreFiscalDigital', 'UUID'))
@ -1187,7 +968,6 @@ def _save_template(rfc, name, file_obj):
rfc = rfc.lower() rfc = rfc.lower()
path = _join(PATHS['USER'], f'{rfc}{name}') path = _join(PATHS['USER'], f'{rfc}{name}')
if save_file(path, file_obj.file.read()): if save_file(path, file_obj.file.read()):
result['ok'] = True result['ok'] = True
@ -1208,18 +988,3 @@ def get_qr(data, kind='svg', in_base64=False):
if in_base64: if in_base64:
qr = base64.b64encode(qr.getvalue()).decode() qr = base64.b64encode(qr.getvalue()).decode()
return qr return qr
def to_date(value):
t = now().time()
d = datetime.datetime.strptime(value.split(' ')[0], '%Y-%m-%d')
dt = datetime.datetime.combine(d, t)
return dt
def adjust_time(date_invoice, hours):
new_date = date_invoice
if hours:
time_change = datetime.timedelta(hours=hours)
new_date = date_invoice + time_change
return new_date

View File

@ -26,7 +26,6 @@ from controllers.main import (AppEmpresas,
AppWareHouseProduct, AppWareHouseProduct,
AppSATUnidadesPeso, AppSATUnidadesPeso,
AppSATRegimenes, AppSATRegimenes,
AppSociosRegimenes,
) )
@ -81,7 +80,6 @@ api.add_route('/ticketsdetails', AppTicketsDetails(db))
api.add_route('/users', AppUsers(db)) api.add_route('/users', AppUsers(db))
api.add_route('/satunidadespeso', AppSATUnidadesPeso(db)) api.add_route('/satunidadespeso', AppSATUnidadesPeso(db))
api.add_route('/satregimenes', AppSATRegimenes(db)) api.add_route('/satregimenes', AppSATRegimenes(db))
api.add_route('/sociosregimenes', AppSociosRegimenes(db))
session_options = { session_options = {

View File

@ -70,9 +70,6 @@ class StorageEngine(object):
def _get_importinvoice(self, values): def _get_importinvoice(self, values):
return main.import_invoice() return main.import_invoice()
def _get_importceods(self, values):
return main.import_ceods()
def _get_main(self, values, session): def _get_main(self, values, session):
return main.config_main(session['userobj']) return main.config_main(session['userobj'])
@ -203,10 +200,6 @@ class StorageEngine(object):
def _get_allusoscfdi(self, values): def _get_allusoscfdi(self, values):
return main.SATUsoCfdi.get_all() return main.SATUsoCfdi.get_all()
def _get_allregimenes(self, values):
filters = {'opt': 'all'}
return main.SATRegimenes.get_data(filters, None)
def _get_allusuarios(self, values, session): def _get_allusuarios(self, values, session):
return main.Usuarios.get_(session['userobj']) return main.Usuarios.get_(session['userobj'])
@ -234,9 +227,6 @@ class StorageEngine(object):
def _get_usocfdiupdate(self, values): def _get_usocfdiupdate(self, values):
return main.SATUsoCfdi.actualizar(values) return main.SATUsoCfdi.actualizar(values)
def _get_regimenesupdate(self, values):
return main.SATRegimenes.actualizar(values)
def _get_emisorcuentasbanco(self, values): def _get_emisorcuentasbanco(self, values):
return main.CuentasBanco.emisor() return main.CuentasBanco.emisor()
@ -539,9 +529,6 @@ class StorageEngine(object):
def sat_regimenes_get(self, filters, user): def sat_regimenes_get(self, filters, user):
return main.SATRegimenes.get_data(filters, user) return main.SATRegimenes.get_data(filters, user)
def socios_regimenes_get(self, filters, user):
return main.SociosRegimenes.get_data(filters, user)
# Companies only in MV # Companies only in MV
def _get_empresas(self, values): def _get_empresas(self, values):
return main.companies_get() return main.companies_get()

File diff suppressed because it is too large Load Diff

View File

@ -28,9 +28,12 @@ from conf import DEBUG, MV, LOG_PATH
try: try:
from conf import DEFAULT_PASSWORD from conf import DEFAULT_PASSWORD
except ImportError: except ImportError:
DEFAULT_PASSWORD = 'salgueiro4.0' DEFAULT_PASSWORD = 'salgueiro3.3'
TITLE_APP = 'Empresa Libre' try:
from conf import TITLE_APP
except ImportError:
TITLE_APP = 'Empresa Libre'
try: try:
from conf import NO_HTTPS from conf import NO_HTTPS
@ -39,8 +42,7 @@ except ImportError:
DEBUG = DEBUG DEBUG = DEBUG
VERSION = '2.3.2' VERSION = '2.0.0'
EMAIL_SUPPORT = ('soporte@empresalibre.mx',) EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
@ -125,22 +127,6 @@ if 'win' in sys.platform:
PATH_XMLSEC = os.path.join(PATH_BIN, 'xmlsec.exe') PATH_XMLSEC = os.path.join(PATH_BIN, 'xmlsec.exe')
PRE_DEFAULT = {
'CFDI': {'VERSION': '4.0', 'PRE': '{http://www.sat.gob.mx/cfd/4}'},
'NOMINA': {'VERSION': '1.2', 'PRE': '{http://www.sat.gob.mx/nomina12}'},
'PAGOS': {'VERSION': '2.0', 'PRE': '{http://www.sat.gob.mx/Pagos20}'},
'TIBRE': {'VERSION': '1.1', 'PRE': '{http://www.sat.gob.mx/TimbreFiscalDigital}'},
}
pre2 ='{http://www.sat.gob.mx/cfd/2}'
pre3 ='{http://www.sat.gob.mx/cfd/3}'
PRE_HISTORY = {
'CFDI': {'2.0': pre2, '2.2': pre2,
'3.0': pre3, '3.2': pre3, '3.3': pre3},
'NOMINA': {'1.1': '{http://www.sat.gob.mx/nomina}'},
'PAGOS': {'1.0': '{http://www.sat.gob.mx/Pagos}'},
}
PRE = { PRE = {
'2.0': '{http://www.sat.gob.mx/cfd/2}', '2.0': '{http://www.sat.gob.mx/cfd/2}',
'2.2': '{http://www.sat.gob.mx/cfd/2}', '2.2': '{http://www.sat.gob.mx/cfd/2}',
@ -156,15 +142,11 @@ PRE = {
'1.1': '{http://www.sat.gob.mx/nomina}', '1.1': '{http://www.sat.gob.mx/nomina}',
'1.2': '{http://www.sat.gob.mx/nomina12}', '1.2': '{http://www.sat.gob.mx/nomina12}',
}, },
'PAGOS': { 'pagos': '{http://www.sat.gob.mx/Pagos}',
'1.0': '{http://www.sat.gob.mx/Pagos}',
}
} }
# To delete CURRENT_CFDI = '3.3'
# ~ CURRENT_CFDI = '4.0' CURRENT_CFDI_NOMINA = '1.2'
# ~ CURRENT_CFDI_NOMINA = '1.2'
DECIMALES = 2 DECIMALES = 2
DECIMALES_TAX = 4 DECIMALES_TAX = 4
DECIMALES_PRECIOS = 4 DECIMALES_PRECIOS = 4
@ -257,8 +239,6 @@ VALUES_PDF = {
}, },
} }
RESICO = '626'
RFCS = { RFCS = {
'PUBLIC': 'XAXX010101000', 'PUBLIC': 'XAXX010101000',
'FOREIGN': 'XEXX010101000', 'FOREIGN': 'XEXX010101000',

Binary file not shown.

View File

@ -104,7 +104,7 @@
{"key": "611", "name": "Ingresos por Dividendos (socios y accionistas)", "fisica": true, "activo": false}, {"key": "611", "name": "Ingresos por Dividendos (socios y accionistas)", "fisica": true, "activo": false},
{"key": "612", "name": "Personas Físicas con Actividades Empresariales y Profesionales", "fisica": true, "activo": true, "default": true}, {"key": "612", "name": "Personas Físicas con Actividades Empresariales y Profesionales", "fisica": true, "activo": true, "default": true},
{"key": "614", "name": "Ingresos por intereses", "fisica": true, "activo": true}, {"key": "614", "name": "Ingresos por intereses", "fisica": true, "activo": true},
{"key": "616", "name": "Sin obligaciones fiscales", "fisica": true, "activo": true}, {"key": "616", "name": "Sin obligaciones fiscales", "fisica": true, "activo": false},
{"key": "620", "name": "Sociedades Cooperativas de Producción que optan por diferir sus ingresos", "moral": true, "activo": false}, {"key": "620", "name": "Sociedades Cooperativas de Producción que optan por diferir sus ingresos", "moral": true, "activo": false},
{"key": "621", "name": "Incorporación Fiscal", "fisica": true, "activo": true}, {"key": "621", "name": "Incorporación Fiscal", "fisica": true, "activo": true},
{"key": "622", "name": "Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras", "fisica": true, "moral": true, "activo": false}, {"key": "622", "name": "Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras", "fisica": true, "moral": true, "activo": false},
@ -682,10 +682,7 @@
{"key": "D08", "name": "Gastos de transportación escolar obligatoria.", "activo": false}, {"key": "D08", "name": "Gastos de transportación escolar obligatoria.", "activo": false},
{"key": "D09", "name": "Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones.", "activo": false}, {"key": "D09", "name": "Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones.", "activo": false},
{"key": "D10", "name": "Pagos por servicios educativos (colegiaturas)", "activo": true}, {"key": "D10", "name": "Pagos por servicios educativos (colegiaturas)", "activo": true},
{"key": "P01", "name": "Por definir", "moral": true, "activo": false}, {"key": "P01", "name": "Por definir", "moral": true, "activo": true}
{"key": "S01", "name": "Sin efectos fiscales.", "moral": true, "activo": true},
{"key": "CP01", "name": "Pagos", "moral": true, "activo": true},
{"key": "CN01", "name": "Nómina", "moral": true, "activo": true}
] ]
}, },
{ {
@ -731,7 +728,7 @@
"pais": "MEX" "pais": "MEX"
}, },
{ {
"key": "CMX", "key": "DIF",
"name": "Ciudad de M\u00e9xico", "name": "Ciudad de M\u00e9xico",
"pais": "MEX" "pais": "MEX"
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -60,7 +60,6 @@ var controllers = {
$$('grid_admin_unidades').attachEvent('onCheck', grid_admin_unidades_on_check) $$('grid_admin_unidades').attachEvent('onCheck', grid_admin_unidades_on_check)
$$('grid_admin_formasdepago').attachEvent('onCheck', grid_admin_formasdepago_on_check) $$('grid_admin_formasdepago').attachEvent('onCheck', grid_admin_formasdepago_on_check)
$$('grid_admin_usos_cfdi').attachEvent('onCheck', grid_admin_usos_cfdi_on_check) $$('grid_admin_usos_cfdi').attachEvent('onCheck', grid_admin_usos_cfdi_on_check)
$$('grid_admin_regimenes_fiscales').attachEvent('onCheck', grid_admin_regimenes_fiscales_on_check)
$$('grid_unidad_found').attachEvent('onValueSuggest', grid_unidad_found_click) $$('grid_unidad_found').attachEvent('onValueSuggest', grid_unidad_found_click)
$$('grid_admin_unidades').attachEvent('onItemClick', grid_admin_unidades_click) $$('grid_admin_unidades').attachEvent('onItemClick', grid_admin_unidades_click)
$$('grid_moneda_found').attachEvent('onValueSuggest', grid_moneda_found_click) $$('grid_moneda_found').attachEvent('onValueSuggest', grid_moneda_found_click)
@ -77,13 +76,15 @@ var controllers = {
//~ Opciones //~ Opciones
tb_options = $$('tab_options').getTabbar() tb_options = $$('tab_options').getTabbar()
tb_options.attachEvent('onChange', tab_options_change) tb_options.attachEvent('onChange', tab_options_change)
$$('txt_plantilla_factura_32').attachEvent('onItemClick', txt_plantilla_factura_32_click)
$$('txt_plantilla_factura_33').attachEvent('onItemClick', txt_plantilla_factura_33_click)
$$('txt_plantilla_factura_html').attachEvent('onItemClick', txt_plantilla_factura_html_click) $$('txt_plantilla_factura_html').attachEvent('onItemClick', txt_plantilla_factura_html_click)
//~ $$('txt_plantilla_factura_json').attachEvent('onItemClick', txt_plantilla_factura_json_click) $$('txt_plantilla_factura_json').attachEvent('onItemClick', txt_plantilla_factura_json_click)
$$('txt_plantilla_factura_css').attachEvent('onItemClick', txt_plantilla_factura_css_click) $$('txt_plantilla_factura_css').attachEvent('onItemClick', txt_plantilla_factura_css_click)
$$('txt_plantilla_ticket').attachEvent('onItemClick', txt_plantilla_ticket_click) $$('txt_plantilla_ticket').attachEvent('onItemClick', txt_plantilla_ticket_click)
//~ $$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click) $$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click)
//~ $$('txt_plantilla_nomina1233').attachEvent('onItemClick', txt_plantilla_nomina1233_click) $$('txt_plantilla_nomina1233').attachEvent('onItemClick', txt_plantilla_nomina1233_click)
//~ $$('txt_plantilla_pagos10').attachEvent('onItemClick', txt_plantilla_pagos10_click) $$('txt_plantilla_pagos10').attachEvent('onItemClick', txt_plantilla_pagos10_click)
$$('make_pdf_from').attachEvent('onChange', opt_make_pdf_from_on_change) $$('make_pdf_from').attachEvent('onChange', opt_make_pdf_from_on_change)
$$('cmd_template_upload').attachEvent('onItemClick', cmd_template_upload_click) $$('cmd_template_upload').attachEvent('onItemClick', cmd_template_upload_click)
@ -114,7 +115,6 @@ var controllers = {
$$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_edu').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_edu').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_carta_porte').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_carta_porte').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_comercio_exterior').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_leyendas_fiscales').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_leyendas_fiscales').attachEvent('onItemClick', chk_config_item_click)
$$('cmd_admin_leyendas_fiscales').attachEvent('onItemClick', cmd_admin_leyendas_fiscales_click) $$('cmd_admin_leyendas_fiscales').attachEvent('onItemClick', cmd_admin_leyendas_fiscales_click)
@ -134,9 +134,7 @@ var controllers = {
$$('chk_config_user_show_doc').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_user_show_doc').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_invoice_by_ticket').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_invoice_by_ticket').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_show_total_cant').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_show_total_cant').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_show_filter_by_day').attachEvent('onItemClick', chk_config_item_click)
$$('chk_cancel_invoices_by_admin').attachEvent('onItemClick', chk_config_item_click) $$('chk_cancel_invoices_by_admin').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_change_date_invoice').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click) $$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
@ -211,9 +209,7 @@ function cmd_save_emisor_click(){
msg = 'Longitud inválida del C.P. de Expedición' msg = 'Longitud inválida del C.P. de Expedición'
msg_error(msg) msg_error(msg)
return return
} }else if(values.emisor_cp2){
if(values.emisor_cp2){
webix.ajax().sync().get('/values/cp', {cp: values.emisor_cp2}, { webix.ajax().sync().get('/values/cp', {cp: values.emisor_cp2}, {
error: function(text, data, xhr) { error: function(text, data, xhr) {
msg = 'Error al consultar el C.P. de Expedición' msg = 'Error al consultar el C.P. de Expedición'
@ -222,12 +218,17 @@ function cmd_save_emisor_click(){
success: function(text, data, xhr) { success: function(text, data, xhr) {
var values = data.json(); var values = data.json();
if (values.estado == undefined){ if (values.estado == undefined){
msg = 'No se encontró el C.P. de Expedición, asegurate de que sea correcto' msg = 'No se encontró el C.P., asegurate de que sea correcto'
msg_error(msg) msg_error(msg)
}else{
valid_cp = true
} }
} }
}) })
} }
if(!valid_cp){
return
}
if(values.es_ong){ if(values.es_ong){
if(!values.ong_autorizacion){ if(!values.ong_autorizacion){
@ -443,15 +444,6 @@ function get_admin_usos_cfdi(){
} }
function get_admin_regimenes_fiscales(){
webix.ajax().sync().get('/values/allregimenes', function(text, data){
var values = data.json()
$$('grid_admin_regimenes_fiscales').clearAll()
$$('grid_admin_regimenes_fiscales').parse(values, 'json')
})
}
function get_admin_usuarios(){ function get_admin_usuarios(){
webix.ajax().sync().get('/values/allusuarios', function(text, data){ webix.ajax().sync().get('/values/allusuarios', function(text, data){
var rows = data.json() var rows = data.json()
@ -510,9 +502,7 @@ function set_config_templates(){
success: function(text, data, xhr) { success: function(text, data, xhr) {
var values = data.json() var values = data.json()
Object.keys(values).forEach(function(key){ Object.keys(values).forEach(function(key){
if(key!='txt_plantilla_donataria'){ show(key, values[key])
show(key, values[key])
}
}) })
} }
}) })
@ -953,42 +943,42 @@ function emisor_logo_click(id, e){
} }
//~ function txt_plantilla_factura_33_click(e){ function txt_plantilla_factura_33_click(e){
//~ var body_elements = [ var body_elements = [
//~ {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files', {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files',
//~ value: 'Seleccionar archivo', upload: '/files/txt_plantilla_factura_33', value: 'Seleccionar archivo', upload: '/files/txt_plantilla_factura_33',
//~ width: 200}, {width: 100}]}, width: 200}, {width: 100}]},
//~ {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true, {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true,
//~ borderless: true}, borderless: true},
//~ {}, {},
//~ {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true, {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
//~ click:("$$('win_template').close();")}, {}]} click:("$$('win_template').close();")}, {}]}
//~ ] ]
//~ var w = webix.ui({ var w = webix.ui({
//~ view: 'window', view: 'window',
//~ id: 'win_template', id: 'win_template',
//~ modal: true, modal: true,
//~ position: 'center', position: 'center',
//~ head: 'Subir Plantilla 3.3 ODT', head: 'Subir Plantilla 3.3 ODT',
//~ body: { body: {
//~ view: 'form', view: 'form',
//~ elements: body_elements, elements: body_elements,
//~ } }
//~ }) })
//~ w.show() w.show()
//~ $$('up_template').attachEvent('onUploadComplete', function(response){ $$('up_template').attachEvent('onUploadComplete', function(response){
//~ if(response.ok){ if(response.ok){
//~ $$('txt_plantilla_factura_33').setValue(response.name) $$('txt_plantilla_factura_33').setValue(response.name)
//~ msg_ok('Plantilla cargada correctamente') msg_ok('Plantilla cargada correctamente')
//~ }else{ }else{
//~ msg_error(response.name) msg_error(response.name)
//~ } }
//~ }) })
//~ } }
function txt_plantilla_ticket_click(e){ function txt_plantilla_ticket_click(e){
@ -1029,42 +1019,42 @@ function txt_plantilla_ticket_click(e){
} }
//~ function txt_plantilla_factura_32_click(e){ function txt_plantilla_factura_32_click(e){
//~ var body_elements = [ var body_elements = [
//~ {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files', {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files',
//~ value: 'Seleccionar archivo', upload: '/files/txt_plantilla_factura_32', value: 'Seleccionar archivo', upload: '/files/txt_plantilla_factura_32',
//~ width: 200}, {width: 100}]}, width: 200}, {width: 100}]},
//~ {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true, {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true,
//~ borderless: true}, borderless: true},
//~ {}, {},
//~ {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true, {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
//~ click:("$$('win_template').close();")}, {}]} click:("$$('win_template').close();")}, {}]}
//~ ] ]
//~ var w = webix.ui({ var w = webix.ui({
//~ view: 'window', view: 'window',
//~ id: 'win_template', id: 'win_template',
//~ modal: true, modal: true,
//~ position: 'center', position: 'center',
//~ head: 'Subir Plantilla 3.2 ODT', head: 'Subir Plantilla 3.2 ODT',
//~ body: { body: {
//~ view: 'form', view: 'form',
//~ elements: body_elements, elements: body_elements,
//~ } }
//~ }) })
//~ w.show() w.show()
//~ $$('up_template').attachEvent('onUploadComplete', function(response){ $$('up_template').attachEvent('onUploadComplete', function(response){
//~ if(response.ok){ if(response.ok){
//~ $$('txt_plantilla_factura_32').setValue(response.name) $$('txt_plantilla_factura_32').setValue(response.name)
//~ msg_ok('Plantilla cargada correctamente') msg_ok('Plantilla cargada correctamente')
//~ }else{ }else{
//~ msg_error(response.name) msg_error(response.name)
//~ } }
//~ }) })
//~ } }
function txt_plantilla_factura_html_click(e){ function txt_plantilla_factura_html_click(e){
@ -1149,83 +1139,83 @@ function txt_plantilla_factura_css_click(e){
} }
//~ function txt_plantilla_factura_json_click(e){ function txt_plantilla_factura_json_click(e){
//~ var body_elements = [ var body_elements = [
//~ {cols: [ {cols: [
//~ {width: 100}, {width: 100},
//~ {view: 'uploader', id: 'up_template', autosend: true, {view: 'uploader', id: 'up_template', autosend: true,
//~ link: 'lst_files', value: 'Seleccionar archivo', link: 'lst_files', value: 'Seleccionar archivo',
//~ upload: '/files/txt_plantilla_factura_json', width: 200}, upload: '/files/txt_plantilla_factura_json', width: 200},
//~ {width: 100}]}, {width: 100}]},
//~ {view: 'list', id: 'lst_files', type: 'uploader', autoheight: true, {view: 'list', id: 'lst_files', type: 'uploader', autoheight: true,
//~ borderless: true}, borderless: true},
//~ {}, {},
//~ {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true, {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
//~ click:("$$('win_template').close();")}, {}]} click:("$$('win_template').close();")}, {}]}
//~ ] ]
//~ var w = webix.ui({ var w = webix.ui({
//~ view: 'window', view: 'window',
//~ id: 'win_template', id: 'win_template',
//~ modal: true, modal: true,
//~ position: 'center', position: 'center',
//~ head: 'Subir Plantilla 3.3 JSON', head: 'Subir Plantilla 3.3 JSON',
//~ body: { body: {
//~ view: 'form', view: 'form',
//~ elements: body_elements, elements: body_elements,
//~ } }
//~ }) })
//~ w.show() w.show()
//~ $$('up_template').attachEvent('onUploadComplete', function(response){ $$('up_template').attachEvent('onUploadComplete', function(response){
//~ if(response.ok){ if(response.ok){
//~ $$('txt_plantilla_factura_json').setValue(response.name) $$('txt_plantilla_factura_json').setValue(response.name)
//~ msg_ok('Plantilla cargada correctamente') msg_ok('Plantilla cargada correctamente')
//~ }else{ }else{
//~ msg_error(response.name) msg_error(response.name)
//~ } }
//~ }) })
//~ } }
//~ function txt_plantilla_donataria_click(e){ function txt_plantilla_donataria_click(e){
//~ var body_elements = [ var body_elements = [
//~ {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files', {cols: [{width: 100}, {view: 'uploader', id: 'up_template', autosend: true, link: 'lst_files',
//~ value: 'Seleccionar archivo', upload: '/files/txt_plantilla_donataria', value: 'Seleccionar archivo', upload: '/files/txt_plantilla_donataria',
//~ width: 200}, {width: 100}]}, width: 200}, {width: 100}]},
//~ {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true, {view: 'list', id: 'lst_files', type: 'uploader', autoheight:true,
//~ borderless: true}, borderless: true},
//~ {}, {},
//~ {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true, {cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
//~ click:("$$('win_template').close();")}, {}]} click:("$$('win_template').close();")}, {}]}
//~ ] ]
//~ var w = webix.ui({ var w = webix.ui({
//~ view: 'window', view: 'window',
//~ id: 'win_template', id: 'win_template',
//~ modal: true, modal: true,
//~ position: 'center', position: 'center',
//~ head: 'Subir Plantilla Donataria', head: 'Subir Plantilla Donataria',
//~ body: { body: {
//~ view: 'form', view: 'form',
//~ elements: body_elements, elements: body_elements,
//~ } }
//~ }) })
//~ w.show() w.show()
//~ $$('up_template').attachEvent('onUploadComplete', function(response){ $$('up_template').attachEvent('onUploadComplete', function(response){
//~ if(response.ok){ if(response.ok){
//~ $$('txt_plantilla_donataria').setValue(response.name) $$('txt_plantilla_donataria').setValue(response.name)
//~ msg_ok('Plantilla cargada correctamente') msg_ok('Plantilla cargada correctamente')
//~ }else{ }else{
//~ msg_error(response.name) msg_error(response.name)
//~ } }
//~ }) })
//~ } }
function txt_plantilla_nomina1233_click(e){ function txt_plantilla_nomina1233_click(e){
@ -1266,6 +1256,44 @@ function txt_plantilla_nomina1233_click(e){
} }
function txt_plantilla_pagos10_click(e){
var body_elements = [
{cols: [{width: 100}, {view: 'uploader', id: 'up_template',
autosend: true, link: 'lst_files', value: 'Seleccionar archivo',
upload: '/files/txt_plantilla_pagos10', width: 200}, {width: 100}]},
{view: 'list', id: 'lst_files', type: 'uploader', autoheight:true,
borderless: true},
{},
{cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
click:("$$('win_template').close();")}, {}]}
]
var w = webix.ui({
view: 'window',
id: 'win_template',
modal: true,
position: 'center',
head: 'Subir Plantilla Factura de Pago',
body: {
view: 'form',
elements: body_elements,
}
})
w.show()
$$('up_template').attachEvent('onUploadComplete', function(response){
if(response.ok){
$$('txt_plantilla_pagos10').setValue(response.name)
msg_ok('Plantilla cargada correctamente')
}else{
msg_error(response.name)
}
})
}
function tab_options_change(nv, ov){ function tab_options_change(nv, ov){
var cv = { var cv = {
tab_admin_templates: 'templates', tab_admin_templates: 'templates',
@ -1290,8 +1318,6 @@ function tab_sat_change(nv, ov){
get_admin_formasdepago() get_admin_formasdepago()
}else if(nv == 'Usos de CFDI'){ }else if(nv == 'Usos de CFDI'){
get_admin_usos_cfdi() get_admin_usos_cfdi()
}else if(nv == 'Regimenes Fiscales'){
get_admin_regimenes_fiscales()
} }
} }
@ -1391,21 +1417,6 @@ function grid_admin_usos_cfdi_on_check(row, column, state){
} }
function grid_admin_regimenes_fiscales_on_check(row, column, state){
var values = {
id: row,
field: column,
value: state,
}
webix.ajax().get('/values/regimenesupdate', values, {
error: function(text, data, xhr) {
},
success: function(text, data, xhr) {
}
})
}
function emisor_cuenta_saldo_inicial_change(new_value, old_value){ function emisor_cuenta_saldo_inicial_change(new_value, old_value){
if(!isFinite(new_value)){ if(!isFinite(new_value)){
this.config.value = old_value this.config.value = old_value

View File

@ -81,7 +81,6 @@ var bancos_controllers = {
$$('grid_bank_invoice_pay').attachEvent('onItemClick', grid_bank_invoice_pay_click) $$('grid_bank_invoice_pay').attachEvent('onItemClick', grid_bank_invoice_pay_click)
$$('grid_cuentabanco').attachEvent('onItemDblClick', grid_cuentabanco_double_click) $$('grid_cuentabanco').attachEvent('onItemDblClick', grid_cuentabanco_double_click)
$$('cmd_invoice_pay_sat').attachEvent('onItemClick', cmd_invoice_pay_sat_click) $$('cmd_invoice_pay_sat').attachEvent('onItemClick', cmd_invoice_pay_sat_click)
$$('cmd_invoice_pay_cancel').attachEvent('onItemClick', cmd_invoice_pay_cancel_click)
init_config_bank() init_config_bank()
} }
@ -579,13 +578,13 @@ function validate_deposito(values){
return false return false
} }
//~ if(grid.count() && current_currency!=CURRENCY_MN){ if(grid.count() && current_currency!=CURRENCY_MN){
//~ if(type_change <= 1.0){ if(type_change <= 1.0){
//~ msg = 'El Tipo de Cambio debe ser mayor a 1.00' msg = 'El Tipo de Cambio debe ser mayor a 1.00'
//~ msg_error(msg) msg_error(msg)
//~ return false return false
//~ } }
//~ } }
var today = new Date() var today = new Date()
if(values.deposito_fecha > today){ if(values.deposito_fecha > today){
@ -954,7 +953,6 @@ function cmd_complemento_pago_click(){
} }
set_data_pay(row) set_data_pay(row)
$$('chk_pay_close_when_stamp').setValue(false)
$$('multi_bancos').setValue('bank_pay') $$('multi_bancos').setValue('bank_pay')
} }
@ -995,8 +993,6 @@ function send_stamp_cfdi_pay(id_mov){
var g = $$('grid_cfdi_pay') var g = $$('grid_cfdi_pay')
var data = {'opt': 'stamp', 'id_mov': id_mov} var data = {'opt': 'stamp', 'id_mov': id_mov}
var close = $$('chk_pay_close_when_stamp').getValue()
//~ ToDo Actualizar cantidad de facturas de pago en el movimiento //~ ToDo Actualizar cantidad de facturas de pago en el movimiento
webix.ajax().sync().post('cfdipay', data, { webix.ajax().sync().post('cfdipay', data, {
@ -1014,11 +1010,6 @@ function send_stamp_cfdi_pay(id_mov){
} }
} }
}) })
if(close){
$$('multi_bancos').setValue('banco_home')
}
} }
function save_cfdi_pay(form){ function save_cfdi_pay(form){
@ -1427,83 +1418,3 @@ function cmd_invoice_pay_sat_click(){
}) })
} }
function cmd_invoice_pay_cancel_click(){
var g = $$('grid_bank_invoice_pay')
if(g.count() == 0){
return
}
var row = g.getSelectedItem()
if (row == undefined){
msg_error('Selecciona una factura de pago')
return
}
if (row instanceof Array){
msg_error('Selecciona solo una factura de pago')
return
}
if(!row.uuid){
msg_error('La factura de pago no esta timbrada')
return
}
win_invoice_cancel_pay2.init()
$$('win_invoice_cancel_pay2').show()
}
function cmd_invoice_cancel_pay2_click(){
var reason = $$('lst_reasons_cancel2').getValue()
var uuid = $$('txt_cancel_uuid2').getValue()
if(!reason){
msg = 'Selecciona un motivo para esta cancelación'
msg_error(msg)
return
}
if(reason=='01' & !uuid){
msg = 'Debes de capturar el UUID que reemplaza a este CFDI'
msg_error(msg)
return
}
send_invoice_cancel_pay2(reason, uuid)
$$('win_invoice_cancel_pay2').close()
}
function cmd_win_cancel_pay_close2_click(){
$$('win_invoice_cancel_pay2').close()
}
function send_invoice_cancel_pay2(reason='', uuid=''){
var grid = $$('grid_bank_invoice_pay')
var row = grid.getSelectedItem()
var data = {
'opt': 'cancel2',
args: {
id: row.id,
reason: reason,
uuid: uuid,
}
}
webix.ajax().post('cfdipay', data, function(text, data){
var values = data.json()
if(values.ok){
msg_ok(values.msg)
grid.updateItem(row.id, {'estatus': 'Cancelada'})
}else{
msg_error('No fue posible cancelar')
webix.alert({
title: 'Error al Cancelar',
text: values.msg,
type: 'alert-error'
})
}
})
}

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,6 @@ function configuracion_inicial(){
add_config({'key': 'used_cfdi_pays', 'value': values.pagos}) add_config({'key': 'used_cfdi_pays', 'value': values.pagos})
add_config({'key': 'multi_currency', 'value': values.multi_currency}) add_config({'key': 'multi_currency', 'value': values.multi_currency})
add_config({'key': 'pays_data_bank', 'value': values.pays_data_bank}) add_config({'key': 'pays_data_bank', 'value': values.pays_data_bank})
add_config({'key': 'show_filter_by_day', 'value': values.show_filter_by_day})
}) })
@ -116,19 +115,16 @@ function menu_user_click(id, e, node){
function current_dates(){ function current_dates(){
var fy = $$('filter_year') var fy = $$('filter_year')
var fm = $$('filter_month') var fm = $$('filter_month')
var fd = $$('filter_day')
var pfy = $$('prefilter_year') var pfy = $$('prefilter_year')
var pfm = $$('prefilter_month') var pfm = $$('prefilter_month')
var d = new Date() var d = new Date()
fy.blockEvent() fy.blockEvent()
fm.blockEvent() fm.blockEvent()
fd.blockEvent()
pfy.blockEvent() pfy.blockEvent()
pfm.blockEvent() pfm.blockEvent()
fm.setValue(d.getMonth() + 1) fm.setValue(d.getMonth() + 1)
fd.setValue(d.getDate())
pfm.setValue(d.getMonth() + 1) pfm.setValue(d.getMonth() + 1)
webix.ajax().sync().get('/values/filteryears', function(text, data){ webix.ajax().sync().get('/values/filteryears', function(text, data){
var values = data.json() var values = data.json()
@ -140,7 +136,6 @@ function current_dates(){
fy.unblockEvent() fy.unblockEvent()
fm.unblockEvent() fm.unblockEvent()
fd.unblockEvent()
pfy.unblockEvent() pfy.unblockEvent()
pfm.unblockEvent() pfm.unblockEvent()
} }

View File

@ -255,10 +255,10 @@ function up_employees_upload_complete(response){
function delete_empleado(id){ function delete_empleado(id){
webix.ajax().del('/employees', {id: id}, function(text, xml, xhr){ webix.ajax().del('/employees', {id: id}, function(text, xml, xhr){
var msg = 'Empleado eliminado correctamente' var msg = 'Empleado eliminado correctamente'
if(xhr.status == 200){ if (xhr.status == 200){
$$('grid_employees').remove(id); $$('grid_employees').remove(id);
msg_ok(msg) msg_ok(msg)
}else{ } else {
msg = 'El Empleado tiene recibos timbrados' msg = 'El Empleado tiene recibos timbrados'
msg_error(msg) msg_error(msg)
} }

View File

@ -109,6 +109,8 @@ function cmd_edit_partner_click(){
var msg = '' var msg = ''
var row = $$('grid_partners').getSelectedItem() var row = $$('grid_partners').getSelectedItem()
get_sat_regimenes()
$$('form_partner_account_bank').clearValidation() $$('form_partner_account_bank').clearValidation()
if (row == undefined){ if (row == undefined){
@ -124,7 +126,6 @@ function cmd_edit_partner_click(){
}, },
success: function(text, data, xhr){ success: function(text, data, xhr){
var values = data.json() var values = data.json()
$$('form_partner').clearValidation() $$('form_partner').clearValidation()
$$('form_partner').setValues(values) $$('form_partner').setValues(values)
$$('forma_pago').getList().load('/values/formapago') $$('forma_pago').getList().load('/values/formapago')
@ -134,10 +135,8 @@ function cmd_edit_partner_click(){
if(values.tipo_persona == 1){ if(values.tipo_persona == 1){
query = table_usocfdi.chain().find({fisica: true}).data() query = table_usocfdi.chain().find({fisica: true}).data()
get_sat_regimenes()
}else if(values.tipo_persona == 2){ }else if(values.tipo_persona == 2){
query = table_usocfdi.chain().find({moral: true}).data() query = table_usocfdi.chain().find({moral: true}).data()
get_sat_regimenes(true)
}else{ }else{
query = [{id: 'P01', value: 'Por definir'}] query = [{id: 'P01', value: 'Por definir'}]
} }
@ -149,7 +148,6 @@ function cmd_edit_partner_click(){
$$('cuenta_proveedor').enable() $$('cuenta_proveedor').enable()
} }
get_partner_accounts_bank(row['id']) get_partner_accounts_bank(row['id'])
pause(250)
$$('lst_receptor_regimenes_fiscales').select(values.regimenes) $$('lst_receptor_regimenes_fiscales').select(values.regimenes)
} }
}) })
@ -157,7 +155,6 @@ function cmd_edit_partner_click(){
$$('multi_partners').setValue('partners_new') $$('multi_partners').setValue('partners_new')
$$('tab_partner').setValue('Datos Fiscales') $$('tab_partner').setValue('Datos Fiscales')
get_partner_banks() get_partner_banks()
} }
@ -361,7 +358,6 @@ function opt_tipo_change(new_value, old_value){
show('id_fiscal', new_value == 4) show('id_fiscal', new_value == 4)
$$('lst_receptor_regimenes_fiscales').clearAll() $$('lst_receptor_regimenes_fiscales').clearAll()
var regimen_616 = {id: 11, value: '[616] Sin obligaciones fiscales'}
if (new_value == 1 || new_value == 2){ if (new_value == 1 || new_value == 2){
$$("rfc").define("value", "") $$("rfc").define("value", "")
@ -375,13 +371,11 @@ function opt_tipo_change(new_value, old_value){
$$("rfc").define("value", RFC_PUBLICO) $$("rfc").define("value", RFC_PUBLICO)
$$("nombre").define("value", PUBLICO) $$("nombre").define("value", PUBLICO)
$$("rfc").define("readonly", true) $$("rfc").define("readonly", true)
$$('lst_receptor_regimenes_fiscales').parse(regimen_616)
} else if (new_value == 4) { } else if (new_value == 4) {
$$("rfc").define("value", RFC_EXTRANJERO) $$("rfc").define("value", RFC_EXTRANJERO)
$$("rfc").define("readonly", true) $$("rfc").define("readonly", true)
$$("pais").define("readonly", false) $$("pais").define("readonly", false)
$$("pais").define("value", "") $$("pais").define("value", "")
$$('lst_receptor_regimenes_fiscales').parse(regimen_616)
} }
$$("nombre").refresh(); $$("nombre").refresh();
@ -399,7 +393,7 @@ function opt_tipo_change(new_value, old_value){
}else if (new_value == 2){ }else if (new_value == 2){
query = table_usocfdi.chain().find({moral: true}).data() query = table_usocfdi.chain().find({moral: true}).data()
}else{ }else{
query = [{id: 'S01', value: '[S01] Sin efectos fiscales. '}] query = [{id: 'P01', value: 'Por definir'}]
} }
$$('lst_uso_cfdi_socio').getList().parse(query) $$('lst_uso_cfdi_socio').getList().parse(query)
$$('lst_uso_cfdi_socio').refresh() $$('lst_uso_cfdi_socio').refresh()
@ -652,7 +646,7 @@ function partner_delete_account_bank(row){
function get_sat_regimenes(morales=false){ function get_sat_regimenes(morales=false){
var data = {opt: 'actives', morales: morales} var data = {opt: 'actives', morales: morales}
webix.ajax().sync().get('/satregimenes', data, { webix.ajax().get('/satregimenes', data, {
error: function(text, data, xhr) { error: function(text, data, xhr) {
msg = 'Error al consultar' msg = 'Error al consultar'
msg_error(msg) msg_error(msg)

View File

@ -19,7 +19,7 @@ function products_default_config(){
if(cfg_products['inventario']){ if(cfg_products['inventario']){
$$('grid_products').showColumn('existencia') $$('grid_products').showColumn('existencia')
} }
//~ show('cant_by_packing', values.chk_use_packing) show('cant_by_packing', values.chk_use_packing)
show('cmd_show_exists', values.chk_multi_stock) show('cmd_show_exists', values.chk_multi_stock)
} }
}) })
@ -123,7 +123,6 @@ function cmd_edit_product_click(){
get_taxes() get_taxes()
$$('unidad').getList().load('/values/unidades') $$('unidad').getList().load('/values/unidades')
configurar_producto() configurar_producto()
var grid = $$('grid_products') var grid = $$('grid_products')
var row = grid.getSelectedItem() var row = grid.getSelectedItem()
if(row == undefined){ if(row == undefined){
@ -132,10 +131,9 @@ function cmd_edit_product_click(){
} }
$$('categoria').getList().load('/values/categorias') $$('categoria').getList().load('/values/categorias')
webix.ajax().get('/products', {id:row['id']}, {
webix.ajax().get('/products', {id: row['id']}, {
error: function(text, data, xhr) { error: function(text, data, xhr) {
msg_error(text) msg_error()
}, },
success: function(text, data, xhr){ success: function(text, data, xhr){
var values = data.json() var values = data.json()
@ -232,9 +230,18 @@ function cmd_save_product_click(id, e, node){
} }
var rows = $$('grid_product_taxes').getSelectedId(true, true) var rows = $$('grid_product_taxes').getSelectedId(true, true)
//~ if (rows.length == 0){
//~ msg_error('Selecciona un impuesto')
//~ return
//~ }
var values = form.getValues(); var values = form.getValues();
if(!isFinite(values.cant_by_packing)){
msg_error('La cantidad por empaque debe ser un número')
return
}
if(!validate_sat_key_product(values.clave_sat, false)){ if(!validate_sat_key_product(values.clave_sat, false)){
msg_error('La clave SAT no existe') msg_error('La clave SAT no existe')
return return
@ -245,19 +252,7 @@ function cmd_save_product_click(id, e, node){
return return
} }
if(values['objeto_impuesto']=='01' && rows.length > 0){
msg = 'Si Objeto de Impuestos = 01, no debes seleccionar ningún impuesto'
msg_error(msg)
return
}
if(values['objeto_impuesto']=='02' && rows.length == 0){
msg = 'Si Objeto de Impuestos = 02, debes de seleccionar al menos un impuesto'
msg_error(msg)
return
}
values['taxes'] = JSON.stringify(rows) values['taxes'] = JSON.stringify(rows)
webix.ajax().sync().post('products', values, { webix.ajax().sync().post('products', values, {
error:function(text, data, XmlHttpRequest){ error:function(text, data, XmlHttpRequest){
msg = 'Ocurrio un error, consulta a soporte técnico' msg = 'Ocurrio un error, consulta a soporte técnico'

View File

@ -149,9 +149,7 @@ function configuracion_inicial_ticket_to_invoice(){
var grid = $$('grid_tickets_active') var grid = $$('grid_tickets_active')
var gridt = $$('grid_tickets_invoice') var gridt = $$('grid_tickets_invoice')
var form = $$('form_ticket_invoice') var form = $$('form_ticket_invoice')
var chk = $$('chk_is_invoice_day')
chk.setValue(false)
get_active_tickets(grid) get_active_tickets(grid)
form.setValues({id_partner: 0, lbl_tclient: 'Ninguno'}) form.setValues({id_partner: 0, lbl_tclient: 'Ninguno'})
gridt.attachEvent('onAfterAdd', function(id, index){ gridt.attachEvent('onAfterAdd', function(id, index){
@ -613,18 +611,12 @@ function cmd_cancelar_ticket_click(){
function chk_is_invoice_day_change(new_value, old_value){ function chk_is_invoice_day_change(new_value, old_value){
var value = Boolean(new_value) var value = Boolean(new_value)
show('fs_ticket_search_client', !value) show('fs_ticket_search_client', !value)
enable('lst_global_periodicidad_2', value)
enable('lst_global_months_2', value)
var current_date = new Date()
var current_month = (current_date.getMonth() + 1).toString().padStart(2, '0')
$$('lst_global_months_2').setValue(current_month)
} }
function send_timbrar_invoice(id){ function send_timbrar_invoice(id){
//~ webix.ajax().get('/values/timbrar', {id: id, update: false}, function(text, data){
webix.ajax().post('invoices', {opt: 'timbrar', id: id, update: false}, function(text, data){ webix.ajax().post('invoices', {opt: 'timbrar', id: id, update: false}, function(text, data){
var values = data.json() var values = data.json()
if(values.ok){ if(values.ok){
@ -652,7 +644,6 @@ function save_ticket_to_invoice(data){
if(values.ok){ if(values.ok){
msg_ok(values.msg) msg_ok(values.msg)
send_timbrar_invoice(values.id) send_timbrar_invoice(values.id)
$$('chk_is_invoice_day').setValue(false)
$$('multi_tickets').setValue('tickets_home') $$('multi_tickets').setValue('tickets_home')
}else{ }else{
msg_error(values.msg) msg_error(values.msg)
@ -689,26 +680,12 @@ function cmd_new_invoice_from_ticket_click(){
}) })
var data = new Object() var data = new Object()
data['opt'] = 'invoice'
data['client'] = values.id_partner data['client'] = values.id_partner
data['tickets'] = tickets data['tickets'] = tickets
data['is_invoice_day'] = chk.getValue() data['is_invoice_day'] = chk.getValue()
data['opt'] = 'invoice'
var periodicidad = '' msg = 'Todos los datos son correctos.<BR><BR>¿Estás seguro de generar esta factura?'
if(data['is_invoice_day']){
periodicidad = $$('lst_global_periodicidad_2').getValue() + '|'
periodicidad += $$('lst_global_months_2').getValue() + '|'
periodicidad += new Date().getFullYear()
}
data['periodicidad'] = periodicidad
msg = 'Todos los datos son correctos.<BR><BR>'
if(data['is_invoice_day']){
msg += 'Es Factura Global.<BR><BR>'
}
msg += '¿Estás seguro de generar esta factura?'
webix.confirm({ webix.confirm({
title: 'Generar Factura', title: 'Generar Factura',
ok: 'Si', ok: 'Si',

View File

@ -15,7 +15,7 @@
//~ along with this program. If not, see <http://www.gnu.org/licenses/>. //~ along with this program. If not, see <http://www.gnu.org/licenses/>.
var PUBLICO = "PUBLICO EN GENERAL"; var PUBLICO = "Público en general";
var RFC_PUBLICO = "XAXX010101000"; var RFC_PUBLICO = "XAXX010101000";
var RFC_EXTRANJERO = "XEXX010101000"; var RFC_EXTRANJERO = "XEXX010101000";
var PAIS = "México"; var PAIS = "México";
@ -24,7 +24,6 @@ var DECIMALES = 2;
var DECIMALES_TAX = 4; var DECIMALES_TAX = 4;
var CLAVE_ANTICIPOS = '84111506'; var CLAVE_ANTICIPOS = '84111506';
var CURRENCY_MN = 'MXN'; var CURRENCY_MN = 'MXN';
var KEY_SAT_01 = '01010101';
var db = new loki('data.db'); var db = new loki('data.db');
@ -55,42 +54,6 @@ var months = [
{id: 12, value: 'Diciembre'}, {id: 12, value: 'Diciembre'},
] ]
var days = [
{id: -1, value: '00'},
{id: 1, value: '01'},
{id: 2, value: '02'},
{id: 3, value: '03'},
{id: 4, value: '04'},
{id: 5, value: '05'},
{id: 6, value: '06'},
{id: 7, value: '07'},
{id: 8, value: '08'},
{id: 9, value: '09'},
{id: 10, value: '10'},
{id: 11, value: '11'},
{id: 12, value: '12'},
{id: 13, value: '13'},
{id: 14, value: '14'},
{id: 15, value: '15'},
{id: 16, value: '16'},
{id: 17, value: '17'},
{id: 18, value: '18'},
{id: 19, value: '19'},
{id: 20, value: '20'},
{id: 21, value: '21'},
{id: 22, value: '22'},
{id: 23, value: '23'},
{id: 24, value: '24'},
{id: 25, value: '25'},
{id: 26, value: '26'},
{id: 27, value: '27'},
{id: 28, value: '28'},
{id: 29, value: '29'},
{id: 30, value: '30'},
{id: 31, value: '31'},
]
function get_icon(tipo){ function get_icon(tipo){
icons = { icons = {
@ -664,33 +627,3 @@ function grid_parse(grid_name, values){
function activate_tab(parent, name){ function activate_tab(parent, name){
$$(parent).getTabbar().setValue(name) $$(parent).getTabbar().setValue(name)
} }
var opt_global_periodicidad = [
{id: '01', value: '[01] Diario'},
{id: '02', value: '[02] Semanal'},
{id: '03', value: '[03] Quincenal'},
{id: '04', value: '[04] Mensual'},
{id: '05', value: '[05] Bimestral'},
]
var opt_global_months = [
{id: '01', value: '[01] Enero'},
{id: '02', value: '[02] Febrero'},
{id: '03', value: '[03] Marzo'},
{id: '04', value: '[04] Abril'},
{id: '05', value: '[05] Mayo'},
{id: '06', value: '[06] Junio'},
{id: '07', value: '[07] Julio'},
{id: '08', value: '[08] Agosto'},
{id: '09', value: '[09] Septiembre'},
{id: '10', value: '[10] Octubre'},
{id: '11', value: '[11] Noviembre'},
{id: '12', value: '[12] Diciembre'},
{id: '13', value: '[13] Enero-Febrero'},
{id: '14', value: '[14] Marzo-Abril'},
{id: '15', value: '[15] Mayo-Junio'},
{id: '16', value: '[16] Julio-Agosto'},
{id: '17', value: '[17] Septiembre-Octubre'},
{id: '18', value: '[18] Noviembre-Diciembre'},
]

View File

@ -176,9 +176,7 @@ var emisor_datos_fiscales = [
invalidMessage: 'El C.P. es requerido'}, invalidMessage: 'El C.P. es requerido'},
{view: 'text', id: 'emisor_cp2', name: 'emisor_cp2', width: 300, {view: 'text', id: 'emisor_cp2', name: 'emisor_cp2', width: 300,
label: 'C.P. de Expedición: ', attributes: {maxlength: 5}}, label: 'C.P. de Expedición: ', attributes: {maxlength: 5}},
{view: 'counter', id: 'emisor_hours', name: 'emisor_hours', value: 0, {}]},
required: false, label: 'Horas Dif.: ', step: 1, min: -1, max: 3}
]},
{cols: [ {cols: [
{view: 'label', label: 'Regimenes Fiscales *', required: true}, {}]}, {view: 'label', label: 'Regimenes Fiscales *', required: true}, {}]},
{cols: [{view: 'list', id: 'lst_emisor_regimen', select: 'multiselect', {cols: [{view: 'list', id: 'lst_emisor_regimen', select: 'multiselect',
@ -598,22 +596,8 @@ var type_make_pdf = [
] ]
//~ Templates
var opt_templates_cfdi = [ var opt_templates_cfdi = [
{id: '_4.0.ods', value: 'CFDI v4.0'}, {id: '_3.3_cp_2.0.ods', value: 'CFDI v3.3 - Carta Porte 2.0'},
{id: '_4.0_cn_1.2.ods', value: 'CFDI v4.0 - Nómina v1.2'},
{id: '_4.0_cp_2.0.ods', value: 'CFDI v4.0 - Pagos v2.0'},
{id: '_4.0_ccp_2.0.ods', value: 'CFDI v4.0 - Carta Porte v2.0'},
{id: '_4.0_ccp_3.0.ods', value: 'CFDI v4.0 - Carta Porte v3.0'},
{id: '_4.0_cd_1.1.ods', value: 'CFDI v4.0 - Donativos v1.1'},
{id: '_4.0_cce_2.0.ods', value: 'CFDI v4.0 - Comercio Exterior v2.0'},
{id: '_4.0.json', value: 'CFDI v4.0 - JSON'},
{id: '_3.3.ods', value: 'CFDI v3.3'},
{id: '_3.3_cn_1.2.ods', value: 'CFDI v3.3 - Nómina v1.2'},
{id: '_3.3_ccp_2.0.ods', value: 'CFDI v3.3 - Carta Porte v2.0'},
{id: '_3.3_cp_1.0.ods', value: 'CFDI v3.3 - Pagos v1.0'},
{id: '_3.3.json', value: 'CFDI v3.3 - JSON'},
{id: '_3.2.ods', value: 'CFDI v3.2'}
] ]
@ -626,6 +610,14 @@ var options_templates = [
{}, {},
{maxWidth: 20} ]}, {maxWidth: 20} ]},
{maxHeight: 50}, {maxHeight: 50},
{cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_factura_32', name: 'plantilla_factura_32',
label: 'Plantilla Factura v3.2 (ODS): ', labelPosition: 'top',
icon: 'file'}, {maxWidth: 25},
{view: 'search', id: 'txt_plantilla_factura_33', labelPosition: 'top',
label: 'Plantilla Factura v3.3 (ODS): ', icon: 'file'},
{maxWidth: 20} ]},
{maxHeight: 20},
{cols: [{maxWidth: 20}, {cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_factura_html', name: 'plantilla_factura_html', {view: 'search', id: 'txt_plantilla_factura_html', name: 'plantilla_factura_html',
label: 'Plantilla Factura v3.3 (HTML): ', labelPosition: 'top', label: 'Plantilla Factura v3.3 (HTML): ', labelPosition: 'top',
@ -633,11 +625,32 @@ var options_templates = [
{view: 'search', id: 'txt_plantilla_factura_css', name: 'plantilla_factura_css', {view: 'search', id: 'txt_plantilla_factura_css', name: 'plantilla_factura_css',
label: 'Archivo de estilos (CSS): ', labelPosition: 'top', label: 'Archivo de estilos (CSS): ', labelPosition: 'top',
icon: 'file'}, {maxWidth: 20} ]}, icon: 'file'}, {maxWidth: 20} ]},
{maxHeight: 20},
{cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_factura_json', name: 'plantilla_factura_json',
label: 'Plantilla Factura v3.3 (JSON): ', labelPosition: 'top',
icon: 'file'}, {maxWidth: 25},
{}, {maxWidth: 20} ]},
{maxHeight: 20},
{cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_nomina1233', name: 'plantilla_nomina1233',
label: 'Plantilla Nomina v1.2 - Cfdi 3.3 (ODS): ', labelPosition: 'top',
icon: 'file'}, {maxWidth: 40}, {}]},
{maxHeight: 20},
{cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_pagos10', name: 'plantilla_pagos10',
label: 'Plantilla Factura de Pagos v1.0 - Cfdi 3.3 (ODS): ',
labelPosition: 'top', icon: 'file'}, {maxWidth: 40}, {}]},
{maxHeight: 20}, {maxHeight: 20},
{cols: [{maxWidth: 20}, {cols: [{maxWidth: 20},
{view: 'search', id: 'txt_plantilla_ticket', name: 'plantilla_ticket', {view: 'search', id: 'txt_plantilla_ticket', name: 'plantilla_ticket',
label: 'Plantilla para Tickets (ODS): ', labelPosition: 'top', label: 'Plantilla para Tickets (ODS): ', labelPosition: 'top',
icon: 'file'}, icon: 'file'},
{view: 'search', id: 'txt_plantilla_donataria', name: 'plantilla_donataria',
label: 'Plantilla Donataria (solo ONGs): ', labelPosition: 'top',
icon: 'file'},
{}]}, {}]},
{maxHeight: 20}, {maxHeight: 20},
{cols: [{maxWidth: 20}, {cols: [{maxWidth: 20},
@ -672,7 +685,7 @@ var options_admin_otros = [
{view: 'checkbox', id: 'chk_config_tax_locales', labelWidth: 0, {view: 'checkbox', id: 'chk_config_tax_locales', labelWidth: 0,
labelRight: 'Impuestos locales, calcular antes del descuento'}, labelRight: 'Impuestos locales, calcular antes del descuento'},
{view: 'checkbox', id: 'chk_config_tax_decimals', labelWidth: 0, {view: 'checkbox', id: 'chk_config_tax_decimals', labelWidth: 0,
labelRight: 'Calcular impuestos con 4 decimales', hidden: true}, labelRight: 'Calcular impuestos con 4 decimales'},
{view: 'checkbox', id: 'chk_config_price_with_taxes_in_invoice', labelWidth: 0, {view: 'checkbox', id: 'chk_config_price_with_taxes_in_invoice', labelWidth: 0,
labelRight: 'Precio incluye impuestos'}, labelRight: 'Precio incluye impuestos'},
{view: 'checkbox', id: 'chk_config_add_same_product', labelWidth: 0, {view: 'checkbox', id: 'chk_config_add_same_product', labelWidth: 0,
@ -691,8 +704,6 @@ var options_admin_otros = [
labelRight: 'Factura global por ticket'}, labelRight: 'Factura global por ticket'},
{view: 'checkbox', id: 'chk_config_show_total_cant', labelWidth: 0, {view: 'checkbox', id: 'chk_config_show_total_cant', labelWidth: 0,
labelRight: 'Mostrar total de cantidades'}, labelRight: 'Mostrar total de cantidades'},
{view: 'checkbox', id: 'chk_config_show_filter_by_day', labelWidth: 0,
labelRight: 'Mostrar filtro por día'},
{} {}
]}, ]},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
@ -700,11 +711,6 @@ var options_admin_otros = [
labelRight: 'Solo admins pueden cancelar'}, labelRight: 'Solo admins pueden cancelar'},
{} {}
]}, ]},
{cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_change_date_invoice', labelWidth: 0,
labelRight: 'Permitir cambiar fecha al facturar [No recomendable]'},
{}
]},
{maxHeight: 15}, {maxHeight: 15},
{template: 'Timbrado', type: 'section'}, {template: 'Timbrado', type: 'section'},
@ -826,7 +832,7 @@ var options_admin_products = [
var options_admin_complements = [ var options_admin_complements = [
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento de Nómina', type: 'section'}, {template: 'Complemento de Nómina', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_usar_nomina', labelWidth: 0, {view: 'checkbox', id: 'chk_usar_nomina', labelWidth: 0,
@ -836,7 +842,7 @@ var options_admin_complements = [
{view: 'text', id: 'txt_config_nomina_folio', name: 'config_nomina_folio', {view: 'text', id: 'txt_config_nomina_folio', name: 'config_nomina_folio',
label: 'Folio', labelWidth: 50, labelAlign: 'right'}, label: 'Folio', labelWidth: 50, labelAlign: 'right'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento de Pagos', type: 'section'}, {template: 'Complemento de Pagos', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_pagos', labelWidth: 0, {view: 'checkbox', id: 'chk_config_pagos', labelWidth: 0,
@ -848,25 +854,25 @@ var options_admin_complements = [
{view: 'text', id: 'txt_config_cfdipay_folio', name: 'txt_config_cfdipay_serie', {view: 'text', id: 'txt_config_cfdipay_folio', name: 'txt_config_cfdipay_serie',
label: 'Folio', labelWidth: 50, labelAlign: 'right'}, label: 'Folio', labelWidth: 50, labelAlign: 'right'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento de Divisas', type: 'section'}, {template: 'Complemento de Divisas', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_divisas', labelWidth: 0, {view: 'checkbox', id: 'chk_config_divisas', labelWidth: 0,
labelRight: 'Usar complemento de divisas'}, labelRight: 'Usar complemento de divisas'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento INE', type: 'section'}, {template: 'Complemento INE', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_ine', labelWidth: 0, {view: 'checkbox', id: 'chk_config_ine', labelWidth: 0,
labelRight: 'Usar el complemento INE'}, labelRight: 'Usar el complemento INE'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento para escuelas EDU', type: 'section'}, {template: 'Complemento para escuelas EDU', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_edu', labelWidth: 0, {view: 'checkbox', id: 'chk_config_edu', labelWidth: 0,
labelRight: 'Usar el complemento EDU'}, labelRight: 'Usar el complemento EDU'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento Leyendas Fiscales', type: 'section'}, {template: 'Complemento Leyendas Fiscales', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_leyendas_fiscales', labelWidth: 0, {view: 'checkbox', id: 'chk_config_leyendas_fiscales', labelWidth: 0,
@ -875,17 +881,12 @@ var options_admin_complements = [
type: 'form', align: 'center', autowidth: true, disabled: true}, type: 'form', align: 'center', autowidth: true, disabled: true},
{}, {maxWidth: 15} {}, {maxWidth: 15}
]}, ]},
{maxHeight: 10}, {maxHeight: 20},
{template: 'Complemento para Carta Porte', type: 'section'}, {template: 'Complemento para Carta Porte', type: 'section'},
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_carta_porte', labelWidth: 0, {view: 'checkbox', id: 'chk_config_carta_porte', labelWidth: 0,
labelRight: 'Usar el complemento Carta Porte'}, labelRight: 'Usar el complemento Carta Porte'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{template: 'Complemento para Comercio Exterior', type: 'section'},
{cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_comercio_exterior', labelWidth: 0,
labelRight: 'Usar el complemento Comercio Exterior'},
{maxWidth: 15}]},
] ]
@ -1134,19 +1135,6 @@ var grid_admin_usos_cfdi_cols = [
] ]
var grid_admin_regimenes_fiscales_cols = [
{id: 'id', header: 'ID', hidden: true},
{id: 'key', header: 'Clave', adjust: 'header'},
{id: 'name', header: 'Nombre', width: 500},
{id: 'fisica', header: 'Físicas', adjust: 'header',
template: format_bool_fisica},
{id: 'moral', header: 'Morales', adjust: 'header',
template: format_bool_moral},
{id: 'activo', header: 'Activa', template: '{common.checkbox()}',
editor: 'checkbox', adjust: 'header'},
]
var grid_admin_formasdepago = { var grid_admin_formasdepago = {
view: 'datatable', view: 'datatable',
id: 'grid_admin_formasdepago', id: 'grid_admin_formasdepago',
@ -1159,18 +1147,6 @@ var grid_admin_formasdepago = {
} }
var grid_admin_regimenes_fiscales = {
view: 'datatable',
id: 'grid_admin_regimenes_fiscales',
select: 'cell',
adjust: true,
autowidth: true,
headermenu: true,
footer: true,
columns: grid_admin_regimenes_fiscales_cols,
}
var grid_admin_usos_cfdi = { var grid_admin_usos_cfdi = {
view: 'datatable', view: 'datatable',
id: 'grid_admin_usos_cfdi', id: 'grid_admin_usos_cfdi',
@ -1193,7 +1169,6 @@ var admin_taxes = [
'CEDULAR', 'CEDULAR',
'CMIC', 'CMIC',
'SUPERVISION', 'SUPERVISION',
'MANO DE OBRA',
] ]
var admin_sat_impuestos = {cols: [{maxWidth: 15}, var admin_sat_impuestos = {cols: [{maxWidth: 15},
@ -1342,16 +1317,6 @@ var sat_usos_cfdi = [
] ]
var msg_regimenes_fiscales = 'Administrar Regimenes Fiscales.'
var sat_regimenes_fiscales = [
{maxHeight: 20},
{cols: [{maxWidth: 15}, {view: 'label', label: msg_regimenes_fiscales}, {}]},
{maxHeight: 20},
{cols: [{maxWidth: 15}, grid_admin_regimenes_fiscales, {}]},
{maxHeight: 20},
]
var suggest_sat_unidades_peso = { var suggest_sat_unidades_peso = {
view: 'gridsuggest', view: 'gridsuggest',
id: 'grid_unidadpeso_found', id: 'grid_unidadpeso_found',
@ -1449,7 +1414,6 @@ var tab_sat = {
{id: 'Unidades', rows: sat_unidades}, {id: 'Unidades', rows: sat_unidades},
{id: 'Formas de Pago', rows: sat_formasdepago}, {id: 'Formas de Pago', rows: sat_formasdepago},
{id: 'Usos de CFDI', rows: sat_usos_cfdi}, {id: 'Usos de CFDI', rows: sat_usos_cfdi},
{id: 'Regimenes Fiscales', rows: sat_regimenes_fiscales},
{id: 'Carta Porte', rows: tab_sat_carta_porte}, {id: 'Carta Porte', rows: tab_sat_carta_porte},
], ],
} }

View File

@ -347,8 +347,6 @@ var toolbar_bank_pay = [
type: 'iconButton', autowidth: true, icon: 'minus'}, type: 'iconButton', autowidth: true, icon: 'minus'},
{view: 'button', id: 'cmd_pay_delete', label: 'Eliminar', {view: 'button', id: 'cmd_pay_delete', label: 'Eliminar',
type: 'iconButton', autowidth: true, icon: 'ban'}, type: 'iconButton', autowidth: true, icon: 'ban'},
{view: 'checkbox', id: 'chk_pay_close_when_stamp',
label: 'Cerrar al timbrar', tooltip: 'Cerrar al timbrar'},
{}, {},
{view: 'icon', click: '$$("multi_bancos").setValue("banco_home")', {view: 'icon', click: '$$("multi_bancos").setValue("banco_home")',
icon: 'times-circle'} icon: 'times-circle'}
@ -367,13 +365,11 @@ var toolbar_bank_invoice_pay_filter = [
{view: 'richselect', id: 'filter_invoice_pay_year', label: 'Año', {view: 'richselect', id: 'filter_invoice_pay_year', label: 'Año',
labelAlign: 'right', labelWidth: 50, width: 150, options: []}, labelAlign: 'right', labelWidth: 50, width: 150, options: []},
{view: 'richselect', id: 'filter_invoice_pay_month', label: 'Mes', {view: 'richselect', id: 'filter_invoice_pay_month', label: 'Mes',
labelAlign: 'right', labelWidth: 50, width: 175, options: months}, labelAlign: 'right', labelWidth: 50, width: 200, options: months},
{view: 'daterangepicker', id: 'filter_invoice_pay_dates', label: 'Fechas', {view: 'daterangepicker', id: 'filter_invoice_pay_dates', label: 'Fechas',
labelAlign: 'right', width: 275}, labelAlign: 'right', width: 300},
{view: 'button', id: 'cmd_invoice_pay_sat', label: 'SAT', {view: 'button', id: 'cmd_invoice_pay_sat', label: 'SAT',
type: 'iconButton', autowidth: true, icon: 'check-circle'}, type: 'iconButton', autowidth: true, icon: 'check-circle'},
{view: 'button', id: 'cmd_invoice_pay_cancel', label: 'Cancelar',
type: 'iconButton', autowidth: true, icon: 'ban'},
{}, {},
] ]
@ -628,7 +624,7 @@ var body_invoice_cancel_pay = {rows: [{minHeight: 15},
{view: 'richselect', id: 'lst_reasons_cancel', labelPosition: 'top', label: 'Razón de cancelación', options: opt_reasons_cancel_pay, value: '', width: 400}, {view: 'richselect', id: 'lst_reasons_cancel', labelPosition: 'top', label: 'Razón de cancelación', options: opt_reasons_cancel_pay, value: '', width: 400},
{view: 'text', id: 'txt_cancel_uuid', labelPosition: 'top', label: 'UUID que sustituye', width: 400}, {view: 'text', id: 'txt_cancel_uuid', labelPosition: 'top', label: 'UUID que sustituye', width: 400},
{view: 'label', label: 'Esta acción no se puede deshacer', autowidth: true, align: 'center'}, {view: 'label', label: 'Esta acción no se puede deshacer', autowidth: true, align: 'center'},
{view: 'label', label: '¿Estás seguro de continuar?', autowidth: true, align: 'center'}, {view: 'label', label: '¿Estás segura de continuar?', autowidth: true, align: 'center'},
{cols: [{}, {cols: [{},
{view: 'button', id: 'cmd_invoice_cancel_pay', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'}, {view: 'button', id: 'cmd_invoice_cancel_pay', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
{maxWidth: 25}, {maxWidth: 25},
@ -654,35 +650,3 @@ var win_invoice_cancel_pay = {
$$('cmd_win_cancel_pay_close').attachEvent('onItemClick', cmd_win_cancel_pay_close_click) $$('cmd_win_cancel_pay_close').attachEvent('onItemClick', cmd_win_cancel_pay_close_click)
} }
} }
var body_invoice_cancel_pay2 = {rows: [{minHeight: 15},
{view: 'richselect', id: 'lst_reasons_cancel2', labelPosition: 'top', label: 'Razón de cancelación', options: opt_reasons_cancel_pay, value: '', width: 400},
{view: 'text', id: 'txt_cancel_uuid2', labelPosition: 'top', label: 'UUID que sustituye', width: 400},
{view: 'label', label: 'Esta acción no se puede deshacer', autowidth: true, align: 'center'},
{view: 'label', label: '¿Estás seguro de continuar?', autowidth: true, align: 'center'},
{cols: [{},
{view: 'button', id: 'cmd_invoice_cancel_pay2', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
{maxWidth: 25},
{view: 'button', id: 'cmd_win_cancel_pay_close2', width: 100, label: 'Cerrar'},
{}
]},
{minHeight: 20},
]}
var win_invoice_cancel_pay2 = {
init: function(){
webix.ui({
view: 'window',
id: 'win_invoice_cancel_pay2',
modal: true,
width: 400,
position: 'center',
head: 'Cancelar CFDI de Pago',
body: body_invoice_cancel_pay2,
})
$$('cmd_invoice_cancel_pay2').attachEvent('onItemClick', cmd_invoice_cancel_pay2_click)
$$('cmd_win_cancel_pay_close2').attachEvent('onItemClick', cmd_win_cancel_pay_close2_click)
}
}

View File

@ -224,8 +224,6 @@ var toolbar_invoices_generate = {view: 'toolbar', elements: [{},
labelWidth: 0, width: 100, hidden: true}, labelWidth: 0, width: 100, hidden: true},
{view: 'checkbox', id: 'chk_cfdi_donativo', labelRight: 'Es Donativo', {view: 'checkbox', id: 'chk_cfdi_donativo', labelRight: 'Es Donativo',
labelWidth: 0, width: 100, hidden: true}, labelWidth: 0, width: 100, hidden: true},
{view: 'button', id: 'cmd_show_global_information', label: 'Global',
type: 'iconButton', autowidth: true, hidden: false, icon: 'file-code-o'},
{}]} {}]}
@ -234,8 +232,6 @@ var toolbar_invoices_filter = [
labelWidth: 50, width: 150, options: []}, labelWidth: 50, width: 150, options: []},
{view: 'richselect', id: 'filter_month', label: 'Mes', labelAlign: 'right', {view: 'richselect', id: 'filter_month', label: 'Mes', labelAlign: 'right',
labelWidth: 50, width: 200, options: months}, labelWidth: 50, width: 200, options: months},
{view: 'richselect', id: 'filter_day', label: 'Día', labelAlign: 'right',
labelWidth: 50, width: 125, options: days},
{view: 'daterangepicker', id: 'filter_dates', label: 'Fechas', {view: 'daterangepicker', id: 'filter_dates', label: 'Fechas',
labelAlign: 'right', width: 300}, labelAlign: 'right', width: 300},
{}, {},
@ -489,11 +485,8 @@ var suggest_students = {
} }
var body_comprobante = {rows: [ var body_comprobante = {rows: [{
{view: 'datepicker', id: 'date_invoice', label: 'Fecha', format: '%d-%F-%Y', cols: [
required: true, invalidMessage: 'Selecciona una fecha', hidden: true
},
{cols: [
{ {
view: 'richselect', view: 'richselect',
id: 'lst_tipo_comprobante', id: 'lst_tipo_comprobante',
@ -523,8 +516,8 @@ var body_comprobante = {rows: [
var opt_metodo_pago = [ var opt_metodo_pago = [
{id: 'PUE', value: '[PUE] Pago en una sola exhibición'}, {id: 'PUE', value: 'Pago en una sola exhibición'},
{id: 'PPD', value: '[PPD] Pago en parcialidades o diferido'} {id: 'PPD', value: 'Pago en parcialidades o diferido'}
] ]
@ -845,66 +838,20 @@ var controls_leyendas_fiscales = [
] ]
var opt_ccp_transporte_internacional = [ var opt_transporte_internacional = [
{id: 'Sí', value: 'Sí'}, {id: 'Sí', value: 'Sí'},
{id: 'No', value: 'No'}, {id: 'No', value: 'No'},
] ]
var opt_ccp_regimen_aduanero = [ var opt_entrada_salida = [
{id: '', value: ''},
{id: 'IMD', value: '[IMD] Definitivo de importación.'},
{id: 'EXD', value: '[EXD] Definitivo de exportación.'},
{id: 'ITR', value: '[ITR] Temporales de importación para retomar al extranjero en el mismo estado.'},
{id: 'ITE', value: '[ITE] Temporales de importación para elaboración, transformación o reparación para empresas con programa IMMEX.'},
{id: 'ETR', value: '[ETR] Temporales de exportación para retornar al país en el mismo estado.'},
{id: 'ETE', value: '[ETE] Temporales de exportación para elaboración, transformación o reparación.'},
{id: 'DFI', value: '[DFI] Depósito Fiscal.'},
{id: 'RFE', value: '[RFE] Elaboración, transformación o reparación en recinto fiscalizado.'},
{id: 'RFS', value: '[RFS] Recinto fiscalizado estratégico.'},
{id: 'TRA', value: '[TRA] Tránsitos.'},
]
var opt_ccp_entrada_salida = [
{id: '', value: ''}, {id: '', value: ''},
{id: 'Entrada', value: 'Entrada'}, {id: 'Entrada', value: 'Entrada'},
{id: 'Salida', value: 'Salida'}, {id: 'Salida', value: 'Salida'},
] ]
var opt_ccp_pais_origen = [ var opt_origen_destino = [
{id: '', value: ''},
]
var opt_ccp_via_entrada = [
{id: '', value: ''},
{id: '01', value: '[01] Autotransporte'},
{id: '02', value: '[02] Marítimo'},
{id: '03', value: '[03] Aéreo'},
{id: '04', value: '[04] Ferroviario'},
]
var opt_ccp_ubicacion_polo = [
{id: '', value: ''},
{id: '01', value: '[01] Coatzacoalcos I'},
{id: '02', value: '[02] Coatzacoalcos II'},
{id: '03', value: '[03] Texistepec'},
{id: '04', value: '[04] San Juan Evangelista'},
{id: '05', value: '[05] Salina Cruz'},
{id: '06', value: '[06] San Blas Atempa'},
]
var opt_ccp_registro_istmo = [
{id: '', value: ''},
{id: 'Si', value: 'Sí'},
]
var opt_ccp_origen_destino = [
{id: 'Origen', value: 'Origen'}, {id: 'Origen', value: 'Origen'},
{id: 'Destino', value: 'Destino'}, {id: 'Destino', value: 'Destino'},
] ]
@ -919,12 +866,12 @@ var date_suggest = {
} }
var opt_ccp_countries = [ var opt_countries = [
{id: 'MEX', value: 'México'}, {id: 'MEX', value: 'México'},
] ]
var opt_ccp_carta_estados = [ var opt_carta_estados = [
{id: 'AGU', value: 'Aguascalientes'}, {id: 'AGU', value: 'Aguascalientes'},
{id: 'BCN', value: 'Baja California'}, {id: 'BCN', value: 'Baja California'},
{id: 'BCS', value: 'Baja California Sur'}, {id: 'BCS', value: 'Baja California Sur'},
@ -961,25 +908,18 @@ var opt_ccp_carta_estados = [
] ]
var grid_cols_ccp_ubicaciones = [ var grid_cols_carta_ubicaciones = [
{id: 'id', header: 'ID', hidden: true}, {id: 'id', header: 'ID', hidden: true},
{id: 'delete', header: '', width: 30, css: 'delete'}, {id: 'delete', header: '', hidden: true, width: 30, css: 'delete'},
{id: 'TipoUbicacion', header: 'TipoUbicacion', editor: 'select', options: opt_ccp_origen_destino, fillspace: 1}, {id: 'TipoUbicacion', header: 'Tipo de Ubicación', editor: 'select', options: opt_origen_destino, fillspace: 1},
//~ {id: 'IDUbicacion', header: 'IDUbicacion', hidden: true, editor: 'text', fillspace: 1},
{id: 'RFCRemitenteDestinatario', header: 'RFC Rem/Des', editor: 'text', fillspace: 1}, {id: 'RFCRemitenteDestinatario', header: 'RFC Rem/Des', editor: 'text', fillspace: 1},
{id: 'NombreRemitenteDestinatario', header: 'Nombre Rem/Des', editor: 'text', fillspace: 1}, {id: 'NombreRemitenteDestinatario', header: 'Nombre Rem/Des', editor: 'text', fillspace: 1},
//~ {id: 'NumRegIdTrib', header: 'NumRegIdTrib', hidden: true, editor: 'text', fillspace: 1},
//~ {id: 'ResidenciaFiscal', header: 'ResidenciaFiscal', hidden: true, editor: 'text', fillspace: 1},
//~ {id: 'NumEstacion', header: 'NumEstacion', hidden: true, editor: 'text', fillspace: 1},
//~ {id: 'NombreEstacion', header: 'NombreEstacion', hidden: true, editor: 'text', fillspace: 1},
//~ {id: 'NavegacionTrafico', header: 'NavegacionTrafico', hidden: true, editor: 'text', fillspace: 1},
{id: 'FechaHoraSalidaLlegada', header: 'Fecha/Hora', editor: 'date', suggest: date_suggest, format: webix.Date.dateToStr("%D, %d-%M-%Y %h:%i"), footer: 'Total distancia:', fillspace: 1}, {id: 'FechaHoraSalidaLlegada', header: 'Fecha/Hora', editor: 'date', suggest: date_suggest, format: webix.Date.dateToStr("%D, %d-%M-%Y %h:%i"), footer: 'Total distancia:', fillspace: 1},
//~ {id: 'TipoEstacion', header: 'TipoEstacion', hidden: true, editor: 'text', fillspace: 1},
{id: 'DistanciaRecorrida', header: 'Distancia (KM)', editor: 'text', format: webix.i18n.numberFormat, css: 'right', footer: {content: 'summColumn', css: 'right'}, fillspace: 1}, {id: 'DistanciaRecorrida', header: 'Distancia (KM)', editor: 'text', format: webix.i18n.numberFormat, css: 'right', footer: {content: 'summColumn', css: 'right'}, fillspace: 1},
{id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1}, {id: 'Municipio', headerd: 'Municipio', editor: 'text', fillspace: 1},
{id: 'Estado', header: 'Estado', editor: 'select', options: opt_ccp_carta_estados, fillspace: 1}, {id: 'Estado', headerd: 'Estado', editor: 'select', options: opt_carta_estados, fillspace: 1},
{id: 'Pais', header: 'País', editor: 'select', options: opt_ccp_countries, fillspace: 1}, {id: 'Pais', headerd: 'Pais', editor: 'select', options: opt_countries, fillspace: 1},
{id: 'CodigoPostal', header: 'C.P.', editor: 'text', fillspace: 1}, {id: 'CodigoPostal', headerd: 'C.P.', editor: 'text', fillspace: 1},
] ]
//~ Calle //~ Calle
//~ NumeroExterior //~ NumeroExterior
@ -989,29 +929,19 @@ var grid_cols_ccp_ubicaciones = [
//~ Referencia //~ Referencia
var grid_cols_ccp_mercancias = [ var grid_cols_carta_mercancias = [
{id: 'id', header: 'ID', hidden: true}, {id: 'id', header: 'ID', hidden: true},
{id: 'delete', header: '', width: 30, css: 'delete'}, {id: 'delete', header: '', width: 30, css: 'delete'},
{id: 'BienesTransp', header: 'Clave SAT', editor: 'text', fillspace: 1}, {id: 'BienesTransp', header: 'Clave SAT', editor: 'text', fillspace: 1},
//~ {id: 'ClaveSTCC', header: 'ClaveSTCC', editor: 'text', fillspace: 1},
{id: 'Descripcion', header: 'Descripción', editor: 'text', fillspace: 1}, {id: 'Descripcion', header: 'Descripción', editor: 'text', fillspace: 1},
{id: 'Cantidad', header: 'Cantidad', editor: 'text', format: webix.i18n.numberFormat, css: 'right', fillspace: 1}, {id: 'Cantidad', header: 'Cantidad', editor: 'text', format: webix.i18n.numberFormat, css: 'right', fillspace: 1},
{id: 'ClaveUnidad', header: 'Unidad', editor: 'select', options: 'values/unitbykey', footer: 'Total peso:', fillspace: 1}, {id: 'ClaveUnidad', header: 'Unidad', editor: 'select', options: 'values/unitbykey', footer: 'Total peso:', fillspace: 1},
//~ {id: 'Unidad', header: 'Unidad', editor: 'text', fillspace: 1},
//~ {id: 'Dimensiones', header: 'Dimensiones', editor: 'text', fillspace: 1},
//~ {id: 'MaterialPeligroso', header: 'MaterialPeligroso', editor: 'text', fillspace: 1},
//~ {id: 'CveMaterialPeligroso', header: 'CveMaterialPeligroso', editor: 'text', fillspace: 1},
//~ {id: 'Embalaje', header: 'Embalaje', editor: 'text', fillspace: 1},
//~ {id: 'DescripEmbalaje', header: 'DescripEmbalaje', editor: 'text', fillspace: 1},
//~ {id: 'SectorCOFEPRIS', header: 'SectorCOFEPRIS', editor: 'text', fillspace: 1},
{id: 'PesoEnKg', header: 'Peso (Kg)', format: webix.i18n.numberFormat, css: 'right', editor: 'text', footer: {content: 'summColumn', css: 'right'}, fillspace: 1},
//~ {id: 'ValorMercancia', header: 'Valor Mercancia', format: webix.i18n.priceFormat, css: 'right', footer: 'Total peso:', fillspace: 1}, //~ {id: 'ValorMercancia', header: 'Valor Mercancia', format: webix.i18n.priceFormat, css: 'right', footer: 'Total peso:', fillspace: 1},
//~ {id: 'Moneda', header: 'Moneda', editor: 'text', fillspace: 1}, {id: 'PesoEnKg', header: 'Peso (Kg)', format: webix.i18n.numberFormat, css: 'right', editor: 'text', footer: {content: 'summColumn', css: 'right'}, fillspace: 1},
//~ {id: 'FraccionArancelaria', header: 'FraccionArancelaria', editor: 'text', fillspace: 1},
] ]
var opt_ccp_tipo_permiso_sct = [ var opt_carta_tipo_permiso_sct = [
{id: 'TPAF01', value: '[TPAF01] Autotransporte Federal de carga general.'}, {id: 'TPAF01', value: '[TPAF01] Autotransporte Federal de carga general.'},
{id: 'TPAF02', value: '[TPAF02] Transporte privado de carga.'}, {id: 'TPAF02', value: '[TPAF02] Transporte privado de carga.'},
{id: 'TPAF03', value: '[TPAF03] Autotransporte Federal de Carga Especializada de materiales y residuos peligrosos.'}, {id: 'TPAF03', value: '[TPAF03] Autotransporte Federal de Carga Especializada de materiales y residuos peligrosos.'},
@ -1041,7 +971,7 @@ var opt_ccp_tipo_permiso_sct = [
] ]
var opt_ccp_config_auto = [ var opt_config_auto = [
{id: '', value: ''}, {id: '', value: ''},
{id: 'VL', value: '[VL] Vehículo ligero de carga (2 llantas en el eje delantero y 2 llantas en el eje trasero)'}, {id: 'VL', value: '[VL] Vehículo ligero de carga (2 llantas en el eje delantero y 2 llantas en el eje trasero)'},
{id: 'C2', value: '[C2] Camión Unitario (2 llantas en el eje delantero y 4 llantas en el eje trasero)'}, {id: 'C2', value: '[C2] Camión Unitario (2 llantas en el eje delantero y 4 llantas en el eje trasero)'},
@ -1080,7 +1010,7 @@ var opt_ccp_config_auto = [
] ]
var opt_ccp_tipo_remolque = [ var opt_carta_tipo_remolque = [
{id: '', value: ''}, {id: '', value: ''},
{id: 'CTR001', value: '[CTR001] Caballete'}, {id: 'CTR001', value: '[CTR001] Caballete'},
{id: 'CTR002', value: '[CTR002] Caja'}, {id: 'CTR002', value: '[CTR002] Caja'},
@ -1116,42 +1046,27 @@ var opt_ccp_tipo_remolque = [
] ]
//~ var opt_carta_aseguradoras = [ var opt_carta_aseguradoras = [
//~ {id: 'General de Seguros', value: 'General de Seguros'}, {id: 'General de Seguros', value: 'General de Seguros'},
//~ {id: 'Qualitas', value: 'Qualitas'}, {id: 'Qualitas', value: 'Qualitas'},
//~ ] ]
var grid_cols_ccp_autotransporte = [ var grid_cols_carta_autotransporte = [
{id: 'id', header: 'ID', hidden: true}, {id: 'id', header: 'ID', hidden: true},
{id: 'PermSCT', header: 'PermSCT', editor: 'select', options: opt_ccp_tipo_permiso_sct, fillspace: 1}, {id: 'PermSCT', header: 'Tipo Permiso SCT', editor: 'select', options: opt_carta_tipo_permiso_sct, fillspace: 1},
{id: 'NumPermisoSCT', header: 'NumPermisoSCT', editor: 'text', fillspace: 1}, {id: 'NumPermisoSCT', header: 'Número Permiso SCT', editor: 'text', fillspace: 1},
{id: 'ConfigVehicular', header: 'ConfigVehicular', editor: 'select', options: opt_ccp_config_auto, fillspace: 1}, {id: 'ConfigVehicular', header: 'Clave Autotransporte', editor: 'select', options: opt_config_auto, fillspace: 1},
{id: 'PesoBrutoVehicular', header: 'PesoBrutoVehicular', editor: 'text', format: webix.i18n.numberFormat, css: 'right', fillspace: 1},
{id: 'PlacaVM', header: 'Placa', editor: 'text', fillspace: 1}, {id: 'PlacaVM', header: 'Placa', editor: 'text', fillspace: 1},
{id: 'AnioModeloVM', header: 'Modelo (Año)', editor: 'text', fillspace: 1}, {id: 'AnioModeloVM', header: 'Modelo (Año)', editor: 'text', fillspace: 1},
//~ {id: 'SubTipoRem', header: 'ST Remolque', editor: 'select', options: opt_ccp_tipo_remolque, fillspace: 1}, {id: 'SubTipoRem', header: 'ST Remolque', editor: 'select', options: opt_carta_tipo_remolque, fillspace: 1},
//~ {id: 'Placa', header: 'Placa', editor: 'text', fillspace: 1},
]
var grid_cols_ccp_remolques = [
{id: 'id', header: 'ID', hidden: true},
{id: 'delete', header: '', width: 30, css: 'delete'},
{id: 'SubTipoRem', header: 'SubTipo Remolque', editor: 'select', options: opt_ccp_tipo_remolque, fillspace: 1},
{id: 'Placa', header: 'Placa', editor: 'text', fillspace: 1}, {id: 'Placa', header: 'Placa', editor: 'text', fillspace: 1},
]
var grid_cols_ccp_seguros = [
{id: 'id', header: 'ID', hidden: true},
{id: 'AseguraRespCivil', header: 'Aseguradora', editor: 'text', fillspace: 1}, {id: 'AseguraRespCivil', header: 'Aseguradora', editor: 'text', fillspace: 1},
{id: 'PolizaRespCivil', header: 'Póliza', editor: 'text', fillspace: 1}, {id: 'PolizaRespCivil', header: 'Póliza', editor: 'text', fillspace: 1},
//~ {id: 'AseguraMedAmbiente', header: 'AseguraMedAmbiente', editor: 'text', fillspace: 1},
//~ {id: 'PolizaMedAmbiente', header: 'PolizaMedAmbiente', editor: 'text', fillspace: 1},
//~ {id: 'AseguraCarga', header: 'AseguraCarga', editor: 'text', fillspace: 1},
//~ {id: 'PolizaCarga', header: 'PolizaCarga', editor: 'text', fillspace: 1},
//~ {id: 'PrimaSeguro', header: 'PrimaSeguro', editor: 'text', format: webix.i18n.numberFormat, css: 'right', fillspace: 1},
] ]
var opt_ccp_tipos_figura = [ var opt_tipos_figura = [
{id: '', value: ''}, {id: '', value: ''},
{id: '01', value: '[01] Operador'}, {id: '01', value: '[01] Operador'},
{id: '02', value: '[02] Propietario'}, {id: '02', value: '[02] Propietario'},
@ -1160,167 +1075,101 @@ var opt_ccp_tipos_figura = [
] ]
var grid_cols_ccp_tipos_figuras = [ var grid_cols_carta_tipos_figuras = [
{id: 'id', header: 'ID', hidden: true}, {id: 'id', header: 'ID', hidden: true},
{id: 'TipoFigura', header: 'TipoFigura', editor: 'select', options: opt_ccp_tipos_figura, fillspace: 1}, {id: 'TipoFigura', header: 'Tipo Figura', editor: 'select', options: opt_tipos_figura, fillspace: 1},
{id: 'RFCFigura', header: 'RFCFigura', editor: 'text', fillspace: 1}, {id: 'RFCFigura', header: 'RFC Figura', editor: 'text', fillspace: 1},
{id: 'NumLicencia', header: 'NumLicencia', editor: 'text', fillspace: 1}, {id: 'NombreFigura', header: 'Nombre Figura', editor: 'text', fillspace: 1},
{id: 'NombreFigura', header: 'NombreFigura', editor: 'text', fillspace: 1}, {id: 'NumLicencia', header: 'Número de Licencia', editor: 'text', fillspace: 1},
//~ {id: 'NumRegIdTribFigura', header: 'NumRegIdTribFigura', editor: 'text', fillspace: 1},
//~ {id: 'ResidenciaFiscalFigura', header: 'ResidenciaFiscalFigura', editor: 'text', fillspace: 1},
//~ {id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1},
//~ {id: 'Estado', header: 'Estado', editor: 'select', options: opt_ccp_carta_estados, fillspace: 1},
//~ {id: 'Pais', header: 'País', editor: 'select', options: opt_ccp_countries, fillspace: 1},
//~ {id: 'CodigoPostal', header: 'C.P.', editor: 'text', fillspace: 1},
] ]
var grid_ccp_ubicaciones = { var grid_carta_ubicaciones = {
view: 'datatable', view: 'datatable',
id: 'grid_ccp_ubicaciones', id: 'grid_carta_ubicaciones',
multiselect: false, multiselect: false,
adjust: true, adjust: true,
autoheight: true, autoheight: true,
headermenu: true, headermenu: true,
editable: true, editable: true,
footer: true, footer: true,
columns: grid_cols_ccp_ubicaciones, columns: grid_cols_carta_ubicaciones,
//~ data: data_tmp1,
data: [
{delete: '-', TipoUbicacion: 'Origen', Pais: 'MEX'},
{delete: '-', TipoUbicacion: 'Destino', Pais: 'MEX'},
]
} }
var grid_ccp_mercancias = { var grid_carta_mercancias = {
view: 'datatable', view: 'datatable',
id: 'grid_ccp_mercancias', id: 'grid_carta_mercancias',
multiselect: false, multiselect: false,
adjust: true, adjust: true,
autoheight: true, autoheight: true,
headermenu: true, headermenu: true,
editable: true, editable: true,
footer: true, footer: true,
columns: grid_cols_ccp_mercancias, columns: grid_cols_carta_mercancias,
} }
var grid_ccp_autotransporte = { var grid_carta_autotransporte = {
view: 'datatable', view: 'datatable',
id: 'grid_ccp_autotransporte', id: 'grid_carta_autotransporte',
multiselect: false, multiselect: false,
adjust: true, adjust: true,
autoheight: true, autoheight: true,
headermenu: true, headermenu: true,
editable: true, editable: true,
columns: grid_cols_ccp_autotransporte, columns: grid_cols_carta_autotransporte,
data: [{id: 0}], data: [{id: 0}],
//~ data: data_tmp2,
} }
var grid_ccp_remolques = {
var grid_carta_tipos_figuras = {
view: 'datatable', view: 'datatable',
id: 'grid_ccp_remolques', id: 'grid_carta_tipos_figuras',
multiselect: false, multiselect: false,
adjust: true, adjust: true,
autoheight: true, autoheight: true,
headermenu: true, headermenu: true,
editable: true, editable: true,
columns: grid_cols_ccp_remolques, columns: grid_cols_carta_tipos_figuras,
}
var grid_ccp_seguros = {
view: 'datatable',
id: 'grid_ccp_seguros',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
columns: grid_cols_ccp_seguros,
data: [{id: 0}], data: [{id: 0}],
//~ data: data_tmp3,
} }
var grid_ccp_tipos_figuras = { var body_carta_mercancias = {rows:[
view: 'datatable',
id: 'grid_ccp_tipos_figuras',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
columns: grid_cols_ccp_tipos_figuras,
data: [{id: 0}],
}
var body_ccp_ubicaciones = {rows:[
{cols: [ {cols: [
{view: 'button', id: 'cmd_ccp_agregar_ubicacion', label: 'Agregar Ubicación', icon: 'plus', {view: 'button', id: 'cmd_carta_add_product', label: 'Agregar Mercancía', icon: 'plus',
type: 'iconButton', autowidth: true, align: 'center'}, type: 'iconButton', autowidth: true, align: 'center'},
{}]}, {view: 'button', id: 'cmd_carta_copy_from_invoice', label: 'Copiar de CFDI', icon: 'copy',
{maxHeight: 10},
grid_ccp_ubicaciones,
]}
var body_ccp_mercancias = {rows:[
{cols: [
{view: 'button', id: 'cmd_ccp_add_product', label: 'Agregar Mercancía', icon: 'plus',
type: 'iconButton', autowidth: true, align: 'center'}, type: 'iconButton', autowidth: true, align: 'center'},
//~ {view: 'button', id: 'cmd_carta_copy_from_invoice', label: 'Copiar de CFDI', icon: 'copy',
//~ type: 'iconButton', autowidth: true, align: 'center'},
{}, {},
{view: 'richselect', id: 'lst_carta_UnidadPeso', label: 'Unidad de Peso: ', {view: 'richselect', id: 'lst_carta_UnidadPeso', label: 'Unidad de Peso: ',
labelWidth: 110, maxWidth: 300, options: '/satunidadespeso?opt=active'} labelWidth: 110, maxWidth: 300, options: '/satunidadespeso?opt=active'}
]}, ]},
{maxHeight: 10}, {maxHeight: 10},
grid_ccp_mercancias, grid_carta_mercancias,
]} ]}
var body_ccp_autotransporte = {rows:[ var body_carta_ubicaciones = {rows:[
grid_ccp_autotransporte, grid_carta_ubicaciones,
{minHeight: 10},
{cols: [
{view: 'button', id: 'cmd_ccp_agregar_remolque', label: 'Agregar Remolque', icon: 'plus',
type: 'iconButton', autowidth: true, align: 'center'},
{}]},
{minHeight: 10},
grid_ccp_remolques,
{minHeight: 10},
grid_ccp_seguros,
]} ]}
var body_ccp_tipos_figuras = {rows:[ var body_carta_autotransporte = {rows:[
grid_ccp_tipos_figuras, grid_carta_autotransporte,
]} ]}
var body_cp_datos_generales = {rows:[ var body_carta_tipos_figuras = {rows:[
{cols: [{maxWidth: 15}, grid_carta_tipos_figuras,
{view: 'richselect', id: 'lst_cp_TranspInternac', labelPosition: 'top',
label: 'TranspInternac', options: opt_ccp_transporte_internacional,
value: 'No', readonly: true},
{view: 'richselect', id: 'lst_cp_RegimenAduanero', labelPosition: 'top',
label: 'RegimenAduanero', options: opt_ccp_regimen_aduanero,
value: '', disabled: true},
{view: 'richselect', id: 'lst_cp_EntradaSalidaMerc', labelPosition: 'top',
label: 'EntradaSalidaMerc', options: opt_ccp_entrada_salida,
value: '', disabled: true},
{view: 'richselect', id: 'lst_cp_PaisOrigenDestino', labelPosition: 'top',
label: 'PaisOrigenDestino', options: opt_ccp_pais_origen,
value: '', disabled: true},
{view: 'richselect', id: 'lst_cp_ViaEntradaSalida', labelPosition: 'top',
label: 'ViaEntradaSalida', options: opt_ccp_via_entrada,
value: '', disabled: true},
]},
{cols: [{maxWidth: 15},
{view: 'richselect', id: 'lst_cp_RegistroISTMO', labelPosition: 'top',
label: 'RegistroISTMO', options: opt_ccp_registro_istmo,
value: '', readonly: false},
{view: 'richselect', id: 'lst_cp_UbicacionPoloOrigen', labelPosition: 'top',
label: 'UbicacionPoloOrigen', options: opt_ccp_ubicacion_polo,
value: '', disabled: true},
{view: 'richselect', id: 'lst_cp_UbicacionPoloDestino', labelPosition: 'top',
label: 'UbicacionPoloDestino', options: opt_ccp_ubicacion_polo,
value: '', disabled: true},
{}]},
]} ]}
@ -1333,276 +1182,24 @@ var controls_carta_porte = [
{view: 'button', id: 'cmd_carta_import_ods', label: 'Importar ODS', {view: 'button', id: 'cmd_carta_import_ods', label: 'Importar ODS',
icon: 'upload', type: 'iconButton', autowidth: true, align: 'center'}, icon: 'upload', type: 'iconButton', autowidth: true, align: 'center'},
{maxWidth: 15}]}, {maxWidth: 15}]},
{view: 'fieldset', label: 'Datos generales', body: body_cp_datos_generales}, {view: 'fieldset', label: 'Mercancias', body: body_carta_mercancias},
{view: 'fieldset', label: 'Ubicaciones', body: body_ccp_ubicaciones},
{view: 'fieldset', label: 'Mercancias', body: body_ccp_mercancias},
{view: 'fieldset', label: 'Autotransporte', body: body_ccp_autotransporte},
{view: 'fieldset', label: 'Tipos Figura', body: body_ccp_tipos_figuras},
]
var opt_ce_exportacion = [
{id: '02', value: '[02] Definitiva con clave A1'},
{id: '03', value: '[03] Temporal'},
{id: '04', value: '[04] Definitiva con clave distinta a A1'},
]
var opt_ce_motivo_traslado = [
{id: '', value: ''},
{id: '01', value: '[01] Envío de mercancias facturadas con anterioridad'},
{id: '02', value: '[02] Reubicación de mercancías propias'},
{id: '03', value: '[03] Envío de mercancías objeto de contrato de consignación'},
{id: '04', value: '[04] Envío de mercancías para posterior enajenación'},
{id: '05', value: '[05] Envío de mercancías propiedad de terceros'},
{id: '99', value: '[99] Otros'},
]
var opt_ce_clave_pedimento = [
{id: 'A1', value: '[A1] Definitiva'},
]
var opt_ce_certificado_origen = [
{id: '0', value: '[0] No funge'},
{id: '1', value: '[1] Funge'},
]
var opt_ce_incoterm = [
{id: 'CFR', value: '[CFR] Coste y flete (puerto de destino convenido)'},
{id: 'CIF', value: '[CIF] Coste, seguro y flete (puerto de destino convenido)'},
{id: 'CPT', value: '[CPT] Trasnporte pagado hasta el lugar de destino convenido'},
{id: 'CIP', value: '[CIP] Trasnporte y seguro pagado hasta el lugar de destino convenido'},
{id: 'DAP', value: '[DAP] Entregada en lugar'},
{id: 'DDP', value: '[DDP] Entregada derechos pagados en lugar de destino convenido'},
{id: 'DPU', value: '[DPU] Entregada y descargada en lugar acordado'},
{id: 'EXW', value: '[EXW] En fábrica (lugar convenido)'},
{id: 'FCA', value: '[FCA] Franco transportista (lugar designado)'},
{id: 'FAS', value: '[FAS] Franco al costado del buque (puerto de carga convenido)'},
{id: 'FOB', value: '[FOB] Franco a bordo (puerto de carga convenido)'},
]
var body_ce_datos_generales = {rows:[
{cols: [{maxWidth: 15}, {cols: [{maxWidth: 15},
{view: 'richselect', id: 'lst_ce_exportacion', label: 'Exportación: ', {view: 'richselect', id: 'lst_carta_TranspInternac', labelPosition: 'top',
value: '02', labelWidth: 130, minWidth: 400, options: opt_ce_exportacion}, label: 'Transporte Internacional', options: opt_transporte_internacional,
{view: 'richselect', id: 'lst_ce_motivo_traslado', label: 'Motivo Traslado: ', value: 'No', readonly: true},
labelWidth: 130, minWidth: 500, options: opt_ce_motivo_traslado}, {view: 'richselect', id: 'lst_carta_EntradaSalidaMerc', labelPosition: 'top',
{}, label: 'Entrada o Salida', options: opt_entrada_salida,
{maxWidth: 15}]}, value: '', disabled: true},
{cols: [{maxWidth: 15}, {view: 'richselect', id: 'lst_carta_PaisOrigenDestino', labelPosition: 'top',
{view: 'richselect', id: 'lst_ce_clave_pedimento', label: 'Clave de Pedimento: ', label: 'País Origen/Destino', options: [],
value: 'A1', labelWidth: 130, minWidth: 400, maxWidth: 400, options: opt_ce_clave_pedimento}, value: '', disabled: true},
{view: 'richselect', id: 'lst_ce_certificado_origen', label: 'Certificado Origen: ', {view: 'richselect', id: 'lst_carta_ViaEntradaSalida', labelPosition: 'top',
value: '0', labelWidth: 130, maxWidth: 300, options: opt_ce_certificado_origen}, label: 'Vía de Entrada o Salida', options: [],
{view: 'text', id: 'txt_ce_numero_certificado', label: 'Nº Certificado:', labelWidth: 100}, value: '', disabled: true},
{maxWidth: 15}]}, ]},
{cols: [{maxWidth: 15}, {view: 'fieldset', label: 'Ubicaciones', body: body_carta_ubicaciones},
{view: 'text', id: 'txt_ce_numero_exportador', label: 'Nº Exportador: ', {view: 'fieldset', label: 'Autotransporte', body: body_carta_autotransporte},
labelWidth: 130, minWidth: 400, maxWidth: 500}, {view: 'fieldset', label: 'Tipos Figura', body: body_carta_tipos_figuras},
{view: 'richselect', id: 'lst_ce_incoterm', label: 'Incoterm: ', value: 'CFR',
labelWidth: 130, minWidth: 500, maxWidth: 500, options: opt_ce_incoterm},
{view: 'text', id: 'txt_ce_observaciones', label: 'Observaciones:', labelWidth: 100},
{maxWidth: 15}]},
{cols: [{maxWidth: 15},
{view: 'text', id: 'txt_ce_total_usd', label: 'Total USD: ',
labelWidth: 130, minWidth: 400, inputAlign: 'right'},
{view: 'text', id: 'txt_ce_tipo_cambio_usd', label: 'Tipo Cambio USD:', labelWidth: 130,
inputAlign: 'right'},
{},
{view: 'button', id: 'cmd_ce_tipo_cambio', label: 'TC Banxico',
type: 'iconButton', autowidth: true, icon: ''},
{maxWidth: 15}]},
]}
var grid_cols_ce_emisor = [
{id: 'id', header: 'ID', hidden: true},
{id: 'Curp', header: 'Curp', editor: 'text', fillspace: 1},
{id: 'Calle', header: 'Calle *', editor: 'text', fillspace: 1},
{id: 'NumeroExterior', header: 'Numero Exterior', editor: 'text', fillspace: 1},
{id: 'NumeroInterior', header: 'Número Interior', editor: 'text', fillspace: 1},
{id: 'Colonia', header: 'Colonia', editor: 'text', fillspace: 1},
{id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1},
{id: 'Estado', header: 'Estado *', editor: 'text', fillspace: 1},
{id: 'Pais', header: 'País *', editor: 'text', fillspace: 1},
{id: 'CodigoPostal', header: 'C.P. *', editor: 'text', fillspace: 1},
]
var grid_ce_emisor = {
view: 'datatable',
id: 'grid_ce_emisor',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
columns: grid_cols_ce_emisor,
data: [{id: 0}],
}
var body_ce_emisor = {rows:[
grid_ce_emisor
]}
var grid_cols_ce_propietarios = [
{id: 'id', header: 'ID', hidden: true},
{id: 'delete', header: '', width: 30, css: 'delete'},
{id: 'NumRegIdTrib', header: 'Registro Fiscal', editor: 'text', fillspace: 1},
{id: 'ResidenciaFiscal', header: 'Residencia Fiscal', editor: 'text', fillspace: 1},
]
var grid_ce_propietarios = {
view: 'datatable',
id: 'grid_ce_propietarios',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
footer: false,
columns: grid_cols_ce_propietarios,
}
var body_ce_propietarios = {rows:[
{cols: [
{view: 'button', id: 'cmd_ce_add_propietario', label: 'Agregar Propietario',
icon: 'plus', type: 'iconButton', autowidth: true, align: 'center'},
{},
]},
{maxHeight: 10},
grid_ce_propietarios
]}
var grid_cols_ce_receptor = [
{id: 'id', header: 'ID', hidden: true},
{id: 'NumRegIdTrib', header: 'Registro Fiscal', editor: 'text', fillspace: 1},
{id: 'Calle', header: 'Calle *', editor: 'text', fillspace: 1},
{id: 'NumeroExterior', header: 'Numero Exterior', editor: 'text', fillspace: 1},
{id: 'NumeroInterior', header: 'Número Interior', editor: 'text', fillspace: 1},
{id: 'Colonia', header: 'Colonia', editor: 'text', fillspace: 1},
{id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1},
{id: 'Estado', header: 'Estado *', editor: 'text', fillspace: 1},
{id: 'Pais', header: 'País *', editor: 'text', fillspace: 1},
{id: 'CodigoPostal', header: 'C.P. *', editor: 'text', fillspace: 1},
]
var grid_ce_receptor = {
view: 'datatable',
id: 'grid_ce_receptor',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
columns: grid_cols_ce_receptor,
data: [{id: 0}],
}
var body_ce_receptor = {rows:[
grid_ce_receptor
]}
var grid_cols_ce_destinatario = [
{id: 'id', header: 'ID', hidden: true},
{id: 'NumRegIdTrib', header: 'Registro Fiscal', editor: 'text', fillspace: 1},
{id: 'Nombre', header: 'Nombre', editor: 'text', fillspace: 1},
{id: 'Calle', header: 'Calle *', editor: 'text', fillspace: 1},
{id: 'NumeroExterior', header: 'No Exterior', editor: 'text', fillspace: 1},
{id: 'NumeroInterior', header: 'No Interior', editor: 'text', fillspace: 1},
{id: 'Colonia', header: 'Colonia', editor: 'text', fillspace: 1},
{id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1},
{id: 'Estado', header: 'Estado *', editor: 'text', fillspace: 1},
{id: 'Pais', header: 'País *', editor: 'text', fillspace: 1},
{id: 'CodigoPostal', header: 'C.P. *', editor: 'text', fillspace: 1},
]
var grid_ce_destinatario = {
view: 'datatable',
id: 'grid_ce_destinatario',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
columns: grid_cols_ce_destinatario,
data: [{id: 0}],
}
var body_ce_destinatario = {rows:[
grid_ce_destinatario
]}
var grid_cols_ce_mercancias = [
{id: 'id', header: 'ID', hidden: true},
{id: 'delete', header: '', width: 30, css: 'delete'},
{id: 'NoIdentificacion', header: 'Clave', editor: 'text', fillspace: 1},
{id: 'FraccionArancelaria', header: 'Fraccion Arancelaria', editor: 'text', fillspace: 1},
{id: 'CantidadAduana', header: 'Cantidad Aduana', editor: 'text', fillspace: 1},
{id: 'UnidadAduana', header: 'Unidad Aduana', editor: 'text', fillspace: 1},
{id: 'ValorUnitarioAduana', header: 'PU Aduana', editor: 'text', fillspace: 1},
{id: 'ValorDolares', header: 'Valor USD', editor: 'text', fillspace: 1},
{id: 'Marca', header: 'Marca', editor: 'text', hidden: true, fillspace: 1},
{id: 'Modelo', header: 'Modelo', editor: 'text', hidden: true, fillspace: 1},
{id: 'SubModelo', header: 'SubModelo', editor: 'text', hidden: true, fillspace: 1},
{id: 'NumeroSerie', header: 'Serie', editor: 'text', hidden: true, fillspace: 1},
]
var grid_ce_mercancias = {
view: 'datatable',
id: 'grid_ce_mercancias',
multiselect: false,
adjust: true,
autoheight: true,
headermenu: true,
editable: true,
footer: true,
columns: grid_cols_ce_mercancias,
}
var body_ce_mercancias = {rows:[
{cols: [
{view: 'button', id: 'cmd_ce_add_mercancia', label: 'Agregar Mercancía',
icon: 'plus', type: 'iconButton', autowidth: true, align: 'center'},
{},
]},
{maxHeight: 10},
grid_ce_mercancias
]}
var controls_comercio_exterior = [
{cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_cfdi_usar_comercioe', labelWidth: 0,
labelRight: 'Usar el complemento Comercio Exterior'},
{},
{view: 'button', id: 'cmd_import_json_comercioe', label: 'Importar JSON',
icon: 'upload', type: 'iconButton', autowidth: true, align: 'center'},
{view: 'button', id: 'cmd_ce_import_ods', label: 'Importar ODS',
icon: 'upload', type: 'iconButton', autowidth: true, align: 'center'},
{maxWidth: 15}]},
{view: 'fieldset', label: 'Datos generales', body: body_ce_datos_generales},
{view: 'fieldset', label: 'Emisor', body: body_ce_emisor},
{view: 'fieldset', label: 'Propietario', body: body_ce_propietarios},
{view: 'fieldset', label: 'Receptor', body: body_ce_receptor},
{view: 'fieldset', label: 'Destinatario', body: body_ce_destinatario},
{view: 'fieldset', label: 'Mercancías', body: body_ce_mercancias},
] ]
@ -1619,19 +1216,6 @@ var form_carta_porte = {
} }
var form_comercio_exterior = {
type: 'space',
responsive: true,
cols: [{
view: 'form',
id: 'form_comercio_exterior',
complexData: true,
scroll: true,
elements: controls_comercio_exterior,
}]
}
var controls_invoices = [ var controls_invoices = [
{ {
view: 'tabview', view: 'tabview',
@ -1643,7 +1227,6 @@ var controls_invoices = [
{id: 'INE', rows: controls_ine}, {id: 'INE', rows: controls_ine},
{id: 'Leyendas Fiscales', rows: controls_leyendas_fiscales}, {id: 'Leyendas Fiscales', rows: controls_leyendas_fiscales},
{id: 'Carta Porte', rows: [form_carta_porte]}, {id: 'Carta Porte', rows: [form_carta_porte]},
{id: 'Comercio Exterior', rows: [form_comercio_exterior]},
] ]
}, },
] ]
@ -1710,13 +1293,7 @@ var win_import_invoice = {
width: 400, width: 400,
modal: true, modal: true,
position: 'center', position: 'center',
head: {view: 'toolbar', head: 'Importar Factura de Plantilla',
elements: [
{view: 'label', label: 'Importar Factura en Lote'},
{view: 'icon', icon: 'times-circle',
click: '$$("win_import_invoice").close()'},
]
},
body: body_upload_invoice, body: body_upload_invoice,
}) })
$$('cmd_upload_invoice').attachEvent('onItemClick', cmd_upload_invoice_click) $$('cmd_upload_invoice').attachEvent('onItemClick', cmd_upload_invoice_click)
@ -1792,114 +1369,7 @@ var win_carta_import_json = {
head: 'Importar Carta Porte JSON', head: 'Importar Carta Porte JSON',
body: body_upload_carta_json, body: body_upload_carta_json,
}) })
//~ $$('cmd_upload_invoice').attachEvent('onItemClick', cmd_upload_invoice_click)
$$('up_invoice_json').attachEvent('onAfterFileAdd', up_invoice_json_on_after_file_add) $$('up_invoice_json').attachEvent('onAfterFileAdd', up_invoice_json_on_after_file_add)
} }
} }
var body_upload_json_comercioe = {rows: [
{view: 'form', id: 'form_upload_comercioe', rows: [
{cols: [{},
{view: 'uploader', id: 'up_invoice_json', autosend: false,
link: 'lst_upload_invoice', value: 'Seleccionar Archivo',
accept:'application/json', upload: ''}, {}]},
{cols: [
{view: 'list', id: 'lst_upload_invoice', name: 'lst_upload_invoice',
type: 'uploader', autoheight: true, borderless: true}]},
]},
]}
var win_import_json_comercioe = {
init: function(){
webix.ui({
view: 'window',
id: 'win_import_json_comercioe',
width: 400,
modal: true,
position: 'center',
head: 'Importar Comerio Exterior JSON',
body: body_upload_json_comercioe,
})
$$('up_invoice_json').attachEvent('onAfterFileAdd', up_invoice_json_comercioe_on_after_file_add)
}
}
var body_global_information = {rows: [{minHeight: 5},
{view: 'richselect', id: 'lst_global_periodicidad', label: 'Periodicidad:', options: opt_global_periodicidad, value: '01'},
{view: 'richselect', id: 'lst_global_months', label: 'Mes:', options: opt_global_months, value: '01'},
{view: 'richselect', id: 'lst_global_year', label: 'Año:', options: []},
{view: 'label', label: '¿Guardar estos datos?', width: 300, align: 'center'},
{cols: [{},
{view: 'button', id: 'cmd_save_global_information', width: 100, label: 'Si Guardar'},
{maxWidth: 25},
{view: 'button', id: 'cmd_win_global_close', width: 100, label: 'No, Cerrar'},
{}
]},
{minHeight: 10},
]}
var win_global_information = {
init: function(){
webix.ui({
view: 'window',
id: 'win_global_information',
modal: true,
width: 400,
position: 'center',
head: 'Información Global',
body: body_global_information,
})
var current_date = new Date()
var current_month = (current_date.getMonth() + 1).toString().padStart(2, '0')
$$('lst_global_months').setValue(current_month)
var current_year = current_date.getFullYear()
$$('lst_global_year').getList().parse([{id: current_year, value: current_year}])
$$('lst_global_year').setValue(current_year)
$$('cmd_save_global_information').attachEvent('onItemClick', cmd_save_global_information_click)
$$('cmd_win_global_close').attachEvent('onItemClick', cmd_win_global_close_click)
}
}
var body_win_ce_import_ods = {rows: [
{view: 'form', id: 'form_ce_import_ods', rows: [
{cols: [{},
{view: 'uploader', id: 'ce_up_template', autosend: false,
link: 'lst_ce_up_template', value: 'Seleccionar Archivo',
upload: '/files/ceods'}, {}]},
{cols: [
{view: 'list', id: 'lst_ce_up_template',
type: 'uploader', autoheight: true, borderless: true}]},
{cols: [{}, {view: 'button', id: 'cmd_ce_upload_ods',
label: 'Importar Plantilla'}, {}]},
]},
]}
var win_ce_import_ods = {
init: function(){
webix.ui({
view: 'window',
id: 'win_ce_import_ods',
width: 400,
modal: true,
position: 'center',
head: {view: 'toolbar',
elements: [
{view: 'label', label: 'Importar desde archivo ODS'},
{view: 'icon', icon: 'times-circle',
click: '$$("win_ce_import_ods").close()'},
]
},
body: body_win_ce_import_ods,
})
$$('cmd_ce_upload_ods').attachEvent('onItemClick', cmd_ce_upload_ods_click)
$$('ce_up_template').attachEvent('onUploadComplete', ce_up_template_complete)
}
}

View File

@ -111,15 +111,6 @@ var suggest_sat_producto = {
} }
var opt_tax_object = [
{id: '01', value: '[01] No objeto de impuesto.'},
{id: '02', value: '[02] Sí objeto de impuesto.'},
{id: '03', value: '[03] Sí objeto del impuesto y no obligado al desglose.'},
{id: '04', value: '[04] Sí objeto del impuesto y no causa impuesto.'},
{id: '05', value: '[05] Sí objeto del impuesto, IVA crédito PODEBI.'},
]
var controls_generals = [ var controls_generals = [
{view: 'checkbox', id: 'es_activo_producto', name: 'es_activo_producto', {view: 'checkbox', id: 'es_activo_producto', name: 'es_activo_producto',
label: 'Activo: ', value: true, label: 'Activo: ', value: true,
@ -150,10 +141,13 @@ var controls_generals = [
{view: "richselect", id: "unidad", name: "unidad", label: "Unidad", {view: "richselect", id: "unidad", name: "unidad", label: "Unidad",
width: 300, labelWidth: 130, labelAlign: "right", required: true, width: 300, labelWidth: 130, labelAlign: "right", required: true,
invalidMessage: "La Unidad es requerida", options: []}, invalidMessage: "La Unidad es requerida", options: []},
{view: 'richselect', id: 'objeto_impuesto', name: 'objeto_impuesto', label: 'Objeto de Impuestos', {view: 'text', id: 'cant_by_packing', name: 'cant_by_packing',
width: 500, labelWidth: 150, labelAlign: "right", required: true, labelAlign: 'right', labelWidth: 150, inputAlign: "right",
invalidMessage: 'Este campo es requerido', options: opt_tax_object}, label: 'Cantidad por empaque:'},
{}, {},
//~ {view: 'text', id: 'tags_producto', name: 'tags_producto',
//~ labelAlign: 'right', label: 'Etiquetas',
//~ placeholder: 'Separadas por comas'}
]}, ]},
{cols: [ {cols: [
{view: "currency", type: "text", id: "valor_unitario", {view: "currency", type: "text", id: "valor_unitario",

View File

@ -235,12 +235,7 @@ var cells_new_ticket = [
var toolbar_ticket_invoice = {view: 'toolbar', elements: [{}, var toolbar_ticket_invoice = {view: 'toolbar', elements: [{},
{view: 'checkbox', id: 'chk_is_invoice_day', labelWidth: 0, width: 150, {view: 'checkbox', id: 'chk_is_invoice_day', labelWidth: 0, width: 150,
labelRight: 'Es Factura Global'}, labelRight: 'Es factura del día'}, {},
{view: 'richselect', id: 'lst_global_periodicidad_2', labelWidth: 90, width: 225,
label: 'Periodicidad:', options: opt_global_periodicidad, value: '01', disabled: true},
{view: 'richselect', id: 'lst_global_months_2', labelWidth: 50, width: 250,
label: 'Mes:', options: opt_global_months, value: '01', disabled: true},
{},
{view: 'button', id: 'cmd_close_ticket_invoice', label: 'Cerrar', {view: 'button', id: 'cmd_close_ticket_invoice', label: 'Cerrar',
type: 'danger', autowidth: true, align: 'center'} type: 'danger', autowidth: true, align: 'center'}
]} ]}

Binary file not shown.

View File

@ -5,19 +5,16 @@
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/> <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:include href="utilerias.xslt"/> <xsl:include href="utilerias.xslt"/>
<xsl:include href="nomina12.xslt"/> <xsl:include href="cartaporte20.xslt"/>
<xsl:include href="divisas.xslt"/>
<xsl:include href="ine11.xslt"/>
<xsl:include href="iedu.xslt"/>
<xsl:include href="leyendasFisc.xslt"/>
<xsl:include href="cartaporte30.xslt"/>
<xsl:include href="comercioexterior20.xslt"/>
<xsl:include href="donat11.xslt"/>
<xsl:include href="pagos20.xslt"/> <xsl:include href="pagos20.xslt"/>
<xsl:include href="implocal.xslt"/>
<!-- <!--
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/donat/donat11.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/divisas/divisas.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/implocal/implocal.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/leyendasFiscales/leyendasFisc.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pfic/pfic.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pfic/pfic.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/TuristaPasajeroExtranjero/TuristaPasajeroExtranjero.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/TuristaPasajeroExtranjero/TuristaPasajeroExtranjero.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pagoenespecie/pagoenespecie.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pagoenespecie/pagoenespecie.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/aerolineas/aerolineas.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/aerolineas/aerolineas.xslt"/>
@ -28,6 +25,9 @@
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/renovacionysustitucionvehiculos/renovacionysustitucionvehiculos.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/renovacionysustitucionvehiculos/renovacionysustitucionvehiculos.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/certificadodestruccion/certificadodedestruccion.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/certificadodestruccion/certificadodedestruccion.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/arteantiguedades/obrasarteantiguedades.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/arteantiguedades/obrasarteantiguedades.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior11/ComercioExterior11.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ine/ine11.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/iedu/iedu.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ventavehiculos/ventavehiculos11.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ventavehiculos/ventavehiculos11.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/detallista/detallista.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/detallista/detallista.xslt"/>
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc12.xslt"/> <xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc12.xslt"/>

View File

@ -1,744 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:cartaporte30="http://www.sat.gob.mx/CartaPorte30">
<xsl:template match="cartaporte30:CartaPorte">
<!--Manejador de nodos tipo CartaPorte-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Version"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@IdCCP"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TranspInternac"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RegimenAduanero"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@EntradaSalidaMerc"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PaisOrigenDestino"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ViaEntradaSalida"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@TotalDistRec"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RegistroISTMO"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@UbicacionPoloOrigen"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@UbicacionPoloDestino"/>
</xsl:call-template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia -->
<xsl:for-each select="./cartaporte30:Ubicaciones">
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:for-each select="./cartaporte30:Mercancias">
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:for-each select="./cartaporte30:FiguraTransporte">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Ubicaciones-->
<xsl:template match="cartaporte30:Ubicaciones">
<!-- Iniciamos el tratamiento de los atributos de Ubicacion-->
<xsl:for-each select="./cartaporte30:Ubicacion">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Ubicacion-->
<xsl:template match="cartaporte30:Ubicacion">
<!--Manejador de nodos tipo Ubicacion-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoUbicacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@IDUbicacion"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@RFCRemitenteDestinatario"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreRemitenteDestinatario"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegIdTrib"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ResidenciaFiscal"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumEstacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreEstacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NavegacionTrafico"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@FechaHoraSalidaLlegada"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@TipoEstacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DistanciaRecorrida"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Domicilio-->
<xsl:for-each select="./cartaporte30:Domicilio">
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Domicilio-->
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Calle"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroExterior"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroInterior"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Colonia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Localidad"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Referencia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Municipio"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Estado"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Pais"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@CodigoPostal"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Origen-->
<xsl:template match="cartaporte30:Mercancias">
<!--Manejador de nodos tipo cartaporte30:Mercancias-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoBrutoTotal"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@UnidadPeso"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PesoNetoTotal"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumTotalMercancias"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@CargoPorTasacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@LogisticaInversaRecoleccionDevolucion"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Mercancia-->
<xsl:for-each select="./cartaporte30:Mercancia">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Autotransporte-->
<xsl:for-each select="./cartaporte30:Autotransporte">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:TransporteMaritimo-->
<xsl:for-each select="./cartaporte30:TransporteMaritimo">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:TransporteAereo-->
<xsl:for-each select="./cartaporte30:TransporteAereo">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:TransporteFerroviario-->
<xsl:for-each select="./cartaporte30:TransporteFerroviario">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Mercancia-->
<xsl:template match="cartaporte30:Mercancia">
<!--Manejador de nodos tipo cartaporte30:Mercancia-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@BienesTransp"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ClaveSTCC"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Descripcion"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Cantidad"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ClaveUnidad"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Unidad"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Dimensiones"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@MaterialPeligroso"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@CveMaterialPeligroso"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Embalaje"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DescripEmbalaje"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@SectorCOFEPRIS"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreIngredienteActivo"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NomQuimico"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DenominacionGenericaProd"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DenominacionDistintivaProd"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Fabricante"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FechaCaducidad"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@LoteMedicamento"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FormaFarmaceutica"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@CondicionesEspTransp"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RegistroSanitarioFolioAutorizacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PermisoImportacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FolioImpoVUCEM"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumCAS"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RazonSocialEmpImp"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegSanPlagCOFEPRIS"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DatosFabricante"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DatosFormulador"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DatosMaquilador"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@UsoAutorizado"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoEnKg"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ValorMercancia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Moneda"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FraccionArancelaria"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@UUIDComercioExt"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@TipoMateria"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@DescripcionMateria"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:DocumentacionAduanera-->
<xsl:for-each select="./cartaporte30:DocumentacionAduanera">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:GuiasIdentificacion-->
<xsl:for-each select="./cartaporte30:GuiasIdentificacion">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:CantidadTransporta-->
<xsl:for-each select="./cartaporte30:CantidadTransporta">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:DetalleMercancia-->
<xsl:for-each select="./cartaporte30:DetalleMercancia">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia DocumentacionAduanera-->
<xsl:template match="cartaporte30:DocumentacionAduanera">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoDocumento"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPedimento"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@IdentDocAduanero"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RFCImpo"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia GuiasIdentificacion-->
<xsl:template match="cartaporte30:GuiasIdentificacion">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumeroGuiaIdentificacion"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@DescripGuiaIdentificacion"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoGuiaIdentificacion"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia CantidadTransporta-->
<xsl:template match="cartaporte30:CantidadTransporta">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Cantidad"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@IDOrigen"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@IDDestino"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@CvesTransporte"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia DetalleMercancia-->
<xsl:template match="cartaporte30:DetalleMercancia">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@UnidadPesoMerc"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoBruto"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoNeto"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoTara"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPiezas"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Autotransporte-->
<xsl:template match="cartaporte30:Autotransporte">
<!--Manejador de nodos tipo cartaporte30:Autotransporte-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PermSCT"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumPermisoSCT"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:IdentificacionVehicular-->
<xsl:for-each select="./cartaporte30:IdentificacionVehicular">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Seguros-->
<xsl:for-each select="./cartaporte30:Seguros">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Remolques-->
<xsl:for-each select="./cartaporte30:Remolques">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia IdentificacionVehicular-->
<xsl:template match="cartaporte30:IdentificacionVehicular">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ConfigVehicular"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoBrutoVehicular"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PlacaVM"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@AnioModeloVM"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Seguros-->
<xsl:template match="cartaporte30:Seguros">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@AseguraRespCivil"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PolizaRespCivil"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@AseguraMedAmbiente"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PolizaMedAmbiente"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@AseguraCarga"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PolizaCarga"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PrimaSeguro"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Remolques-->
<xsl:template match="cartaporte30:Remolques">
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Remolque-->
<xsl:for-each select="./cartaporte30:Remolque">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Remolque-->
<xsl:template match="cartaporte30:Remolque">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@SubTipoRem"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Placa"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TransporteMaritimo-->
<xsl:template match="cartaporte30:TransporteMaritimo">
<!--Manejador de nodos tipo cartaporte30:TransporteMaritimo-->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PermSCT"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPermisoSCT"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreAseg"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPolizaSeguro"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoEmbarcacion"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Matricula"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumeroOMI"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@AnioEmbarcacion"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreEmbarc"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NacionalidadEmbarc"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@UnidadesDeArqBruto"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoCarga"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Eslora"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Manga"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Calado"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Puntal"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@LineaNaviera"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NombreAgenteNaviero"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumAutorizacionNaviero"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumViaje"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumConocEmbarc"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PermisoTempNavegacion"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Contenedor-->
<xsl:for-each select="./cartaporte30:Contenedor">
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Contenedor-->
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoContenedor"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@MatriculaContenedor"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPrecinto"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@IdCCPRelacionado"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@PlacaVMCCP"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FechaCertificacionCCP"/>
</xsl:call-template>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:RemolquesCCP-->
<xsl:for-each select="./cartaporte30:RemolquesCCP">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia RemolquesCCP-->
<xsl:template match="cartaporte30:RemolquesCCP">
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:RemolqueCCP-->
<xsl:for-each select="./cartaporte30:RemolqueCCP">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia RemolqueCCP-->
<xsl:template match="cartaporte30:RemolqueCCP">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@SubTipoRemCCP"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PlacaCCP"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TransporteAereo-->
<xsl:template match="cartaporte30:TransporteAereo">
<!--Manejador de nodos tipo cartaporte30:TransporteAereo-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PermSCT"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumPermisoSCT"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@MatriculaAeronave"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreAseg"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPolizaSeguro"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumeroGuia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@LugarContrato"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@CodigoTransportista"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RFCEmbarcador"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegIdTribEmbarc"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ResidenciaFiscalEmbarc"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreEmbarcador"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TransporteFerroviario-->
<xsl:template match="cartaporte30:TransporteFerroviario">
<!--Manejador de nodos tipo cartaporte30:TransporteFerroviario-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoDeServicio"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoDeTrafico"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NombreAseg"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumPolizaSeguro"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:DerechosDePaso-->
<xsl:for-each select="./cartaporte30:DerechosDePaso">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Carro-->
<xsl:for-each select="./cartaporte30:Carro">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia DerechosDePaso-->
<xsl:template match="cartaporte30:DerechosDePaso">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoDerechoDePaso"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@KilometrajePagado"/>
</xsl:call-template>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Carro-->
<xsl:template match="cartaporte30:Carro">
<!--Manejador de nodos tipo cartaporte30:Carro-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoCarro"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@MatriculaCarro"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@GuiaCarro"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ToneladasNetasCarro"/>
</xsl:call-template>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Contenedor -->
<xsl:for-each select="./cartaporte30:Contenedor ">
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Contenedor-->
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoContenedor"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoContenedorVacio"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@PesoNetoMercancia"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia FiguraTransporte-->
<xsl:template match="cartaporte30:FiguraTransporte">
<!--Manejador de nodos tipo cartaporte30:FiguraTransporte-->
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:TiposFigura-->
<xsl:for-each select="./cartaporte30:TiposFigura ">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TiposFigura-->
<xsl:template match="cartaporte30:TiposFigura">
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:TiposFigura-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoFigura"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@RFCFigura"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumLicencia"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NombreFigura"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegIdTribFigura"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ResidenciaFiscalFigura"/>
</xsl:call-template>
<xsl:for-each select="./cartaporte30:PartesTransporte">
<xsl:apply-templates select="."/>
</xsl:for-each>
<!-- Iniciamos el tratamiento de los atributos de cartaporte30:Domicilio -->
<xsl:for-each select="./cartaporte30:Domicilio ">
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Domicilio -->
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Calle"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroExterior"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroInterior"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Colonia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Localidad"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Referencia"/>
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Municipio"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Estado"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Pais"/>
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@CodigoPostal"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia PartesTransporte -->
<xsl:template match="cartaporte30:PartesTransporte">
<!-- Manejador de nodos tipo cartaporte30:PartesTransporte -->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ParteTransporte"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,171 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:cce20="http://www.sat.gob.mx/ComercioExterior20">
<xsl:template match="cce20:ComercioExterior">
<!--Manejador de nodos tipo ComercioExterior-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Version" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@MotivoTraslado" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ClaveDePedimento" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@CertificadoOrigen" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumCertificadoOrigen" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroExportadorConfiable" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Incoterm" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Observaciones" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TipoCambioUSD" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@TotalUSD" />
</xsl:call-template>
<!-- Iniciamos el manejo de los elementos hijo en la secuencia -->
<xsl:apply-templates select="./cce20:Emisor" />
<xsl:apply-templates select="./cce20:Receptor" />
<xsl:for-each select="./cce20:Destinatario">
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:apply-templates select="./cce20:Mercancias" />
</xsl:template>
<xsl:template match="cce20:Emisor">
<!-- Iniciamos el tratamiento de los atributos de cce20:Emisor-->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Curp" />
</xsl:call-template>
<xsl:apply-templates select="./cce20:Domicilio" />
</xsl:template>
<xsl:template match="cce20:Propietario">
<!-- Iniciamos el tratamiento de los atributos de cce20:Propietario-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NumRegIdTrib" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ResidenciaFiscal" />
</xsl:call-template>
</xsl:template>
<xsl:template match="cce20:Receptor">
<!-- Tratamiento de los atributos de cce20:Receptor-->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegIdTrib" />
</xsl:call-template>
<xsl:apply-templates select="./cce20:Domicilio" />
</xsl:template>
<xsl:template match="cce20:Destinatario">
<!-- Tratamiento de los atributos de cce20:Destinatario-->
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumRegIdTrib" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Nombre" />
</xsl:call-template>
<!-- Manejo de los nodos dependientes -->
<xsl:for-each select="./cce20:Domicilio">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<xsl:template match="cce20:Mercancias">
<!-- Iniciamos el manejo de los nodos dependientes -->
<xsl:for-each select="./cce20:Mercancia">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<xsl:template match="cce20:Domicilio">
<!-- Iniciamos el tratamiento de los atributos de cce20:Domicilio-->
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Calle" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroExterior" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroInterior" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Colonia" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Localidad" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Referencia" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Municipio" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Estado" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Pais" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@CodigoPostal" />
</xsl:call-template>
</xsl:template>
<xsl:template match="cce20:Mercancia">
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@NoIdentificacion" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@FraccionArancelaria" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@CantidadAduana" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@UnidadAduana" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@ValorUnitarioAduana" />
</xsl:call-template>
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@ValorDolares" />
</xsl:call-template>
<xsl:for-each select="./cce20:DescripcionesEspecificas">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<xsl:template match="cce20:DescripcionesEspecificas">
<xsl:call-template name="Requerido">
<xsl:with-param name="valor" select="./@Marca" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@Modelo" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@SubModelo" />
</xsl:call-template>
<xsl:call-template name="Opcional">
<xsl:with-param name="valor" select="./@NumeroSerie" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>