Compare commits
350 Commits
Author | SHA1 | Date |
---|---|---|
El Mau | 34a981a2dd | |
El Mau | 66549e271b | |
El Mau | 884b10bd79 | |
El Mau | fd050159ba | |
El Mau | 8199667188 | |
El Mau | 05d3f617eb | |
El Mau | 0ec4f0c2c9 | |
El Mau | 29bfb42abc | |
El Mau | 7f129b84b2 | |
El Mau | 13a3c106c6 | |
El Mau | 0c7abf634b | |
El Mau | f0c4423fc8 | |
El Mau | d925587a98 | |
El Mau | 510ebdd1e5 | |
El Mau | d2e92098da | |
El Mau | c1ce206835 | |
El Mau | 1efa280920 | |
El Mau | 6fd8f9e2ea | |
El Mau | e3a44e6400 | |
El Mau | 390ec60fdd | |
El Mau | 957160755a | |
El Mau | 070ee31a1b | |
El Mau | 2620159408 | |
El Mau | 4d9bc4a172 | |
El Mau | 17ed56e9d7 | |
El Mau | 5057ac57ae | |
El Mau | 410a7080da | |
El Mau | edd8d560bd | |
El Mau | bd1699d082 | |
El Mau | 6d4023bb17 | |
Mauricio | beda45690f | |
Mauricio | 8feba167af | |
Mauricio | 4dbb797d99 | |
Mauricio | cd424b71dc | |
Mauricio | ea13d11319 | |
Mauricio | d9c863820a | |
Categulario | 6815d6c64c | |
Mauricio | 402cb7d70c | |
Mauricio | a5f1114774 | |
Mauricio | 2588a5f0b8 | |
Mauricio | eeae157772 | |
Mauricio | 7cad4093d4 | |
Mauricio | 7caf6423e1 | |
Mauricio | 8a3aea41eb | |
Mauricio | bd49356d3f | |
Mauricio | 3b54ef0a36 | |
Mauricio | 497a4be392 | |
Mauricio | 7fc6264322 | |
Mauricio | c5d0e97212 | |
Mauricio | 5bbad9ef58 | |
Mauricio | 8e7aa23d1b | |
Mauricio | f3d8b1dae5 | |
Mauricio | 2c684ae6bd | |
el Mau | febea3f289 | |
el Mau | 5facb96662 | |
el Mau | 6411c2e51e | |
el Mau | eeb128fda6 | |
el Mau | a078e27703 | |
el Mau | 28ef53043f | |
el Mau | e956c243f7 | |
el Mau | 1b33413de2 | |
el Mau | 64541a84b9 | |
el Mau | 834c1faae6 | |
el Mau | affe57bfcd | |
el Mau | 4dc54ade1e | |
el Mau | e72739a5fe | |
el Mau | dd7b9c1680 | |
el Mau | 9823bd967f | |
el Mau | aee467d98f | |
el Mau | 64917527f7 | |
el Mau | 5f56179ebb | |
el Mau | 955a0348f8 | |
el Mau | 0826b0cea2 | |
el Mau | 8b0f9fbc64 | |
el Mau | f3d827364b | |
el Mau | 50cbb3bae8 | |
el Mau | a7c8d80219 | |
el Mau | ca9d7a02e3 | |
el Mau | 31fcb63e51 | |
el Mau | bd7a31ea8a | |
el Mau | 6a6b6ca395 | |
el Mau | 3148c5ba82 | |
el Mau | 5f62ad7750 | |
el Mau | ff44162622 | |
el Mau | a37b3a5c23 | |
el Mau | 4fdea6173b | |
el Mau | 968c2744ec | |
el Mau | c9d85ca2e7 | |
el Mau | 93e64eafd8 | |
el Mau | 1984103ff5 | |
el Mau | e4ba06c0ff | |
el Mau | 38bb267e55 | |
el Mau | 602467c8e9 | |
el Mau | 4020237f68 | |
el Mau | 933c9820e6 | |
el Mau | 51daf0ad5e | |
el Mau | 709c524830 | |
el Mau | 434e15bb5b | |
el Mau | ae5949c529 | |
el Mau | af5fa3c812 | |
el Mau | 6d399fcb39 | |
el Mau | 8003fc42b9 | |
el Mau | 7a0fb2b243 | |
el Mau | 83bebde169 | |
el Mau | 76d5f51d78 | |
el Mau | 5f641c632e | |
el Mau | 85eb7cd58c | |
el Mau | 1c11a1b013 | |
el Mau | 701bb68478 | |
el Mau | f13491d983 | |
el Mau | 4020365616 | |
el Mau | a90f218c76 | |
el Mau | 37995befd8 | |
el Mau | 746c827492 | |
el Mau | 3cea54c07c | |
el Mau | 661eff1dc3 | |
el Mau | cd11456ec3 | |
el Mau | 2526a8f5aa | |
el Mau | 0a13004419 | |
el Mau | 296874a9b1 | |
el Mau | 34b1af1319 | |
el Mau | 5fbf80fb92 | |
el Mau | b56fee5f73 | |
el Mau | c9ca45b60d | |
el Mau | 86e7f50621 | |
el Mau | 2cef108856 | |
el Mau | 260ba62b2e | |
el Mau | 76d15e482b | |
el Mau | 8e2446e8f5 | |
el Mau | 482a0385cd | |
el Mau | 29e02e649d | |
el Mau | 5aece843bf | |
el Mau | d47e059d93 | |
el Mau | 89f79de9b6 | |
el Mau | fbaa85f13a | |
el Mau | bed6039fff | |
el Mau | acbaecbfc5 | |
el Mau | 8dddb7b293 | |
el Mau | 24777f691e | |
el Mau | 1d270aa478 | |
el Mau | 8872af8c50 | |
el Mau | d57ded161c | |
el Mau | 0c8d6d3cea | |
el Mau | f14c1f74d8 | |
el Mau | 210f50a7d7 | |
el Mau | 5418b23200 | |
el Mau | a13c7c0a1d | |
el Mau | a6276a33fb | |
el Mau | e3bd1e8871 | |
el Mau | 2ddb3d6b75 | |
Mauricio Baeza | 4cda9f7f21 | |
Mauricio Baeza | 7c184c9513 | |
Mauricio Baeza | aea8aeaecf | |
Mauricio Baeza | e08e4e038f | |
Mauricio Baeza | 496dcf7162 | |
Mauricio Baeza | f8cd99084a | |
Mauricio Baeza | 1e824bd841 | |
Mauricio Baeza | bc0cd9f3e1 | |
Mauricio Baeza | ae259e461b | |
Mauricio Baeza | 1a507d2eeb | |
Mauricio Baeza | f766f92618 | |
Mauricio Baeza | ad56356a6f | |
El Mau | c6cf33c4c4 | |
El Mau | dbc3910297 | |
El Mau | 6c78a282fe | |
El Mau | f8c2c5e2d6 | |
El Mau | 7d40e79f3c | |
El Mau | a36034a476 | |
El Mau | de2ab5cedd | |
El Mau | b60e2d6a37 | |
El Mau | d9021cca4a | |
El Mau | 7bbef31936 | |
El Mau | 74e7f12088 | |
El Mau | 20c0757f04 | |
El Mau | 3a5fbc609b | |
El Mau | 5e888d2337 | |
El Mau | d97fd4867a | |
El Mau | e58b8f90af | |
El Mau | 50d4a3f4b7 | |
El Mau | 1978edfaf0 | |
El Mau | 7ca87d1811 | |
El Mau | a7bc6d6f6c | |
El Mau | 1991c68b3b | |
El Mau | bebcd29710 | |
El Mau | de856f28ab | |
El Mau | e726cda085 | |
El Mau | eee386a97b | |
El Mau | ae21403c59 | |
El Mau | 110d41cf6e | |
El Mau | bd6fb65a1b | |
El Mau | b68d79d0ca | |
El Mau | 68c0203039 | |
El Mau | 51af15f311 | |
El Mau | 64ef75fbf5 | |
El Mau | bd6ba5d4d0 | |
El Mau | dd606be46b | |
El Mau | cc0eee1443 | |
El Mau | a609c0c6f5 | |
El Mau | 9daf07693a | |
El Mau | d2f879c224 | |
El Mau | ff8bc31f50 | |
El Mau | d2c361e174 | |
El Mau | 6de30c3417 | |
El Mau | 47ec5ad360 | |
Mauricio Baeza | 416bc65174 | |
Mauricio Baeza | 3dd88f14d6 | |
Mauricio Baeza | fb24346601 | |
Mauricio Baeza | a518278b55 | |
Mauricio Baeza | 565f36be3a | |
Mauricio Baeza | 1a9087b13a | |
Mauricio Baeza | 952dcba7ae | |
Mauricio Baeza | 12a24c1117 | |
Mauricio Baeza | fa01e6cf01 | |
Mauricio Baeza | b5bdcbbeb3 | |
Mauricio Baeza | b03fbebe09 | |
Mauricio Baeza | c98cdd7fff | |
Mauricio Baeza | 537cecbb0b | |
Mauricio Baeza | 5b8cd0ecb2 | |
Mauricio Baeza | 5c047ee9d5 | |
Mauricio Baeza | 431422361b | |
Mauricio Baeza | 739ac08205 | |
Mauricio Baeza | de06f706a6 | |
Mauricio Baeza | aaccece897 | |
Mauricio Baeza | f813fb4dd8 | |
Mauricio Baeza | 51b4386b24 | |
Mauricio Baeza | e678083eea | |
Mauricio Baeza | 32679fced3 | |
Mauricio Baeza | 0084197906 | |
Mauricio Baeza | 17fa99e45b | |
Mauricio Baeza | cca598310b | |
Mauricio Baeza | 21fd903943 | |
Mauricio Baeza | 1f3e51861d | |
Mauricio Baeza | 1c6f9cd5f7 | |
Mauricio Baeza | 8d815bf570 | |
Mauricio Baeza | 443b916056 | |
Mauricio Baeza | 980a7aafdb | |
Mauricio Baeza | 267a96ebbc | |
Mauricio Baeza | 763f3c21fb | |
Mauricio Baeza | 26e4ce3d13 | |
Mauricio Baeza | a202f12a17 | |
Mauricio Baeza | a17345c0fd | |
Mauricio Baeza | d509bfb8be | |
Mauricio Baeza | 71bd536cb1 | |
Mauricio Baeza | e94cda3577 | |
Mauricio Baeza | 77b35f8322 | |
Mauricio Baeza | 1c55fbd7c7 | |
Mauricio Baeza | 6f3d9cc3fa | |
Mauricio Baeza | ce0e960534 | |
Mauricio Baeza | abbb4cc608 | |
Mauricio Baeza | 692477f41a | |
Mauricio Baeza | 519a61e132 | |
Mauricio Baeza | 4bff2703a4 | |
Mauricio Baeza | 6cef8fe669 | |
Mauricio Baeza | 2cacb786b6 | |
Mauricio Baeza | 79cea5b092 | |
Mauricio Baeza | 43684b7fe9 | |
Mauricio Baeza | 3d300146f1 | |
Mauricio Baeza | dbf3a342bf | |
Mauricio Baeza | 997dfe90ba | |
Mauricio Baeza | ff0ee73a73 | |
Mauricio Baeza | 4660e1d4e0 | |
Mauricio Baeza | dc8aeaebba | |
Mauricio Baeza | 0bddc189b4 | |
Mauricio Baeza | bbaf709e0e | |
Mauricio Baeza | 2765958a23 | |
Mauricio Baeza | 2090aa743d | |
Mauricio Baeza | 63fc8e9a78 | |
Mauricio Baeza | 425f2ee079 | |
Mauricio Baeza | acd8604e92 | |
Mauricio Baeza | 71d773f999 | |
Mauricio Baeza | 2e98d69685 | |
Mauricio Baeza | 135d469f3e | |
Mauricio Baeza | 18b1880772 | |
Mauricio Baeza | 66111d9080 | |
Mauricio Baeza | 127ceceada | |
Mauricio Baeza | b6b5aa3447 | |
Mauricio Baeza | b0de7655cc | |
Mauricio Baeza | dea511d161 | |
Mauricio Baeza | 9081d54865 | |
Mauricio Baeza | f0ab9246e0 | |
Mauricio Baeza | 8de2b20dcf | |
Mauricio Baeza | 4608246b7d | |
Mauricio Baeza | 94240f2356 | |
Mauricio Baeza | 3163fef0d5 | |
Mauricio Baeza | 32ec443a19 | |
Mauricio Baeza | 64caf4f415 | |
Mauricio Baeza | 13836add29 | |
Mauricio Baeza | f3309429e6 | |
Mauricio Baeza | f9e4bced15 | |
Mauricio Baeza | c3d92ff45e | |
Mauricio Baeza | 3424f7f78a | |
Mauricio Baeza | de40cb0453 | |
Mauricio Baeza | da84fbafb6 | |
Mauricio Baeza | 32926740be | |
Mauricio Baeza | 57dce9670b | |
Mauricio Baeza | 03ac074c66 | |
Mauricio Baeza | 1f043746dd | |
Mauricio Baeza | 5b15166c7a | |
Mauricio Baeza | 0a48580f0c | |
Mauricio Baeza | 2f797af8b2 | |
Mauricio Baeza | aac5c04a3f | |
Mauricio Baeza | 348f2d4443 | |
Mauricio Baeza | 313af2cce1 | |
Mauricio Baeza | 7308ec86ae | |
Mauricio Baeza | dc68b54f08 | |
Mauricio Baeza | b90e0a26ba | |
Mauricio Baeza | 9ae0d7d924 | |
Mauricio Baeza | 07d51db625 | |
Mauricio Baeza | eedd253e6a | |
Mauricio Baeza | 73eb2f0b8c | |
Mauricio Baeza | fd334eade4 | |
Mauricio Baeza | 7bbfcd6cae | |
Mauricio Baeza | 6381975518 | |
Mauricio Baeza | edd1be81ed | |
Mauricio Baeza | e7a4d38681 | |
Mauricio Baeza | 9a0f74eb52 | |
Mauricio Baeza | cf73669e3a | |
Mauricio Baeza | 3db6775f57 | |
Mauricio Baeza | 8a03dba323 | |
Mauricio Baeza | 874bf11447 | |
Mauricio Baeza | bb3f6d3aed | |
Mauricio Baeza | 0ee99296a6 | |
Mauricio Baeza | e1424e2e70 | |
Mauricio Baeza | 5bfcc4ca07 | |
Mauricio Baeza | b2148e1789 | |
Mauricio Baeza | badf1b0f5f | |
Mauricio Baeza | 1c65205bea | |
Mauricio Baeza | 4bd7e335d8 | |
Mauricio Baeza | 09ccffdc62 | |
Mauricio Baeza | 0207b9fa78 | |
Mauricio Baeza | 785cb32773 | |
Mauricio Baeza | 77ff862400 | |
Mauricio Baeza | da730801d6 | |
Mauricio Baeza | 13d82f1df8 | |
Mauricio Baeza | dcfc80edc8 | |
Mauricio Baeza | 3376505ea1 | |
Mauricio Baeza | 21eafd9e4a | |
Mauricio Baeza | b7b96611a6 | |
Mauricio Baeza | 2141f84402 | |
Mauricio Baeza | 0e909628dc | |
Mauricio Baeza | 012331b523 | |
Mauricio Baeza | 64f5dd9170 | |
Mauricio Baeza | e1b975f0f9 | |
Mauricio Baeza | b73d0d6284 | |
Mauricio Baeza | 83dff5bc5f | |
Mauricio Baeza | ac481862d9 | |
Mauricio Baeza | 14f17a6188 | |
Mauricio Baeza | 7e91476e47 | |
Mauricio Baeza | e728d948d0 | |
Mauricio Baeza | 5a791eec7c |
|
@ -2,6 +2,7 @@
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
Pipfile*
|
||||||
|
|
||||||
# Django stuff:
|
# Django stuff:
|
||||||
*.log
|
*.log
|
||||||
|
@ -22,6 +23,7 @@ vedev/
|
||||||
# Virtualenv
|
# Virtualenv
|
||||||
.env/
|
.env/
|
||||||
virtual/
|
virtual/
|
||||||
|
env
|
||||||
|
|
||||||
docs/build
|
docs/build
|
||||||
cache/
|
cache/
|
||||||
|
@ -32,4 +34,5 @@ credenciales.conf
|
||||||
*.orig
|
*.orig
|
||||||
rfc.db
|
rfc.db
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
chuletas/
|
||||||
|
|
||||||
|
|
128
CHANGELOG.md
128
CHANGELOG.md
|
@ -1,3 +1,129 @@
|
||||||
|
v 2.3.2 [10-Abr-2024]
|
||||||
|
- 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
|
||||||
|
- **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
|
||||||
|
@ -128,7 +254,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 [31-May-2021]
|
v 1.42.1 [01-Jun-2021]
|
||||||
----------------------
|
----------------------
|
||||||
- Error - Ticket #5
|
- Error - Ticket #5
|
||||||
|
|
||||||
|
|
|
@ -12,3 +12,4 @@
|
||||||
* Crea nueva documentación
|
* Crea nueva documentación
|
||||||
* Propon nuevas funcionalidades
|
* Propon nuevas funcionalidades
|
||||||
* Difunde Empresa Libre
|
* Difunde Empresa Libre
|
||||||
|
|
||||||
|
|
25
README.md
25
README.md
|
@ -15,12 +15,11 @@ 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
|
||||||
* python3.7+
|
* python 3.8
|
||||||
* xsltproc
|
* xsltproc
|
||||||
* openssl
|
* openssl
|
||||||
* xmlsec
|
* xmlsec
|
||||||
|
@ -37,5 +36,25 @@ 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
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[ ] Permitir más de un remolque en la Carta Porte
|
||||||
|
[ ] Campos de captura de Comercio Exterior
|
||||||
|
[ ] Representación impresa de Comercio Exterior
|
|
@ -1,20 +0,0 @@
|
||||||
# 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)
|
|
|
@ -1,35 +0,0 @@
|
||||||
@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
|
|
|
@ -1,21 +0,0 @@
|
||||||
.. 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`
|
|
|
@ -1,39 +0,0 @@
|
||||||
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
|
|
||||||
|
|
|
@ -14,9 +14,4 @@ cryptography==3.4.8
|
||||||
xmlsec
|
xmlsec
|
||||||
segno
|
segno
|
||||||
|
|
||||||
# pyqrcode
|
|
||||||
# pypng
|
|
||||||
# python-escpos
|
# python-escpos
|
||||||
# pyusb
|
|
||||||
# pyserial
|
|
||||||
# qrcode
|
|
||||||
|
|
|
@ -25,16 +25,23 @@ from logbook import Logger
|
||||||
|
|
||||||
|
|
||||||
log = Logger('XML')
|
log = Logger('XML')
|
||||||
CFDI_ACTUAL = 'cfdi33'
|
CFDI_ACTUAL = 'cfdi40'
|
||||||
NOMINA_ACTUAL = 'nomina12'
|
NOMINA_ACTUAL = 'nomina12'
|
||||||
|
PUBLIC = 'PUBLICO EN GENERAL'
|
||||||
|
CFDI_EGRESO = 'E'
|
||||||
|
|
||||||
|
DEFAULT = {
|
||||||
|
'exportacion': '01',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SAT = {
|
SAT = {
|
||||||
'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
||||||
'cfdi32': {
|
'cfdi40': {
|
||||||
'version': '3.2',
|
'version': '4.0',
|
||||||
'prefix': 'cfdi',
|
'prefix': 'cfdi',
|
||||||
'xmlns': 'http://www.sat.gob.mx/cfd/3',
|
'xmlns': 'http://www.sat.gob.mx/cfd/4',
|
||||||
'schema': 'http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd',
|
'schema': 'http://www.sat.gob.mx/cfd/4 http://www.sat.gob.mx/sitio_internet/cfd/4/cfdv40.xsd',
|
||||||
},
|
},
|
||||||
'cfdi33': {
|
'cfdi33': {
|
||||||
'version': '3.3',
|
'version': '3.3',
|
||||||
|
@ -42,6 +49,12 @@ SAT = {
|
||||||
'xmlns': 'http://www.sat.gob.mx/cfd/3',
|
'xmlns': 'http://www.sat.gob.mx/cfd/3',
|
||||||
'schema': 'http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd',
|
'schema': 'http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd',
|
||||||
},
|
},
|
||||||
|
'cfdi32': {
|
||||||
|
'version': '3.2',
|
||||||
|
'prefix': 'cfdi',
|
||||||
|
'xmlns': 'http://www.sat.gob.mx/cfd/3',
|
||||||
|
'schema': 'http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv32.xsd',
|
||||||
|
},
|
||||||
'nomina11': {
|
'nomina11': {
|
||||||
'version': '1.1',
|
'version': '1.1',
|
||||||
'prefix': 'nomina',
|
'prefix': 'nomina',
|
||||||
|
@ -80,10 +93,10 @@ SAT = {
|
||||||
'schema': ' http://www.sat.gob.mx/iedu http://www.sat.gob.mx/sitio_internet/cfd/iedu/iedu.xsd',
|
'schema': ' http://www.sat.gob.mx/iedu http://www.sat.gob.mx/sitio_internet/cfd/iedu/iedu.xsd',
|
||||||
},
|
},
|
||||||
'pagos': {
|
'pagos': {
|
||||||
'version': '1.0',
|
'version': '2.0',
|
||||||
'prefix': 'pago10',
|
'prefix': 'pago20',
|
||||||
'xmlns': 'http://www.sat.gob.mx/Pagos',
|
'xmlns': 'http://www.sat.gob.mx/Pagos20',
|
||||||
'schema': ' http://www.sat.gob.mx/Pagos http://www.sat.gob.mx/sitio_internet/cfd/Pagos/Pagos10.xsd',
|
'schema': ' http://www.sat.gob.mx/Pagos20 http://www.sat.gob.mx/sitio_internet/cfd/Pagos/Pagos20.xsd',
|
||||||
},
|
},
|
||||||
'divisas': {
|
'divisas': {
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
|
@ -98,10 +111,16 @@ 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': 'cartaporte20',
|
'prefix': 'cce20',
|
||||||
'xmlns': 'http://www.sat.gob.mx/CartaPorte20',
|
'xmlns': 'http://www.sat.gob.mx/ComercioExterior20',
|
||||||
'schema': ' http://www.sat.gob.mx/CartaPorte20 http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte20.xsd',
|
'schema': ' http://www.sat.gob.mx/ComercioExterior20 http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior20/ComercioExterior20.xsd',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +141,10 @@ 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):
|
||||||
|
@ -133,6 +155,8 @@ 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'])
|
||||||
|
@ -145,7 +169,9 @@ class CFDI(object):
|
||||||
if 'nomina' in datos:
|
if 'nomina' in datos:
|
||||||
self._nomina(datos['nomina'])
|
self._nomina(datos['nomina'])
|
||||||
|
|
||||||
return self._to_pretty_xml(ET.tostring(self._cfdi, encoding='utf-8'))
|
xml = 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
|
||||||
|
@ -174,6 +200,9 @@ 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', '')
|
||||||
|
|
||||||
|
@ -245,10 +274,16 @@ 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_carta_porte + schema_comercioe
|
||||||
attributes.update(datos)
|
attributes.update(datos)
|
||||||
|
|
||||||
if not 'Version' in attributes:
|
if not 'Version' in attributes:
|
||||||
|
@ -256,9 +291,23 @@ class CFDI(object):
|
||||||
if not 'Fecha' in attributes:
|
if not 'Fecha' in attributes:
|
||||||
attributes['Fecha'] = self._now()
|
attributes['Fecha'] = self._now()
|
||||||
|
|
||||||
|
# ~ cfdi4
|
||||||
|
if not 'Exportacion' in attributes:
|
||||||
|
attributes['Exportacion'] = self._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
|
||||||
|
@ -278,6 +327,10 @@ 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
|
||||||
|
@ -347,6 +400,10 @@ 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)
|
||||||
|
|
||||||
|
@ -463,6 +520,47 @@ 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
|
||||||
|
@ -477,6 +575,11 @@ 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)
|
||||||
|
|
||||||
|
@ -494,10 +597,6 @@ 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:
|
||||||
|
@ -506,10 +605,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 'SubTipoRem' in remolque and 'Placa' in remolque \
|
if remolques:
|
||||||
and remolque['SubTipoRem'] and remolque['Placa']:
|
node_remolques = ET.SubElement(sub_node, f'{prefix}:Remolques')
|
||||||
tmp = ET.SubElement(sub_node, f'{prefix}:Remolques')
|
for remolque in remolques:
|
||||||
ET.SubElement(tmp, f'{prefix}:Remolque', remolque)
|
ET.SubElement(node_remolques, 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')
|
||||||
|
@ -532,21 +631,53 @@ 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, 'Ambito': ine_ambito}
|
attr = {'ClaveEntidad': ine_key_entidad}
|
||||||
|
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)
|
||||||
|
|
||||||
if 'pagos' in datos:
|
if 'pagos' in datos:
|
||||||
datos = datos.pop('pagos')
|
datos = datos.pop('pagos')
|
||||||
|
totales = datos.pop('totales')
|
||||||
relacionados = datos.pop('relacionados')
|
relacionados = datos.pop('relacionados')
|
||||||
|
taxes_pay = datos.pop('taxes_pay')
|
||||||
pre = SAT['pagos']['prefix']
|
pre = SAT['pagos']['prefix']
|
||||||
|
|
||||||
attributes = {'Version': SAT['pagos']['version']}
|
attributes = {'Version': SAT['pagos']['version']}
|
||||||
pagos = ET.SubElement(
|
pagos = ET.SubElement(
|
||||||
self._complemento, '{}:Pagos'.format(pre), attributes)
|
self._complemento, '{}:Pagos'.format(pre), attributes)
|
||||||
|
|
||||||
|
ET.SubElement(pagos, '{}:Totales'.format(pre), totales)
|
||||||
|
|
||||||
node_pago = ET.SubElement(pagos, '{}:Pago'.format(pre), datos)
|
node_pago = ET.SubElement(pagos, '{}:Pago'.format(pre), datos)
|
||||||
for row in relacionados:
|
for row in relacionados:
|
||||||
ET.SubElement(node_pago, '{}:DoctoRelacionado'.format(pre), row)
|
taxes = row.pop('taxes')
|
||||||
|
node = ET.SubElement(node_pago, f'{pre}:DoctoRelacionado', row)
|
||||||
|
nodex_tax = None
|
||||||
|
if taxes['traslados'] or taxes['retenciones']:
|
||||||
|
node_tax = ET.SubElement(node, f'{pre}:ImpuestosDR')
|
||||||
|
if taxes['retenciones']:
|
||||||
|
node = ET.SubElement(node_tax, f'{pre}:RetencionesDR')
|
||||||
|
for tax in taxes['retenciones']:
|
||||||
|
ET.SubElement(node, f'{pre}:RetencionDR', tax)
|
||||||
|
if taxes['traslados']:
|
||||||
|
node = ET.SubElement(node_tax, f'{pre}:TrasladosDR')
|
||||||
|
for tax in taxes['traslados']:
|
||||||
|
ET.SubElement(node, f'{pre}:TrasladoDR', tax)
|
||||||
|
|
||||||
|
if taxes_pay['traslados'] or taxes_pay['retenciones']:
|
||||||
|
node_tax = ET.SubElement(node_pago, f'{pre}:ImpuestosP')
|
||||||
|
if taxes_pay['retenciones']:
|
||||||
|
node = ET.SubElement(node_tax, f'{pre}:RetencionesP')
|
||||||
|
for key, importe in taxes_pay['retenciones'].items():
|
||||||
|
attr = {'ImpuestoP': key, 'ImporteP': importe}
|
||||||
|
ET.SubElement(node, f'{pre}:RetencionP', attr)
|
||||||
|
if taxes_pay['traslados']:
|
||||||
|
node = ET.SubElement(node_tax, f'{pre}:TrasladosP')
|
||||||
|
for key, tax in taxes_pay['traslados'].items():
|
||||||
|
ET.SubElement(node, f'{pre}:TrasladoP', tax)
|
||||||
|
|
||||||
if 'leyendas' in datos:
|
if 'leyendas' in datos:
|
||||||
pre = SAT['leyendas']['prefix']
|
pre = SAT['leyendas']['prefix']
|
||||||
|
@ -556,57 +687,8 @@ 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 'ce' in datos:
|
if self._comercio_exterior:
|
||||||
pre = 'cce11'
|
datos = datos.pop('comercioe')
|
||||||
datos = datos.pop('ce')
|
self._complemento_comercio_exterior(datos)
|
||||||
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
|
||||||
|
|
|
@ -542,12 +542,16 @@ 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'):
|
if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html', 'nompdf'):
|
||||||
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
|
||||||
|
|
||||||
|
@ -797,3 +801,27 @@ class AppSATUnidadesPeso(object):
|
||||||
user = req.env['beaker.session']['userobj']
|
user = req.env['beaker.session']['userobj']
|
||||||
req.context['result'] = self._db.sat_unidades_peso_post(values, user)
|
req.context['result'] = self._db.sat_unidades_peso_post(values, user)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppSATRegimenes(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.sat_regimenes_get(values, user)
|
||||||
|
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
|
||||||
|
|
|
@ -41,6 +41,12 @@ 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):
|
||||||
"""
|
"""
|
||||||
|
@ -63,7 +69,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', 'timbre/timbrarV5.aspx'),
|
'timbra': ws.format('ws', 'timbre4/timbrarV5'),
|
||||||
'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'),
|
||||||
|
@ -78,7 +84,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/3',
|
'cfdi': 'http://www.sat.gob.mx/cfd/4',
|
||||||
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
|
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +92,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('timbre/timbrarV5.aspx'),
|
'timbra': ws.format('timbre4/timbrarV5'),
|
||||||
'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'),
|
||||||
|
@ -126,10 +132,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
|
return xml.encode('utf-8')
|
||||||
|
|
||||||
def stamp(self, cfdi, auth):
|
def stamp(self, cfdi, auth):
|
||||||
# ~ if DEBUG or not auth:
|
# ~ if DEBUG or not auth:
|
||||||
|
@ -175,26 +181,29 @@ 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()
|
||||||
|
|
||||||
NS_CFDI = {
|
|
||||||
'cfdi': 'http://www.sat.gob.mx/cfd/3',
|
|
||||||
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
|
|
||||||
}
|
|
||||||
tree = ET.fromstring(cfdi.encode())
|
tree = ET.fromstring(cfdi.encode())
|
||||||
|
version = tree.attrib['Version']
|
||||||
|
|
||||||
|
namespaces = {
|
||||||
|
'cfdi': NAMESPACES[version],
|
||||||
|
'tdf': NAMESPACES['tdf'],
|
||||||
|
}
|
||||||
|
|
||||||
tipo = tree.xpath(
|
tipo = tree.xpath(
|
||||||
'string(//cfdi:Comprobante/@TipoDeComprobante)',
|
'string(//cfdi:Comprobante/@TipoDeComprobante)',
|
||||||
namespaces=NS_CFDI)
|
namespaces=namespaces)
|
||||||
total = tree.xpath(
|
total = tree.xpath(
|
||||||
'string(//cfdi:Comprobante/@Total)',
|
'string(//cfdi:Comprobante/@Total)',
|
||||||
namespaces=NS_CFDI)
|
namespaces=namespaces)
|
||||||
rfc_emisor = tree.xpath(
|
rfc_emisor = tree.xpath(
|
||||||
'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)',
|
'string(//cfdi:Comprobante/cfdi:Emisor/@Rfc)',
|
||||||
namespaces=NS_CFDI)
|
namespaces=namespaces)
|
||||||
rfc_receptor = tree.xpath(
|
rfc_receptor = tree.xpath(
|
||||||
'string(//cfdi:Comprobante/cfdi:Receptor/@Rfc)',
|
'string(//cfdi:Comprobante/cfdi:Receptor/@Rfc)',
|
||||||
namespaces=NS_CFDI)
|
namespaces=namespaces)
|
||||||
uid = tree.xpath(
|
uid = tree.xpath(
|
||||||
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
|
'string(//cfdi:Complemento/tdf:TimbreFiscalDigital/@UUID)',
|
||||||
namespaces=NS_CFDI)
|
namespaces=namespaces)
|
||||||
data = (
|
data = (
|
||||||
f"USER={auth['user']}",
|
f"USER={auth['user']}",
|
||||||
f"PWDW={auth['pass']}",
|
f"PWDW={auth['pass']}",
|
||||||
|
|
|
@ -47,7 +47,7 @@ logging.getLogger('zeep').setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
|
||||||
TIMEOUT = 10
|
TIMEOUT = 10
|
||||||
DEBUG_SOAP = True
|
DEBUG_SOAP = False
|
||||||
|
|
||||||
|
|
||||||
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 = 'http://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
|
WS = 'https://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
|
||||||
NS_TYPE = 'ns0'
|
NS_TYPE = 'ns0'
|
||||||
URL = {
|
URL = {
|
||||||
'quick_stamp': False,
|
'quick_stamp': False,
|
||||||
|
@ -190,11 +190,18 @@ 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)
|
||||||
|
@ -223,6 +230,7 @@ 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'],
|
||||||
|
|
|
@ -30,6 +30,7 @@ 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
|
||||||
|
@ -44,7 +45,6 @@ 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,9 +52,20 @@ 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:
|
||||||
APP_LIBO = False
|
path_fun = '/usr/lib/libreoffice/program/fundamentalrc'
|
||||||
|
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
|
||||||
|
|
||||||
|
@ -69,7 +80,6 @@ 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
|
||||||
|
@ -78,9 +88,11 @@ import segno
|
||||||
from .pacs.cfdi_cert import SATCertificate
|
from .pacs.cfdi_cert import SATCertificate
|
||||||
|
|
||||||
from settings import (
|
from settings import (
|
||||||
|
CFDI_VERSIONS,
|
||||||
EXT,
|
EXT,
|
||||||
MXN,
|
MXN,
|
||||||
PATHS,
|
PATHS,
|
||||||
|
PRE_DEFAULT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -291,7 +303,8 @@ def get_sat_productos(key):
|
||||||
|
|
||||||
|
|
||||||
def now():
|
def now():
|
||||||
return datetime.datetime.now().replace(microsecond=0)
|
n = datetime.datetime.now().replace(microsecond=0)
|
||||||
|
return n
|
||||||
|
|
||||||
|
|
||||||
def today():
|
def today():
|
||||||
|
@ -636,6 +649,12 @@ 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)
|
||||||
|
@ -733,7 +752,12 @@ 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)
|
||||||
|
@ -873,8 +897,6 @@ 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)
|
||||||
|
@ -883,11 +905,11 @@ class LIBO(object):
|
||||||
image.Graphic = gp.queryGraphic(properties)
|
image.Graphic = gp.queryGraphic(properties)
|
||||||
|
|
||||||
s = Size()
|
s = Size()
|
||||||
s.Width = 4150
|
s.Width = 4000
|
||||||
s.Height = 4500
|
s.Height = 4000
|
||||||
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):
|
||||||
|
@ -939,6 +961,7 @@ 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')
|
||||||
|
@ -997,6 +1020,10 @@ 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)
|
||||||
|
@ -1007,7 +1034,72 @@ 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):
|
||||||
|
@ -1119,6 +1211,9 @@ 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',):
|
||||||
|
@ -1150,7 +1245,8 @@ 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)
|
||||||
cell_4 = self._set_cell('{doc.metodopago}', metodo_pago)
|
if version != VERSION2:
|
||||||
|
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)
|
||||||
|
@ -1160,7 +1256,8 @@ class LIBO(object):
|
||||||
col1.append((uuid,))
|
col1.append((uuid,))
|
||||||
col2.append((serie,))
|
col2.append((serie,))
|
||||||
col3.append((folio,))
|
col3.append((folio,))
|
||||||
col4.append((metodo_pago,))
|
if version != VERSION2:
|
||||||
|
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),))
|
||||||
|
@ -1186,8 +1283,9 @@ 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)
|
||||||
col = cell_4.getCellAddress().Column
|
if version != VERSION2:
|
||||||
target4 = self._sheet.getCellRangeByPosition(col, row1, col, row2)
|
col = cell_4.getCellAddress().Column
|
||||||
|
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
|
||||||
|
@ -1202,7 +1300,8 @@ 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))
|
||||||
target4.setDataArray(tuple(col4))
|
if version != VERSION2:
|
||||||
|
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))
|
||||||
|
@ -1221,6 +1320,7 @@ 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)
|
||||||
|
@ -1238,6 +1338,7 @@ 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'])
|
||||||
|
|
||||||
|
@ -1289,6 +1390,7 @@ 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):
|
||||||
|
@ -1358,6 +1460,7 @@ 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'
|
||||||
|
@ -1548,41 +1651,105 @@ 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:
|
||||||
donativo = ''
|
path = get_template_ods(template_name, default)
|
||||||
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)
|
||||||
|
|
||||||
|
@ -1592,6 +1759,7 @@ 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")
|
||||||
|
@ -1662,10 +1830,11 @@ 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 ()
|
return (), msg
|
||||||
|
|
||||||
msg = 'LibreOffice no se pudo iniciar'
|
msg = 'LibreOffice no se pudo iniciar'
|
||||||
if APP_LIBO:
|
if APP_LIBO:
|
||||||
|
@ -1710,24 +1879,6 @@ 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:
|
||||||
|
@ -1754,7 +1905,7 @@ def _comprobante(doc, options):
|
||||||
data['tiporelacion'] = options.get('tiporelacion', '')
|
data['tiporelacion'] = options.get('tiporelacion', '')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
if data['version'] == '3.3':
|
if data['version'] in CFDI_VERSIONS:
|
||||||
tipos = {
|
tipos = {
|
||||||
'I': 'ingreso',
|
'I': 'ingreso',
|
||||||
'E': 'egreso',
|
'E': 'egreso',
|
||||||
|
@ -1839,7 +1990,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
|
||||||
|
|
||||||
|
|
||||||
|
@ -1857,7 +2008,7 @@ def _conceptos(doc, version, options):
|
||||||
data.append(values)
|
data.append(values)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if version == '3.3':
|
if version in CFDI_VERSIONS:
|
||||||
if 'noidentificacion' in values:
|
if 'noidentificacion' in values:
|
||||||
values['noidentificacion'] = '{}\n(SAT {})'.format(
|
values['noidentificacion'] = '{}\n(SAT {})'.format(
|
||||||
values['noidentificacion'], values['ClaveProdServ'])
|
values['noidentificacion'], values['ClaveProdServ'])
|
||||||
|
@ -1921,19 +2072,22 @@ def _totales(doc, cfdi, version):
|
||||||
# ~ for n in node.getchildren():
|
# ~ for n in node.getchildren():
|
||||||
for n in list(node):
|
for n in list(node):
|
||||||
tmp = CaseInsensitiveDict(n.attrib.copy())
|
tmp = CaseInsensitiveDict(n.attrib.copy())
|
||||||
if version == '3.3':
|
if version in CFDI_VERSIONS:
|
||||||
tasa = round(float(tmp['tasaocuota']), DECIMALES)
|
tasa = ''
|
||||||
|
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'])
|
||||||
traslados.append((title, float(tmp['importe'])))
|
if 'importe' in tmp:
|
||||||
|
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:
|
||||||
# ~ for n in node.getchildren():
|
# ~ for n in node.getchildren():
|
||||||
for n in list(node):
|
for n in list(node):
|
||||||
tmp = CaseInsensitiveDict(n.attrib.copy())
|
tmp = CaseInsensitiveDict(n.attrib.copy())
|
||||||
if version == '3.3':
|
if version in CFDI_VERSIONS:
|
||||||
title = 'Retención {} {}'.format(
|
title = 'Retención {} {}'.format(
|
||||||
tn.get(tmp['impuesto']), '')
|
tn.get(tmp['impuesto']), '')
|
||||||
else:
|
else:
|
||||||
|
@ -1965,7 +2119,7 @@ def _totales(doc, cfdi, version):
|
||||||
|
|
||||||
def _timbre(doc, version, values, pdf_from='1'):
|
def _timbre(doc, version, values, pdf_from='1'):
|
||||||
CADENA = '||{version}|{UUID}|{FechaTimbrado}|{selloCFD}|{noCertificadoSAT}||'
|
CADENA = '||{version}|{UUID}|{FechaTimbrado}|{selloCFD}|{noCertificadoSAT}||'
|
||||||
if version == '3.3':
|
if version in CFDI_VERSIONS:
|
||||||
CADENA = '||{Version}|{UUID}|{FechaTimbrado}|{SelloCFD}|{NoCertificadoSAT}||'
|
CADENA = '||{Version}|{UUID}|{FechaTimbrado}|{SelloCFD}|{NoCertificadoSAT}||'
|
||||||
node = doc.find('{}Complemento/{}TimbreFiscalDigital'.format(
|
node = doc.find('{}Complemento/{}TimbreFiscalDigital'.format(
|
||||||
PRE[version], PRE['TIMBRE']))
|
PRE[version], PRE['TIMBRE']))
|
||||||
|
@ -2095,19 +2249,54 @@ 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):
|
||||||
node = doc.find('{}Complemento/{}Pagos'.format(PRE[version], PRE['pagos']))
|
pre_pays = PRE_DEFAULT['PAGOS']['PRE']
|
||||||
|
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 {}
|
||||||
|
|
||||||
info = CaseInsensitiveDict(node.attrib.copy())
|
if version == '4.0':
|
||||||
related = []
|
info = _get_info_pays_2(node)
|
||||||
for n1 in node:
|
else:
|
||||||
info.update(CaseInsensitiveDict(n1.attrib.copy()))
|
info = CaseInsensitiveDict(node.attrib.copy())
|
||||||
for n2 in n1:
|
related = []
|
||||||
related.append(CaseInsensitiveDict(n2.attrib.copy()))
|
for n1 in node:
|
||||||
|
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'])
|
||||||
|
@ -2120,6 +2309,7 @@ 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']
|
||||||
|
@ -2226,11 +2416,37 @@ 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'],
|
||||||
|
@ -2347,6 +2563,15 @@ 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}
|
||||||
|
@ -2824,6 +3049,20 @@ 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)
|
||||||
|
|
||||||
|
@ -2923,4 +3162,8 @@ 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
|
||||||
|
|
||||||
|
|
|
@ -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
|
from settings import DEBUG, DB_COMPANIES, PATHS, TEMPLATE_CANCEL, RFCS, PRE
|
||||||
|
|
||||||
from .pacs.cfdi_cert import SATCertificate
|
from .pacs.cfdi_cert import SATCertificate
|
||||||
from .pacs import PACComercioDigital
|
from .pacs import PACComercioDigital
|
||||||
|
@ -88,6 +88,7 @@ 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',
|
||||||
|
@ -255,11 +256,18 @@ class SendMail(object):
|
||||||
|
|
||||||
|
|
||||||
class CfdiToDict(object):
|
class CfdiToDict(object):
|
||||||
|
NS_VERSION = {
|
||||||
|
'cfdi3.3': 'http://www.sat.gob.mx/cfd/3',
|
||||||
|
'cfdi4.0': 'http://www.sat.gob.mx/cfd/4',
|
||||||
|
}
|
||||||
NS = {
|
NS = {
|
||||||
'cfdi': 'http://www.sat.gob.mx/cfd/3',
|
'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',
|
||||||
|
@ -267,6 +275,54 @@ 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',
|
||||||
}
|
}
|
||||||
|
@ -305,8 +361,30 @@ 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': (),
|
||||||
}
|
}
|
||||||
|
@ -318,9 +396,54 @@ class CfdiToDict(object):
|
||||||
return self._values
|
return self._values
|
||||||
|
|
||||||
def _get_values(self):
|
def _get_values(self):
|
||||||
|
self.version = self._root.attrib['Version']
|
||||||
|
ns = f'cfdi{self.version}'
|
||||||
|
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']]
|
||||||
|
@ -332,6 +455,14 @@ 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:
|
||||||
|
@ -397,6 +528,94 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -656,7 +875,8 @@ def db_backup_local():
|
||||||
|
|
||||||
|
|
||||||
def now():
|
def now():
|
||||||
return datetime.datetime.now().replace(microsecond=0)
|
n = datetime.datetime.now().replace(microsecond=0)
|
||||||
|
return n
|
||||||
|
|
||||||
|
|
||||||
def get_days(date):
|
def get_days(date):
|
||||||
|
@ -725,6 +945,9 @@ 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:
|
||||||
|
@ -741,9 +964,6 @@ 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()))
|
||||||
|
@ -760,8 +980,10 @@ 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=NS_CFDI)
|
rfc_pac = tree.xpath(path, namespaces=namespaces)
|
||||||
return RFCS[rfc_pac]
|
return RFCS[rfc_pac]
|
||||||
|
|
||||||
|
|
||||||
|
@ -827,17 +1049,20 @@ 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=NS_CFDI) or
|
tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=namespaces) or
|
||||||
tree.xpath('string(//cfdi:Emisor/@Rfc)', namespaces=NS_CFDI)
|
tree.xpath('string(//cfdi:Emisor/@Rfc)', namespaces=namespaces)
|
||||||
)
|
)
|
||||||
receptor = escape(
|
receptor = escape(
|
||||||
tree.xpath('string(//cfdi:Receptor/@rfc)', namespaces=NS_CFDI) or
|
tree.xpath('string(//cfdi:Receptor/@rfc)', namespaces=namespaces) or
|
||||||
tree.xpath('string(//cfdi:Receptor/@Rfc)', namespaces=NS_CFDI)
|
tree.xpath('string(//cfdi:Receptor/@Rfc)', namespaces=namespaces)
|
||||||
)
|
)
|
||||||
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'))
|
||||||
|
@ -962,6 +1187,7 @@ 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
|
||||||
|
|
||||||
|
@ -982,3 +1208,18 @@ 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
|
||||||
|
|
|
@ -25,6 +25,8 @@ from controllers.main import (AppEmpresas,
|
||||||
AppWareHouse,
|
AppWareHouse,
|
||||||
AppWareHouseProduct,
|
AppWareHouseProduct,
|
||||||
AppSATUnidadesPeso,
|
AppSATUnidadesPeso,
|
||||||
|
AppSATRegimenes,
|
||||||
|
AppSociosRegimenes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,6 +80,8 @@ api.add_route('/warehouseproduct', AppWareHouseProduct(db))
|
||||||
api.add_route('/ticketsdetails', AppTicketsDetails(db))
|
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('/sociosregimenes', AppSociosRegimenes(db))
|
||||||
|
|
||||||
|
|
||||||
session_options = {
|
session_options = {
|
||||||
|
|
|
@ -70,6 +70,9 @@ 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'])
|
||||||
|
|
||||||
|
@ -200,6 +203,10 @@ 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'])
|
||||||
|
|
||||||
|
@ -227,6 +234,9 @@ 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()
|
||||||
|
|
||||||
|
@ -526,6 +536,12 @@ class StorageEngine(object):
|
||||||
def sat_unidades_peso_post(self, args, user):
|
def sat_unidades_peso_post(self, args, user):
|
||||||
return main.SATUnidadesPeso.post(args, user)
|
return main.SATUnidadesPeso.post(args, user)
|
||||||
|
|
||||||
|
def sat_regimenes_get(self, 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
|
@ -28,12 +28,9 @@ 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 = 'salgueiro3.3'
|
DEFAULT_PASSWORD = 'salgueiro4.0'
|
||||||
|
|
||||||
try:
|
TITLE_APP = 'Empresa Libre'
|
||||||
from conf import TITLE_APP
|
|
||||||
except ImportError:
|
|
||||||
TITLE_APP = 'Empresa Libre'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from conf import NO_HTTPS
|
from conf import NO_HTTPS
|
||||||
|
@ -42,7 +39,8 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
DEBUG = DEBUG
|
DEBUG = DEBUG
|
||||||
VERSION = '1.46.4'
|
VERSION = '2.3.2'
|
||||||
|
|
||||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||||
|
|
||||||
|
@ -127,12 +125,29 @@ 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}',
|
||||||
'3.0': '{http://www.sat.gob.mx/cfd/3}',
|
'3.0': '{http://www.sat.gob.mx/cfd/3}',
|
||||||
'3.2': '{http://www.sat.gob.mx/cfd/3}',
|
'3.2': '{http://www.sat.gob.mx/cfd/3}',
|
||||||
'3.3': '{http://www.sat.gob.mx/cfd/3}',
|
'3.3': '{http://www.sat.gob.mx/cfd/3}',
|
||||||
|
'4.0': '{http://www.sat.gob.mx/cfd/4}',
|
||||||
'TIMBRE': '{http://www.sat.gob.mx/TimbreFiscalDigital}',
|
'TIMBRE': '{http://www.sat.gob.mx/TimbreFiscalDigital}',
|
||||||
'DONATARIA': '{http://www.sat.gob.mx/donat}',
|
'DONATARIA': '{http://www.sat.gob.mx/donat}',
|
||||||
'INE': '{http://www.sat.gob.mx/ine}',
|
'INE': '{http://www.sat.gob.mx/ine}',
|
||||||
|
@ -141,11 +156,15 @@ 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': '{http://www.sat.gob.mx/Pagos}',
|
'PAGOS': {
|
||||||
|
'1.0': '{http://www.sat.gob.mx/Pagos}',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CURRENT_CFDI = '3.3'
|
# To delete
|
||||||
CURRENT_CFDI_NOMINA = '1.2'
|
# ~ CURRENT_CFDI = '4.0'
|
||||||
|
# ~ CURRENT_CFDI_NOMINA = '1.2'
|
||||||
|
|
||||||
DECIMALES = 2
|
DECIMALES = 2
|
||||||
DECIMALES_TAX = 4
|
DECIMALES_TAX = 4
|
||||||
DECIMALES_PRECIOS = 4
|
DECIMALES_PRECIOS = 4
|
||||||
|
@ -168,7 +187,8 @@ DEFAULT_CFDIPAY = {
|
||||||
'TYPE': 'P',
|
'TYPE': 'P',
|
||||||
'WAYPAY': 'PPD',
|
'WAYPAY': 'PPD',
|
||||||
'CURRENCY': 'XXX',
|
'CURRENCY': 'XXX',
|
||||||
'USED': 'P01',
|
'TC': '1',
|
||||||
|
'USED': 'CP01',
|
||||||
'KEYSAT': '84111506',
|
'KEYSAT': '84111506',
|
||||||
'UNITKEY': 'ACT',
|
'UNITKEY': 'ACT',
|
||||||
'DESCRIPTION': 'Pago',
|
'DESCRIPTION': 'Pago',
|
||||||
|
@ -181,7 +201,7 @@ PUBLIC = 'Público en general'
|
||||||
DEFAULT_SAT_NOMINA = {
|
DEFAULT_SAT_NOMINA = {
|
||||||
'SERIE': 'N',
|
'SERIE': 'N',
|
||||||
'FORMA_PAGO': '99',
|
'FORMA_PAGO': '99',
|
||||||
'USO_CFDI': 'P01',
|
'USO_CFDI': 'CN01',
|
||||||
'CLAVE': '84111505',
|
'CLAVE': '84111505',
|
||||||
'UNIDAD': 'ACT',
|
'UNIDAD': 'ACT',
|
||||||
'DESCRIPCION': 'Pago de nómina',
|
'DESCRIPCION': 'Pago de nómina',
|
||||||
|
@ -193,6 +213,7 @@ CURRENCY_MN = 'MXN'
|
||||||
|
|
||||||
# ~ v2
|
# ~ v2
|
||||||
CANCEL_VERSION = ('3.3', '4.0')
|
CANCEL_VERSION = ('3.3', '4.0')
|
||||||
|
CFDI_VERSIONS = CANCEL_VERSION
|
||||||
|
|
||||||
IS_MV = MV
|
IS_MV = MV
|
||||||
DB_COMPANIES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', 'rfc.db'))
|
DB_COMPANIES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', 'rfc.db'))
|
||||||
|
@ -236,6 +257,8 @@ VALUES_PDF = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESICO = '626'
|
||||||
|
|
||||||
RFCS = {
|
RFCS = {
|
||||||
'PUBLIC': 'XAXX010101000',
|
'PUBLIC': 'XAXX010101000',
|
||||||
'FOREIGN': 'XEXX010101000',
|
'FOREIGN': 'XEXX010101000',
|
||||||
|
|
BIN
source/db/cp.db
BIN
source/db/cp.db
Binary file not shown.
|
@ -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": false},
|
{"key": "616", "name": "Sin obligaciones fiscales", "fisica": true, "activo": true},
|
||||||
{"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,7 +682,10 @@
|
||||||
{"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": true}
|
{"key": "P01", "name": "Por definir", "moral": true, "activo": false},
|
||||||
|
{"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}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -728,7 +731,7 @@
|
||||||
"pais": "MEX"
|
"pais": "MEX"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "DIF",
|
"key": "CMX",
|
||||||
"name": "Ciudad de M\u00e9xico",
|
"name": "Ciudad de M\u00e9xico",
|
||||||
"pais": "MEX"
|
"pais": "MEX"
|
||||||
},
|
},
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 380 B |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
|
@ -60,6 +60,7 @@ 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)
|
||||||
|
@ -76,15 +77,13 @@ 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)
|
||||||
|
|
||||||
|
@ -115,6 +114,7 @@ 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,7 +134,9 @@ 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)
|
||||||
|
|
||||||
|
@ -209,7 +211,9 @@ 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'
|
||||||
|
@ -218,17 +222,12 @@ 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., asegurate de que sea correcto'
|
msg = 'No se encontró el C.P. de Expedición, 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){
|
||||||
|
@ -444,6 +443,15 @@ 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()
|
||||||
|
@ -502,7 +510,9 @@ 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){
|
||||||
show(key, values[key])
|
if(key!='txt_plantilla_donataria'){
|
||||||
|
show(key, values[key])
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -943,42 +953,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){
|
||||||
|
@ -1019,42 +1029,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){
|
||||||
|
@ -1139,83 +1149,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){
|
||||||
|
@ -1256,44 +1266,6 @@ 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',
|
||||||
|
@ -1318,6 +1290,8 @@ 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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,6 +1391,21 @@ 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
|
||||||
|
|
|
@ -81,6 +81,7 @@ 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()
|
||||||
}
|
}
|
||||||
|
@ -578,13 +579,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){
|
||||||
|
@ -953,6 +954,7 @@ 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')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -993,6 +995,8 @@ 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, {
|
||||||
|
@ -1010,6 +1014,11 @@ function send_stamp_cfdi_pay(id_mov){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(close){
|
||||||
|
$$('multi_bancos').setValue('banco_home')
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_cfdi_pay(form){
|
function save_cfdi_pay(form){
|
||||||
|
@ -1418,3 +1427,83 @@ 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
|
@ -40,6 +40,7 @@ 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})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -115,16 +116,19 @@ 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()
|
||||||
|
@ -136,6 +140,7 @@ function current_dates(){
|
||||||
|
|
||||||
fy.unblockEvent()
|
fy.unblockEvent()
|
||||||
fm.unblockEvent()
|
fm.unblockEvent()
|
||||||
|
fd.unblockEvent()
|
||||||
pfy.unblockEvent()
|
pfy.unblockEvent()
|
||||||
pfm.unblockEvent()
|
pfm.unblockEvent()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ function cmd_new_partner_click(id, e, node){
|
||||||
$$('partner_balance').define('readonly', !cfg_partners['chk_config_change_balance_partner'])
|
$$('partner_balance').define('readonly', !cfg_partners['chk_config_change_balance_partner'])
|
||||||
get_partner_banks()
|
get_partner_banks()
|
||||||
get_partner_accounts_bank(0)
|
get_partner_accounts_bank(0)
|
||||||
|
get_sat_regimenes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ 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')
|
||||||
|
@ -132,8 +134,10 @@ 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'}]
|
||||||
}
|
}
|
||||||
|
@ -145,12 +149,15 @@ 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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$$('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()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +246,17 @@ function cmd_save_partner_click(id, e, node){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ids_regimenes = $$('lst_receptor_regimenes_fiscales').getSelectedId()
|
||||||
|
if(values.tipo_persona < 3){
|
||||||
|
if(!ids_regimenes){
|
||||||
|
msg = 'Selecciona al menos un Regimen Fiscal'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
values['accounts'] = $$('grid_partner_account_bank').data.getRange()
|
values['accounts'] = $$('grid_partner_account_bank').data.getRange()
|
||||||
|
values['regimenes'] = ids_regimenes
|
||||||
|
|
||||||
webix.ajax().post('/partners', values, {
|
webix.ajax().post('/partners', values, {
|
||||||
error:function(text, data, XmlHttpRequest){
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
@ -343,18 +360,28 @@ function opt_tipo_change(new_value, old_value){
|
||||||
$$('id_fiscal').define('value', '')
|
$$('id_fiscal').define('value', '')
|
||||||
show('id_fiscal', new_value == 4)
|
show('id_fiscal', new_value == 4)
|
||||||
|
|
||||||
|
$$('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", "")
|
||||||
$$("rfc").define("readonly", false)
|
$$("rfc").define("readonly", false)
|
||||||
|
moral = false
|
||||||
|
if(new_value == 2){
|
||||||
|
moral = true
|
||||||
|
}
|
||||||
|
get_sat_regimenes(moral)
|
||||||
} else if (new_value == 3) {
|
} else if (new_value == 3) {
|
||||||
$$("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();
|
||||||
|
@ -372,10 +399,12 @@ 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: 'P01', value: 'Por definir'}]
|
query = [{id: 'S01', value: '[S01] Sin efectos fiscales. '}]
|
||||||
}
|
}
|
||||||
$$('lst_uso_cfdi_socio').getList().parse(query)
|
$$('lst_uso_cfdi_socio').getList().parse(query)
|
||||||
$$('lst_uso_cfdi_socio').refresh()
|
$$('lst_uso_cfdi_socio').refresh()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -619,3 +648,21 @@ function partner_delete_account_bank(row){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_sat_regimenes(morales=false){
|
||||||
|
var data = {opt: 'actives', morales: morales}
|
||||||
|
webix.ajax().sync().get('/satregimenes', data, {
|
||||||
|
error: function(text, data, xhr) {
|
||||||
|
msg = 'Error al consultar'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success: function(text, data, xhr) {
|
||||||
|
var values = data.json()
|
||||||
|
$$('lst_receptor_regimenes_fiscales').clearAll()
|
||||||
|
$$('lst_receptor_regimenes_fiscales').parse(values)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,6 +123,7 @@ 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){
|
||||||
|
@ -131,9 +132,10 @@ 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()
|
msg_error(text)
|
||||||
},
|
},
|
||||||
success: function(text, data, xhr){
|
success: function(text, data, xhr){
|
||||||
var values = data.json()
|
var values = data.json()
|
||||||
|
@ -230,18 +232,9 @@ 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
|
||||||
|
@ -252,7 +245,19 @@ 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'
|
||||||
|
|
|
@ -149,7 +149,9 @@ 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){
|
||||||
|
@ -611,12 +613,18 @@ 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){
|
||||||
|
@ -644,6 +652,7 @@ 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)
|
||||||
|
@ -680,12 +689,26 @@ 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'
|
|
||||||
|
|
||||||
msg = 'Todos los datos son correctos.<BR><BR>¿Estás seguro de generar esta factura?'
|
var periodicidad = ''
|
||||||
|
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',
|
||||||
|
|
|
@ -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 = "Público en general";
|
var PUBLICO = "PUBLICO 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,6 +24,7 @@ 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');
|
||||||
|
@ -54,6 +55,42 @@ 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 = {
|
||||||
|
@ -627,3 +664,33 @@ 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'},
|
||||||
|
]
|
||||||
|
|
|
@ -176,7 +176,9 @@ 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',
|
||||||
|
@ -596,8 +598,22 @@ var type_make_pdf = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
//~ Templates
|
||||||
var opt_templates_cfdi = [
|
var opt_templates_cfdi = [
|
||||||
{id: '_3.3_cp_2.0.ods', value: 'CFDI v3.3 - Carta Porte 2.0'},
|
{id: '_4.0.ods', value: 'CFDI v4.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'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -610,14 +626,6 @@ 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',
|
||||||
|
@ -625,32 +633,11 @@ 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},
|
||||||
|
@ -685,7 +672,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'},
|
labelRight: 'Calcular impuestos con 4 decimales', hidden: true},
|
||||||
{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,
|
||||||
|
@ -704,6 +691,8 @@ 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},
|
||||||
|
@ -711,6 +700,11 @@ 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'},
|
||||||
|
@ -832,7 +826,7 @@ var options_admin_products = [
|
||||||
|
|
||||||
|
|
||||||
var options_admin_complements = [
|
var options_admin_complements = [
|
||||||
{maxHeight: 20},
|
{maxHeight: 10},
|
||||||
{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,
|
||||||
|
@ -842,7 +836,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: 20},
|
{maxHeight: 10},
|
||||||
{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,
|
||||||
|
@ -854,25 +848,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: 20},
|
{maxHeight: 10},
|
||||||
{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: 20},
|
{maxHeight: 10},
|
||||||
{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: 20},
|
{maxHeight: 10},
|
||||||
{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: 20},
|
{maxHeight: 10},
|
||||||
{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,
|
||||||
|
@ -881,12 +875,17 @@ 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: 20},
|
{maxHeight: 10},
|
||||||
{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}]},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1135,6 +1134,19 @@ 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',
|
||||||
|
@ -1147,6 +1159,18 @@ 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',
|
||||||
|
@ -1169,6 +1193,7 @@ 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},
|
||||||
|
@ -1317,6 +1342,16 @@ 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',
|
||||||
|
@ -1414,6 +1449,7 @@ 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},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,6 +347,8 @@ 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'}
|
||||||
|
@ -365,11 +367,13 @@ 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: 200, options: months},
|
labelAlign: 'right', labelWidth: 50, width: 175, options: months},
|
||||||
{view: 'daterangepicker', id: 'filter_invoice_pay_dates', label: 'Fechas',
|
{view: 'daterangepicker', id: 'filter_invoice_pay_dates', label: 'Fechas',
|
||||||
labelAlign: 'right', width: 300},
|
labelAlign: 'right', width: 275},
|
||||||
{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'},
|
||||||
{},
|
{},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -624,7 +628,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 segura de continuar?', autowidth: true, align: 'center'},
|
{view: 'label', label: '¿Estás seguro 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},
|
||||||
|
@ -650,3 +654,35 @@ 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -224,6 +224,8 @@ 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'},
|
||||||
{}]}
|
{}]}
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,6 +234,8 @@ 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},
|
||||||
{},
|
{},
|
||||||
|
@ -418,6 +422,7 @@ var suggest_partners = {
|
||||||
{id: 'rfc', adjust: 'data'},
|
{id: 'rfc', adjust: 'data'},
|
||||||
{id: 'forma_pago', hidden: true},
|
{id: 'forma_pago', hidden: true},
|
||||||
{id: 'uso_cfdi', hidden: true},
|
{id: 'uso_cfdi', hidden: true},
|
||||||
|
{id: 'codigo_postal', hidden: true},
|
||||||
],
|
],
|
||||||
dataFeed:function(text){
|
dataFeed:function(text){
|
||||||
if (text.length > 2){
|
if (text.length > 2){
|
||||||
|
@ -484,8 +489,11 @@ var suggest_students = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var body_comprobante = {rows: [{
|
var body_comprobante = {rows: [
|
||||||
cols: [
|
{view: 'datepicker', id: 'date_invoice', label: 'Fecha', format: '%d-%F-%Y',
|
||||||
|
required: true, invalidMessage: 'Selecciona una fecha', hidden: true
|
||||||
|
},
|
||||||
|
{cols: [
|
||||||
{
|
{
|
||||||
view: 'richselect',
|
view: 'richselect',
|
||||||
id: 'lst_tipo_comprobante',
|
id: 'lst_tipo_comprobante',
|
||||||
|
@ -515,8 +523,8 @@ var body_comprobante = {rows: [{
|
||||||
|
|
||||||
|
|
||||||
var opt_metodo_pago = [
|
var opt_metodo_pago = [
|
||||||
{id: 'PUE', value: 'Pago en una sola exhibición'},
|
{id: 'PUE', value: '[PUE] Pago en una sola exhibición'},
|
||||||
{id: 'PPD', value: 'Pago en parcialidades o diferido'}
|
{id: 'PPD', value: '[PPD] Pago en parcialidades o diferido'}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -596,6 +604,10 @@ var controls_generate = [
|
||||||
autowidth:true},
|
autowidth:true},
|
||||||
{view: 'label', id: 'lbl_client', name: 'lbl_client',
|
{view: 'label', id: 'lbl_client', name: 'lbl_client',
|
||||||
label: 'Ninguno'},
|
label: 'Ninguno'},
|
||||||
|
]},
|
||||||
|
{cols: [{
|
||||||
|
view: 'richselect', id: 'lst_invoice_client_regimen',
|
||||||
|
label: 'Regimen Fiscal: ', labelWidth: 150, options: []}
|
||||||
]}
|
]}
|
||||||
]}},
|
]}},
|
||||||
{view: 'fieldset', label: 'Buscar Producto', body: {rows: [
|
{view: 'fieldset', label: 'Buscar Producto', body: {rows: [
|
||||||
|
@ -833,20 +845,66 @@ var controls_leyendas_fiscales = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_transporte_internacional = [
|
var opt_ccp_transporte_internacional = [
|
||||||
{id: 'Sí', value: 'Sí'},
|
{id: 'Sí', value: 'Sí'},
|
||||||
{id: 'No', value: 'No'},
|
{id: 'No', value: 'No'},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_entrada_salida = [
|
var opt_ccp_regimen_aduanero = [
|
||||||
|
{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_origen_destino = [
|
var opt_ccp_pais_origen = [
|
||||||
|
{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'},
|
||||||
]
|
]
|
||||||
|
@ -861,12 +919,12 @@ var date_suggest = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var opt_countries = [
|
var opt_ccp_countries = [
|
||||||
{id: 'MEX', value: 'México'},
|
{id: 'MEX', value: 'México'},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_carta_estados = [
|
var opt_ccp_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'},
|
||||||
|
@ -903,18 +961,25 @@ var opt_carta_estados = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var grid_cols_carta_ubicaciones = [
|
var grid_cols_ccp_ubicaciones = [
|
||||||
{id: 'id', header: 'ID', hidden: true},
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
{id: 'delete', header: '', hidden: true, width: 30, css: 'delete'},
|
{id: 'delete', header: '', width: 30, css: 'delete'},
|
||||||
{id: 'TipoUbicacion', header: 'Tipo de Ubicación', editor: 'select', options: opt_origen_destino, fillspace: 1},
|
{id: 'TipoUbicacion', header: 'TipoUbicacion', editor: 'select', options: opt_ccp_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', headerd: 'Municipio', editor: 'text', fillspace: 1},
|
{id: 'Municipio', header: 'Municipio', editor: 'text', fillspace: 1},
|
||||||
{id: 'Estado', headerd: 'Estado', editor: 'select', options: opt_carta_estados, fillspace: 1},
|
{id: 'Estado', header: 'Estado', editor: 'select', options: opt_ccp_carta_estados, fillspace: 1},
|
||||||
{id: 'Pais', headerd: 'Pais', editor: 'select', options: opt_countries, fillspace: 1},
|
{id: 'Pais', header: 'País', editor: 'select', options: opt_ccp_countries, fillspace: 1},
|
||||||
{id: 'CodigoPostal', headerd: 'C.P.', editor: 'text', fillspace: 1},
|
{id: 'CodigoPostal', header: 'C.P.', editor: 'text', fillspace: 1},
|
||||||
]
|
]
|
||||||
//~ Calle
|
//~ Calle
|
||||||
//~ NumeroExterior
|
//~ NumeroExterior
|
||||||
|
@ -924,19 +989,29 @@ var grid_cols_carta_ubicaciones = [
|
||||||
//~ Referencia
|
//~ Referencia
|
||||||
|
|
||||||
|
|
||||||
var grid_cols_carta_mercancias = [
|
var grid_cols_ccp_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: 'ValorMercancia', header: 'Valor Mercancia', format: webix.i18n.priceFormat, css: 'right', 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: '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: 'Moneda', header: 'Moneda', editor: 'text', fillspace: 1},
|
||||||
|
//~ {id: 'FraccionArancelaria', header: 'FraccionArancelaria', editor: 'text', fillspace: 1},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_carta_tipo_permiso_sct = [
|
var opt_ccp_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.'},
|
||||||
|
@ -966,7 +1041,7 @@ var opt_carta_tipo_permiso_sct = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_config_auto = [
|
var opt_ccp_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)'},
|
||||||
|
@ -1005,7 +1080,7 @@ var opt_config_auto = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var opt_carta_tipo_remolque = [
|
var opt_ccp_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'},
|
||||||
|
@ -1041,27 +1116,42 @@ var opt_carta_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_carta_autotransporte = [
|
var grid_cols_ccp_autotransporte = [
|
||||||
{id: 'id', header: 'ID', hidden: true},
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
{id: 'PermSCT', header: 'Tipo Permiso SCT', editor: 'select', options: opt_carta_tipo_permiso_sct, fillspace: 1},
|
{id: 'PermSCT', header: 'PermSCT', editor: 'select', options: opt_ccp_tipo_permiso_sct, fillspace: 1},
|
||||||
{id: 'NumPermisoSCT', header: 'Número Permiso SCT', editor: 'text', fillspace: 1},
|
{id: 'NumPermisoSCT', header: 'NumPermisoSCT', editor: 'text', fillspace: 1},
|
||||||
{id: 'ConfigVehicular', header: 'Clave Autotransporte', editor: 'select', options: opt_config_auto, fillspace: 1},
|
{id: 'ConfigVehicular', header: 'ConfigVehicular', editor: 'select', options: opt_ccp_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_carta_tipo_remolque, fillspace: 1},
|
//~ {id: 'SubTipoRem', header: 'ST Remolque', editor: 'select', options: opt_ccp_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_tipos_figura = [
|
var opt_ccp_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'},
|
||||||
|
@ -1070,101 +1160,167 @@ var opt_tipos_figura = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
var grid_cols_carta_tipos_figuras = [
|
var grid_cols_ccp_tipos_figuras = [
|
||||||
{id: 'id', header: 'ID', hidden: true},
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
{id: 'TipoFigura', header: 'Tipo Figura', editor: 'select', options: opt_tipos_figura, fillspace: 1},
|
{id: 'TipoFigura', header: 'TipoFigura', editor: 'select', options: opt_ccp_tipos_figura, fillspace: 1},
|
||||||
{id: 'RFCFigura', header: 'RFC Figura', editor: 'text', fillspace: 1},
|
{id: 'RFCFigura', header: 'RFCFigura', editor: 'text', fillspace: 1},
|
||||||
{id: 'NombreFigura', header: 'Nombre Figura', editor: 'text', fillspace: 1},
|
{id: 'NumLicencia', header: 'NumLicencia', editor: 'text', fillspace: 1},
|
||||||
{id: 'NumLicencia', header: 'Número de Licencia', editor: 'text', fillspace: 1},
|
{id: 'NombreFigura', header: 'NombreFigura', 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_carta_ubicaciones = {
|
var grid_ccp_ubicaciones = {
|
||||||
view: 'datatable',
|
view: 'datatable',
|
||||||
id: 'grid_carta_ubicaciones',
|
id: 'grid_ccp_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_carta_ubicaciones,
|
columns: grid_cols_ccp_ubicaciones,
|
||||||
//~ data: data_tmp1,
|
|
||||||
data: [
|
|
||||||
{delete: '-', TipoUbicacion: 'Origen', Pais: 'MEX'},
|
|
||||||
{delete: '-', TipoUbicacion: 'Destino', Pais: 'MEX'},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var grid_carta_mercancias = {
|
var grid_ccp_mercancias = {
|
||||||
view: 'datatable',
|
view: 'datatable',
|
||||||
id: 'grid_carta_mercancias',
|
id: 'grid_ccp_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_carta_mercancias,
|
columns: grid_cols_ccp_mercancias,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var grid_carta_autotransporte = {
|
var grid_ccp_autotransporte = {
|
||||||
view: 'datatable',
|
view: 'datatable',
|
||||||
id: 'grid_carta_autotransporte',
|
id: 'grid_ccp_autotransporte',
|
||||||
multiselect: false,
|
multiselect: false,
|
||||||
adjust: true,
|
adjust: true,
|
||||||
autoheight: true,
|
autoheight: true,
|
||||||
headermenu: true,
|
headermenu: true,
|
||||||
editable: true,
|
editable: true,
|
||||||
columns: grid_cols_carta_autotransporte,
|
columns: grid_cols_ccp_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_carta_tipos_figuras',
|
id: 'grid_ccp_remolques',
|
||||||
multiselect: false,
|
multiselect: false,
|
||||||
adjust: true,
|
adjust: true,
|
||||||
autoheight: true,
|
autoheight: true,
|
||||||
headermenu: true,
|
headermenu: true,
|
||||||
editable: true,
|
editable: true,
|
||||||
columns: grid_cols_carta_tipos_figuras,
|
columns: grid_cols_ccp_remolques,
|
||||||
|
}
|
||||||
|
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 body_carta_mercancias = {rows:[
|
var grid_ccp_tipos_figuras = {
|
||||||
|
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_carta_add_product', label: 'Agregar Mercancía', icon: 'plus',
|
{view: 'button', id: 'cmd_ccp_agregar_ubicacion', label: 'Agregar Ubicación', 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_carta_mercancias,
|
grid_ccp_mercancias,
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
|
||||||
var body_carta_ubicaciones = {rows:[
|
var body_ccp_autotransporte = {rows:[
|
||||||
grid_carta_ubicaciones,
|
grid_ccp_autotransporte,
|
||||||
|
{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_carta_autotransporte = {rows:[
|
var body_ccp_tipos_figuras = {rows:[
|
||||||
grid_carta_autotransporte,
|
grid_ccp_tipos_figuras,
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
|
||||||
var body_carta_tipos_figuras = {rows:[
|
var body_cp_datos_generales = {rows:[
|
||||||
grid_carta_tipos_figuras,
|
{cols: [{maxWidth: 15},
|
||||||
|
{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},
|
||||||
|
{}]},
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1177,24 +1333,276 @@ 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: 'Mercancias', body: body_carta_mercancias},
|
{view: 'fieldset', label: 'Datos generales', body: body_cp_datos_generales},
|
||||||
|
{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_carta_TranspInternac', labelPosition: 'top',
|
{view: 'richselect', id: 'lst_ce_exportacion', label: 'Exportación: ',
|
||||||
label: 'Transporte Internacional', options: opt_transporte_internacional,
|
value: '02', labelWidth: 130, minWidth: 400, options: opt_ce_exportacion},
|
||||||
value: 'No', readonly: true},
|
{view: 'richselect', id: 'lst_ce_motivo_traslado', label: 'Motivo Traslado: ',
|
||||||
{view: 'richselect', id: 'lst_carta_EntradaSalidaMerc', labelPosition: 'top',
|
labelWidth: 130, minWidth: 500, options: opt_ce_motivo_traslado},
|
||||||
label: 'Entrada o Salida', options: opt_entrada_salida,
|
{},
|
||||||
value: '', disabled: true},
|
{maxWidth: 15}]},
|
||||||
{view: 'richselect', id: 'lst_carta_PaisOrigenDestino', labelPosition: 'top',
|
{cols: [{maxWidth: 15},
|
||||||
label: 'País Origen/Destino', options: [],
|
{view: 'richselect', id: 'lst_ce_clave_pedimento', label: 'Clave de Pedimento: ',
|
||||||
value: '', disabled: true},
|
value: 'A1', labelWidth: 130, minWidth: 400, maxWidth: 400, options: opt_ce_clave_pedimento},
|
||||||
{view: 'richselect', id: 'lst_carta_ViaEntradaSalida', labelPosition: 'top',
|
{view: 'richselect', id: 'lst_ce_certificado_origen', label: 'Certificado Origen: ',
|
||||||
label: 'Vía de Entrada o Salida', options: [],
|
value: '0', labelWidth: 130, maxWidth: 300, options: opt_ce_certificado_origen},
|
||||||
value: '', disabled: true},
|
{view: 'text', id: 'txt_ce_numero_certificado', label: 'Nº Certificado:', labelWidth: 100},
|
||||||
]},
|
{maxWidth: 15}]},
|
||||||
{view: 'fieldset', label: 'Ubicaciones', body: body_carta_ubicaciones},
|
{cols: [{maxWidth: 15},
|
||||||
{view: 'fieldset', label: 'Autotransporte', body: body_carta_autotransporte},
|
{view: 'text', id: 'txt_ce_numero_exportador', label: 'Nº Exportador: ',
|
||||||
{view: 'fieldset', label: 'Tipos Figura', body: body_carta_tipos_figuras},
|
labelWidth: 130, minWidth: 400, maxWidth: 500},
|
||||||
|
{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},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1211,6 +1619,19 @@ 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',
|
||||||
|
@ -1222,6 +1643,7 @@ 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]},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -1288,7 +1710,13 @@ var win_import_invoice = {
|
||||||
width: 400,
|
width: 400,
|
||||||
modal: true,
|
modal: true,
|
||||||
position: 'center',
|
position: 'center',
|
||||||
head: 'Importar Factura de Plantilla',
|
head: {view: 'toolbar',
|
||||||
|
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)
|
||||||
|
@ -1364,7 +1792,114 @@ 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)
|
||||||
|
}
|
||||||
|
}
|
|
@ -96,7 +96,7 @@ var controls_fiscales = [
|
||||||
{cols: [{view: 'text', id: 'no_interior', name: 'no_interior', width: 300,
|
{cols: [{view: 'text', id: 'no_interior', name: 'no_interior', width: 300,
|
||||||
label: 'No Interior: '},{}]},
|
label: 'No Interior: '},{}]},
|
||||||
{cols: [{view: 'search', id: 'codigo_postal', name: 'codigo_postal',
|
{cols: [{view: 'search', id: 'codigo_postal', name: 'codigo_postal',
|
||||||
width: 300, label: 'C.P.: ', attributes: {maxlength: 5}},{}]},
|
width: 300, label: 'C.P.: ', attributes: {maxlength: 5}, required: true},{}]},
|
||||||
{view: 'text', id: 'colonia', name: 'colonia', label: 'Colonia: '},
|
{view: 'text', id: 'colonia', name: 'colonia', label: 'Colonia: '},
|
||||||
{view: 'text', id: 'municipio', name: 'municipio', label: 'Municipio: '},
|
{view: 'text', id: 'municipio', name: 'municipio', label: 'Municipio: '},
|
||||||
{view: 'text', id: 'estado', name: 'estado', label: 'Estado: '},
|
{view: 'text', id: 'estado', name: 'estado', label: 'Estado: '},
|
||||||
|
@ -122,6 +122,12 @@ var controls_fiscales = [
|
||||||
{view: 'richselect', id: 'lst_uso_cfdi_socio', name: 'uso_cfdi_socio',
|
{view: 'richselect', id: 'lst_uso_cfdi_socio', name: 'uso_cfdi_socio',
|
||||||
label: 'Uso del CFDI', options: []},
|
label: 'Uso del CFDI', options: []},
|
||||||
{},
|
{},
|
||||||
|
]},
|
||||||
|
{template: 'Regimenes Fiscales', type: 'section'},
|
||||||
|
{cols: [
|
||||||
|
{view: 'list', id: 'lst_receptor_regimenes_fiscales', data: [],
|
||||||
|
select: 'multiselect', width: 600, height: 125, required: true},
|
||||||
|
{},
|
||||||
]}
|
]}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -159,7 +165,7 @@ var controls_others = [
|
||||||
label: 'Cuenta Proveedor: ', disabled: true}, {}]
|
label: 'Cuenta Proveedor: ', disabled: true}, {}]
|
||||||
},
|
},
|
||||||
{view: 'checkbox', name: 'es_ong', label: 'Es ONG: ', value: false},
|
{view: 'checkbox', name: 'es_ong', label: 'Es ONG: ', value: false},
|
||||||
{view: 'text', name: 'tags', label: 'Etiquetas',
|
{view: 'text', name: 'tags', label: 'Etiquetas', disabled: true,
|
||||||
tooltip: 'Utiles para filtrados rápidos. Separa por comas.'},
|
tooltip: 'Utiles para filtrados rápidos. Separa por comas.'},
|
||||||
{view: 'textarea' , height: 200, name: 'notas', label: 'Notas'},
|
{view: 'textarea' , height: 200, name: 'notas', label: 'Notas'},
|
||||||
]
|
]
|
||||||
|
|
|
@ -111,6 +111,15 @@ 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,
|
||||||
|
@ -141,13 +150,10 @@ 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: 'text', id: 'cant_by_packing', name: 'cant_by_packing',
|
{view: 'richselect', id: 'objeto_impuesto', name: 'objeto_impuesto', label: 'Objeto de Impuestos',
|
||||||
labelAlign: 'right', labelWidth: 150, inputAlign: "right",
|
width: 500, labelWidth: 150, labelAlign: "right", required: true,
|
||||||
label: 'Cantidad por empaque:'},
|
invalidMessage: 'Este campo es requerido', options: opt_tax_object},
|
||||||
{},
|
{},
|
||||||
//~ {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",
|
||||||
|
|
|
@ -235,7 +235,12 @@ 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 del día'}, {},
|
labelRight: 'Es Factura Global'},
|
||||||
|
{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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,347 +1,401 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xsl:stylesheet version="1.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:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:cce11="http://www.sat.gob.mx/ComercioExterior11" xmlns:donat="http://www.sat.gob.mx/donat" xmlns:divisas="http://www.sat.gob.mx/divisas" xmlns:implocal="http://www.sat.gob.mx/implocal" xmlns:leyendasFisc="http://www.sat.gob.mx/leyendasFiscales" xmlns:pfic="http://www.sat.gob.mx/pfic" xmlns:tpe="http://www.sat.gob.mx/TuristaPasajeroExtranjero" xmlns:nomina12="http://www.sat.gob.mx/nomina12" xmlns:registrofiscal="http://www.sat.gob.mx/registrofiscal" xmlns:pagoenespecie="http://www.sat.gob.mx/pagoenespecie" xmlns:aerolineas="http://www.sat.gob.mx/aerolineas" xmlns:valesdedespensa="http://www.sat.gob.mx/valesdedespensa" xmlns:consumodecombustibles="http://www.sat.gob.mx/consumodecombustibles" xmlns:notariospublicos="http://www.sat.gob.mx/notariospublicos" xmlns:vehiculousado="http://www.sat.gob.mx/vehiculousado" xmlns:servicioparcial="http://www.sat.gob.mx/servicioparcialconstruccion" xmlns:decreto="http://www.sat.gob.mx/renovacionysustitucionvehiculos" xmlns:destruccion="http://www.sat.gob.mx/certificadodestruccion" xmlns:obrasarte="http://www.sat.gob.mx/arteantiguedades" xmlns:ine="http://www.sat.gob.mx/ine" xmlns:iedu="http://www.sat.gob.mx/iedu" xmlns:ventavehiculos="http://www.sat.gob.mx/ventavehiculos" xmlns:terceros="http://www.sat.gob.mx/terceros" xmlns:pago10="http://www.sat.gob.mx/Pagos">
|
<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:cfdi="http://www.sat.gob.mx/cfd/4" xmlns:cce11="http://www.sat.gob.mx/ComercioExterior11" xmlns:donat="http://www.sat.gob.mx/donat" xmlns:divisas="http://www.sat.gob.mx/divisas" xmlns:implocal="http://www.sat.gob.mx/implocal" xmlns:leyendasFisc="http://www.sat.gob.mx/leyendasFiscales" xmlns:pfic="http://www.sat.gob.mx/pfic" xmlns:tpe="http://www.sat.gob.mx/TuristaPasajeroExtranjero" xmlns:nomina12="http://www.sat.gob.mx/nomina12" xmlns:registrofiscal="http://www.sat.gob.mx/registrofiscal" xmlns:pagoenespecie="http://www.sat.gob.mx/pagoenespecie" xmlns:aerolineas="http://www.sat.gob.mx/aerolineas" xmlns:valesdedespensa="http://www.sat.gob.mx/valesdedespensa" xmlns:notariospublicos="http://www.sat.gob.mx/notariospublicos" xmlns:vehiculousado="http://www.sat.gob.mx/vehiculousado" xmlns:servicioparcial="http://www.sat.gob.mx/servicioparcialconstruccion" xmlns:decreto="http://www.sat.gob.mx/renovacionysustitucionvehiculos" xmlns:destruccion="http://www.sat.gob.mx/certificadodestruccion" xmlns:obrasarte="http://www.sat.gob.mx/arteantiguedades" xmlns:ine="http://www.sat.gob.mx/ine" xmlns:iedu="http://www.sat.gob.mx/iedu" xmlns:ventavehiculos="http://www.sat.gob.mx/ventavehiculos" xmlns:detallista="http://www.sat.gob.mx/detallista" xmlns:ecc12="http://www.sat.gob.mx/EstadoDeCuentaCombustible12" xmlns:consumodecombustibles11="http://www.sat.gob.mx/ConsumoDeCombustibles11" xmlns:gceh="http://www.sat.gob.mx/GastosHidrocarburos10" xmlns:ieeh="http://www.sat.gob.mx/IngresosHidrocarburos10" xmlns:cartaporte20="http://www.sat.gob.mx/CartaPorte20" xmlns:pago20="http://www.sat.gob.mx/Pagos20">
|
||||||
|
|
||||||
<!-- Con el siguiente método se establece que la salida deberá ser en texto -->
|
<!-- Con el siguiente método se establece que la salida deberá ser en texto -->
|
||||||
<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="comercioexterior11.xslt"/>
|
<xsl:include href="nomina12.xslt"/>
|
||||||
<xsl:include href="leyendasFisc.xslt"/>
|
<xsl:include href="divisas.xslt"/>
|
||||||
<xsl:include href="nomina12.xslt"/>
|
<xsl:include href="ine11.xslt"/>
|
||||||
<xsl:include href="implocal.xslt"/>
|
<xsl:include href="iedu.xslt"/>
|
||||||
<xsl:include href="donat11.xslt"/>
|
<xsl:include href="leyendasFisc.xslt"/>
|
||||||
<xsl:include href="ine11.xslt"/>
|
<xsl:include href="cartaporte30.xslt"/>
|
||||||
<xsl:include href="iedu.xslt"/>
|
<xsl:include href="comercioexterior20.xslt"/>
|
||||||
<xsl:include href="pagos10.xslt"/>
|
<xsl:include href="donat11.xslt"/>
|
||||||
<xsl:include href="divisas.xslt"/>
|
<xsl:include href="pagos20.xslt"/>
|
||||||
<xsl:include href="servicioconstruccion.xslt"/>
|
<xsl:include href="implocal.xslt"/>
|
||||||
<xsl:include href="cartaporte20.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="ecc11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xslt"/>
|
||||||
<xsl:include href="pfic.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pagoenespecie/pagoenespecie.xslt"/>
|
||||||
<xsl:include href="TuristaPasajeroExtranjero.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/aerolineas/aerolineas.xslt"/>
|
||||||
<xsl:include href="cfdiregistrofiscal.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/valesdedespensa/valesdedespensa.xslt"/>
|
||||||
<xsl:include href="pagoenespecie.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/notariospublicos/notariospublicos.xslt"/>
|
||||||
<xsl:include href="aerolineas.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/vehiculousado/vehiculousado.xslt"/>
|
||||||
<xsl:include href="valesdedespensa.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/servicioparcialconstruccion/servicioparcialconstruccion.xslt"/>
|
||||||
<xsl:include href="consumodecombustibles.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/renovacionysustitucionvehiculos/renovacionysustitucionvehiculos.xslt"/>
|
||||||
<xsl:include href="notariospublicos.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/certificadodestruccion/certificadodedestruccion.xslt"/>
|
||||||
<xsl:include href="vehiculousado.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/arteantiguedades/obrasarteantiguedades.xslt"/>
|
||||||
<xsl:include href="servicioparcialconstruccion.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ventavehiculos/ventavehiculos11.xslt"/>
|
||||||
<xsl:include href="renovacionysustitucionvehiculos.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/detallista/detallista.xslt"/>
|
||||||
<xsl:include href="certificadodedestruccion.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc12.xslt"/>
|
||||||
<xsl:include href="obrasarteantiguedades.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/consumodecombustibles/consumodeCombustibles11.xslt"/>
|
||||||
<xsl:include href="ventavehiculos11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/GastosHidrocarburos10/GastosHidrocarburos10.xslt"/>
|
||||||
<xsl:include href="terceros11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/IngresosHidrocarburos10/IngresosHidrocarburos.xslt"/>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!-- Aquí iniciamos el procesamiento de la cadena original con su | inicial y el terminador || -->
|
||||||
<!-- Aquí iniciamos el procesamiento de la cadena original con su | inicial y el terminador || -->
|
<xsl:template match="/">|<xsl:apply-templates select="/cfdi:Comprobante"/>||</xsl:template>
|
||||||
<xsl:template match="/">|<xsl:apply-templates select="/cfdi:Comprobante"/>||</xsl:template>
|
<!-- Aquí iniciamos el procesamiento de los datos incluidos en el comprobante -->
|
||||||
<!-- Aquí iniciamos el procesamiento de los datos incluidos en el comprobante -->
|
<xsl:template match="cfdi:Comprobante">
|
||||||
<xsl:template match="cfdi:Comprobante">
|
<!-- Iniciamos el tratamiento de los atributos de comprobante -->
|
||||||
<!-- Iniciamos el tratamiento de los atributos de comprobante -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Version"/>
|
||||||
<xsl:with-param name="valor" select="./@Version"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Serie"/>
|
||||||
<xsl:with-param name="valor" select="./@Serie"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Folio"/>
|
||||||
<xsl:with-param name="valor" select="./@Folio"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Fecha"/>
|
||||||
<xsl:with-param name="valor" select="./@Fecha"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@FormaPago"/>
|
||||||
<xsl:with-param name="valor" select="./@FormaPago"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@NoCertificado"/>
|
||||||
<xsl:with-param name="valor" select="./@NoCertificado"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@CondicionesDePago"/>
|
||||||
<xsl:with-param name="valor" select="./@CondicionesDePago"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@SubTotal"/>
|
||||||
<xsl:with-param name="valor" select="./@SubTotal"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Descuento"/>
|
||||||
<xsl:with-param name="valor" select="./@Descuento"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Moneda"/>
|
||||||
<xsl:with-param name="valor" select="./@Moneda"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@TipoCambio"/>
|
||||||
<xsl:with-param name="valor" select="./@TipoCambio"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Total"/>
|
||||||
<xsl:with-param name="valor" select="./@Total"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@TipoDeComprobante"/>
|
||||||
<xsl:with-param name="valor" select="./@TipoDeComprobante"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Exportacion"/>
|
||||||
<xsl:with-param name="valor" select="./@MetodoPago"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@MetodoPago"/>
|
||||||
<xsl:with-param name="valor" select="./@LugarExpedicion"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@LugarExpedicion"/>
|
||||||
<xsl:with-param name="valor" select="./@Confirmacion"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<!--
|
<xsl:with-param name="valor" select="./@Confirmacion"/>
|
||||||
Llamadas para procesar al los sub nodos del comprobante
|
</xsl:call-template>
|
||||||
-->
|
<!--
|
||||||
<xsl:apply-templates select="./cfdi:CfdiRelacionados"/>
|
Llamadas para procesar al los sub nodos del comprobante
|
||||||
<xsl:apply-templates select="./cfdi:Emisor"/>
|
-->
|
||||||
<xsl:apply-templates select="./cfdi:Receptor"/>
|
<xsl:apply-templates select="./cfdi:InformacionGlobal"/>
|
||||||
<xsl:apply-templates select="./cfdi:Conceptos"/>
|
<xsl:apply-templates select="./cfdi:CfdiRelacionados"/>
|
||||||
<xsl:apply-templates select="./cfdi:Impuestos"/>
|
<xsl:apply-templates select="./cfdi:Emisor"/>
|
||||||
<xsl:for-each select="./cfdi:Complemento">
|
<xsl:apply-templates select="./cfdi:Receptor"/>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:apply-templates select="./cfdi:Conceptos"/>
|
||||||
</xsl:for-each>
|
<xsl:apply-templates select="./cfdi:Impuestos"/>
|
||||||
</xsl:template>
|
<xsl:for-each select="./cfdi:Complemento">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
<!-- Manejador de nodos tipo CFDIRelacionados -->
|
</xsl:for-each>
|
||||||
<xsl:template match="cfdi:CfdiRelacionados">
|
</xsl:template>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del CFDIRelacionados -->
|
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejador de nodos tipo InformacionGlobal -->
|
||||||
<xsl:with-param name="valor" select="./@TipoRelacion"/>
|
<xsl:template match="cfdi:InformacionGlobal">
|
||||||
</xsl:call-template>
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo InformacionGlobal -->
|
||||||
<xsl:for-each select="./cfdi:CfdiRelacionado">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Periodicidad"/>
|
||||||
<xsl:with-param name="valor" select="./@UUID"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:for-each>
|
<xsl:with-param name="valor" select="./@Meses"/>
|
||||||
</xsl:template>
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejador de nodos tipo Emisor -->
|
<xsl:with-param name="valor" select="./@Año"/>
|
||||||
<xsl:template match="cfdi:Emisor">
|
</xsl:call-template>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Emisor -->
|
</xsl:template>
|
||||||
<xsl:call-template name="Requerido">
|
|
||||||
<xsl:with-param name="valor" select="./@Rfc"/>
|
<!-- Manejador de nodos tipo CFDIRelacionados -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:CfdiRelacionados">
|
||||||
<xsl:call-template name="Opcional">
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo CFDIRelacionados -->
|
||||||
<xsl:with-param name="valor" select="./@Nombre"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@TipoRelacion"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@RegimenFiscal"/>
|
<xsl:for-each select="./cfdi:CfdiRelacionado">
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:template>
|
<xsl:with-param name="valor" select="./@UUID"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejador de nodos tipo Receptor -->
|
</xsl:for-each>
|
||||||
<xsl:template match="cfdi:Receptor">
|
</xsl:template>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Receptor -->
|
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejador de nodos tipo Emisor -->
|
||||||
<xsl:with-param name="valor" select="./@Rfc"/>
|
<xsl:template match="cfdi:Emisor">
|
||||||
</xsl:call-template>
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo Emisor -->
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Nombre"/>
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@ResidenciaFiscal"/>
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@NumRegIdTrib"/>
|
<xsl:with-param name="valor" select="./@RegimenFiscal"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@UsoCFDI"/>
|
<xsl:with-param name="valor" select="./@FacAtrAdquirente"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
</xsl:template>
|
|
||||||
|
<!-- Manejador de nodos tipo Receptor -->
|
||||||
<!-- Manejador de nodos tipo Conceptos -->
|
<xsl:template match="cfdi:Receptor">
|
||||||
<xsl:template match="cfdi:Conceptos">
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo Receptor -->
|
||||||
<!-- Llamada para procesar los distintos nodos tipo Concepto -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select="./cfdi:Concepto">
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:template>
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!--Manejador de nodos tipo Concepto-->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:template match="cfdi:Concepto">
|
<xsl:with-param name="valor" select="./@DomicilioFiscalReceptor"/>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Concepto -->
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
<xsl:with-param name="valor" select="./@ResidenciaFiscal"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
<xsl:with-param name="valor" select="./@NumRegIdTrib"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Cantidad"/>
|
<xsl:with-param name="valor" select="./@RegimenFiscalReceptor"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@ClaveUnidad"/>
|
<xsl:with-param name="valor" select="./@UsoCFDI"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
|
||||||
<xsl:with-param name="valor" select="./@Unidad"/>
|
</xsl:template>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejador de nodos tipo Conceptos -->
|
||||||
<xsl:with-param name="valor" select="./@Descripcion"/>
|
<xsl:template match="cfdi:Conceptos">
|
||||||
</xsl:call-template>
|
<!-- Llamada para procesar los distintos nodos tipo Concepto -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:for-each select="./cfdi:Concepto">
|
||||||
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
<xsl:apply-templates select="."/>
|
||||||
</xsl:call-template>
|
</xsl:for-each>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:template>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
|
||||||
</xsl:call-template>
|
<!--Manejador de nodos tipo Concepto-->
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:template match="cfdi:Concepto">
|
||||||
<xsl:with-param name="valor" select="./@Descuento"/>
|
<!-- Iniciamos el tratamiento de los atributos del Concepto -->
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
<!-- Manejo de sub nodos de información Traslado de Conceptos:Concepto:Impuestos:Traslados-->
|
</xsl:call-template>
|
||||||
<xsl:for-each select="./cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
<xsl:with-param name="valor" select="./@Base"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Cantidad"/>
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@ClaveUnidad"/>
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Unidad"/>
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:with-param name="valor" select="./@Descripcion"/>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:for-each>
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejo de sub nodos de Retencion por cada una de los Conceptos:Concepto:Impuestos:Retenciones-->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select="./cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion">
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Base"/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Descuento"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@ObjetoImp"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
|
||||||
</xsl:call-template>
|
<!-- Manejo de sub nodos de información Traslado de Conceptos:Concepto:Impuestos:Traslados-->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado">
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
</xsl:for-each>
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejo de los distintos sub nodos de información aduanera de forma indistinta a su grado de dependencia -->
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
<xsl:for-each select="./cfdi:InformacionAduanera">
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:for-each>
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Llamada al manejador de nodos de CuentaPredial en caso de existir -->
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:if test="./cfdi:CuentaPredial">
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
<xsl:apply-templates select="./cfdi:CuentaPredial"/>
|
</xsl:call-template>
|
||||||
</xsl:if>
|
</xsl:for-each>
|
||||||
|
|
||||||
<!-- Llamada al manejador de nodos de ComplementoConcepto en caso de existir -->
|
<!-- Manejo de sub nodos de Retencion por cada una de los Conceptos:Concepto:Impuestos:Retenciones-->
|
||||||
<xsl:if test="./cfdi:ComplementoConcepto">
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion">
|
||||||
<xsl:apply-templates select="./cfdi:ComplementoConcepto"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:if>
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Llamada al manejador de nodos de Parte en caso de existir -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select=".//cfdi:Parte">
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:template>
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejador de nodos tipo Información Aduanera -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:template match="cfdi:InformacionAduanera">
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
<!-- Manejo de los atributos de la información aduanera -->
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@NumeroPedimento"/>
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:for-each>
|
||||||
|
|
||||||
<!-- Manejador de nodos tipo Información CuentaPredial -->
|
<!-- Manejo de los distintos sub nodos a cuenta de terceros de forma indistinta a su grado de dependencia -->
|
||||||
<xsl:template match="cfdi:CuentaPredial">
|
<xsl:for-each select="./cfdi:ACuentaTerceros">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:with-param name="valor" select="./@Numero"/>
|
</xsl:for-each>
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:template>
|
<!-- Manejo de los distintos sub nodos de información aduanera de forma indistinta a su grado de dependencia -->
|
||||||
|
<xsl:for-each select="./cfdi:InformacionAduanera">
|
||||||
<!-- Manejador de nodos tipo ComplementoConcepto -->
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:template match="cfdi:ComplementoConcepto">
|
</xsl:for-each>
|
||||||
<xsl:for-each select="./*">
|
|
||||||
<xsl:apply-templates select="."/>
|
<!-- Llamada al manejador de nodos de CuentaPredial en caso de existir -->
|
||||||
</xsl:for-each>
|
<xsl:if test="./cfdi:CuentaPredial">
|
||||||
</xsl:template>
|
<xsl:apply-templates select="./cfdi:CuentaPredial"/>
|
||||||
|
</xsl:if>
|
||||||
<!-- Manejador de nodos tipo Parte -->
|
|
||||||
<xsl:template match="cfdi:Parte">
|
<!-- Llamada al manejador de nodos de ComplementoConcepto en caso de existir -->
|
||||||
<!-- Iniciamos el tratamiento de los atributos de Parte-->
|
<xsl:if test="./cfdi:ComplementoConcepto">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:apply-templates select="./cfdi:ComplementoConcepto"/>
|
||||||
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
</xsl:if>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Opcional">
|
<!-- Llamada al manejador de nodos de Parte en caso de existir -->
|
||||||
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
<xsl:for-each select=".//cfdi:Parte">
|
||||||
</xsl:call-template>
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:for-each>
|
||||||
<xsl:with-param name="valor" select="./@Cantidad"/>
|
</xsl:template>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Opcional">
|
<!-- Manejador de nodos tipo ACuentaTerceros -->
|
||||||
<xsl:with-param name="valor" select="./@Unidad"/>
|
<xsl:template match="cfdi:ACuentaTerceros">
|
||||||
</xsl:call-template>
|
<!-- Manejo de los atributos del nodo tipo ACuentaTerceros -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Descripcion"/>
|
<xsl:with-param name="valor" select="./@RfcACuentaTerceros"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
<xsl:with-param name="valor" select="./@NombreACuentaTerceros"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:with-param name="valor" select="./@RegimenFiscalACuentaTerceros"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejador de nodos tipo InformacionAduanera-->
|
<xsl:with-param name="valor" select="./@DomicilioFiscalACuentaTerceros"/>
|
||||||
<xsl:for-each select=".//cfdi:InformacionAduanera">
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:template>
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:template>
|
<!-- Manejador de nodos tipo Información Aduanera -->
|
||||||
|
<xsl:template match="cfdi:InformacionAduanera">
|
||||||
<!-- Manejador de nodos tipo Complemento -->
|
<!-- Manejo de los atributos de la información aduanera -->
|
||||||
<xsl:template match="cfdi:Complemento">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select="./*">
|
<xsl:with-param name="valor" select="./@NumeroPedimento"/>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
</xsl:template>
|
||||||
</xsl:template>
|
|
||||||
|
<!-- Manejador de nodos tipo Información CuentaPredial -->
|
||||||
<!-- Manejador de nodos tipo Domicilio fiscal -->
|
<xsl:template match="cfdi:CuentaPredial">
|
||||||
<xsl:template match="cfdi:Impuestos">
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejo de sub nodos de Retencion por cada una de los Impuestos:Retenciones-->
|
<xsl:with-param name="valor" select="./@Numero"/>
|
||||||
<xsl:for-each select="./cfdi:Retenciones/cfdi:Retencion">
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:template>
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
|
||||||
</xsl:call-template>
|
<!-- Manejador de nodos tipo ComplementoConcepto -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:template match="cfdi:ComplementoConcepto">
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:for-each select="./*">
|
||||||
</xsl:call-template>
|
<xsl:apply-templates select="."/>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosRetenidos-->
|
</xsl:template>
|
||||||
<xsl:call-template name="Opcional">
|
|
||||||
<xsl:with-param name="valor" select="./@TotalImpuestosRetenidos"/>
|
<!-- Manejador de nodos tipo Parte -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:Parte">
|
||||||
<!-- Manejo de sub nodos de información Traslado de Impuestos:Traslados-->
|
<!-- Iniciamos el tratamiento de los atributos de Parte-->
|
||||||
<xsl:for-each select="./cfdi:Traslados/cfdi:Traslado">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Cantidad"/>
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Unidad"/>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:for-each>
|
<xsl:with-param name="valor" select="./@Descripcion"/>
|
||||||
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosTrasladados-->
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@TotalImpuestosTrasladados"/>
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:stylesheet>
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo InformacionAduanera-->
|
||||||
|
<xsl:for-each select=".//cfdi:InformacionAduanera">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Complemento -->
|
||||||
|
<xsl:template match="cfdi:Complemento">
|
||||||
|
<xsl:for-each select="./*">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Domicilio fiscal -->
|
||||||
|
<xsl:template match="cfdi:Impuestos">
|
||||||
|
<!-- Manejo de sub nodos de Retencion por cada una de los Impuestos:Retenciones-->
|
||||||
|
<xsl:for-each select="./cfdi:Retenciones/cfdi:Retencion">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosRetenidos-->
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalImpuestosRetenidos"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<!-- Manejo de sub nodos de información Traslado de Impuestos:Traslados-->
|
||||||
|
<xsl:for-each select="./cfdi:Traslados/cfdi:Traslado">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosTrasladados-->
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalImpuestosTrasladados"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -0,0 +1,347 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet version="1.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:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:cce11="http://www.sat.gob.mx/ComercioExterior11" xmlns:donat="http://www.sat.gob.mx/donat" xmlns:divisas="http://www.sat.gob.mx/divisas" xmlns:implocal="http://www.sat.gob.mx/implocal" xmlns:leyendasFisc="http://www.sat.gob.mx/leyendasFiscales" xmlns:pfic="http://www.sat.gob.mx/pfic" xmlns:tpe="http://www.sat.gob.mx/TuristaPasajeroExtranjero" xmlns:nomina12="http://www.sat.gob.mx/nomina12" xmlns:registrofiscal="http://www.sat.gob.mx/registrofiscal" xmlns:pagoenespecie="http://www.sat.gob.mx/pagoenespecie" xmlns:aerolineas="http://www.sat.gob.mx/aerolineas" xmlns:valesdedespensa="http://www.sat.gob.mx/valesdedespensa" xmlns:consumodecombustibles="http://www.sat.gob.mx/consumodecombustibles" xmlns:notariospublicos="http://www.sat.gob.mx/notariospublicos" xmlns:vehiculousado="http://www.sat.gob.mx/vehiculousado" xmlns:servicioparcial="http://www.sat.gob.mx/servicioparcialconstruccion" xmlns:decreto="http://www.sat.gob.mx/renovacionysustitucionvehiculos" xmlns:destruccion="http://www.sat.gob.mx/certificadodestruccion" xmlns:obrasarte="http://www.sat.gob.mx/arteantiguedades" xmlns:ine="http://www.sat.gob.mx/ine" xmlns:iedu="http://www.sat.gob.mx/iedu" xmlns:ventavehiculos="http://www.sat.gob.mx/ventavehiculos" xmlns:terceros="http://www.sat.gob.mx/terceros" xmlns:pago10="http://www.sat.gob.mx/Pagos">
|
||||||
|
|
||||||
|
<!-- Con el siguiente método se establece que la salida deberá ser en texto -->
|
||||||
|
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
|
||||||
|
|
||||||
|
<xsl:include href="utilerias.xslt"/>
|
||||||
|
<xsl:include href="comercioexterior11.xslt"/>
|
||||||
|
<xsl:include href="leyendasFisc.xslt"/>
|
||||||
|
<xsl:include href="nomina12.xslt"/>
|
||||||
|
<xsl:include href="implocal.xslt"/>
|
||||||
|
<xsl:include href="donat11.xslt"/>
|
||||||
|
<xsl:include href="ine11.xslt"/>
|
||||||
|
<xsl:include href="iedu.xslt"/>
|
||||||
|
<xsl:include href="pagos10.xslt"/>
|
||||||
|
<xsl:include href="divisas.xslt"/>
|
||||||
|
<xsl:include href="servicioconstruccion.xslt"/>
|
||||||
|
<xsl:include href="cartaporte20.xslt"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<xsl:include href="ecc11.xslt"/>
|
||||||
|
<xsl:include href="pfic.xslt"/>
|
||||||
|
<xsl:include href="TuristaPasajeroExtranjero.xslt"/>
|
||||||
|
<xsl:include href="cfdiregistrofiscal.xslt"/>
|
||||||
|
<xsl:include href="pagoenespecie.xslt"/>
|
||||||
|
<xsl:include href="aerolineas.xslt"/>
|
||||||
|
<xsl:include href="valesdedespensa.xslt"/>
|
||||||
|
<xsl:include href="consumodecombustibles.xslt"/>
|
||||||
|
<xsl:include href="notariospublicos.xslt"/>
|
||||||
|
<xsl:include href="vehiculousado.xslt"/>
|
||||||
|
<xsl:include href="servicioparcialconstruccion.xslt"/>
|
||||||
|
<xsl:include href="renovacionysustitucionvehiculos.xslt"/>
|
||||||
|
<xsl:include href="certificadodedestruccion.xslt"/>
|
||||||
|
<xsl:include href="obrasarteantiguedades.xslt"/>
|
||||||
|
<xsl:include href="ventavehiculos11.xslt"/>
|
||||||
|
<xsl:include href="terceros11.xslt"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Aquí iniciamos el procesamiento de la cadena original con su | inicial y el terminador || -->
|
||||||
|
<xsl:template match="/">|<xsl:apply-templates select="/cfdi:Comprobante"/>||</xsl:template>
|
||||||
|
<!-- Aquí iniciamos el procesamiento de los datos incluidos en el comprobante -->
|
||||||
|
<xsl:template match="cfdi:Comprobante">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de comprobante -->
|
||||||
|
<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="./@Serie"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Folio"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Fecha"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@FormaPago"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@NoCertificado"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@CondicionesDePago"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@SubTotal"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Descuento"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Moneda"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoCambio"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Total"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoDeComprobante"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@MetodoPago"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@LugarExpedicion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Confirmacion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<!--
|
||||||
|
Llamadas para procesar al los sub nodos del comprobante
|
||||||
|
-->
|
||||||
|
<xsl:apply-templates select="./cfdi:CfdiRelacionados"/>
|
||||||
|
<xsl:apply-templates select="./cfdi:Emisor"/>
|
||||||
|
<xsl:apply-templates select="./cfdi:Receptor"/>
|
||||||
|
<xsl:apply-templates select="./cfdi:Conceptos"/>
|
||||||
|
<xsl:apply-templates select="./cfdi:Impuestos"/>
|
||||||
|
<xsl:for-each select="./cfdi:Complemento">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo CFDIRelacionados -->
|
||||||
|
<xsl:template match="cfdi:CfdiRelacionados">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del CFDIRelacionados -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoRelacion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:for-each select="./cfdi:CfdiRelacionado">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@UUID"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Emisor -->
|
||||||
|
<xsl:template match="cfdi:Emisor">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del Emisor -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@RegimenFiscal"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Receptor -->
|
||||||
|
<xsl:template match="cfdi:Receptor">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del Receptor -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
|
</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="./@NumRegIdTrib"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@UsoCFDI"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Conceptos -->
|
||||||
|
<xsl:template match="cfdi:Conceptos">
|
||||||
|
<!-- Llamada para procesar los distintos nodos tipo Concepto -->
|
||||||
|
<xsl:for-each select="./cfdi:Concepto">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--Manejador de nodos tipo Concepto-->
|
||||||
|
<xsl:template match="cfdi:Concepto">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del Concepto -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
|
</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="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Descripcion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Descuento"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Manejo de sub nodos de información Traslado de Conceptos:Concepto:Impuestos:Traslados-->
|
||||||
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Manejo de sub nodos de Retencion por cada una de los Conceptos:Concepto:Impuestos:Retenciones-->
|
||||||
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Manejo de los distintos sub nodos de información aduanera de forma indistinta a su grado de dependencia -->
|
||||||
|
<xsl:for-each select="./cfdi:InformacionAduanera">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Llamada al manejador de nodos de CuentaPredial en caso de existir -->
|
||||||
|
<xsl:if test="./cfdi:CuentaPredial">
|
||||||
|
<xsl:apply-templates select="./cfdi:CuentaPredial"/>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<!-- Llamada al manejador de nodos de ComplementoConcepto en caso de existir -->
|
||||||
|
<xsl:if test="./cfdi:ComplementoConcepto">
|
||||||
|
<xsl:apply-templates select="./cfdi:ComplementoConcepto"/>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<!-- Llamada al manejador de nodos de Parte en caso de existir -->
|
||||||
|
<xsl:for-each select=".//cfdi:Parte">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Información Aduanera -->
|
||||||
|
<xsl:template match="cfdi:InformacionAduanera">
|
||||||
|
<!-- Manejo de los atributos de la información aduanera -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@NumeroPedimento"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Información CuentaPredial -->
|
||||||
|
<xsl:template match="cfdi:CuentaPredial">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Numero"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo ComplementoConcepto -->
|
||||||
|
<xsl:template match="cfdi:ComplementoConcepto">
|
||||||
|
<xsl:for-each select="./*">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Parte -->
|
||||||
|
<xsl:template match="cfdi:Parte">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de Parte-->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Cantidad"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Unidad"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Descripcion"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo InformacionAduanera-->
|
||||||
|
<xsl:for-each select=".//cfdi:InformacionAduanera">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Complemento -->
|
||||||
|
<xsl:template match="cfdi:Complemento">
|
||||||
|
<xsl:for-each select="./*">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de nodos tipo Domicilio fiscal -->
|
||||||
|
<xsl:template match="cfdi:Impuestos">
|
||||||
|
<!-- Manejo de sub nodos de Retencion por cada una de los Impuestos:Retenciones-->
|
||||||
|
<xsl:for-each select="./cfdi:Retenciones/cfdi:Retencion">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosRetenidos-->
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalImpuestosRetenidos"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<!-- Manejo de sub nodos de información Traslado de Impuestos:Traslados-->
|
||||||
|
<xsl:for-each select="./cfdi:Traslados/cfdi:Traslado">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosTrasladados-->
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalImpuestosTrasladados"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
|
@ -0,0 +1,744 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,171 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,233 @@
|
||||||
|
<?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:pago20="http://www.sat.gob.mx/Pagos20">
|
||||||
|
|
||||||
|
<xsl:template match="pago20:Pagos">
|
||||||
|
<!--Manejador de Atributos Pagos-->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Version" />
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el manejo de los elementos de tipo Totales. -->
|
||||||
|
<xsl:for-each select="./pago20:Totales">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Iniciamos el manejo de los elementos de tipo Pago. -->
|
||||||
|
<xsl:for-each select="./pago20:Pago">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:Totales. -->
|
||||||
|
<xsl:template match="pago20:Totales">
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalRetencionesIVA" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalRetencionesISR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalRetencionesIEPS" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosBaseIVA16" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosImpuestoIVA16" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosBaseIVA8" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosImpuestoIVA8" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosBaseIVA0" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosImpuestoIVA0" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TotalTrasladosBaseIVAExento" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@MontoTotalPagos" />
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:Pago -->
|
||||||
|
<xsl:template match="pago20:Pago">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@FechaPago" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@FormaDePagoP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@MonedaP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoCambioP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Monto" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@NumOperacion" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@RfcEmisorCtaOrd" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@NomBancoOrdExt" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@CtaOrdenante" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@RfcEmisorCtaBen" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@CtaBeneficiario" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoCadPago" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@CertPago" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@CadPago" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@SelloPago" />
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:DocumentoRelacionado. -->
|
||||||
|
<xsl:for-each select="./pago20:DoctoRelacionado">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:ImpuestosP. -->
|
||||||
|
<xsl:for-each select="./pago20:ImpuestosP">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:DoctoRelacionado. -->
|
||||||
|
<xsl:template match="pago20:DoctoRelacionado">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@IdDocumento" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Serie" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@Folio" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@MonedaDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@EquivalenciaDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@NumParcialidad" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpSaldoAnt" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpPagado" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpSaldoInsoluto" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ObjetoImpDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del subnodo ImpuestosDR-RetencionesDR-RetencionDR. -->
|
||||||
|
<xsl:for-each select="./pago20:ImpuestosDR/pago20:RetencionesDR/pago20:RetencionDR">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@BaseDR"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpuestoDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactorDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuotaDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImporteDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos del subnodo ImpuestosDR-TrasladosDR-TrasladoDR. -->
|
||||||
|
<xsl:for-each select="./pago20:ImpuestosDR/pago20:TrasladosDR/pago20:TrasladoDR">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@BaseDR"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpuestoDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactorDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuotaDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@ImporteDR" />
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de pago20:ImpuestosP. -->
|
||||||
|
<xsl:template match="pago20:ImpuestosP">
|
||||||
|
<xsl:apply-templates select="./pago20:RetencionesP"/>
|
||||||
|
<xsl:apply-templates select="./pago20:TrasladosP"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="pago20:RetencionesP">
|
||||||
|
<xsl:for-each select="./pago20:RetencionP">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="pago20:TrasladosP">
|
||||||
|
<xsl:for-each select="./pago20:TrasladoP">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="pago20:RetencionP">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpuestoP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImporteP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="pago20:TrasladoP">
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@BaseP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ImpuestoP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactorP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuotaP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@ImporteP" />
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
|
@ -1,22 +1,22 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xsl:stylesheet version="1.1" 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">
|
<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">
|
||||||
|
|
||||||
<!-- Manejador de datos requeridos -->
|
<!-- Manejador de datos requeridos -->
|
||||||
<xsl:template name="Requerido">
|
<xsl:template name="Requerido">
|
||||||
<xsl:param name="valor"/>|<xsl:call-template name="ManejaEspacios">
|
<xsl:param name="valor"/>|<xsl:call-template name="ManejaEspacios">
|
||||||
<xsl:with-param name="s" select="$valor"/>
|
<xsl:with-param name="s" select="$valor"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Manejador de datos opcionales -->
|
<!-- Manejador de datos opcionales -->
|
||||||
<xsl:template name="Opcional">
|
<xsl:template name="Opcional">
|
||||||
<xsl:param name="valor"/>
|
<xsl:param name="valor"/>
|
||||||
<xsl:if test="$valor">|<xsl:call-template name="ManejaEspacios"><xsl:with-param name="s" select="$valor"/></xsl:call-template></xsl:if>
|
<xsl:if test="$valor">|<xsl:call-template name="ManejaEspacios"><xsl:with-param name="s" select="$valor"/></xsl:call-template></xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Normalizador de espacios en blanco -->
|
<!-- Normalizador de espacios en blanco -->
|
||||||
<xsl:template name="ManejaEspacios">
|
<xsl:template name="ManejaEspacios">
|
||||||
<xsl:param name="s"/>
|
<xsl:param name="s"/>
|
||||||
<xsl:value-of select="normalize-space(string($s))"/>
|
<xsl:value-of select="normalize-space(string($s))"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet version="1.1" 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">
|
||||||
|
|
||||||
|
<!-- Manejador de datos requeridos -->
|
||||||
|
<xsl:template name="Requerido">
|
||||||
|
<xsl:param name="valor"/>|<xsl:call-template name="ManejaEspacios">
|
||||||
|
<xsl:with-param name="s" select="$valor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Manejador de datos opcionales -->
|
||||||
|
<xsl:template name="Opcional">
|
||||||
|
<xsl:param name="valor"/>
|
||||||
|
<xsl:if test="$valor">|<xsl:call-template name="ManejaEspacios"><xsl:with-param name="s" select="$valor"/></xsl:call-template></xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Normalizador de espacios en blanco -->
|
||||||
|
<xsl:template name="ManejaEspacios">
|
||||||
|
<xsl:param name="s"/>
|
||||||
|
<xsl:value-of select="normalize-space(string($s))"/>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
Loading…
Reference in New Issue