Compare commits
445 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 | 670aca3886 | |
El Mau | 68c0203039 | |
El Mau | b2cdd0efbe | |
El Mau | 51af15f311 | |
El Mau | edf35aa5ce | |
El Mau | b19d087d10 | |
El Mau | 64ef75fbf5 | |
El Mau | d6a8c1e3fa | |
El Mau | a7080bf954 | |
El Mau | 3ddf99075e | |
El Mau | bd6ba5d4d0 | |
El Mau | 6a18934b19 | |
El Mau | 61548c9135 | |
El Mau | fe3f743e32 | |
El Mau | c83e6981ae | |
El Mau | 39b9af125c | |
El Mau | dd606be46b | |
El Mau | 34df8882b3 | |
El Mau | e992103c57 | |
El Mau | 8f74d24b14 | |
El Mau | 480ec57d1e | |
El Mau | a38247727c | |
El Mau | 702aa264d8 | |
El Mau | 0422eece40 | |
El Mau | 12774af7ac | |
El Mau | b16eabd773 | |
El Mau | 1bab1cb23c | |
El Mau | 15a05e38f7 | |
El Mau | a0a8e0ce62 | |
El Mau | 825e23e369 | |
El Mau | 121831a139 | |
El Mau | c09a5749da | |
El Mau | 01ccbcabd5 | |
El Mau | cc0eee1443 | |
El Mau | 7a88c4b97f | |
El Mau | 0e7db2b711 | |
El Mau | 65851182c3 | |
El Mau | 2de98b9b92 | |
El Mau | 5a24bc159d | |
El Mau | f84721716c | |
El Mau | 8b91532b82 | |
El Mau | 0a98338fad | |
El Mau | 7bcf6d6e3c | |
El Mau | dbc8717575 | |
El Mau | 0adcd7f30f | |
El Mau | d237b33020 | |
El Mau | 5b997f7858 | |
El Mau | a609c0c6f5 | |
El Mau | d70cae64b7 | |
El Mau | 9daf07693a | |
El Mau | e40acd28ba | |
El Mau | 88dd9ca04b | |
El Mau | d2f879c224 | |
El Mau | 4922010caf | |
El Mau | ff8bc31f50 | |
El Mau | e795e87461 | |
El Mau | d2c361e174 | |
El Mau | 6b0ca817a3 | |
El Mau | 84fd8f57df | |
El Mau | f105f2a0fa | |
El Mau | ea145c630b | |
El Mau | 88bb6d9411 | |
El Mau | 0498217b65 | |
El Mau | 581e8bbdc5 | |
El Mau | c79e8492d3 | |
El Mau | f9df0d34d0 | |
El Mau | f06022ac69 | |
El Mau | 074cdc475f | |
El Mau | 0f041ed975 | |
El Mau | 6de30c3417 | |
El Mau | 8bbd2ba62b | |
El Mau | 00c58d9b41 | |
El Mau | a3d291c893 | |
El Mau | 86bc032413 | |
El Mau | a91feb15d7 | |
El Mau | 3ffc54f966 | |
El Mau | b3663dfcc6 | |
El Mau | 3cc11430d7 | |
El Mau | 4ae5197ced | |
El Mau | bf601dfcef | |
El Mau | 481594839d | |
El Mau | 7b2467f99a | |
El Mau | 2f22ad4cc8 | |
El Mau | 46d6329754 | |
El Mau | 2a2689a61b | |
El Mau | 76663fdd67 | |
El Mau | 54ab86a089 | |
El Mau | 7fe5251153 | |
El Mau | fe4829c6b8 | |
El Mau | bb90b3f6d7 | |
El Mau | f4779dbb99 | |
El Mau | 47ec5ad360 | |
El Mau | 80957afb84 | |
El Mau | b9af99aad6 | |
El Mau | 43e932e445 | |
El Mau | 8a151d42ad | |
El Mau | db77f6972d | |
El Mau | ef2314880f | |
El Mau | 1a1cb1173e | |
El Mau | fe26744a8f | |
El Mau | 69402e03bb | |
El Mau | 4a84654117 | |
El Mau | 81428c4f8e | |
El Mau | 28ef107949 | |
El Mau | e372f064b4 | |
El Mau | 46efb3693c | |
El Mau | d2bacc3b6b | |
El Mau | 264090f2a6 | |
El Mau | 425cd53df1 | |
El Mau | b7e8bb3cff | |
El Mau | 1df477e0b1 | |
El Mau | 9b09fbbcd1 | |
El Mau | f793cd2240 | |
El Mau | 54f2a574a3 | |
El Mau | 219f7c6712 | |
El Mau | 342f64a18b | |
El Mau | e880256cde | |
El Mau | 3a1cb8d142 | |
El Mau | 42a840f85c | |
Mauricio Baeza | 2e5f4ac27e | |
Mauricio Baeza | 98f091a347 | |
Mauricio Baeza | 82ec2faac5 | |
Mauricio Baeza | 11c0cc4899 | |
Mauricio Baeza | 1c9c829296 | |
Mauricio Baeza | 03f26b65e4 | |
Mauricio Baeza | 00f2b2b126 | |
Mauricio Baeza | c77438216d | |
Mauricio Baeza | b02b2b0e63 | |
Mauricio Baeza | 75788474ba | |
Mauricio Baeza | 866e8c40b9 | |
Mauricio Baeza | c64de2bbb9 | |
Mauricio Baeza | cd35884999 | |
Mauricio Baeza | c4e29e47fa | |
Mauricio Baeza | 00cbe4d557 | |
Mauricio Baeza | a95a6842f9 | |
Mauricio Baeza | 30a4a276dd | |
Mauricio Baeza | 416bc65174 | |
Mauricio Baeza | 3dd88f14d6 | |
Mauricio Baeza | fb24346601 | |
Mauricio Baeza | f792b79655 | |
Mauricio Baeza | 2055a904f6 | |
Mauricio Baeza | 7a1fd8fcaf | |
Mauricio Baeza | cd22a5a24d | |
Mauricio Baeza | 25e86cd28c | |
Mauricio Baeza | 4aad1a94eb | |
Mauricio Baeza | 229be3b415 | |
Mauricio Baeza | bc53171969 | |
Mauricio Baeza | 61a8937eb3 | |
Mauricio Baeza | be75abeb54 | |
Mauricio Baeza | 2c314a3891 | |
Mauricio Baeza | 7fc1d42381 | |
Mauricio Baeza | 0957cf673f | |
Mauricio Baeza | f99adaf109 | |
Mauricio Baeza | 91cfbb0508 | |
Mauricio Baeza | 4f18e1e01f | |
Mauricio Baeza | 7e7b08b1c0 | |
Mauricio Baeza | 4006322f30 | |
Mauricio Baeza | 935483f7ee | |
Mauricio Baeza | 80b766783d | |
Mauricio Baeza | 8822687308 | |
Mauricio Baeza | 0512e0f6dd | |
Mauricio Baeza | 93f0d09f4d | |
Mauricio Baeza | 870d95cb5a | |
Mauricio Baeza | 9fa35d5592 | |
Mauricio Baeza | 2bfe86973a | |
Mauricio Baeza | 896be35e3b | |
Mauricio Baeza | f2af10c2df | |
Mauricio Baeza | 8f7aaac563 | |
Mauricio Baeza | 8a615144a6 | |
Mauricio Baeza | 227204abec | |
Mauricio Baeza | 637c69b9c7 | |
Mauricio Baeza | 4f3bdbda95 | |
Mauricio Baeza | 34c467d26e | |
Mauricio Baeza | d61672dac4 | |
Mauricio Baeza | 1aa6540ac1 | |
Mauricio Baeza | 1b87591f62 | |
Mauricio Baeza | 986020a4a3 | |
Mauricio Baeza | 3514944f5d | |
Mauricio Baeza | 9be913c47d | |
Mauricio Baeza | b9d87f0343 | |
Mauricio Baeza | 585632882d | |
Mauricio Baeza | 920ff62e98 | |
Mauricio Baeza | dc61d3b010 | |
Mauricio Baeza | 62a0a82699 | |
Mauricio Baeza | 702ac88b38 | |
Mauricio Baeza | 535cc9d527 | |
Mauricio Baeza | cf35cd08cd | |
Mauricio Baeza | e9eeab8c2c | |
Mauricio Baeza | a518278b55 | |
Mauricio Baeza | 0442019ea5 | |
Mauricio Baeza | fa94e36e7f | |
Mauricio Baeza | 348be949ac | |
Mauricio Baeza | 565f36be3a | |
Mauricio Baeza | 7062151e79 | |
Mauricio Baeza | 5f1edc76ca | |
Mauricio Baeza | 5729a1f83e | |
Mauricio Baeza | 1a9087b13a | |
Mauricio Baeza | a2670cb92c | |
Mauricio Baeza | a8667a5d4f | |
Mauricio Baeza | 952dcba7ae | |
Mauricio Baeza | 676ff29b57 | |
Mauricio Baeza | 12a24c1117 | |
Mauricio Baeza | e59941db34 | |
Mauricio Baeza | 0e881eb17a | |
Mauricio Baeza | fa01e6cf01 | |
Mauricio Baeza | 51e2464141 | |
Mauricio Baeza | 3e43cc3b46 | |
Mauricio Baeza | b5bdcbbeb3 | |
Mauricio Baeza | 4f71dd0de3 | |
Mauricio Baeza | 720c9f0cb1 | |
Mauricio Baeza | 66d740e8d1 | |
Mauricio Baeza | 892906c46f | |
Mauricio Baeza | aa68225571 | |
Mauricio Baeza | 4f40bc3bfa | |
Mauricio Baeza | b03fbebe09 | |
Mauricio Baeza | 3cdbe14287 | |
Mauricio Baeza | 0bbf0b438f | |
Mauricio Baeza | c98cdd7fff | |
Mauricio Baeza | f0b5fa5ae9 | |
Mauricio Baeza | 537cecbb0b | |
Mauricio Baeza | 7f44f7f26d | |
Mauricio Baeza | c1e1c5ad7c | |
Mauricio Baeza | 3c574425eb | |
Mauricio Baeza | 5b8cd0ecb2 | |
Mauricio Baeza | 05a51741b6 | |
Mauricio Baeza | b3e2671359 | |
Mauricio Baeza | 5c047ee9d5 | |
Mauricio Baeza | b680d728a7 | |
Mauricio Baeza | 431422361b | |
Mauricio Baeza | 85e58c2728 | |
Mauricio Baeza | 739ac08205 | |
Mauricio Baeza | 64adba1588 | |
Mauricio Baeza | de06f706a6 | |
Mauricio Baeza | 6785dfebf7 | |
Mauricio Baeza | aaccece897 | |
Mauricio Baeza | 94f5df0723 | |
Mauricio Baeza | f813fb4dd8 | |
Mauricio Baeza | 49d5838822 | |
Mauricio Baeza | 51b4386b24 | |
Mauricio Baeza | 38f3c125cd | |
Mauricio Baeza | e678083eea | |
Mauricio Baeza | b612991476 | |
Mauricio Baeza | 32679fced3 | |
Mauricio Baeza | 8e4bf56846 | |
Mauricio Baeza | 0084197906 | |
Mauricio Baeza | ace4ef21a7 | |
Mauricio Baeza | 17fa99e45b | |
Mauricio Baeza | e547ce0113 | |
Mauricio Baeza | 858fd829aa | |
Mauricio Baeza | 788a1723b4 | |
Mauricio Baeza | 4b9df44dac | |
Mauricio Baeza | cca598310b | |
Mauricio Baeza | 39071be43b | |
Mauricio Baeza | e633f8e2bf |
|
@ -2,6 +2,7 @@
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
Pipfile*
|
||||||
|
|
||||||
# Django stuff:
|
# Django stuff:
|
||||||
*.log
|
*.log
|
||||||
|
@ -14,7 +15,7 @@ source/media
|
||||||
# Sphinx documentation
|
# Sphinx documentation
|
||||||
*.xlsx
|
*.xlsx
|
||||||
|
|
||||||
docs/bk/
|
bk/
|
||||||
source/docs/
|
source/docs/
|
||||||
site/
|
site/
|
||||||
vedev/
|
vedev/
|
||||||
|
@ -22,8 +23,9 @@ vedev/
|
||||||
# Virtualenv
|
# Virtualenv
|
||||||
.env/
|
.env/
|
||||||
virtual/
|
virtual/
|
||||||
|
env
|
||||||
|
|
||||||
docs/
|
docs/build
|
||||||
cache/
|
cache/
|
||||||
credenciales.conf
|
credenciales.conf
|
||||||
*.sqlite
|
*.sqlite
|
||||||
|
@ -32,4 +34,5 @@ credenciales.conf
|
||||||
*.orig
|
*.orig
|
||||||
rfc.db
|
rfc.db
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
chuletas/
|
||||||
|
|
||||||
|
|
310
CHANGELOG.md
310
CHANGELOG.md
|
@ -1,3 +1,299 @@
|
||||||
|
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]
|
||||||
|
----------------------
|
||||||
|
- Error: Issue #54
|
||||||
|
|
||||||
|
|
||||||
|
v 1.46.3 [15-Feb-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Issue #53
|
||||||
|
|
||||||
|
|
||||||
|
v 1.46.2 [31-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Al generar Carta Porte sin remolque.
|
||||||
|
- Error: Al cancelar con Finkok.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.46.1 [29-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Issue #49
|
||||||
|
- Mejora: Agregar validación para distancia en origen de Carta Porte.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.46.0 [27-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Mejora: Issue #45
|
||||||
|
- Mejora: Agregar tipos de persimos SCT para Carta Porte
|
||||||
|
- Mejora: Buscar estado y municipio por CP en Carta Porte
|
||||||
|
|
||||||
|
|
||||||
|
v 1.45.4 [25-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Al timbrar carta porte.
|
||||||
|
- Error: Al cancelar con Comercio Digital.
|
||||||
|
- Error: Issue #42
|
||||||
|
- Mejora: Issue #44
|
||||||
|
|
||||||
|
* IMPORTANTE: Es necesario subir de nuevo tus certificados de sello, **solo** si timbras con Comercio Digital.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.45.3 [23-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: El enviar por correo CFDI de pago. Ticket #40
|
||||||
|
|
||||||
|
|
||||||
|
v 1.45.2 [21-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Al cancelar un CFDI
|
||||||
|
|
||||||
|
|
||||||
|
v 1.45.1 [20-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Al enviar correos con la nueva configuración
|
||||||
|
|
||||||
|
|
||||||
|
* IMPORTANTE: Revisa tu configuración de correo para verificar que todo funcione.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.45.0 [20-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Importar Carta Porte desde archivo JSON
|
||||||
|
|
||||||
|
|
||||||
|
v 1.44.2 [19-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Agregar opción STARTTLS que requieren algunos servidores de correo
|
||||||
|
|
||||||
|
* IMPORTANTE: Revisa tu configuración de correo para verificar si tienes que usar esta opción.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.44.1 [19-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Correciones en generación de Carta Porte v2.0
|
||||||
|
- Plantilla para representación impresa de Carta Porte v2.0
|
||||||
|
|
||||||
|
|
||||||
|
v 1.44.0 [10-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Soporte para Carta Porte v2 con CFDI 3.3
|
||||||
|
- Soporte para el nuevo esquema de cancelación del SAT
|
||||||
|
|
||||||
|
* 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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
v 1.43.0 [12-Dic-2021]
|
||||||
|
----------------------
|
||||||
|
- Soporte para entradas de almacen.
|
||||||
|
- Soporte para multi almacen.
|
||||||
|
- Soporte para regenerar un ticket.
|
||||||
|
- Soporte para movimientos entre almacenes
|
||||||
|
- Consulta en SAT para estatus de nómina
|
||||||
|
|
||||||
|
* IMPORTANTE:
|
||||||
|
|
||||||
|
Instalar nuevo requerimiento:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install segno
|
||||||
|
```
|
||||||
|
|
||||||
|
Es necesario hacer una migración:
|
||||||
|
|
||||||
|
```
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
cd source/app/models
|
||||||
|
|
||||||
|
python main.py -bk
|
||||||
|
|
||||||
|
python main.py -m -r RFC
|
||||||
|
```
|
||||||
|
|
||||||
|
v 1.42.2 [14-Sep-2021]
|
||||||
|
----------------------
|
||||||
|
- Los productos pueden no llevar ningún impuesto.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.42.1 [01-Jun-2021]
|
||||||
|
----------------------
|
||||||
|
- Error - Ticket #5
|
||||||
|
|
||||||
|
|
||||||
|
v 1.42.0 [24-May-2021]
|
||||||
|
----------------------
|
||||||
|
- Opción para que solo un admin pueda cancelar.
|
||||||
|
|
||||||
|
|
||||||
|
v 1.41.4 [13-Abr-2021]
|
||||||
|
----------------------
|
||||||
|
- Error - Ticket #4
|
||||||
|
|
||||||
|
|
||||||
|
v 1.41.3 [12-Feb-2021]
|
||||||
|
----------------------
|
||||||
|
- Error - Ticket #3
|
||||||
|
|
||||||
|
|
||||||
|
v 1.41.2 [12-Feb-2021]
|
||||||
|
----------------------
|
||||||
|
- Error - Ticket #2
|
||||||
|
|
||||||
|
|
||||||
|
v 1.41.1 [11-Feb-2021]
|
||||||
|
----------------------
|
||||||
|
- Error - Ticket #1
|
||||||
|
|
||||||
|
|
||||||
|
v 1.41.0 [10-Feb-2021]
|
||||||
|
----------------------
|
||||||
|
- Importar clientes desde archivo CSV
|
||||||
|
|
||||||
|
|
||||||
|
v 1.40.1 [09-Feb-2021]
|
||||||
|
----------------------
|
||||||
|
- Fix #422
|
||||||
|
|
||||||
|
|
||||||
v 1.40.0 [05-ene-2021]
|
v 1.40.0 [05-ene-2021]
|
||||||
----------------------
|
----------------------
|
||||||
- Error: Al parsear XML en Python 3.9+
|
- Error: Al parsear XML en Python 3.9+
|
||||||
|
@ -13,16 +309,24 @@ versión, **no continues hasta seguir paso a paso** estas instrucciones.
|
||||||
necesario subirlos de nuevo. **NO actualices si no tienes tus certificados**
|
necesario subirlos de nuevo. **NO actualices si no tienes tus certificados**
|
||||||
con su respectiva contraseña, te quedarás sin poder timbrar.
|
con su respectiva contraseña, te quedarás sin poder timbrar.
|
||||||
|
|
||||||
|
Estas instrucciones solamente aplican para la maquina virtual con Ubuntu Server,
|
||||||
|
la ultima y única versión sobre la que se dará soporte.
|
||||||
|
|
||||||
1. Entra a la parte administrativa y toma de tus credenciales de timbrado en el
|
1. Entra a la parte administrativa y toma de tus credenciales de timbrado en el
|
||||||
menú "Emisor" ficha "Otros Datos", usuario y token de timbrado.
|
menú "Emisor" ficha "Otros Datos", usuario y token de timbrado.
|
||||||
1. Agregar nuevo requerimiento `pip install xmlsec`
|
1. Agregar nuevos requerimientos `sudo apt install pkgconf libxml2-dev libxmlsec1-dev libxmlsec1-openssl`
|
||||||
|
1. Agregar nuevo requerimiento `pip install --user xmlsec`
|
||||||
|
1. Entrar a la carpeta del sistema: `/opt/empresa-libre`
|
||||||
1. Actualizar `git pull origin master`
|
1. Actualizar `git pull origin master`
|
||||||
1. Entrar a `source/app/controllers/pacs` y copiar `conf.py.example` a `conf.py`
|
1. Entrar a `source/app/controllers/pacs/comerciodigital` y copiar `conf.py.example` a `conf.py`
|
||||||
|
1. Entrar a `source/app/controllers/pacs/finkok` y copiar `conf.py.example` a `conf.py`
|
||||||
|
1. Agregar la variable `TOKEN = ''` al archivo `source/app/conf.py` mira el archivo de ejemplo en el mismo directorio.
|
||||||
1. Reiniciar el servicio: `sudo systemctl restart empresalibre`
|
1. Reiniciar el servicio: `sudo systemctl restart empresalibre`
|
||||||
|
1. Si no ves los cambios descritos a continuación, fuerza el refresco de tu navegador, generalmente con **CTRL+F5**
|
||||||
1. Sube de nuevo tus certificados en el menú "Emisor" ficha "Certificado".
|
1. Sube de nuevo tus certificados en el menú "Emisor" ficha "Certificado".
|
||||||
1. Ve al menú "Opciones", ficha "Otros".
|
1. Ve al menú "Opciones", ficha "Otros".
|
||||||
1. Selecciona tu PAC, si tu usuario es un correo electrónico, invariablemente
|
1. Selecciona tu PAC, si tu usuario es un correo electrónico, invariablemente
|
||||||
debes seleccionar Finkok.
|
debes seleccionar Finkok. Si tienes duda ponte en contacto con nosotros.
|
||||||
1. Establece las credenciales del punto 1.
|
1. Establece las credenciales del punto 1.
|
||||||
1. Guarda los datos.
|
1. Guarda los datos.
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,3 @@
|
||||||
* Propon nuevas funcionalidades
|
* Propon nuevas funcionalidades
|
||||||
* Difunde Empresa Libre
|
* Difunde Empresa Libre
|
||||||
|
|
||||||
|
|
||||||
### Prioridades
|
|
||||||
|
|
||||||
1. [X] Darle continuidad a la facturación de los clientes
|
|
||||||
2. Cubrir todas las funcionalidades que cubre ahora Factura Libre
|
|
||||||
3. Agregar nuevas funcionalidades
|
|
||||||
|
|
33
README.md
33
README.md
|
@ -12,24 +12,49 @@ contratar: administracion ARROBA empresalibre.net
|
||||||
|
|
||||||
#### Ahora también puede aportar con criptomonedas:
|
#### Ahora también puede aportar con criptomonedas:
|
||||||
|
|
||||||
|
G1: `A5DdXxCKPw3QKWVdDVs7CzkNugNUW1sHu5zDJFWxCU2h`
|
||||||
BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d`
|
BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d`
|
||||||
BTC: `3FhiXcXmAesmQzrNEngjHFnvaJRhU1AGWV`
|
|
||||||
|
|
||||||
|
## Requerimientos:
|
||||||
### Requerimientos:
|
|
||||||
|
|
||||||
* Servidor web, recomendado Nginx
|
* Servidor web, recomendado Nginx
|
||||||
* uwsgi
|
* uwsgi
|
||||||
* python3.7+
|
* python 3.8
|
||||||
* xsltproc
|
* xsltproc
|
||||||
* openssl
|
* openssl
|
||||||
* xmlsec
|
* xmlsec
|
||||||
|
|
||||||
|
* Ubuntu 20.04
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl xsltproc
|
||||||
|
```
|
||||||
|
|
||||||
Debería de funcionar con cualquier combinación servidor-wsgi que soporte
|
Debería de funcionar con cualquier combinación servidor-wsgi que soporte
|
||||||
aplicaciones Python.
|
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
|
|
@ -8,15 +8,10 @@ bcrypt
|
||||||
python-dateutil
|
python-dateutil
|
||||||
zeep
|
zeep
|
||||||
chardet
|
chardet
|
||||||
pyqrcode
|
|
||||||
pypng
|
|
||||||
reportlab
|
reportlab
|
||||||
psycopg2-binary
|
psycopg2-binary
|
||||||
cryptography
|
cryptography==3.4.8
|
||||||
xmlsec
|
xmlsec
|
||||||
|
segno
|
||||||
|
|
||||||
# escpos
|
# python-escpos
|
||||||
# pyusb
|
|
||||||
# pyserial
|
|
||||||
# qrcode
|
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,9 @@ TITLE_APP = 'Empresa Libre'
|
||||||
#~ Establece una ruta accesible para el servidor web
|
#~ Establece una ruta accesible para el servidor web
|
||||||
LOG_PATH = '/var/log/empresalibre/empresa-libre.log'
|
LOG_PATH = '/var/log/empresalibre/empresa-libre.log'
|
||||||
|
|
||||||
# ~ Establece los valores para sincronizar los backups de la base de datos
|
# ~ Establece un token personalizado para encriptar las claves
|
||||||
# ~ por ejemplo
|
# ~ from secrets import token_hex
|
||||||
# ~ SEAFILE_SERVER = {
|
# ~ token_hex(32)
|
||||||
# ~ 'URL': 'https://tu_servidor_seafile',
|
# ~ IMPORTANTE: Cada vez que cambies este valor, debes de subir de nuevo
|
||||||
# ~ 'USER': 'tu_usuario',
|
# ~ tus certificados
|
||||||
# ~ 'PASS': 'tu_contraseña',
|
TOKEN = ''
|
||||||
# ~ 'REPO': 'id_repo',
|
|
||||||
# ~ }
|
|
||||||
|
|
||||||
SEAFILE_SERVER = {}
|
|
||||||
|
|
|
@ -20,20 +20,28 @@ import datetime
|
||||||
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
|
||||||
|
|
||||||
|
from dateutil import parser
|
||||||
from logbook import Logger
|
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',
|
||||||
|
@ -41,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',
|
||||||
|
@ -79,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',
|
||||||
|
@ -96,6 +110,18 @@ SAT = {
|
||||||
'xmlns': 'http://www.sat.gob.mx/leyendasFiscales',
|
'xmlns': 'http://www.sat.gob.mx/leyendasFiscales',
|
||||||
'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': {
|
||||||
|
'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',
|
||||||
|
'prefix': 'cce20',
|
||||||
|
'xmlns': 'http://www.sat.gob.mx/ComercioExterior20',
|
||||||
|
'schema': ' http://www.sat.gob.mx/ComercioExterior20 http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior20/ComercioExterior20.xsd',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,7 +140,11 @@ class CFDI(object):
|
||||||
self._pagos = False
|
self._pagos = False
|
||||||
self._is_nomina = False
|
self._is_nomina = False
|
||||||
self._leyendas = False
|
self._leyendas = 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):
|
||||||
|
@ -125,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'])
|
||||||
|
@ -137,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
|
||||||
|
@ -165,6 +199,10 @@ class CFDI(object):
|
||||||
self._ine = True
|
self._ine = True
|
||||||
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._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', '')
|
||||||
|
|
||||||
|
@ -230,9 +268,22 @@ class CFDI(object):
|
||||||
attributes[name] = SAT['leyendas']['xmlns']
|
attributes[name] = SAT['leyendas']['xmlns']
|
||||||
schema_leyendas = SAT['leyendas']['schema']
|
schema_leyendas = SAT['leyendas']['schema']
|
||||||
|
|
||||||
|
schema_carta_porte = ''
|
||||||
|
if self._carta_porte:
|
||||||
|
name = 'xmlns:{}'.format(SAT['cartaporte']['prefix'])
|
||||||
|
attributes[name] = SAT['cartaporte']['xmlns']
|
||||||
|
schema_carta_porte = SAT['cartaporte']['schema']
|
||||||
|
|
||||||
|
schema_comercioe = ''
|
||||||
|
if self._comercio_exterior:
|
||||||
|
name = 'xmlns:{}'.format(SAT['comercioe']['prefix'])
|
||||||
|
attributes[name] = SAT['comercioe']['xmlns']
|
||||||
|
schema_carta_porte = SAT['comercioe']['schema']
|
||||||
|
|
||||||
attributes['xsi:schemaLocation'] = self._sat_cfdi['schema'] + \
|
attributes['xsi:schemaLocation'] = self._sat_cfdi['schema'] + \
|
||||||
schema_locales + schema_donativo + schema_ine + schema_edu + \
|
schema_locales + schema_donativo + schema_ine + schema_edu + \
|
||||||
schema_divisas + schema_nomina + schema_pagos + schema_leyendas
|
schema_divisas + schema_nomina + schema_pagos + schema_leyendas + \
|
||||||
|
schema_carta_porte + schema_comercioe
|
||||||
attributes.update(datos)
|
attributes.update(datos)
|
||||||
|
|
||||||
if not 'Version' in attributes:
|
if not 'Version' in attributes:
|
||||||
|
@ -240,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
|
||||||
|
@ -262,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
|
||||||
|
@ -270,7 +339,8 @@ class CFDI(object):
|
||||||
from xml.sax.saxutils import escape, unescape
|
from xml.sax.saxutils import escape, unescape
|
||||||
|
|
||||||
conceptos = ET.SubElement(self._cfdi, '{}:Conceptos'.format(self._pre))
|
conceptos = ET.SubElement(self._cfdi, '{}:Conceptos'.format(self._pre))
|
||||||
for row in reversed(datos):
|
# ~ for row in reversed(datos):
|
||||||
|
for row in datos:
|
||||||
complemento = {}
|
complemento = {}
|
||||||
if 'complemento' in row:
|
if 'complemento' in row:
|
||||||
complemento = row.pop('complemento')
|
complemento = row.pop('complemento')
|
||||||
|
@ -330,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)
|
||||||
|
|
||||||
|
@ -446,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
|
||||||
|
@ -454,6 +569,52 @@ class CFDI(object):
|
||||||
self._complemento = ET.SubElement(
|
self._complemento = ET.SubElement(
|
||||||
self._cfdi, '{}:Complemento'.format(self._pre))
|
self._cfdi, '{}:Complemento'.format(self._pre))
|
||||||
|
|
||||||
|
if self._carta_porte:
|
||||||
|
datos = datos['cartaporte']
|
||||||
|
ubicaciones = datos.pop('ubicaciones')
|
||||||
|
mercancias = datos.pop('mercancias', ())
|
||||||
|
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.update(datos)
|
||||||
|
|
||||||
|
prefix = SAT['cartaporte']['prefix']
|
||||||
|
node_carta = ET.SubElement(self._complemento, f'{prefix}:CartaPorte', atributos)
|
||||||
|
|
||||||
|
node = ET.SubElement(node_carta, f'{prefix}:Ubicaciones')
|
||||||
|
for ubicacion in ubicaciones:
|
||||||
|
domicilio = ubicacion.pop('domicilio', {})
|
||||||
|
dt = parser.parse(ubicacion['FechaHoraSalidaLlegada'])
|
||||||
|
ubicacion['FechaHoraSalidaLlegada'] = dt.isoformat()[:19]
|
||||||
|
sub_node = ET.SubElement(node, f'{prefix}:Ubicacion', ubicacion)
|
||||||
|
if domicilio:
|
||||||
|
ET.SubElement(sub_node, f'{prefix}:Domicilio', domicilio)
|
||||||
|
|
||||||
|
attr = mercancias
|
||||||
|
mercancias = attr.pop('mercancias')
|
||||||
|
|
||||||
|
node = ET.SubElement(node_carta, f'{prefix}:Mercancias', attr)
|
||||||
|
for mercancia in mercancias:
|
||||||
|
ET.SubElement(node, f'{prefix}:Mercancia', mercancia)
|
||||||
|
|
||||||
|
sub_node = ET.SubElement(node, f'{prefix}:Autotransporte', autotransporte)
|
||||||
|
ET.SubElement(sub_node, f'{prefix}:IdentificacionVehicular', identificacion)
|
||||||
|
ET.SubElement(sub_node, f'{prefix}:Seguros', seguros)
|
||||||
|
if remolques:
|
||||||
|
node_remolques = ET.SubElement(sub_node, f'{prefix}:Remolques')
|
||||||
|
for remolque in remolques:
|
||||||
|
ET.SubElement(node_remolques, f'{prefix}:Remolque', remolque)
|
||||||
|
|
||||||
|
if tiposfigura:
|
||||||
|
sub_node = ET.SubElement(node_carta, f'{prefix}:FiguraTransporte')
|
||||||
|
for figura in tiposfigura:
|
||||||
|
ET.SubElement(sub_node, f'{prefix}:TiposFigura', figura)
|
||||||
|
|
||||||
if self._divisas:
|
if self._divisas:
|
||||||
atributos = {
|
atributos = {
|
||||||
'version': SAT['divisas']['version'],
|
'version': SAT['divisas']['version'],
|
||||||
|
@ -463,19 +624,60 @@ class CFDI(object):
|
||||||
|
|
||||||
if 'ine' in datos:
|
if 'ine' in datos:
|
||||||
atributos = {'Version': SAT['ine']['version']}
|
atributos = {'Version': SAT['ine']['version']}
|
||||||
|
ine_key_entidad = datos['ine'].pop('ClaveEntidad', '')
|
||||||
|
ine_ambito = datos['ine'].pop('Ambito', '')
|
||||||
|
if ine_key_entidad:
|
||||||
|
ine_id_conta = datos['ine'].pop('IdContabilidad', '')
|
||||||
atributos.update(datos['ine'])
|
atributos.update(datos['ine'])
|
||||||
ET.SubElement(self._complemento, 'ine:INE', atributos)
|
node_ine = ET.SubElement(self._complemento, 'ine:INE', atributos)
|
||||||
|
if ine_key_entidad:
|
||||||
|
attr = {'ClaveEntidad': ine_key_entidad}
|
||||||
|
if ine_ambito:
|
||||||
|
attr['Ambito'] = ine_ambito
|
||||||
|
node_entidad = ET.SubElement(node_ine, 'ine:Entidad', attr)
|
||||||
|
attr = {'IdContabilidad': ine_id_conta}
|
||||||
|
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']
|
||||||
|
@ -485,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
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import smtplib
|
import smtplib
|
||||||
|
@ -268,9 +269,7 @@ class SendMail(object):
|
||||||
|
|
||||||
def _login(self):
|
def _login(self):
|
||||||
try:
|
try:
|
||||||
if self._config['ssl'] and (
|
if self._config['ssl'] and self._config['starttls']:
|
||||||
'gmail' in self._config['servidor'] or
|
|
||||||
'outlook' in self._config['servidor']):
|
|
||||||
self._server = smtplib.SMTP(
|
self._server = smtplib.SMTP(
|
||||||
self._config['servidor'],
|
self._config['servidor'],
|
||||||
self._config['puerto'], timeout=10)
|
self._config['puerto'], timeout=10)
|
||||||
|
@ -597,7 +596,7 @@ class TemplateInvoice(BaseDocTemplate):
|
||||||
p = Paragraph(v, ps)
|
p = Paragraph(v, ps)
|
||||||
ls.append(p)
|
ls.append(p)
|
||||||
|
|
||||||
cbb = Image(data['path_cbb'])
|
cbb = Image(data['cbb'])
|
||||||
cbb.drawHeight = 4 * cm
|
cbb.drawHeight = 4 * cm
|
||||||
cbb.drawWidth = 4 * cm
|
cbb.drawWidth = 4 * cm
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import falcon
|
import falcon
|
||||||
from middleware import get_template
|
from middleware import get_template
|
||||||
|
from urllib.parse import unquote
|
||||||
|
|
||||||
|
|
||||||
class AppEmpresas(object):
|
class AppEmpresas(object):
|
||||||
|
@ -111,6 +112,14 @@ class AppValues(object):
|
||||||
def on_get(self, req, resp, table):
|
def on_get(self, req, resp, table):
|
||||||
values = req.params
|
values = req.params
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
|
|
||||||
|
if table == 'product':
|
||||||
|
original = values['name']
|
||||||
|
try:
|
||||||
|
values['name'] = unquote(req.query_string.split('=')[1])
|
||||||
|
except Exception as e:
|
||||||
|
values['name'] = original
|
||||||
|
|
||||||
if req.path in ('/values/titlelogin', '/values/empresas'):
|
if req.path in ('/values/titlelogin', '/values/empresas'):
|
||||||
req.context['result'] = self._db.get_values(table, values, session)
|
req.context['result'] = self._db.get_values(table, values, session)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
@ -279,7 +288,12 @@ class AppProducts(object):
|
||||||
|
|
||||||
def on_get(self, req, resp):
|
def on_get(self, req, resp):
|
||||||
values = req.params
|
values = req.params
|
||||||
req.context['result'] = self._db.get_products(values)
|
user = req.env['beaker.session']['userobj']
|
||||||
|
|
||||||
|
if 'opt' in values:
|
||||||
|
req.context['result'] = self._db.products_get(values, user)
|
||||||
|
else:
|
||||||
|
req.context['result'] = self._db.get_products(values)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
def on_post(self, req, resp):
|
def on_post(self, req, resp):
|
||||||
|
@ -494,14 +508,18 @@ class AppNomina(object):
|
||||||
|
|
||||||
def on_get(self, req, resp):
|
def on_get(self, req, resp):
|
||||||
values = req.params
|
values = req.params
|
||||||
by = values.get('by', '')
|
user = req.env['beaker.session']['userobj']
|
||||||
req.context['result'] = self._db.get_nomina(values)
|
if 'opt' in values:
|
||||||
if 'download' in by:
|
req.context['result'] = self._db.nomina_get(values, user)
|
||||||
name = req.context['result']['name']
|
else:
|
||||||
req.context['blob'] = req.context['result']['data']
|
by = values.get('by', '')
|
||||||
resp.content_type = 'application/octet-stream'
|
req.context['result'] = self._db.get_nomina(values)
|
||||||
resp.append_header(
|
if 'download' in by:
|
||||||
'Content-Disposition', f'attachment; filename={name}')
|
name = req.context['result']['name']
|
||||||
|
req.context['blob'] = req.context['result']['data']
|
||||||
|
resp.content_type = 'application/octet-stream'
|
||||||
|
resp.append_header(
|
||||||
|
'Content-Disposition', f'attachment; filename={name}')
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
def on_post(self, req, resp):
|
def on_post(self, req, resp):
|
||||||
|
@ -524,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
|
||||||
|
|
||||||
|
@ -648,3 +670,158 @@ class AppCert(object):
|
||||||
req.context['result'] = self._db.cert_post(values)
|
req.context['result'] = self._db.cert_post(values)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppSucursales(object):
|
||||||
|
|
||||||
|
def __init__(self, db):
|
||||||
|
self._db = db
|
||||||
|
|
||||||
|
def on_get(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.sucursales_get(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.sucursales_post(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppPartnerProducts(object):
|
||||||
|
|
||||||
|
def __init__(self, db):
|
||||||
|
self._db = db
|
||||||
|
|
||||||
|
def on_get(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.partner_products_get(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.partner_products_post(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppInventoryEntries(object):
|
||||||
|
|
||||||
|
def __init__(self, db):
|
||||||
|
self._db = db
|
||||||
|
|
||||||
|
def on_get(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.inventory_entries_get(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
user = req.env['beaker.session']['userobj']
|
||||||
|
req.context['result'] = self._db.inventory_entries_post(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppWareHouse(object):
|
||||||
|
|
||||||
|
def __init__(self, db):
|
||||||
|
self._db = db
|
||||||
|
|
||||||
|
def on_get(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
req.context['result'] = self._db.warehouse_get(values)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
user = req.env['beaker.session']['userobj']
|
||||||
|
req.context['result'] = self._db.warehouse_post(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppWareHouseProduct(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.warehouseproduct_get(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
user = req.env['beaker.session']['userobj']
|
||||||
|
req.context['result'] = self._db.warehouseproduct_post(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppTicketsDetails(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.ticketsdetails_get(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppUsers(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.users_get(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
user = req.env['beaker.session']['userobj']
|
||||||
|
req.context['result'] = self._db.users_post(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|
||||||
|
class AppSATUnidadesPeso(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_unidades_peso_get(values, user)
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
def on_post(self, req, resp):
|
||||||
|
values = req.params
|
||||||
|
user = req.env['beaker.session']['userobj']
|
||||||
|
req.context['result'] = self._db.sat_unidades_peso_post(values, user)
|
||||||
|
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
|
||||||
|
|
|
@ -4,8 +4,11 @@ import argparse
|
||||||
import base64
|
import base64
|
||||||
import datetime
|
import datetime
|
||||||
import getpass
|
import getpass
|
||||||
|
import hashlib
|
||||||
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import lxml.etree as ET
|
||||||
import xmlsec
|
import xmlsec
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
|
@ -15,7 +18,7 @@ from cryptography.x509.oid import ExtensionOID
|
||||||
from cryptography.hazmat.primitives import hashes
|
from cryptography.hazmat.primitives import hashes
|
||||||
from cryptography.hazmat.primitives.asymmetric import padding
|
from cryptography.hazmat.primitives.asymmetric import padding
|
||||||
|
|
||||||
from .conf import TOKEN
|
from conf import TOKEN
|
||||||
|
|
||||||
|
|
||||||
class SATCertificate(object):
|
class SATCertificate(object):
|
||||||
|
@ -25,19 +28,36 @@ class SATCertificate(object):
|
||||||
self._init_values()
|
self._init_values()
|
||||||
self._get_data_cer(cer)
|
self._get_data_cer(cer)
|
||||||
self._get_data_key(key, password)
|
self._get_data_key(key, password)
|
||||||
|
# ~ if not password:
|
||||||
|
# ~ self._test()
|
||||||
|
|
||||||
|
# ~ def _test(self):
|
||||||
|
# ~ key = self._get_key('')
|
||||||
|
# ~ self._p = ''
|
||||||
|
# ~ self._key_der = key.private_bytes(
|
||||||
|
# ~ encoding=serialization.Encoding.DER,
|
||||||
|
# ~ format=serialization.PrivateFormat.PKCS8,
|
||||||
|
# ~ encryption_algorithm=serialization.BestAvailableEncryption(self._p.encode())
|
||||||
|
# ~ )
|
||||||
|
# ~ return
|
||||||
|
|
||||||
def _init_values(self):
|
def _init_values(self):
|
||||||
self._rfc = ''
|
self._rfc = ''
|
||||||
self._serial_number = ''
|
self._serial_number = ''
|
||||||
|
self._serial_number2 = ''
|
||||||
|
self._subject = ''
|
||||||
|
self._issuer = ''
|
||||||
self._not_before = None
|
self._not_before = None
|
||||||
self._not_after = None
|
self._not_after = None
|
||||||
self._is_fiel = False
|
self._is_fiel = False
|
||||||
self._are_couple = False
|
self._are_couple = False
|
||||||
self._is_valid_time = False
|
self._is_valid_time = False
|
||||||
|
self._key = b''
|
||||||
self._cer = b''
|
self._cer = b''
|
||||||
self._cer_pem = ''
|
self._cer_pem = ''
|
||||||
self._cer_txt = ''
|
self._cer_txt = ''
|
||||||
self._key_enc = b''
|
self._key_enc = b''
|
||||||
|
self._key_der = b''
|
||||||
self._p12 = b''
|
self._p12 = b''
|
||||||
self._cer_modulus = 0
|
self._cer_modulus = 0
|
||||||
self._key_modulus = 0
|
self._key_modulus = 0
|
||||||
|
@ -66,9 +86,14 @@ class SATCertificate(object):
|
||||||
def _get_data_cer(self, cer):
|
def _get_data_cer(self, cer):
|
||||||
self._cer = cer
|
self._cer = cer
|
||||||
obj = x509.load_der_x509_certificate(cer, default_backend())
|
obj = x509.load_der_x509_certificate(cer, default_backend())
|
||||||
|
|
||||||
|
self._issuer = obj.issuer.rfc4514_string()
|
||||||
|
self._subject = obj.subject.rfc4514_string()
|
||||||
|
|
||||||
self._rfc = obj.subject.get_attributes_for_oid(
|
self._rfc = obj.subject.get_attributes_for_oid(
|
||||||
NameOID.X500_UNIQUE_IDENTIFIER)[0].value.split(' ')[0]
|
NameOID.X500_UNIQUE_IDENTIFIER)[0].value.split(' ')[0]
|
||||||
self._serial_number = '{0:x}'.format(obj.serial_number)[1::2]
|
self._serial_number2 = '{0:x}'.format(obj.serial_number)
|
||||||
|
self._serial_number = self._serial_number2[1::2]
|
||||||
self._not_before = obj.not_valid_before
|
self._not_before = obj.not_valid_before
|
||||||
self._not_after = obj.not_valid_after
|
self._not_after = obj.not_valid_after
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
|
@ -86,6 +111,8 @@ class SATCertificate(object):
|
||||||
return
|
return
|
||||||
|
|
||||||
def _get_data_key(self, key, password):
|
def _get_data_key(self, key, password):
|
||||||
|
self._key = key
|
||||||
|
self._keyp = password
|
||||||
self._key_enc = key
|
self._key_enc = key
|
||||||
if not key or not password:
|
if not key or not password:
|
||||||
return
|
return
|
||||||
|
@ -144,12 +171,27 @@ class SATCertificate(object):
|
||||||
def sign_xml(self, tree):
|
def sign_xml(self, tree):
|
||||||
node = xmlsec.tree.find_node(tree, xmlsec.constants.NodeSignature)
|
node = xmlsec.tree.find_node(tree, xmlsec.constants.NodeSignature)
|
||||||
ctx = xmlsec.SignatureContext()
|
ctx = xmlsec.SignatureContext()
|
||||||
key = xmlsec.Key.from_memory(self.key_pem, xmlsec.constants.KeyDataFormatPem)
|
key = xmlsec.Key.from_memory(
|
||||||
|
self.key_pem, xmlsec.constants.KeyDataFormatPem)
|
||||||
ctx.key = key
|
ctx.key = key
|
||||||
ctx.sign(node)
|
ctx.sign(node)
|
||||||
|
|
||||||
node = xmlsec.tree.find_node(tree, 'X509Certificate')
|
node = xmlsec.tree.find_node(tree, 'X509Certificate')
|
||||||
node.text = self.cer_txt
|
node.text = self.cer_txt
|
||||||
return tree
|
node = xmlsec.tree.find_node(tree, 'X509IssuerName')
|
||||||
|
node.text = self.issuer
|
||||||
|
node = xmlsec.tree.find_node(tree, 'X509SerialNumber')
|
||||||
|
node.text = self.serial_number
|
||||||
|
node = xmlsec.tree.find_node(tree, 'SignatureValue')
|
||||||
|
node.text = node.text.replace('\n', '')
|
||||||
|
node = xmlsec.tree.find_node(tree, 'Modulus')
|
||||||
|
node.text = node.text.replace('\n', '')
|
||||||
|
|
||||||
|
# ~ xml_signed = ET.tostring(tree,
|
||||||
|
# ~ xml_declaration=True, encoding='UTF-8').decode()
|
||||||
|
xml_signed = ET.tostring(tree, encoding='UTF-8').decode().replace('\n', '')
|
||||||
|
|
||||||
|
return xml_signed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rfc(self):
|
def rfc(self):
|
||||||
|
@ -159,6 +201,18 @@ class SATCertificate(object):
|
||||||
def serial_number(self):
|
def serial_number(self):
|
||||||
return self._serial_number
|
return self._serial_number
|
||||||
|
|
||||||
|
@property
|
||||||
|
def serial_number2(self):
|
||||||
|
return self._serial_number2
|
||||||
|
|
||||||
|
@property
|
||||||
|
def issuer(self):
|
||||||
|
return self._issuer
|
||||||
|
|
||||||
|
@property
|
||||||
|
def subject(self):
|
||||||
|
return self._subject
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def not_before(self):
|
def not_before(self):
|
||||||
return self._not_before
|
return self._not_before
|
||||||
|
@ -211,6 +265,41 @@ class SATCertificate(object):
|
||||||
def error(self):
|
def error(self):
|
||||||
return self._error
|
return self._error
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def save_cert(cls, obj):
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
cer = x509.load_pem_x509_certificate(obj.cer_pem.encode(), default_backend())
|
||||||
|
cer_der = cer.public_bytes(serialization.Encoding.DER)
|
||||||
|
token = hashlib.md5(obj.rfc.encode()).hexdigest()
|
||||||
|
path = Path(f'/tmp/{obj.rfc}.key')
|
||||||
|
path.write_text(obj.key_enc)
|
||||||
|
args = f'openssl rsa -inform PEM -outform PEM -in "{str(path)}" -passin pass:{token}'
|
||||||
|
pem = subprocess.check_output(args, shell=True).decode()
|
||||||
|
key = serialization.load_pem_private_key(
|
||||||
|
pem.encode(), password=None, backend=default_backend())
|
||||||
|
|
||||||
|
digest = hashes.Hash(hashes.SHA512(), default_backend())
|
||||||
|
digest.update(obj.rfc.encode())
|
||||||
|
digest.update(obj.serie.encode())
|
||||||
|
digest.update(TOKEN.encode())
|
||||||
|
p = digest.finalize()
|
||||||
|
|
||||||
|
key_enc = key.private_bytes(
|
||||||
|
encoding=serialization.Encoding.PEM,
|
||||||
|
format=serialization.PrivateFormat.PKCS8,
|
||||||
|
encryption_algorithm=serialization.BestAvailableEncryption(p)
|
||||||
|
)
|
||||||
|
|
||||||
|
cert = SATCertificate(cer_der, key_enc)
|
||||||
|
obj.key_enc = cert.key_enc
|
||||||
|
obj.cer = cert.cer
|
||||||
|
obj.serie = cert.serial_number
|
||||||
|
obj.desde = cert.not_before
|
||||||
|
obj.hasta = cert.not_after
|
||||||
|
obj.save()
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
# ~ contra = getpass.getpass('Introduce la contraseña del archivo KEY: ')
|
# ~ contra = getpass.getpass('Introduce la contraseña del archivo KEY: ')
|
||||||
|
|
|
@ -17,13 +17,15 @@
|
||||||
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
import base64
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import lxml.etree as ET
|
import lxml.etree as ET
|
||||||
import requests
|
import requests
|
||||||
from requests.exceptions import ConnectionError
|
from requests.exceptions import ConnectionError
|
||||||
|
|
||||||
from .conf import DEBUG, AUTH
|
from .conf import DEBUG
|
||||||
|
# ~ , AUTH
|
||||||
|
|
||||||
|
|
||||||
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
|
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
@ -39,14 +41,37 @@ 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):
|
||||||
|
"""
|
||||||
|
At this point it is completely built and ready
|
||||||
|
to be fired; it is "prepared".
|
||||||
|
|
||||||
|
However pay attention at the formatting used in
|
||||||
|
this function because it is programmed to be pretty
|
||||||
|
printed and may differ from the actual request.
|
||||||
|
"""
|
||||||
|
print('{}\n{}\r\n{}\r\n\r\n{}'.format(
|
||||||
|
'-----------START-----------',
|
||||||
|
req.method + ' ' + req.url,
|
||||||
|
'\r\n'.join('{}: {}'.format(k, v) for k, v in req.headers.items()),
|
||||||
|
req.body,
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
class PACComercioDigital(object):
|
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', 'cancela3/cancelarUuid'),
|
'cancel': ws.format('cancela', 'cancela4/cancelarUuid'),
|
||||||
'cancelxml': ws.format('cancela', 'cancela3/cancelarXml'),
|
'cancelxml': ws.format('cancela', 'cancela4/cancelarXml'),
|
||||||
'status': ws.format('cancela', 'arws/consultaEstatus'),
|
'status': ws.format('cancela', 'arws/consultaEstatus'),
|
||||||
'client': api.format('x3/altaEmpresa'),
|
'client': api.format('x3/altaEmpresa'),
|
||||||
'saldo': api.format('x3/saldo'),
|
'saldo': api.format('x3/saldo'),
|
||||||
|
@ -59,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',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +92,9 @@ 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('cancela3/cancelarUuid'),
|
'cancel': ws.format('cancela4/cancelarUuid'),
|
||||||
'cancelxml': ws.format('cancela3/cancelarXml'),
|
'cancelxml': ws.format('cancela4/cancelarXml'),
|
||||||
'status': ws6.format('consultaEstatus'),
|
'status': ws6.format('consultaEstatus'),
|
||||||
'client': api.format('x3/altaEmpresa'),
|
'client': api.format('x3/altaEmpresa'),
|
||||||
'saldo': api.format('x3/saldo'),
|
'saldo': api.format('x3/saldo'),
|
||||||
|
@ -78,8 +103,6 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.error = ''
|
self.error = ''
|
||||||
# ~ self.cfdi_uuid = ''
|
|
||||||
# ~ self.date_stamped = ''
|
|
||||||
|
|
||||||
def _error(self, msg):
|
def _error(self, msg):
|
||||||
self.error = str(msg)
|
self.error = str(msg)
|
||||||
|
@ -91,6 +114,12 @@ class PACComercioDigital(object):
|
||||||
headers['host'] = url.split('/')[2]
|
headers['host'] = url.split('/')[2]
|
||||||
headers['Content-type'] = 'text/plain'
|
headers['Content-type'] = 'text/plain'
|
||||||
headers['Connection'] = 'Keep-Alive'
|
headers['Connection'] = 'Keep-Alive'
|
||||||
|
headers['Expect'] = '100-continue'
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
req = requests.Request('POST', url, headers=headers, data=data)
|
||||||
|
prepared = req.prepare()
|
||||||
|
pretty_print_POST(prepared)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = requests.post(url, data=data, headers=headers, timeout=TIMEOUT)
|
result = requests.post(url, data=data, headers=headers, timeout=TIMEOUT)
|
||||||
|
@ -103,14 +132,14 @@ 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:
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
|
|
||||||
url = self.URL['timbra']
|
url = self.URL['timbra']
|
||||||
headers = {
|
headers = {
|
||||||
|
@ -148,26 +177,33 @@ class PACComercioDigital(object):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def _get_data_cancel(self, cfdi, info, auth):
|
def _get_data_cancel(self, cfdi, info, auth):
|
||||||
NS_CFDI = {
|
info['tipo'] = 'cfdi'
|
||||||
'cfdi': 'http://www.sat.gob.mx/cfd/3',
|
info['key'] = base64.b64encode(info['key_enc']).decode()
|
||||||
'tdf': 'http://www.sat.gob.mx/TimbreFiscalDigital',
|
info['cer'] = base64.b64encode(info['cer_ori']).decode()
|
||||||
}
|
|
||||||
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']}",
|
||||||
|
@ -176,17 +212,19 @@ class PACComercioDigital(object):
|
||||||
f"PWDK={info['pass']}",
|
f"PWDK={info['pass']}",
|
||||||
f"KEYF={info['key']}",
|
f"KEYF={info['key']}",
|
||||||
f"CERT={info['cer']}",
|
f"CERT={info['cer']}",
|
||||||
f"TIPO={info['tipo']}",
|
f"TIPO1={info['tipo']}",
|
||||||
f"ACUS=SI",
|
f"ACUS=SI",
|
||||||
f"RFCR={rfc_receptor}",
|
f"RFCR={rfc_receptor}",
|
||||||
f"TIPOC={tipo}",
|
f"TIPOC={tipo}",
|
||||||
f"TOTAL={total}",
|
f"TOTAL={total}",
|
||||||
|
f"UUIDREL={info['args']['uuid']}",
|
||||||
|
f"MOTIVO={info['args']['reason']}",
|
||||||
)
|
)
|
||||||
return '\n'.join(data)
|
return '\n'.join(data)
|
||||||
|
|
||||||
def cancel(self, cfdi, info, auth={}):
|
def cancel(self, cfdi, info, auth):
|
||||||
if not auth:
|
# ~ if DEBUG or not auth:
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
url = self.URL['cancel']
|
url = self.URL['cancel']
|
||||||
data = self._get_data_cancel(cfdi, info, auth)
|
data = self._get_data_cancel(cfdi, info, auth)
|
||||||
|
|
||||||
|
@ -202,7 +240,15 @@ class PACComercioDigital(object):
|
||||||
self._error(result.headers['errmsg'])
|
self._error(result.headers['errmsg'])
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
return result.text
|
tree = ET.fromstring(result.text)
|
||||||
|
date_cancel = tree.xpath('string(//Acuse/@Fecha)')[:19]
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'acuse': result.text,
|
||||||
|
'date': date_cancel,
|
||||||
|
}
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
def _get_headers_cancel_xml(self, cfdi, info, auth):
|
def _get_headers_cancel_xml(self, cfdi, info, auth):
|
||||||
NS_CFDI = {
|
NS_CFDI = {
|
||||||
|
@ -231,9 +277,9 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
return headers
|
return headers
|
||||||
|
|
||||||
def cancel_xml(self, xml, auth={}, cfdi='', info={'tipo': 'cfdi3.3'}):
|
def cancel_xml(self, xml, auth, cfdi='', info={'tipo': 'cfdi'}):
|
||||||
if DEBUG or not auth:
|
# ~ if DEBUG or not auth:
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
|
|
||||||
url = self.URL['cancelxml']
|
url = self.URL['cancelxml']
|
||||||
headers = self._get_headers_cancel_xml(cfdi, info, auth)
|
headers = self._get_headers_cancel_xml(cfdi, info, auth)
|
||||||
|
@ -258,9 +304,9 @@ class PACComercioDigital(object):
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def status(self, data, auth={}):
|
def status(self, data, auth):
|
||||||
if not auth:
|
# ~ if not auth:
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
url = self.URL['status']
|
url = self.URL['status']
|
||||||
|
|
||||||
data = (
|
data = (
|
||||||
|
@ -309,8 +355,8 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
return '\n'.join(data)
|
return '\n'.join(data)
|
||||||
|
|
||||||
def client_add(self, data):
|
def client_add(self, data, auth):
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
url = self.URL['client']
|
url = self.URL['client']
|
||||||
data = self._get_data_client(auth, data)
|
data = self._get_data_client(auth, data)
|
||||||
|
|
||||||
|
@ -329,7 +375,7 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def client_balance(self, data):
|
def client_balance(self, data, rfc=''):
|
||||||
url = self.URL['saldo']
|
url = self.URL['saldo']
|
||||||
host = url.split('/')[2]
|
host = url.split('/')[2]
|
||||||
headers = {
|
headers = {
|
||||||
|
@ -337,7 +383,7 @@ class PACComercioDigital(object):
|
||||||
'Host': host,
|
'Host': host,
|
||||||
'Connection' : 'Keep-Alive',
|
'Connection' : 'Keep-Alive',
|
||||||
}
|
}
|
||||||
data = {'usr': data['rfc'], 'pwd': data['password']}
|
data = {'usr': data['user'], 'pwd': data['pass']}
|
||||||
try:
|
try:
|
||||||
result = requests.get(url, params=data, headers=headers, timeout=TIMEOUT)
|
result = requests.get(url, params=data, headers=headers, timeout=TIMEOUT)
|
||||||
except ConnectionError as e:
|
except ConnectionError as e:
|
||||||
|
@ -357,9 +403,9 @@ class PACComercioDigital(object):
|
||||||
|
|
||||||
return result.text
|
return result.text
|
||||||
|
|
||||||
def client_add_timbres(self, data, auth={}):
|
def client_add_timbres(self, data, auth):
|
||||||
if not auth:
|
# ~ if not auth:
|
||||||
auth = AUTH
|
# ~ auth = AUTH
|
||||||
url = self.URL['timbres']
|
url = self.URL['timbres']
|
||||||
data = '\n'.join((
|
data = '\n'.join((
|
||||||
f"usr_ws={auth['user']}",
|
f"usr_ws={auth['user']}",
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
# ~ AUTH = Las credenciales de timbrado proporcionadas por el PAC
|
# ~ AUTH = Las credenciales de timbrado proporcionadas por el PAC
|
||||||
# ~ NO cambies las credenciales de prueba
|
# ~ NO cambies las credenciales de prueba
|
||||||
|
|
||||||
DEBUG = True
|
|
||||||
|
DEBUG = False
|
||||||
|
|
||||||
|
|
||||||
AUTH = {
|
AUTH = {
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
|
|
||||||
DEBUG = False
|
|
||||||
|
|
||||||
TOKEN = ''
|
|
|
@ -22,7 +22,7 @@
|
||||||
# ~ NO cambies las credenciales de prueba
|
# ~ NO cambies las credenciales de prueba
|
||||||
|
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
|
|
||||||
AUTH = {
|
AUTH = {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
# ~ You should have received a copy of the GNU General Public License
|
# ~ You should have received a copy of the GNU General Public License
|
||||||
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import base64
|
# ~ import base64
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -58,6 +58,7 @@ class DebugPlugin(Plugin):
|
||||||
path = f'/tmp/soap_{name}.xml'
|
path = f'/tmp/soap_{name}.xml'
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
# ~ print(data)
|
||||||
return
|
return
|
||||||
|
|
||||||
def egress(self, envelope, http_headers, operation, binding_options):
|
def egress(self, envelope, http_headers, operation, binding_options):
|
||||||
|
@ -71,8 +72,10 @@ class DebugPlugin(Plugin):
|
||||||
|
|
||||||
class PACFinkok(object):
|
class PACFinkok(object):
|
||||||
WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
|
WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
|
||||||
|
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'
|
||||||
URL = {
|
URL = {
|
||||||
'quick_stamp': False,
|
'quick_stamp': False,
|
||||||
'timbra': WS.format('stamp'),
|
'timbra': WS.format('stamp'),
|
||||||
|
@ -100,6 +103,17 @@ class PACFinkok(object):
|
||||||
return self._error
|
return self._error
|
||||||
|
|
||||||
def _validate_result(self, result):
|
def _validate_result(self, result):
|
||||||
|
if hasattr(result, 'Incidencias') and not result.Incidencias is None:
|
||||||
|
fault = result.Incidencias.Incidencia[0]
|
||||||
|
cod_error = fault.CodigoError.encode('utf-8').decode()
|
||||||
|
msg_error = fault.MensajeIncidencia.encode('utf-8').decode()
|
||||||
|
error = 'Error: {}\n{}'.format(cod_error, msg_error)
|
||||||
|
if cod_error == '307':
|
||||||
|
return result
|
||||||
|
|
||||||
|
self._error = self.CODE.get(cod_error, error)
|
||||||
|
return {}
|
||||||
|
|
||||||
if hasattr(result, 'CodEstatus'):
|
if hasattr(result, 'CodEstatus'):
|
||||||
ce = result.CodEstatus
|
ce = result.CodEstatus
|
||||||
if ce is None:
|
if ce is None:
|
||||||
|
@ -118,16 +132,10 @@ class PACFinkok(object):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
if self.CODE['200'] != ce:
|
if self.CODE['200'] != ce:
|
||||||
log.error('CodEstatus', type(ce), ce)
|
self._error = ce
|
||||||
return result
|
return {}
|
||||||
|
|
||||||
if hasattr(result, 'Incidencias'):
|
return result
|
||||||
fault = result.Incidencias.Incidencia[0]
|
|
||||||
cod_error = fault.CodigoError.encode('utf-8')
|
|
||||||
msg_error = fault.MensajeIncidencia.encode('utf-8')
|
|
||||||
error = 'Error: {}\n{}'.format(cod_error, msg_error)
|
|
||||||
self._error = self.CODE.get(cod_error, error)
|
|
||||||
return {}
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -182,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)
|
||||||
|
@ -203,11 +218,21 @@ class PACFinkok(object):
|
||||||
method = 'cancel'
|
method = 'cancel'
|
||||||
client = Client(self.URL[method],
|
client = Client(self.URL[method],
|
||||||
transport=self._transport, plugins=self._plugins)
|
transport=self._transport, plugins=self._plugins)
|
||||||
uuid_type = client.get_type('ns1:UUIDS')
|
|
||||||
sa = client.get_type('ns0:stringArray')
|
uuid_type = client.get_type(f'{self.NS_TYPE}:UUIDS')
|
||||||
|
ns1_uuid = client.get_type(f'{self.NS_TYPE}:UUID')
|
||||||
|
|
||||||
|
# ~ sa = client.get_type('ns0:stringArray')
|
||||||
|
|
||||||
|
data_uuid = {
|
||||||
|
'UUID': cfdi_uuid,
|
||||||
|
'FolioSustitucion': info['args']['uuid'],
|
||||||
|
'Motivo': info['args']['reason'],
|
||||||
|
}
|
||||||
|
# ~ 'UUIDS': uuid_type(uuids=sa(string=cfdi_uuid)),
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
'UUIDS': uuid_type(uuids=sa(string=cfdi_uuid)),
|
'UUIDS': uuid_type(ns1_uuid(**data_uuid)),
|
||||||
'username': auth['user'],
|
'username': auth['user'],
|
||||||
'password': auth['pass'],
|
'password': auth['pass'],
|
||||||
'taxpayer_id': rfc_emisor,
|
'taxpayer_id': rfc_emisor,
|
||||||
|
@ -240,8 +265,6 @@ class PACFinkok(object):
|
||||||
client = Client(self.URL[method],
|
client = Client(self.URL[method],
|
||||||
transport=self._transport, plugins=self._plugins)
|
transport=self._transport, plugins=self._plugins)
|
||||||
client.set_ns_prefix('can', 'http://facturacion.finkok.com/cancel')
|
client.set_ns_prefix('can', 'http://facturacion.finkok.com/cancel')
|
||||||
# ~ xml = f'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n{xml}'
|
|
||||||
# ~ xml = f'<?xml version="1.0" encoding="UTF-8" standalone="true"?>\n{xml}'
|
|
||||||
args = {
|
args = {
|
||||||
'xml': xml.encode(),
|
'xml': xml.encode(),
|
||||||
'username': auth['user'],
|
'username': auth['user'],
|
||||||
|
@ -412,15 +435,12 @@ class PACFinkok(object):
|
||||||
Se pueden usar las credenciales de relleser o las credenciales del emisor
|
Se pueden usar las credenciales de relleser o las credenciales del emisor
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
rfc (str): El RFC del emisor
|
|
||||||
|
|
||||||
Kwargs:
|
|
||||||
auth (dict): Credenciales del emisor
|
auth (dict): Credenciales del emisor
|
||||||
|
rfc (str): El RFC del emisor
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int Cantidad de timbres restantes
|
int Cantidad de timbres restantes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not auth:
|
if not auth:
|
||||||
auth = AUTH['RESELLER']
|
auth = AUTH['RESELLER']
|
||||||
|
|
||||||
|
@ -432,15 +452,16 @@ class PACFinkok(object):
|
||||||
'reseller_password': auth['pass'],
|
'reseller_password': auth['pass'],
|
||||||
'taxpayer_id': rfc,
|
'taxpayer_id': rfc,
|
||||||
}
|
}
|
||||||
|
|
||||||
result = self._get_result(client, 'get', args)
|
result = self._get_result(client, 'get', args)
|
||||||
|
|
||||||
if self.error:
|
if self.error:
|
||||||
log.error(self.error)
|
log.error(self.error)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
success = bool(result.users)
|
success = bool(result.users)
|
||||||
if not success:
|
if not success:
|
||||||
self.error = result.message or 'RFC no existe'
|
self._error = result.message or 'RFC no existe'
|
||||||
|
log.error(self.error)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return result.users.ResellerUser[0].credit
|
return result.users.ResellerUser[0].credit
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from decimal import Decimal, getcontext
|
||||||
|
# ~ getcontext().prec = 6
|
||||||
|
|
||||||
|
import lxml.etree as ET
|
||||||
|
from requests.structures import CaseInsensitiveDict as CIDict
|
||||||
|
|
||||||
|
|
||||||
|
NS_CFDI = {
|
||||||
|
'cfdi': 'http://www.sat.gob.mx/cfd/3',
|
||||||
|
'tfd': 'http://www.sat.gob.mx/TimbreFiscalDigital',
|
||||||
|
'nomina12': 'http://www.sat.gob.mx/nomina12',
|
||||||
|
}
|
||||||
|
PRE = '/cfdi:Comprobante'
|
||||||
|
|
||||||
|
|
||||||
|
class CfdiRead(object):
|
||||||
|
|
||||||
|
def __init__(self, source):
|
||||||
|
self._source = source
|
||||||
|
self._data = {}
|
||||||
|
self._error = ''
|
||||||
|
self._rfc_emisor = ''
|
||||||
|
self._rfc_receptor = ''
|
||||||
|
self._parse()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def source(self):
|
||||||
|
return self._source
|
||||||
|
|
||||||
|
@property
|
||||||
|
def data(self):
|
||||||
|
return self._data
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rfc_emisor(self):
|
||||||
|
return self._rfc_emisor
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rfc_receptor(self):
|
||||||
|
return self._rfc_receptor
|
||||||
|
|
||||||
|
@property
|
||||||
|
def error(self):
|
||||||
|
return self._error
|
||||||
|
|
||||||
|
def _parse(self):
|
||||||
|
self._tree = ET.fromstring(self.source)
|
||||||
|
self._data['cfdi'] = dict(self._tree.attrib)
|
||||||
|
|
||||||
|
node_name = f'{PRE}/cfdi:Emisor'
|
||||||
|
self._data['emisor'] = self._get_attr(node_name)
|
||||||
|
self._rfc_emisor = self._data['emisor']['Rfc']
|
||||||
|
|
||||||
|
node_name = f'{PRE}/cfdi:Receptor'
|
||||||
|
self._data['receptor'] = self._get_attr(node_name)
|
||||||
|
self._rfc_receptor = self._data['receptor']['Rfc']
|
||||||
|
|
||||||
|
node_name = f'{PRE}/cfdi:Complemento/tfd:TimbreFiscalDigital'
|
||||||
|
self._data['timbre'] = self._get_attr(node_name)
|
||||||
|
|
||||||
|
self._parse_details()
|
||||||
|
return
|
||||||
|
|
||||||
|
def _get_attr(self, node_name):
|
||||||
|
node = self._tree.xpath(node_name, namespaces=NS_CFDI)[0]
|
||||||
|
attr = dict(node.attrib)
|
||||||
|
return attr
|
||||||
|
|
||||||
|
def _parse_details(self):
|
||||||
|
node_name = f'{PRE}/cfdi:Conceptos/cfdi:Concepto'
|
||||||
|
details = self._tree.xpath(node_name, namespaces=NS_CFDI)
|
||||||
|
rows = []
|
||||||
|
for detail in details:
|
||||||
|
row = dict(detail.attrib)
|
||||||
|
for k, v in row.items():
|
||||||
|
if k in ('Cantidad', 'ValorUnitario', 'Descuento', 'Importe'):
|
||||||
|
row[k] = Decimal(v)
|
||||||
|
# ~ row['taxes'] = self._get_taxes(detail)
|
||||||
|
rows.append(row)
|
||||||
|
self._data['conceptos'] = rows
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
class CfdiWrite(object):
|
||||||
|
pass
|
File diff suppressed because it is too large
Load Diff
|
@ -18,8 +18,10 @@
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import collections
|
import collections
|
||||||
|
import csv
|
||||||
import datetime
|
import datetime
|
||||||
import getpass
|
import getpass
|
||||||
|
import io
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
|
@ -28,10 +30,13 @@ import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import smtplib
|
import smtplib
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import ssl
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
|
import unicodedata
|
||||||
import zipfile
|
import zipfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from xml.sax.saxutils import escape
|
||||||
|
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.base import MIMEBase
|
from email.mime.base import MIMEBase
|
||||||
|
@ -50,12 +55,16 @@ 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
|
||||||
from .pacs import PACFinkok
|
from .pacs import PACFinkok
|
||||||
|
|
||||||
|
# ~ v2
|
||||||
|
import segno
|
||||||
|
from .pycfdi import CfdiRead
|
||||||
|
|
||||||
|
|
||||||
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
|
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
|
||||||
LOG_DATE = '%d/%m/%Y %H:%M:%S'
|
LOG_DATE = '%d/%m/%Y %H:%M:%S'
|
||||||
|
@ -79,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',
|
||||||
|
@ -172,10 +182,8 @@ class SendMail(object):
|
||||||
return self._error
|
return self._error
|
||||||
|
|
||||||
def _login(self):
|
def _login(self):
|
||||||
hosts = ('gmail' in self._config['server'] or
|
|
||||||
'outlook' in self._config['server'])
|
|
||||||
try:
|
try:
|
||||||
if self._config['ssl'] and hosts:
|
if self._config['ssl'] and self._config['starttls']:
|
||||||
self._server = smtplib.SMTP(
|
self._server = smtplib.SMTP(
|
||||||
self._config['server'],
|
self._config['server'],
|
||||||
self._config['port'], timeout=TIMEOUT)
|
self._config['port'], timeout=TIMEOUT)
|
||||||
|
@ -248,13 +256,135 @@ 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',
|
||||||
|
'cartaporte30': 'http://www.sat.gob.mx/CartaPorte30',
|
||||||
|
'nomina12': 'http://www.sat.gob.mx/nomina12',
|
||||||
|
'cce20': 'http://www.sat.gob.mx/ComercioExterior20',
|
||||||
|
}
|
||||||
|
tipo_figura = {
|
||||||
|
'01': '[01] Operador',
|
||||||
|
'02': '[02] Propietario',
|
||||||
|
'03': '[03] Arrendador',
|
||||||
|
'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 = {
|
||||||
|
'MEX': 'México',
|
||||||
|
}
|
||||||
|
ESTADOS = {
|
||||||
|
'AGU': 'Aguascalientes',
|
||||||
|
'BCN': 'Baja California',
|
||||||
|
'BCS': 'Baja California Sur',
|
||||||
|
'CAM': 'Campeche',
|
||||||
|
'CHP': 'Chiapas',
|
||||||
|
'CHH': 'Chihuahua',
|
||||||
|
'COA': 'Coahuila',
|
||||||
|
'COL': 'Colima',
|
||||||
|
'DIF': 'Ciudad de México',
|
||||||
|
'DUR': 'Durango',
|
||||||
|
'GUA': 'Guanajuato',
|
||||||
|
'GRO': 'Guerrero',
|
||||||
|
'HID': 'Hidalgo',
|
||||||
|
'JAL': 'Jalisco',
|
||||||
|
'MEX': 'México',
|
||||||
|
'MIC': 'Michoacán',
|
||||||
|
'MOR': 'Morelos',
|
||||||
|
'NAC': 'Nacional',
|
||||||
|
'NAY': 'Nayarit',
|
||||||
|
'NLE': 'Nuevo León',
|
||||||
|
'OAX': 'Oaxaca',
|
||||||
|
'PUE': 'Puebla',
|
||||||
|
'QUE': 'Querétaro',
|
||||||
|
'ROO': 'Quintana Roo',
|
||||||
|
'SLP': 'San Luis Potosí',
|
||||||
|
'SIN': 'Sinaloa',
|
||||||
|
'SON': 'Sonora',
|
||||||
|
'TAB': 'Tabasco',
|
||||||
|
'TAM': 'Tamaulipas',
|
||||||
|
'TLA': 'Tlaxcala',
|
||||||
|
'VER': 'Veracruz',
|
||||||
|
'YUC': 'Yucatán',
|
||||||
|
'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': (),
|
||||||
}
|
}
|
||||||
|
@ -266,13 +396,73 @@ 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):
|
||||||
|
municipio = data['Municipio']
|
||||||
|
estado = self.ESTADOS[data['Estado']]
|
||||||
|
pais = self.PAISES[data['Pais']]
|
||||||
|
domicilio = f"{municipio}, {estado}, {pais}, C.P. {data['CodigoPostal']}"
|
||||||
|
return domicilio
|
||||||
|
|
||||||
def _complementos(self):
|
def _complementos(self):
|
||||||
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:
|
||||||
|
@ -285,6 +475,147 @@ class CfdiToDict(object):
|
||||||
if node:
|
if node:
|
||||||
leyendas = [CaseInsensitiveDict(n.attrib) for n in node]
|
leyendas = [CaseInsensitiveDict(n.attrib) for n in node]
|
||||||
self._values['leyendas'] = leyendas
|
self._values['leyendas'] = leyendas
|
||||||
|
|
||||||
|
path = '//cartaporte20:CartaPorte'
|
||||||
|
carta_porte = complemento.xpath(path, namespaces=self.NS)
|
||||||
|
if carta_porte:
|
||||||
|
values = CaseInsensitiveDict(carta_porte[0].attrib)
|
||||||
|
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 = '//cartaporte20:Autotransporte'
|
||||||
|
node_auto = node.xpath(path, namespaces=self.NS)[0]
|
||||||
|
values_auto = CaseInsensitiveDict(node_auto.attrib)
|
||||||
|
values['autotransporte'] = values_auto
|
||||||
|
|
||||||
|
path = '//cartaporte20:IdentificacionVehicular'
|
||||||
|
node_tmp = node_auto.xpath(path, namespaces=self.NS)[0]
|
||||||
|
values_auto = CaseInsensitiveDict(node_tmp.attrib)
|
||||||
|
values['autotransporte'].update(values_auto)
|
||||||
|
|
||||||
|
path = '//cartaporte20:Seguros'
|
||||||
|
node_tmp = node_auto.xpath(path, namespaces=self.NS)[0]
|
||||||
|
values_auto = CaseInsensitiveDict(node_tmp.attrib)
|
||||||
|
values['autotransporte'].update(values_auto)
|
||||||
|
|
||||||
|
path = '//cartaporte20: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)
|
||||||
|
ubicacion['domicilio'] = self._set_carta_porte_domicilio(
|
||||||
|
CaseInsensitiveDict(n[0].attrib))
|
||||||
|
ubicaciones.append(ubicacion)
|
||||||
|
|
||||||
|
values['ubicaciones'] = ubicaciones
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
@ -544,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):
|
||||||
|
@ -612,15 +944,14 @@ def xml_cancel(xml, auth, cert, name):
|
||||||
return data, result
|
return data, result
|
||||||
|
|
||||||
|
|
||||||
def get_client_balance(auth):
|
def get_client_balance(auth, rfc=''):
|
||||||
if DEBUG:
|
if not auth:
|
||||||
return '-d'
|
return 'p/c'
|
||||||
|
|
||||||
pac = PACS[auth['pac']]()
|
pac = PACS[auth['pac']]()
|
||||||
balance = pac.client_balance(auth)
|
balance = pac.client_balance(auth, rfc)
|
||||||
if pac.error:
|
if pac.error:
|
||||||
balance = 'p/e'
|
balance = 'p/e'
|
||||||
|
|
||||||
return balance
|
return balance
|
||||||
|
|
||||||
|
|
||||||
|
@ -633,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()))
|
||||||
|
@ -652,15 +980,28 @@ 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]
|
||||||
|
|
||||||
|
|
||||||
def _cancel_finkok(invoice, auth, certificado):
|
def _cancel_with_cert(invoice, args, auth, certificado):
|
||||||
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
|
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
|
||||||
pac = PACS[auth['pac']]()
|
pac = PACS[auth['pac']]()
|
||||||
info = {'cer': cert.cer_pem, 'key': cert.key_pem}
|
contra = ''
|
||||||
|
try:
|
||||||
|
contra = decrypt(bytes(certificado.p12).decode(), certificado.serie)
|
||||||
|
except Exception as e:
|
||||||
|
log.error(e)
|
||||||
|
if auth['pac'] == 'comercio':
|
||||||
|
msg = 'Es necesario subir de nuevo los certificados de sello'
|
||||||
|
data = {'ok': False, 'msg': msg, 'row': {}}
|
||||||
|
return data
|
||||||
|
|
||||||
|
info = {'cer': cert.cer_pem, 'key': cert.key_pem, 'cer_ori': cert.cer,
|
||||||
|
'key_enc': certificado.key, 'pass': contra, 'args': args}
|
||||||
|
|
||||||
result = pac.cancel(invoice.xml, info, auth)
|
result = pac.cancel(invoice.xml, info, auth)
|
||||||
if pac.error:
|
if pac.error:
|
||||||
|
@ -673,23 +1014,29 @@ def _cancel_finkok(invoice, auth, certificado):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def cancel_xml_sign(invoice, auth, certificado):
|
def cancel_xml_sign(invoice, args, auth, certificado):
|
||||||
if auth['pac'] == 'finkok':
|
# ~ if auth['pac'] == 'finkok':
|
||||||
return _cancel_finkok(invoice, auth, certificado)
|
return _cancel_with_cert(invoice, args, auth, certificado)
|
||||||
|
|
||||||
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
|
cert = SATCertificate(certificado.cer, certificado.key_enc.encode())
|
||||||
pac = PACS[auth['pac']]()
|
pac = PACS[auth['pac']]()
|
||||||
|
folio_new = ''
|
||||||
|
if args['uuid']:
|
||||||
|
folio_new = f' FolioSustitucion="{args["uuid"]}"'
|
||||||
data = {
|
data = {
|
||||||
'rfc': certificado.rfc,
|
'rfc': certificado.rfc,
|
||||||
'fecha': now().isoformat()[:19],
|
'fecha': now().isoformat()[:19],
|
||||||
'uuid': str(invoice.uuid).upper(),
|
'uuid': str(invoice.uuid).upper(),
|
||||||
|
'motivo': args['reason'],
|
||||||
|
'folio': folio_new,
|
||||||
}
|
}
|
||||||
|
|
||||||
template = TEMPLATE_CANCEL.format(**data)
|
template = TEMPLATE_CANCEL.format(**data)
|
||||||
tree = ET.fromstring(template.encode())
|
tree = ET.fromstring(template.encode())
|
||||||
tree = cert.sign_xml(tree)
|
sign_xml = cert.sign_xml(tree)
|
||||||
sign_xml = ET.tostring(tree).decode()
|
# ~ print(sign_xml)
|
||||||
|
|
||||||
result = pac.cancel_xml(sign_xml, auth, invoice.xml)
|
result = pac.cancel_xml(sign_xml, auth, invoice.xml)
|
||||||
|
|
||||||
if pac.error:
|
if pac.error:
|
||||||
data = {'ok': False, 'msg': pac.error, 'row': {}}
|
data = {'ok': False, 'msg': pac.error, 'row': {}}
|
||||||
return data
|
return data
|
||||||
|
@ -698,3 +1045,181 @@ def cancel_xml_sign(invoice, auth, certificado):
|
||||||
data = {'ok': True, 'msg': msg, 'row': {'estatus': 'Cancelada'},
|
data = {'ok': True, 'msg': msg, 'row': {'estatus': 'Cancelada'},
|
||||||
'date': result['date'], 'acuse': result['acuse']}
|
'date': result['date'], 'acuse': result['acuse']}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def _get_data_sat(xml):
|
||||||
|
BF = 'string(//*[local-name()="{}"]/@{})'
|
||||||
|
# ~ NS_CFDI = {'cfdi': 'http://www.sat.gob.mx/cfd/3'}
|
||||||
|
|
||||||
|
try:
|
||||||
|
tree = ET.fromstring(xml.encode())
|
||||||
|
version = tree.attrib['Version']
|
||||||
|
namespaces = {'cfdi': PRE[version][1:-1]}
|
||||||
|
|
||||||
|
emisor = escape(
|
||||||
|
tree.xpath('string(//cfdi:Emisor/@rfc)', namespaces=namespaces) or
|
||||||
|
tree.xpath('string(//cfdi:Emisor/@Rfc)', namespaces=namespaces)
|
||||||
|
)
|
||||||
|
receptor = escape(
|
||||||
|
tree.xpath('string(//cfdi:Receptor/@rfc)', namespaces=namespaces) or
|
||||||
|
tree.xpath('string(//cfdi:Receptor/@Rfc)', namespaces=namespaces)
|
||||||
|
)
|
||||||
|
total = tree.get('total') or tree.get('Total')
|
||||||
|
uuid = tree.xpath(BF.format('TimbreFiscalDigital', 'UUID'))
|
||||||
|
except Exception as e:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
data = f'?re={emisor}&rr={receptor}&tt={total}&id={uuid}'
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
def get_status_sat(xml):
|
||||||
|
data = _get_data_sat(xml)
|
||||||
|
if not data:
|
||||||
|
return 'XML inválido'
|
||||||
|
|
||||||
|
data = """<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<soap:Envelope
|
||||||
|
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
|
||||||
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<soap:Header/>
|
||||||
|
<soap:Body>
|
||||||
|
<Consulta xmlns="http://tempuri.org/">
|
||||||
|
<expresionImpresa>
|
||||||
|
{}
|
||||||
|
</expresionImpresa>
|
||||||
|
</Consulta>
|
||||||
|
</soap:Body>
|
||||||
|
</soap:Envelope>""".format(data)
|
||||||
|
headers = {
|
||||||
|
'SOAPAction': '"http://tempuri.org/IConsultaCFDIService/Consulta"',
|
||||||
|
'Content-type': 'text/xml; charset="UTF-8"'
|
||||||
|
}
|
||||||
|
URL = 'https://consultaqr.facturaelectronica.sat.gob.mx/consultacfdiservice.svc'
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = requests.post(URL, data=data, headers=headers)
|
||||||
|
tree = ET.fromstring(result.text)
|
||||||
|
node = tree.xpath("//*[local-name() = 'Estado']")[0]
|
||||||
|
except Exception as e:
|
||||||
|
return 'Error: {}'.format(str(e))
|
||||||
|
|
||||||
|
return node.text
|
||||||
|
|
||||||
|
|
||||||
|
def spaces(value):
|
||||||
|
return '\n'.join([' '.join(l.split()) for l in value.split('\n')])
|
||||||
|
|
||||||
|
|
||||||
|
def to_slug(string):
|
||||||
|
value = (unicodedata.normalize('NFKD', string)
|
||||||
|
.encode('ascii', 'ignore')
|
||||||
|
.decode('ascii').lower())
|
||||||
|
return value.replace(' ', '_')
|
||||||
|
|
||||||
|
|
||||||
|
def read_csv(path, args={'delimiter': '|'}):
|
||||||
|
with open(path) as f:
|
||||||
|
reader = csv.DictReader(f, **args)
|
||||||
|
rows = [r for r in reader]
|
||||||
|
return rows
|
||||||
|
|
||||||
|
|
||||||
|
def _products_from_xml(rfc, data):
|
||||||
|
result = {'status': 'server', 'error': ''}
|
||||||
|
cfdi = CfdiRead(data)
|
||||||
|
|
||||||
|
if not DEBUG and rfc != cfdi.rfc_receptor:
|
||||||
|
msg = f'El receptor no es: {rfc}'
|
||||||
|
result['error'] = msg
|
||||||
|
return result
|
||||||
|
|
||||||
|
result['data'] = cfdi.data
|
||||||
|
# ~ result['data']['xml'] = cfdi.source
|
||||||
|
del result['data']['cfdi']['Certificado']
|
||||||
|
del result['data']['cfdi']['NoCertificado']
|
||||||
|
del result['data']['cfdi']['Sello']
|
||||||
|
del result['data']['timbre']['SelloCFD']
|
||||||
|
del result['data']['timbre']['SelloSAT']
|
||||||
|
|
||||||
|
emisor = result['data']['emisor']
|
||||||
|
emisor['rfc'] = emisor.pop('Rfc')
|
||||||
|
emisor['nombre'] = emisor.pop('Nombre')
|
||||||
|
result['data']['emisor'] = emisor
|
||||||
|
|
||||||
|
products = result['data']['conceptos']
|
||||||
|
rows = []
|
||||||
|
for p in products:
|
||||||
|
row = {
|
||||||
|
'key': p['NoIdentificacion'],
|
||||||
|
'key_sat': p['ClaveProdServ'],
|
||||||
|
'description': p['Descripcion'],
|
||||||
|
'unit': p['Unidad'],
|
||||||
|
'unit_value': p['ValorUnitario'],
|
||||||
|
'import': p['Importe'],
|
||||||
|
'cant': p['Cantidad'],
|
||||||
|
}
|
||||||
|
rows.append(row)
|
||||||
|
result['data']['conceptos'] = rows
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def save_file(path, data, modo='wb'):
|
||||||
|
try:
|
||||||
|
with open(path, modo) as f:
|
||||||
|
f.write(data)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _save_template(rfc, name, file_obj):
|
||||||
|
result = {'status': 'server', 'ok': False}
|
||||||
|
|
||||||
|
ext1 = name[-3:]
|
||||||
|
ext2 = file_obj.filename.split('.')[-1].lower()
|
||||||
|
if ext1 != ext2:
|
||||||
|
msg = f'Extensión incorrecta del archivo: {ext2}'
|
||||||
|
result['error'] = msg
|
||||||
|
return result
|
||||||
|
|
||||||
|
rfc = rfc.lower()
|
||||||
|
path = _join(PATHS['USER'], f'{rfc}{name}')
|
||||||
|
|
||||||
|
if save_file(path, file_obj.file.read()):
|
||||||
|
result['ok'] = True
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def upload_file(rfc, name, file_obj):
|
||||||
|
if name == 'productsadd':
|
||||||
|
return _products_from_xml(rfc, file_obj.file.read())
|
||||||
|
|
||||||
|
return _save_template(rfc, name, file_obj)
|
||||||
|
|
||||||
|
|
||||||
|
def get_qr(data, kind='svg', in_base64=False):
|
||||||
|
buffer = io.BytesIO()
|
||||||
|
segno.make(data).save(buffer, kind=kind, scale=8, border=2)
|
||||||
|
qr = buffer
|
||||||
|
if in_base64:
|
||||||
|
qr = base64.b64encode(qr.getvalue()).decode()
|
||||||
|
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
|
||||||
|
|
|
@ -17,7 +17,16 @@ from controllers.main import (AppEmpresas,
|
||||||
AppDocumentos, AppFiles, AppPreInvoices, AppCuentasBanco,
|
AppDocumentos, AppFiles, AppPreInvoices, AppCuentasBanco,
|
||||||
AppMovimientosBanco, AppTickets, AppStudents, AppEmployees, AppNomina,
|
AppMovimientosBanco, AppTickets, AppStudents, AppEmployees, AppNomina,
|
||||||
AppInvoicePay, AppCfdiPay, AppSATBancos, AppSociosCuentasBanco,
|
AppInvoicePay, AppCfdiPay, AppSATBancos, AppSociosCuentasBanco,
|
||||||
AppSATFormaPago, AppSATLeyendaFiscales, AppCert
|
AppSATFormaPago, AppSATLeyendaFiscales, AppCert, AppSucursales,
|
||||||
|
AppPartnerProducts,
|
||||||
|
AppInventoryEntries,
|
||||||
|
AppTicketsDetails,
|
||||||
|
AppUsers,
|
||||||
|
AppWareHouse,
|
||||||
|
AppWareHouseProduct,
|
||||||
|
AppSATUnidadesPeso,
|
||||||
|
AppSATRegimenes,
|
||||||
|
AppSociosRegimenes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +72,16 @@ api.add_route('/satformapago', AppSATFormaPago(db))
|
||||||
api.add_route('/socioscb', AppSociosCuentasBanco(db))
|
api.add_route('/socioscb', AppSociosCuentasBanco(db))
|
||||||
api.add_route('/leyendasfiscales', AppSATLeyendaFiscales(db))
|
api.add_route('/leyendasfiscales', AppSATLeyendaFiscales(db))
|
||||||
api.add_route('/cert', AppCert(db))
|
api.add_route('/cert', AppCert(db))
|
||||||
|
api.add_route('/sucursales', AppSucursales(db))
|
||||||
|
api.add_route('/partnerproducts', AppPartnerProducts(db))
|
||||||
|
api.add_route('/inventoryentries', AppInventoryEntries(db))
|
||||||
|
api.add_route('/warehouse', AppWareHouse(db))
|
||||||
|
api.add_route('/warehouseproduct', AppWareHouseProduct(db))
|
||||||
|
api.add_route('/ticketsdetails', AppTicketsDetails(db))
|
||||||
|
api.add_route('/users', AppUsers(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'])
|
||||||
|
|
||||||
|
@ -120,12 +123,6 @@ class StorageEngine(object):
|
||||||
def enviar_prefac(self, values):
|
def enviar_prefac(self, values):
|
||||||
return main.PreFacturas.enviar(values['id'])
|
return main.PreFacturas.enviar(values['id'])
|
||||||
|
|
||||||
# ~ def _get_cancelinvoice(self, values):
|
|
||||||
# ~ return main.Facturas.cancel(values['id'])
|
|
||||||
|
|
||||||
# ~ def _get_statussat(self, values):
|
|
||||||
# ~ return main.Facturas.get_status_sat(values['id'])
|
|
||||||
|
|
||||||
def _get_verifysat(self, values):
|
def _get_verifysat(self, values):
|
||||||
return main.Facturas.get_verify_sat(values['id'])
|
return main.Facturas.get_verify_sat(values['id'])
|
||||||
|
|
||||||
|
@ -167,6 +164,9 @@ class StorageEngine(object):
|
||||||
def _get_unidades(self, values):
|
def _get_unidades(self, values):
|
||||||
return main.SATUnidades.get_activos()
|
return main.SATUnidades.get_activos()
|
||||||
|
|
||||||
|
def _get_unitbykey(self, values):
|
||||||
|
return main.SATUnidades.get_activos_by_key()
|
||||||
|
|
||||||
def add_moneda(self, values):
|
def add_moneda(self, values):
|
||||||
return main.SATMonedas.add(values)
|
return main.SATMonedas.add(values)
|
||||||
|
|
||||||
|
@ -203,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'])
|
||||||
|
|
||||||
|
@ -230,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()
|
||||||
|
|
||||||
|
@ -242,6 +249,9 @@ class StorageEngine(object):
|
||||||
def _get_satunidades(self, values):
|
def _get_satunidades(self, values):
|
||||||
return main.get_sat_unidades(values['key'])
|
return main.get_sat_unidades(values['key'])
|
||||||
|
|
||||||
|
def _get_satunidadespeso(self, values):
|
||||||
|
return main.get_sat_unidadespeso(values['key'])
|
||||||
|
|
||||||
def _get_satproductos(self, values):
|
def _get_satproductos(self, values):
|
||||||
return main.get_sat_productos(values['key'])
|
return main.get_sat_productos(values['key'])
|
||||||
|
|
||||||
|
@ -372,7 +382,7 @@ class StorageEngine(object):
|
||||||
if opt == 'add':
|
if opt == 'add':
|
||||||
return main.Tickets.add(values, user)
|
return main.Tickets.add(values, user)
|
||||||
if opt == 'cancel':
|
if opt == 'cancel':
|
||||||
return main.Tickets.cancel(values)
|
return main.Tickets.cancel(values, user)
|
||||||
if opt == 'invoice':
|
if opt == 'invoice':
|
||||||
return main.Tickets.invoice(values, user)
|
return main.Tickets.invoice(values, user)
|
||||||
if opt == 'print':
|
if opt == 'print':
|
||||||
|
@ -472,11 +482,65 @@ class StorageEngine(object):
|
||||||
return main.SATLeyendasFiscales.remove(values)
|
return main.SATLeyendasFiscales.remove(values)
|
||||||
|
|
||||||
# ~ v2
|
# ~ v2
|
||||||
def cert_get(self, values):
|
def cert_get(self, filters):
|
||||||
return main.Certificado.get_data(values)
|
return main.Certificado.get_data(filters)
|
||||||
|
|
||||||
def cert_post(self, values):
|
def cert_post(self, filters):
|
||||||
return main.Certificado.post(values)
|
return main.Certificado.post(filters)
|
||||||
|
|
||||||
|
def sucursales_get(self, filters):
|
||||||
|
return main.Sucursales.get_data(filters)
|
||||||
|
|
||||||
|
def sucursales_post(self, filters):
|
||||||
|
return main.Sucursales.post(filters)
|
||||||
|
|
||||||
|
def partner_products_get(self, filters):
|
||||||
|
return main.PartnerProducts.get_data(filters)
|
||||||
|
|
||||||
|
def inventory_entries_get(self, filters):
|
||||||
|
return main.InventoryEntries.get_data(filters)
|
||||||
|
|
||||||
|
def inventory_entries_post(self, filters, user):
|
||||||
|
return main.InventoryEntries.post(filters, user)
|
||||||
|
|
||||||
|
def warehouse_get(self, filters):
|
||||||
|
return main.Almacenes.get_data(filters)
|
||||||
|
|
||||||
|
def warehouse_post(self, values, user):
|
||||||
|
return main.Almacenes.post(values, user)
|
||||||
|
|
||||||
|
def warehouseproduct_get(self, filters, user):
|
||||||
|
return main.WareHouseProduct.get_data(filters, user)
|
||||||
|
|
||||||
|
def warehouseproduct_post(self, filters, user):
|
||||||
|
return main.WareHouseProduct.post(filters, user)
|
||||||
|
|
||||||
|
def users_get(self, filters, user):
|
||||||
|
return main.Usuarios.get_data(filters, user)
|
||||||
|
|
||||||
|
def users_post(self, args, user):
|
||||||
|
return main.Usuarios.post(args, user)
|
||||||
|
|
||||||
|
def ticketsdetails_get(self, filters, user):
|
||||||
|
return main.TicketsDetalle.get_data(filters, user)
|
||||||
|
|
||||||
|
def products_get(self, filters, user):
|
||||||
|
return main.Productos.get_data(filters, user)
|
||||||
|
|
||||||
|
def nomina_get(self, filters, user):
|
||||||
|
return main.CfdiNomina.get_data(filters, user)
|
||||||
|
|
||||||
|
def sat_unidades_peso_get(self, filters, user):
|
||||||
|
return main.SATUnidadesPeso.get_data(filters, user)
|
||||||
|
|
||||||
|
def sat_unidades_peso_post(self, 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):
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# ~ Empresa Libre
|
# ~ Empresa Libre
|
||||||
# ~ Copyright (C) 2016-2018 Mauricio Baeza Servin (web@correolibre.net)
|
# ~ Copyright (C) 2016-2018 Mauricio Baeza Servin (publico@cuates.net)
|
||||||
# ~
|
# ~
|
||||||
# ~ This program is free software: you can redistribute it and/or modify
|
# ~ This program is free software: you can redistribute it and/or modify
|
||||||
# ~ it under the terms of the GNU General Public License as published by
|
# ~ it under the terms of the GNU General Public License as published by
|
||||||
|
@ -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.40.0'
|
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',
|
||||||
|
@ -192,6 +212,9 @@ API = 'https://api.empresalibre.net{}'
|
||||||
CURRENCY_MN = 'MXN'
|
CURRENCY_MN = 'MXN'
|
||||||
|
|
||||||
# ~ v2
|
# ~ v2
|
||||||
|
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'))
|
||||||
path_bk = os.path.join(path_docs, 'tmp')
|
path_bk = os.path.join(path_docs, 'tmp')
|
||||||
|
@ -207,6 +230,10 @@ EXT = {
|
||||||
}
|
}
|
||||||
MXN = 'MXN'
|
MXN = 'MXN'
|
||||||
|
|
||||||
|
CARTA_PORTE = {
|
||||||
|
'MONEDA': 'XXX',
|
||||||
|
}
|
||||||
|
|
||||||
PATHS = {
|
PATHS = {
|
||||||
'STATIC': path_static,
|
'STATIC': path_static,
|
||||||
'CSS': path_css,
|
'CSS': path_css,
|
||||||
|
@ -230,15 +257,19 @@ VALUES_PDF = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESICO = '626'
|
||||||
|
|
||||||
RFCS = {
|
RFCS = {
|
||||||
'PUBLIC': 'XAXX010101000',
|
'PUBLIC': 'XAXX010101000',
|
||||||
'FOREIGN': 'XEXX010101000',
|
'FOREIGN': 'XEXX010101000',
|
||||||
'CVD110412TF6': 'finkok',
|
'CVD110412TF6': 'finkok',
|
||||||
'SCD110105654': 'comercio',
|
'SCD110105654': 'comercio',
|
||||||
|
'AAA010101AAA': 'comercio',
|
||||||
|
'SPR190613I52': 'comercio',
|
||||||
}
|
}
|
||||||
|
|
||||||
URL = {
|
URL = {
|
||||||
'SEAFILE': 'https://seafile.elmau.net',
|
'SEAFILE': 'https://seafile.cuates.net',
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_GLOBAL = {
|
DEFAULT_GLOBAL = {
|
||||||
|
@ -248,31 +279,41 @@ DEFAULT_GLOBAL = {
|
||||||
'clave_sat': '01010101',
|
'clave_sat': '01010101',
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE_CANCEL = """<Cancelacion RfcEmisor="{rfc}" Fecha="{fecha}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://cancelacfd.sat.gob.mx">
|
# ~ TEMPLATE_CANCEL = """<CancelaCFD xmlns="http://cancelacfd.sat.gob.mx">
|
||||||
<Folios>
|
# ~ <Cancelacion xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RfcEmisor="{rfc}" Fecha="{fecha}">
|
||||||
<UUID>{uuid}</UUID>
|
# ~ <Folios>
|
||||||
</Folios>
|
# ~ <Folio UUID="{uuid}" Motivo="{motivo}"{folio}/>
|
||||||
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
# ~ </Folios>
|
||||||
<SignedInfo>
|
# ~ <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
||||||
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
|
# ~ <SignedInfo>
|
||||||
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
|
# ~ <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
|
||||||
<Reference URI="">
|
# ~ <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
|
||||||
<Transforms>
|
# ~ <Reference URI="">
|
||||||
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
|
# ~ <Transforms>
|
||||||
</Transforms>
|
# ~ <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
|
||||||
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
# ~ </Transforms>
|
||||||
<DigestValue />
|
# ~ <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
||||||
</Reference>
|
# ~ <DigestValue/>
|
||||||
</SignedInfo>
|
# ~ </Reference>
|
||||||
<SignatureValue />
|
# ~ </SignedInfo>
|
||||||
<KeyInfo>
|
# ~ <SignatureValue/>
|
||||||
<X509Data>
|
# ~ <KeyInfo>
|
||||||
<X509SubjectName />
|
# ~ <X509Data>
|
||||||
<X509IssuerSerial />
|
# ~ <X509IssuerSerial>
|
||||||
<X509Certificate />
|
# ~ <X509IssuerName/>
|
||||||
</X509Data>
|
# ~ <X509SerialNumber/>
|
||||||
<KeyValue />
|
# ~ </X509IssuerSerial>
|
||||||
</KeyInfo>
|
# ~ <X509Certificate/>
|
||||||
</Signature>
|
# ~ </X509Data>
|
||||||
</Cancelacion>
|
# ~ <KeyValue>
|
||||||
"""
|
# ~ <RSAKeyValue>
|
||||||
|
# ~ <Modulus/>
|
||||||
|
# ~ <Exponent/>
|
||||||
|
# ~ </RSAKeyValue>
|
||||||
|
# ~ </KeyValue>
|
||||||
|
# ~ </KeyInfo>
|
||||||
|
# ~ </Signature>
|
||||||
|
# ~ </Cancelacion>
|
||||||
|
# ~ </CancelaCFD>"""
|
||||||
|
|
||||||
|
TEMPLATE_CANCEL = """<CancelaCFD xmlns="http://cancelacfd.sat.gob.mx"><Cancelacion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Fecha="{fecha}" RfcEmisor="{rfc}" xmlns="http://cancelacfd.sat.gob.mx"><Folios><Folio UUID="{uuid}" Motivo="{motivo}"{folio}/></Folios><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue/></Reference></SignedInfo><SignatureValue/><KeyInfo><X509Data><X509IssuerSerial><X509IssuerName/><X509SerialNumber/></X509IssuerSerial><X509Certificate/></X509Data><KeyValue><RSAKeyValue><Modulus/><Exponent/></RSAKeyValue></KeyValue></KeyInfo></Signature></Cancelacion></CancelaCFD>"""
|
||||||
|
|
BIN
source/db/cp.db
BIN
source/db/cp.db
Binary file not shown.
BIN
source/db/sat.db
BIN
source/db/sat.db
Binary file not shown.
|
@ -0,0 +1,473 @@
|
||||||
|
id key name
|
||||||
|
1 Tu Contenedor externo
|
||||||
|
2 X1A Tambor de acero
|
||||||
|
3 X1B Tambor de aluminio
|
||||||
|
4 X1D Tambor contrachapado
|
||||||
|
5 X1F Contenedor flexible
|
||||||
|
6 X1G Tambor de fibra
|
||||||
|
7 X1w Tambor de madera
|
||||||
|
8 X2C Barril de madera
|
||||||
|
9 X3A Bidón de acero
|
||||||
|
10 X3H Bidón de plástico
|
||||||
|
11 X43 Bolsa de gran tamaño
|
||||||
|
12 X44 Bolsa de plástico
|
||||||
|
13 X4A Caja de acero
|
||||||
|
14 X4B Caja de aluminio
|
||||||
|
15 X4C Caja de madera natural
|
||||||
|
16 X4D Caja de contrachapado
|
||||||
|
17 X4F Caja de madera reconstituida
|
||||||
|
18 X4G Caja de cartón
|
||||||
|
19 X4H Caja de plástico
|
||||||
|
20 X5H Bolsa de plástico tejido
|
||||||
|
21 X5L Bolsa textil
|
||||||
|
22 X5M Bolsa de papel
|
||||||
|
23 X6H Recipiente de plástico, Contenedor compuesto.
|
||||||
|
24 X6P Recipiente de vidrio, Contenedor compuesto.
|
||||||
|
25 X7A Estuche para carro
|
||||||
|
26 X7B Estuche de madera
|
||||||
|
27 X8A Pallet de madera
|
||||||
|
28 X8B Cajón de madera
|
||||||
|
29 X8C Madera flejada
|
||||||
|
30 XAA Contenedor intermedio para gráneles de plástico rígido
|
||||||
|
31 XAB Contenedor de fibra
|
||||||
|
32 XAC Contenedor de papel
|
||||||
|
33 XAD Contenedor de madera
|
||||||
|
34 XAE Aerosol
|
||||||
|
35 XAF Pallet modular con collares, 80cms * 60cms
|
||||||
|
36 XAG Pallet o empaquetado
|
||||||
|
37 XAH Pallet, 100cms X 110cms
|
||||||
|
38 XAI Contenedor tipo concha
|
||||||
|
39 XAJ Cono
|
||||||
|
40 XAL Esfera
|
||||||
|
41 XAM Ampolleta no protegida
|
||||||
|
42 XAP Ampolleta protegida
|
||||||
|
43 XAT Atomizador
|
||||||
|
44 XAV Cápsula
|
||||||
|
45 XB4 Cinturón
|
||||||
|
46 XBA Barril
|
||||||
|
47 XBB Bobina
|
||||||
|
48 XBC Cajón para botellas / Estante para botellas
|
||||||
|
49 XBD Tablero
|
||||||
|
50 XBE Flejado
|
||||||
|
51 XBF Globo no protegido
|
||||||
|
52 XBG Bolso
|
||||||
|
53 XBH Manojo
|
||||||
|
54 XBI Compartimiento
|
||||||
|
55 XBJ Cubeta
|
||||||
|
56 XBK Cesta
|
||||||
|
57 XBL Paca comprimida
|
||||||
|
58 XBM Cuenco
|
||||||
|
59 XBN Paca no comprimida
|
||||||
|
60 XBO Botella no-protegida y cilíndrica
|
||||||
|
61 XBP Globo protegido
|
||||||
|
62 XBQ Botella cilíndrica protegida
|
||||||
|
63 XBR Barra
|
||||||
|
64 XBS Botella, no-protegida en forma de bulbo
|
||||||
|
65 XBT Rollo de tela
|
||||||
|
66 XBU Butt
|
||||||
|
67 XBV Botella de bulbo protegido
|
||||||
|
68 XBW Caja para líquidos
|
||||||
|
69 XBX Caja
|
||||||
|
70 XBY Tablero, con fleje/ agrupados/ armados
|
||||||
|
71 XBZ Barras, con fleje/ agrupados/ armados
|
||||||
|
72 XCA Lata rectangular
|
||||||
|
73 XCB Cajón para cerveza
|
||||||
|
74 XCC Mantequera
|
||||||
|
75 XCD Lata con mango y boquilla
|
||||||
|
76 XCE Cesto tejido
|
||||||
|
77 XCF Cofre
|
||||||
|
78 XCG Contenedor tipo Jaula
|
||||||
|
79 XCH Cajonera
|
||||||
|
80 XCI Frasco
|
||||||
|
81 XCJ Ataúd
|
||||||
|
82 XCK Barrica
|
||||||
|
83 XCL Espiral
|
||||||
|
84 XCM Paquete de tarjetas
|
||||||
|
85 XCN Contenedor, no especificado como equipo de transporte
|
||||||
|
86 XCO Garrafón no protegido
|
||||||
|
87 XCP Garrafón protegido
|
||||||
|
88 XCQ Cartucho
|
||||||
|
89 XCR Cajón
|
||||||
|
90 XCS Estuche
|
||||||
|
91 XCT Cartón
|
||||||
|
92 XCU Vaso
|
||||||
|
93 XCV Cubierta
|
||||||
|
94 XCW Jaula estilo rodillo
|
||||||
|
95 XCX Lata cilíndrica
|
||||||
|
96 XCY Cilindro
|
||||||
|
97 XCZ Lona
|
||||||
|
98 XDA Cajón multicapa de plástico
|
||||||
|
99 XDB Cajón de varias capas de madera
|
||||||
|
100 XDC Cajón multicapa de cartón
|
||||||
|
101 XDG Jaula, Según la clasificación de la compañía (Commonwealth Handling Equipment Pool (CHEP))
|
||||||
|
102 XDH Caja, Según la clasificación de la compañía (CHEP), Eurobox
|
||||||
|
103 XDI Tambor de hierro
|
||||||
|
104 XDJ damajuana o garrafa, no protegido
|
||||||
|
105 XDK Cajón a granel, cartón
|
||||||
|
106 XDL Cajas de plástico
|
||||||
|
107 XDM Cajones a granel de madera
|
||||||
|
108 XDN Dispensador
|
||||||
|
109 XDP damajuana o garrafa, protegido
|
||||||
|
110 XDR Tambor
|
||||||
|
111 XDS Bandeja de una capa sin cubierta y de plástico
|
||||||
|
112 XDT Bandeja de una capa sin cubierta y de madera
|
||||||
|
113 XDU Bandeja de una capa sin cubierta y poliestireno
|
||||||
|
114 XDV Bandeja de una capa sin cubierta y de cartón
|
||||||
|
115 XDW Bandeja de dos capas sin tapa y con bandeja de plástico
|
||||||
|
116 XDX Bandeja de dos capas sin cubierta y de madera
|
||||||
|
117 XDY Bandeja de dos capas sin cubierta y de cartón
|
||||||
|
118 XEC Bolsa de plástico
|
||||||
|
119 XED Estuche, con pallet de base
|
||||||
|
120 XEE Estuche, con pallet base de madera
|
||||||
|
121 XEF Estuche, con pallet base de cartón
|
||||||
|
122 XEG Estuche, con pallet base de plástico
|
||||||
|
123 XEH Estuche, con pallet base de metal
|
||||||
|
124 XEI Estuche isotérmico
|
||||||
|
125 XEN Sobre
|
||||||
|
126 XFB Bolsa flexible
|
||||||
|
127 XFC Cajón para fruta
|
||||||
|
128 XFD Cajón enmarcado
|
||||||
|
129 XFE Tanque flexible
|
||||||
|
130 XFI Firkin
|
||||||
|
131 XFL Matraz
|
||||||
|
132 XFO Cajón para zapatos
|
||||||
|
133 XFP Caja auxiliar para película fotográfica
|
||||||
|
134 XFR Marco
|
||||||
|
135 XFT Contenedor para alimentos
|
||||||
|
136 XFW Carro de cama plana
|
||||||
|
137 XFX Bolsa flexible tipo contenedor
|
||||||
|
138 XGB Botella para gas
|
||||||
|
139 XGI Viga
|
||||||
|
140 XGL Contenedor tipo galón
|
||||||
|
141 XGR Recipiente de vidrio
|
||||||
|
142 XGU Bandeja contenedor para apilar horizontalmente objetos planos
|
||||||
|
143 XGY Costal de Yute
|
||||||
|
144 XGZ Vigas con correas o agrupadas
|
||||||
|
145 XHA Cesta con mango y de plástico
|
||||||
|
146 XHB Cesta con mango y de madera
|
||||||
|
147 XHC Cesta con asa y de cartón
|
||||||
|
148 XHG Hogshead
|
||||||
|
149 XHN Gancho
|
||||||
|
150 XHR Cesto
|
||||||
|
151 XIA Paquete con pantalla y de madera
|
||||||
|
152 XIB Paquete con pantalla y de cartón
|
||||||
|
153 XIC Paquete con pantalla y de plástico
|
||||||
|
154 XID Paquete con pantalla y de metal
|
||||||
|
155 XIE Paquete de mostrador.
|
||||||
|
156 XIF Envase para alimentos
|
||||||
|
157 XIG Paquete envuelto en papel
|
||||||
|
158 XIH Tambor de plástico
|
||||||
|
159 XIK Paquete de cartón con los agujeros para botellas
|
||||||
|
160 XIL Bandeja rígida con tapa y apilable (CEN TS 14482: 2002)
|
||||||
|
161 XIN Lingote
|
||||||
|
162 XIZ Lingotes con correas/ agrupados
|
||||||
|
163 XJB Bolsa jumbo
|
||||||
|
164 XJC Bidón rectangular
|
||||||
|
165 XJG Jarra
|
||||||
|
166 XJR Tarro
|
||||||
|
167 XJT Bolsa de yute
|
||||||
|
168 XJY Bidón, cilíndrico
|
||||||
|
169 XKG Barrilete
|
||||||
|
170 XKI Kit (Conjunto de piezas)
|
||||||
|
171 XLE Valijas
|
||||||
|
172 XLG Bitácora
|
||||||
|
173 XLT Lote
|
||||||
|
174 XLU Caja de arrastre
|
||||||
|
175 XLV Contenedor pequeño
|
||||||
|
176 XLZ Registros con fleje/ agrupados/ armados
|
||||||
|
177 XMA Cajón metálico
|
||||||
|
178 XMB Múltiplo de bolsas
|
||||||
|
179 XMC Cajón para leche
|
||||||
|
180 XME Contenedor de metal
|
||||||
|
181 XMR Recipiente de metal
|
||||||
|
182 XMS Saco milti-pared
|
||||||
|
183 XMT Tapete
|
||||||
|
184 XMW Contenedor envuelto en plástico
|
||||||
|
185 XMX Caja pequeña de cerillos
|
||||||
|
186 XNA No disponible
|
||||||
|
187 XNE Sin empaque o no empaquetado
|
||||||
|
188 XNF Sin empaque o no empaquetado, unidad simple
|
||||||
|
189 XNG Sin empaque o no empaquetado, unidades múltiples
|
||||||
|
190 XNS Caja nido
|
||||||
|
191 XNT Red
|
||||||
|
192 XNU Red de plástico con tubo
|
||||||
|
193 XNV Red textil con tubo
|
||||||
|
194 XOA Pallet, Según la clasificación de la compañía (Commonwealth Handling Equipment Pool (CHEP) 40 cm x 60 cm
|
||||||
|
195 XOB Pallet, Según la clasificación de la compañía (Commonwealth Handling Equipment Pool (CHEP) 80 cm x 120 cm
|
||||||
|
196 XOC Pallet, Según la clasificación de la compañía (Commonwealth Handling Equipment Pool (CHEP) 100 cm x 120 cm
|
||||||
|
197 XOD Pallet, AS 4068-1993
|
||||||
|
198 XOE Pallet, ISO T11
|
||||||
|
199 XOF Plataforma, peso o dimensión no especificada
|
||||||
|
200 XOK Bloque
|
||||||
|
201 XOT Octabin
|
||||||
|
202 XP2 Charola
|
||||||
|
203 XPA Cajetilla
|
||||||
|
204 XPB Pallet, Caja combinada y abierta con caja y pallet.
|
||||||
|
205 XPC Paquete postal
|
||||||
|
206 XPD Pallet modular con collares (80cms * 100cms)
|
||||||
|
207 XPE Pallet modular con collares (80cms * 120cms)
|
||||||
|
208 XPF Corral
|
||||||
|
209 XPG Placa
|
||||||
|
210 XPH Cantaro
|
||||||
|
211 XPI Pleca
|
||||||
|
212 XPJ Canastilla
|
||||||
|
213 XPK Paquete
|
||||||
|
214 XPL Balde
|
||||||
|
215 XPN Tablón
|
||||||
|
216 XPO Bolsa pequeña
|
||||||
|
217 XPR Contenedor de plástico
|
||||||
|
218 XPT Maceta
|
||||||
|
219 XPU Cacerola
|
||||||
|
220 XPV Tubos, con fleje/ agrupados/ armados
|
||||||
|
221 XPX Pallet
|
||||||
|
222 XPY Placas con fleje/ agrupados/ armados
|
||||||
|
223 XPZ Tablones con fleje/ agrupados/ armados
|
||||||
|
224 XQA Tambor de acero con cabeza no desmontable
|
||||||
|
225 XQB Tambor de acero con cabeza extraíble
|
||||||
|
226 XQC Tambor de aluminio con cabeza no extraíble
|
||||||
|
227 XQD Tambor de aluminio con cabeza extraíble
|
||||||
|
228 XQF Tambor, plástico con cabeza no desmontable
|
||||||
|
229 XQG Tambor, plástico, cabeza extraíble
|
||||||
|
230 XQH Barril de madera con tapón
|
||||||
|
231 XQJ Barril de madera con cabeza desprendible
|
||||||
|
232 XQK Bidón de acero con cabeza no desmontable
|
||||||
|
233 XQL Bidón de acero con cabeza desmontable
|
||||||
|
234 XQM Bidón de plástico con cabeza no desmontable
|
||||||
|
235 XQN Bidón de plástico con cabeza extraíble
|
||||||
|
236 XQP Caja de madera natural estándar
|
||||||
|
237 XQQ Caja de madera natural con muros a prueba de filtraciones
|
||||||
|
238 XQR Caja de plástico expandida
|
||||||
|
239 XQS Caja de plástico sólida
|
||||||
|
240 XRD Rod
|
||||||
|
241 XRG Anillo
|
||||||
|
242 XRJ Estante, Perchero para ropa
|
||||||
|
243 XRK Estante
|
||||||
|
244 XRL Carrete
|
||||||
|
245 XRO Rollo
|
||||||
|
246 XRT Red Roja
|
||||||
|
247 XRZ Varillas con fleje/ agrupados/ armados
|
||||||
|
248 XSA Saco
|
||||||
|
249 XSB Losa
|
||||||
|
250 XSC Cajón poco profundo
|
||||||
|
251 XSD Huso
|
||||||
|
252 XSE Baúl
|
||||||
|
253 XSH Bolsa pequeña hermética
|
||||||
|
254 XSI Patín
|
||||||
|
255 XSK Carcasa esqueleto
|
||||||
|
256 XSL Hoja de deslizamiento
|
||||||
|
257 XSM Hoja de metal
|
||||||
|
258 XSO Carrete pequeño
|
||||||
|
259 XSP Hoja de empaque de plástico
|
||||||
|
260 XSS Cajón de acero
|
||||||
|
261 XSU Maleta
|
||||||
|
262 XSV Sobre de acero
|
||||||
|
263 XSW Envoltorio
|
||||||
|
264 XSY Manga
|
||||||
|
265 XSZ Hojas con fleje/ agrupados/ armados
|
||||||
|
266 XT1 Tableta
|
||||||
|
267 XTB Tina
|
||||||
|
268 XTC Caja para té
|
||||||
|
269 XTD Tubo plegable
|
||||||
|
270 XTG Contenedor de tanque genérico
|
||||||
|
271 XTI Tierce
|
||||||
|
272 XTK Tanque rectangular
|
||||||
|
273 XTL Tina con tapa
|
||||||
|
274 XTN Hojalata
|
||||||
|
275 XTO Tonel
|
||||||
|
276 XTR Maletero
|
||||||
|
277 XTS Estructura
|
||||||
|
278 XTT Bolsa de mano
|
||||||
|
279 XTU Tubo
|
||||||
|
280 XTV Tubo con boquilla
|
||||||
|
281 XTW Pallet tricapa
|
||||||
|
282 XTY Tanque cilíndrico
|
||||||
|
283 XTZ Tubos con fleje/ agrupados/ armados
|
||||||
|
284 XUC Sin empaque
|
||||||
|
285 XUN Unidad
|
||||||
|
286 XVA Tanque
|
||||||
|
287 XVG Tanque de gas (a 1,031 mbar y 15° C)
|
||||||
|
288 XVI Frasco pequeño
|
||||||
|
289 XVK Paquete transportable
|
||||||
|
290 XVL Contenedor para líquidos a granel
|
||||||
|
291 XVN Vehículo
|
||||||
|
292 XVO "Contenedor para sólido de partículas grandes a granel (""nódulos"")"
|
||||||
|
293 XVP Envasado al vacío
|
||||||
|
294 XVQ Tanque para Gas licuado (a temperatura / presión anormal)
|
||||||
|
295 XVR Contenedor para sólidos de partículas granulares a granel (Granos)
|
||||||
|
296 XVS Contenedor de chatarra a granel
|
||||||
|
297 XVY "Contenedor para sólido de partículas finas a granel (""polvos"")"
|
||||||
|
298 XWA Contenedor de granel intermedio
|
||||||
|
299 XWB Botella de mimbre
|
||||||
|
300 XWC Contenedor intermedio para gráneles y de acero
|
||||||
|
301 XWD Contenedor intermedio para gráneles y de aluminio
|
||||||
|
302 XWF Contenedor intermedio para gráneles y de metal
|
||||||
|
303 XWG Contenedor intermedio para gráneles y de acero presurizado menor a 10 kpa
|
||||||
|
304 XWH Contenedor intermedio para gráneles y de aluminio, presurizado menor a 10 kpa
|
||||||
|
305 XWJ Contenedor intermedio para gráneles y de metal con una presión de 10 kpa
|
||||||
|
306 XWK Contenedor intermedio para gráneles y de acero para líquido
|
||||||
|
307 XWL Contenedor intermedio para gráneles y de aluminio para líquido
|
||||||
|
308 XWM Contenedor intermedio para gráneles y de metal para líquido
|
||||||
|
309 XWN Contenedor intermedio para gráneles con tejido plástico sin capa con revestimiento
|
||||||
|
310 XWP Contenedor intermedio para gráneles con tejido plástico y recubierto
|
||||||
|
311 XWQ Contenedor intermedio para gráneles con tejido plástico con revestimiento
|
||||||
|
312 XWR Contenedor intermedio para gráneles con tejido plástico, revestido y con forro
|
||||||
|
313 XWS Contenedor intermedio para gráneles con película de plástico
|
||||||
|
314 XWT Contenedor intermedio para gráneles textil sin capa / forro
|
||||||
|
315 XWU Contenedor intermedio para gráneles de madera natural con forro interior
|
||||||
|
316 XWV Contenedor intermedio para gráneles textil recubierto
|
||||||
|
317 XWW Contenedor intermedio para gráneles textil con revestimiento
|
||||||
|
318 XWX Contenedor intermedio para gráneles textil recubierto y con forro
|
||||||
|
319 XWY Contenedor intermedio para gráneles contrachapado con revestimiento interior
|
||||||
|
320 XWZ Contenedor intermedio para gráneles de madera reconstituida con revestimiento interior
|
||||||
|
321 XXA Bolsa de tejido plástico, sin abrigo interior ni forro
|
||||||
|
322 XXB Bolsa de tejido plástico a prueba de filtraciones
|
||||||
|
323 XXC Bolsa de tejido plástico resistente al agua
|
||||||
|
324 XXD Bolsa con película de plástico
|
||||||
|
325 XXF Bolsa textil sin capa ni forro interior
|
||||||
|
326 XXG Bolsa textil a prueba de filtraciones
|
||||||
|
327 XXH Bolsa textil resistente al agua
|
||||||
|
328 XXJ Bolsa de papel multi-pared
|
||||||
|
329 XXK Bolsa de papel multi-pared, resistente al agua
|
||||||
|
330 XYA Empaque compuesto, recipiente de plástico en tambor de acero
|
||||||
|
331 XYB Empaque compuesto, recipiente de plástico en cajas de acero
|
||||||
|
332 XYC Empaque compuesto, recipiente de plástico en tambor de aluminio
|
||||||
|
333 XYD Empaque compuesto, recipiente de plástico en cajón de aluminio
|
||||||
|
334 XYF Empaque compuesto, recipiente de plástico en caja de madera
|
||||||
|
335 XYG Empaque compuesto, recipiente de plástico en tambor de madera contrachapada
|
||||||
|
336 XYH Empaque compuesto, recipiente de plástico en caja de madera contrachapada
|
||||||
|
337 XYJ Empaque compuesto, recipiente de plástico en tambor de fibra
|
||||||
|
338 XYK Empaque compuesto, recipiente de plástico en caja de cartón
|
||||||
|
339 XYL Empaque compuesto, recipiente de plástico en el tambor de plástico
|
||||||
|
340 XYM Empaque compuesto, recipiente de plástico en caja de plástico sólido
|
||||||
|
341 XYN Empaque compuesto, receptáculo de vidrio en tambor de acero
|
||||||
|
342 XYP Empaque compuesto, receptáculo de vidrio en caja de cajas de acero
|
||||||
|
343 XYQ Empaque compuesto, recipiente de vidrio en tambor de aluminio
|
||||||
|
344 XYR Empaque compuesto, receptáculo de vidrio en caja de aluminio
|
||||||
|
345 XYS Empaque compuesto, recipiente de vidrio en caja de madera
|
||||||
|
346 XYT Empaque compuesto, recipiente de vidrio en tambor de madera contrachapada
|
||||||
|
347 Xyv Empaque compuesto, recipiente de vidrio en el cesto de mimbre
|
||||||
|
348 XYW Empaque compuesto, recipiente de vidrio en tambor de fibra
|
||||||
|
349 XYX Empaque compuesto, recipiente de vidrio en caja de cartón
|
||||||
|
350 XYY Empaque compuesto, recipiente de vidrio en paquete de plástico expandible
|
||||||
|
351 XYZ Empaque compuesto, recipiente de vidrio en paquete de plástico sólido
|
||||||
|
352 XZA Contenedor de granel intermedio, papel, multi-pared
|
||||||
|
353 XZB Bolsa grande
|
||||||
|
354 XZC Contenedor intermedio para gráneles de papel, multi-pared y resistente al agua
|
||||||
|
355 XZD Contenedor intermedio para gráneles de plástico rígido, con equipo estructural para sólidos
|
||||||
|
356 XZF Contenedor intermedio para gráneles de plástico rígido, autoportante para sólidos
|
||||||
|
357 XZG Contenedor intermedio para gráneles de plástico rígido, con equipo estructural, presurizado
|
||||||
|
358 XZH Contenedor intermedio para gráneles de plástico rígido, autoportante y presurizado
|
||||||
|
359 XZJ Contenedor intermedio para gráneles de plástico rígido, con equipo estructural para líquidos
|
||||||
|
360 XZK Contenedor intermedio para gráneles de plástico rígido, autoportante, líquidos
|
||||||
|
361 XZL Contenedor intermedio para gráneles, compuesto y de plástico rígido, sólidos
|
||||||
|
362 XZM Contenedor intermedio para gráneles, compuesto y de plástico flexible, sólidos
|
||||||
|
363 XZN Contenedor intermedio para gráneles, compuesto y de plástico rígido, presurizado
|
||||||
|
364 XZP Contenedor intermedio para gráneles, compuesto y de plástico flexible, presurizado
|
||||||
|
365 XZQ Contenedor intermedio para gráneles, compuesto y de plástico rígido, líquidos
|
||||||
|
366 XZR Contenedor intermedio para gráneles, compuesto y de plástico flexible para líquidos
|
||||||
|
367 XZS Contenedor intermedio para gráneles, compuesto
|
||||||
|
368 XZT Contenedor intermedio para gráneles con tablero de fibras
|
||||||
|
369 XZU Contenedor intermedio para gráneles flexible
|
||||||
|
370 XZV Contenedor intermedio para gráneles de metal, distinto del acero
|
||||||
|
371 XZW Contenedor intermedio para gráneles, de madera natural
|
||||||
|
372 XZX Contenedor intermedio para gráneles, de contrachapado
|
||||||
|
373 XZY Contenedor intermedio para gráneles, de madera reconstituida
|
||||||
|
374 KGM Kilogramo
|
||||||
|
375 MC Microgramo
|
||||||
|
376 DJ Decagramo
|
||||||
|
377 DG Decigramo
|
||||||
|
378 GRM Gramo
|
||||||
|
379 CGM Centigramo
|
||||||
|
380 TNE Tonelada (tonelada métrica)
|
||||||
|
381 DTN Decitonelada métrica
|
||||||
|
382 MGM Miligramo
|
||||||
|
383 HGM Hectogramo
|
||||||
|
384 KTN Kilotonelada Métrica
|
||||||
|
385 2U Megagramo
|
||||||
|
386 LBR Libra
|
||||||
|
387 GRN Grano
|
||||||
|
388 ONZ Onza (avoirdupois)
|
||||||
|
389 CWI Hundredweight
|
||||||
|
390 CWA Hundred pound
|
||||||
|
391 LTN Tonelada (UK) o tonelada larga (estados unidos)
|
||||||
|
392 STI Estone (UK)
|
||||||
|
393 STN Tonelada (estados unidos) o tonelada corta (UK y estados unidos)
|
||||||
|
394 APZ Onza troy u onza farmacéutica
|
||||||
|
395 F13 Slug
|
||||||
|
396 K64 Libra (avoirdupois) por grado fahrenheit
|
||||||
|
397 L69 Tonelada por kelvin
|
||||||
|
398 L87 Tonelada corta por grado fahrenheit
|
||||||
|
399 M85 Tonelada, ensayo
|
||||||
|
400 M86 Libra Alemana
|
||||||
|
401 J33 Microgramo por kilogramo
|
||||||
|
402 L32 Nanogramo por kilogramo
|
||||||
|
403 NA Miligramo por kilogramo
|
||||||
|
404 M29 Kilogramo por kilogramo
|
||||||
|
405 M91 Libra por libra
|
||||||
|
406 Q29 Microgramo por hectogramo
|
||||||
|
407 MTQ Metro cúbico
|
||||||
|
408 MAL Megalitro
|
||||||
|
409 LTR Litro
|
||||||
|
410 MMQ Milímetro cúbico
|
||||||
|
411 CMQ Centímetro cúbico
|
||||||
|
412 DMQ Decímetro cúbico
|
||||||
|
413 MLT Mililitro
|
||||||
|
414 HLT Hectolitro
|
||||||
|
415 CLT Centilitro
|
||||||
|
416 DMA Decámetro cúbico
|
||||||
|
417 H19 Hectómetro cúbico
|
||||||
|
418 H20 Kilómetro cúbico
|
||||||
|
419 M71 Metro cúbico por pascal (joules)
|
||||||
|
420 DLT Decilitro
|
||||||
|
421 4G Microlitro
|
||||||
|
422 K6 Kilolitro
|
||||||
|
423 A44 Decalitro
|
||||||
|
424 G94 Centímetro cúbico por bar
|
||||||
|
425 G95 Litro por bar
|
||||||
|
426 G96 Metro cúbico por bar
|
||||||
|
427 G97 Mililitro por bar
|
||||||
|
428 5I Pies cúbicos estándar
|
||||||
|
429 INQ Pulgada cúbica
|
||||||
|
430 FTQ Pie cúbico
|
||||||
|
431 YDQ Yarda cúbica
|
||||||
|
432 GLI Galón (UK)
|
||||||
|
433 GLL Galón (EUA)
|
||||||
|
434 PT Pinta (US)
|
||||||
|
435 PTI Pint (uk)
|
||||||
|
436 QTI Cuarto (UK)
|
||||||
|
437 PTL Pinta líquida (estados unidos)
|
||||||
|
438 QTL Cuarto de líquido (estadis unidos)
|
||||||
|
439 PTD Pinta seca (estados unidos)
|
||||||
|
440 OZI Onza líquida (UK)
|
||||||
|
441 QT Cuarto (EUA)
|
||||||
|
442 J57 Barril (uk petróleo)
|
||||||
|
443 K21 Pie cúbico por grado fahrenheit
|
||||||
|
444 K23 Pie cúbico por psi (libra por pulgada cuadrada)
|
||||||
|
445 L43 Peck (UK)
|
||||||
|
446 L61 Pinta (US seco)
|
||||||
|
447 L62 Cuarto de galón (seco de los EUA)
|
||||||
|
448 L84 Tonelada (flota UK)
|
||||||
|
449 L86 Tonelada (flota estados unidos)
|
||||||
|
450 M11 Yarda cúbica por grado fahrenheit
|
||||||
|
451 M14 Yarda cúbica por psi (libra por pulgada cuadrada)
|
||||||
|
452 OZA Onza líquida (estados unidos)
|
||||||
|
453 BUI Bushel (UK)
|
||||||
|
454 BUA Bushel (EUA)
|
||||||
|
455 BLL Barril (EUA)
|
||||||
|
456 BLD Barril seco (EUA)
|
||||||
|
457 GLD Galón seco (EUA)
|
||||||
|
458 QTD Cuarto seco (estados unidos)
|
||||||
|
459 G26 Estere
|
||||||
|
460 G21 Taza (unidad de volumen)
|
||||||
|
461 G24 Cucharada (estados unidos)
|
||||||
|
462 G25 Cucharilla (estados unidos)
|
||||||
|
463 G23 Peck
|
||||||
|
464 M67 Acre-pie
|
||||||
|
465 M68 Cordón
|
||||||
|
466 M69 Milla cúbica (reino unido)
|
||||||
|
467 M70 Unidad tradicional de capacidad de carga
|
||||||
|
468 Q32 Femtolitro
|
||||||
|
469 Q33 Picolitro
|
||||||
|
470 Q34 Nanolitro
|
||||||
|
471 NM3 Metro cúbico normalizado
|
||||||
|
472 SM3 Metro cúbico estándar
|
|
|
@ -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},
|
||||||
|
@ -114,7 +114,9 @@
|
||||||
{"key": "607", "name": "Régimen de Enajenación o Adquisición de Bienes", "moral": true, "activo": false},
|
{"key": "607", "name": "Régimen de Enajenación o Adquisición de Bienes", "moral": true, "activo": false},
|
||||||
{"key": "629", "name": "De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales", "fisica": true, "activo": false},
|
{"key": "629", "name": "De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales", "fisica": true, "activo": false},
|
||||||
{"key": "630", "name": "Enajenación de acciones en bolsa de valores", "fisica": true, "activo": false},
|
{"key": "630", "name": "Enajenación de acciones en bolsa de valores", "fisica": true, "activo": false},
|
||||||
{"key": "615", "name": "Régimen de los ingresos por obtención de premios", "fisica": true, "activo": false}
|
{"key": "615", "name": "Régimen de los ingresos por obtención de premios", "fisica": true, "activo": false},
|
||||||
|
{"key": "625", "name": "Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas", "fisica": true, "activo": true},
|
||||||
|
{"key": "626", "name": "Régimen Simplificado de Confianza", "moral": true, "fisica": true, "activo": true}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -680,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}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -726,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 |
File diff suppressed because it is too large
Load Diff
|
@ -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){
|
||||||
|
@ -1063,6 +1072,61 @@ function cmd_pay_stamp_click(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_win_cancel_pay_close_click(){
|
||||||
|
$$('win_invoice_cancel_pay').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function send_invoice_cancel_pay(reason='', uuid=''){
|
||||||
|
var grid = $$('grid_cfdi_pay')
|
||||||
|
var form = $$('form_bank_pay')
|
||||||
|
var values = form.getValues()
|
||||||
|
var data = {
|
||||||
|
'opt': 'cancel',
|
||||||
|
'id_mov': values.id_mov,
|
||||||
|
args: {
|
||||||
|
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(values.id, {'estatus': 'Cancelada'})
|
||||||
|
}else{
|
||||||
|
msg_error('No fue posible cancelar')
|
||||||
|
webix.alert({
|
||||||
|
title: 'Error al Cancelar',
|
||||||
|
text: values.msg,
|
||||||
|
type: 'alert-error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_invoice_cancel_pay_click(){
|
||||||
|
var reason = $$('lst_reasons_cancel').getValue()
|
||||||
|
var uuid = $$('txt_cancel_uuid').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_pay(reason, uuid)
|
||||||
|
$$('win_invoice_cancel_pay').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function cmd_pay_cancel_click(){
|
function cmd_pay_cancel_click(){
|
||||||
var form = $$('form_bank_pay')
|
var form = $$('form_bank_pay')
|
||||||
var values = form.getValues()
|
var values = form.getValues()
|
||||||
|
@ -1074,34 +1138,8 @@ function cmd_pay_cancel_click(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = '¿Estás seguro de cancelar esta factura?\n\nESTA ACCIÓN NO SE PUEDE DESHACER'
|
win_invoice_cancel_pay.init()
|
||||||
webix.confirm({
|
$$('win_invoice_cancel_pay').show()
|
||||||
title: 'Cancelar Factura',
|
|
||||||
ok: 'Si',
|
|
||||||
cancel: 'No',
|
|
||||||
type: 'confirm-error',
|
|
||||||
text: msg,
|
|
||||||
callback:function(result){
|
|
||||||
if(result){
|
|
||||||
webix.ajax().post('/cfdipay', data, {
|
|
||||||
error:function(text, data, XmlHttpRequest){
|
|
||||||
msg = 'Ocurrio un error, consulta a soporte técnico'
|
|
||||||
msg_error(msg)
|
|
||||||
},
|
|
||||||
success:function(text, data, XmlHttpRequest){
|
|
||||||
values = data.json();
|
|
||||||
if(values.ok){
|
|
||||||
grid.updateItem(values.id, {'estatus': 'Cancelada'})
|
|
||||||
msg_ok(values.msg)
|
|
||||||
}else{
|
|
||||||
msg_error(values.msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1389,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()
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ var nomina_controllers = {
|
||||||
$$('cmd_nomina_without_stamp').attachEvent('onItemClick', cmd_nomina_without_stamp_click)
|
$$('cmd_nomina_without_stamp').attachEvent('onItemClick', cmd_nomina_without_stamp_click)
|
||||||
$$('cmd_nomina_delete').attachEvent('onItemClick', cmd_nomina_delete_click)
|
$$('cmd_nomina_delete').attachEvent('onItemClick', cmd_nomina_delete_click)
|
||||||
$$('cmd_nomina_timbrar').attachEvent('onItemClick', cmd_nomina_timbrar_click)
|
$$('cmd_nomina_timbrar').attachEvent('onItemClick', cmd_nomina_timbrar_click)
|
||||||
|
$$('cmd_nomina_sat').attachEvent('onItemClick', cmd_nomina_sat_click)
|
||||||
$$('cmd_nomina_log').attachEvent('onItemClick', cmd_nomina_log_click)
|
$$('cmd_nomina_log').attachEvent('onItemClick', cmd_nomina_log_click)
|
||||||
$$('cmd_nomina_download').attachEvent('onItemClick', cmd_nomina_download_click)
|
$$('cmd_nomina_download').attachEvent('onItemClick', cmd_nomina_download_click)
|
||||||
$$('cmd_nomina_cancel').attachEvent('onItemClick', cmd_nomina_cancel_click)
|
$$('cmd_nomina_cancel').attachEvent('onItemClick', cmd_nomina_cancel_click)
|
||||||
|
@ -254,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)
|
||||||
}
|
}
|
||||||
|
@ -484,29 +485,43 @@ function cmd_nomina_cancel_click(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = '¿Estás seguro de cancelar el recibo?<BR><BR>'
|
win_invoice_cancel_nomina.init()
|
||||||
msg += row['empleado'] + ' (' + row['serie'] + '-' + row['folio'] + ')'
|
$$('win_invoice_cancel_nomina').show()
|
||||||
msg += '<BR><BR>ESTA ACCIÓN NO SE PUEDE DESHACER<BR><BR>'
|
|
||||||
webix.confirm({
|
|
||||||
title: 'Cancelar Nomina',
|
|
||||||
ok: 'Si',
|
|
||||||
cancel: 'No',
|
|
||||||
type: 'confirm-error',
|
|
||||||
text: msg,
|
|
||||||
callback:function(result){
|
|
||||||
if (result){
|
|
||||||
cancel_nomina(row['id'])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cancel_nomina(id){
|
function cmd_win_cancel_nomina_close_click(){
|
||||||
|
$$('win_invoice_cancel_nomina').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_invoice_cancel_nomina_click(){
|
||||||
|
var reason = $$('lst_reasons_cancel').getValue()
|
||||||
|
var uuid = $$('txt_cancel_uuid').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
|
||||||
|
}
|
||||||
|
|
||||||
|
$$('win_invoice_cancel_nomina').close()
|
||||||
|
send_cancel_nomina(reason, uuid)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function send_cancel_nomina(reason, uuid){
|
||||||
var grid = $$('grid_nomina')
|
var grid = $$('grid_nomina')
|
||||||
|
var row = grid.getSelectedItem()
|
||||||
var data = new Object()
|
var data = new Object()
|
||||||
data['opt'] = 'cancel'
|
data['opt'] = 'cancel'
|
||||||
data['id'] = id
|
data['id'] = row.id
|
||||||
|
data['args'] = {reason: reason, uuid: uuid}
|
||||||
|
|
||||||
webix.ajax().sync().post('nomina', data, {
|
webix.ajax().sync().post('nomina', data, {
|
||||||
error:function(text, data, XmlHttpRequest){
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
@ -516,7 +531,7 @@ function cancel_nomina(id){
|
||||||
success:function(text, data, XmlHttpRequest){
|
success:function(text, data, XmlHttpRequest){
|
||||||
values = data.json();
|
values = data.json();
|
||||||
if(values.ok){
|
if(values.ok){
|
||||||
grid.updateItem(id, values.row)
|
grid.updateItem(row.id, values.row)
|
||||||
msg_ok(values.msg)
|
msg_ok(values.msg)
|
||||||
}else{
|
}else{
|
||||||
msg_error(values.msg)
|
msg_error(values.msg)
|
||||||
|
@ -570,3 +585,43 @@ function grid_nomina_on_select_change(){
|
||||||
g.getColumnConfig('empleado').footer[0].text = webix.i18n.priceFormat(total)
|
g.getColumnConfig('empleado').footer[0].text = webix.i18n.priceFormat(total)
|
||||||
g.refreshColumns()
|
g.refreshColumns()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_nomina_sat_click(){
|
||||||
|
var g = $$('grid_nomina')
|
||||||
|
|
||||||
|
if(g.count() == 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var row = g.getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un recibo de nómina')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (row instanceof Array){
|
||||||
|
msg_error('Selecciona solo un recibo de nómina')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!row.uuid){
|
||||||
|
msg_error('La factura no esta timbrada, solo es posible consultar \
|
||||||
|
el estatus en el SAT de facturas timbradas')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = {opt: 'status_sat', id: row.id}
|
||||||
|
webix.ajax().get('/nomina', options, function(text, data){
|
||||||
|
var value = data.json()
|
||||||
|
if(value == 'Vigente'){
|
||||||
|
msg_ok(value)
|
||||||
|
}else if(value == 'uncancel'){
|
||||||
|
ask_invoice_uncancel(row.id)
|
||||||
|
}else{
|
||||||
|
msg_error(value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var cfg_products = new Object()
|
var cfg_products = new Object()
|
||||||
|
var gis_admin = false
|
||||||
|
|
||||||
|
|
||||||
function products_default_config(){
|
function products_default_config(){
|
||||||
|
@ -18,9 +19,26 @@ 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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
webix.ajax().get('/users', {'opt': 'is_admin'}, {
|
||||||
|
error: function(text, data, xhr) {
|
||||||
|
msg = 'Error al consultar'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success: function(text, data, xhr) {
|
||||||
|
var values = data.json()
|
||||||
|
gis_admin = values.is_admin
|
||||||
|
if(values.is_admin){
|
||||||
|
$$('cmd_add_inventory').show()
|
||||||
|
//~ $$('cmd_products_add').show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +50,12 @@ var products_controllers = {
|
||||||
$$("cmd_save_product").attachEvent("onItemClick", cmd_save_product_click)
|
$$("cmd_save_product").attachEvent("onItemClick", cmd_save_product_click)
|
||||||
$$("cmd_cancel_product").attachEvent("onItemClick", cmd_cancel_product_click)
|
$$("cmd_cancel_product").attachEvent("onItemClick", cmd_cancel_product_click)
|
||||||
$$("cmd_import_products").attachEvent("onItemClick", cmd_import_products_click)
|
$$("cmd_import_products").attachEvent("onItemClick", cmd_import_products_click)
|
||||||
|
$$("cmd_add_inventory").attachEvent("onItemClick", cmd_add_inventory_click)
|
||||||
|
$$("cmd_products_add").attachEvent("onItemClick", cmd_products_add_click)
|
||||||
|
$$('cmd_add_products_from_xml').attachEvent('onItemClick', cmd_add_products_from_xml_click)
|
||||||
|
$$('cmd_show_exists').attachEvent('onItemClick', cmd_show_exists_click)
|
||||||
|
$$('cmd_save_products_add').attachEvent('onItemClick', cmd_save_products_add_click)
|
||||||
|
$$('cmd_close_products_add').attachEvent('onItemClick', cmd_close_products_add_click)
|
||||||
$$("chk_automatica").attachEvent("onChange", chk_automatica_change)
|
$$("chk_automatica").attachEvent("onChange", chk_automatica_change)
|
||||||
$$("valor_unitario").attachEvent("onChange", valor_unitario_change)
|
$$("valor_unitario").attachEvent("onChange", valor_unitario_change)
|
||||||
$$('precio_con_impuestos').attachEvent('onChange', precio_con_impuestos_change)
|
$$('precio_con_impuestos').attachEvent('onChange', precio_con_impuestos_change)
|
||||||
|
@ -99,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){
|
||||||
|
@ -107,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()
|
||||||
|
@ -206,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
|
||||||
|
@ -228,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'
|
||||||
|
@ -247,9 +276,7 @@ function cmd_save_product_click(id, e, node){
|
||||||
|
|
||||||
|
|
||||||
function cmd_cancel_product_click(id, e, node){
|
function cmd_cancel_product_click(id, e, node){
|
||||||
|
|
||||||
$$("multi_products").setValue("products_home")
|
$$("multi_products").setValue("products_home")
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -429,3 +456,536 @@ function up_products_upload_complete(response){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//~ Add inventory
|
||||||
|
function cmd_add_inventory_click(id, e, node){
|
||||||
|
var row = $$('grid_products').getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un Producto')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
win_add_inventory.init()
|
||||||
|
$$('txt_add_id').setValue(row.id)
|
||||||
|
$$('txt_add_key').setValue(row.clave)
|
||||||
|
$$('txt_add_unit').setValue(row.unidad)
|
||||||
|
$$('txt_add_description').setValue(row.descripcion)
|
||||||
|
$$('lst_warehouses').getList().load('/warehouse?opt=for_select')
|
||||||
|
$$('win_add_inventory').show()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//~ Show details inventory
|
||||||
|
function cmd_show_exists_click(id, e, node){
|
||||||
|
var row = $$('grid_products').getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un Producto')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
win_show_exists.init()
|
||||||
|
$$('txt_id_product').setValue(row.id)
|
||||||
|
$$('grid_warehouse_exists').load('warehouseproduct?opt=by_product&id=' + row.id)
|
||||||
|
|
||||||
|
if(gis_admin){
|
||||||
|
$$('lst_warehouse_target').getList().load('/warehouse?opt=for_select')
|
||||||
|
}else{
|
||||||
|
$$('lbl_title_move').hide()
|
||||||
|
$$('txt_cant_to_move').hide()
|
||||||
|
$$('lst_warehouse_target').hide()
|
||||||
|
$$('cmd_warehouse_move').hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
$$('win_show_exists').show()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_warehouse_move_click(id, e, node){
|
||||||
|
var id_product = $$('txt_id_product').getValue()
|
||||||
|
var row = $$('grid_warehouse_exists').getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un Almacen origen')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var warehouse_source = row.id
|
||||||
|
var cant_to_move = $$('txt_cant_to_move').getValue()
|
||||||
|
var warehouse_target = $$('lst_warehouse_target').getValue()
|
||||||
|
|
||||||
|
if(!cant_to_move){
|
||||||
|
msg_error('La cantidad no puede ser cero')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cant_to_move > row.exists){
|
||||||
|
msg_error('La cantidad a mover no puede ser mayor a la existencia')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (warehouse_target == ''){
|
||||||
|
msg_error('Selecciona un Almacen destino')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (warehouse_source == warehouse_target){
|
||||||
|
msg_error('Los almacenes origen y destino deben ser diferentes')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var values = {
|
||||||
|
id_product: id_product,
|
||||||
|
cant: cant_to_move,
|
||||||
|
source: warehouse_source,
|
||||||
|
target: warehouse_target
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = '¿Estás seguro de hacer este movimiento?'
|
||||||
|
webix.confirm({
|
||||||
|
title: 'Movimiento de Almacen',
|
||||||
|
ok: 'Si',
|
||||||
|
cancel: 'No',
|
||||||
|
type: 'confirm-error',
|
||||||
|
text: msg,
|
||||||
|
callback:function(result){
|
||||||
|
if(result){
|
||||||
|
_warehouse_movement(values)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _warehouse_movement(args){
|
||||||
|
var values = {
|
||||||
|
opt: 'warehouse_movement',
|
||||||
|
values: args,
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().sync().post('inventoryentries', values, {
|
||||||
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success:function(text, data, XmlHttpRequest){
|
||||||
|
var values = data.json();
|
||||||
|
if (values.ok) {
|
||||||
|
$$('txt_cant_to_move').setValue(0)
|
||||||
|
$$('lst_warehouse_target').setValue('')
|
||||||
|
$$('grid_warehouse_exists').load('warehouseproduct?opt=by_product&id=' + args.id_product)
|
||||||
|
$$('grid_warehouse_exists').clearSelection()
|
||||||
|
msg_ok('Movimiento realizado correctamente')
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_win_show_exists_close_click(id, e, node){
|
||||||
|
$$('win_show_exists').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//~ Add products
|
||||||
|
function cmd_products_add_click(id, e, node){
|
||||||
|
$$("multi_products").setValue("product_add")
|
||||||
|
cfg_products['partner_id'] = 0
|
||||||
|
cfg_products['partner_rfc'] = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
//~ Close add products
|
||||||
|
function cmd_close_products_add_click(id, e, node){
|
||||||
|
var grid = $$('grid_partner_products')
|
||||||
|
|
||||||
|
$$('multi_invoices').setValue('products_home')
|
||||||
|
$$('lbl_partner').setValue('')
|
||||||
|
grid.clearAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _add_entries_inventory(data){
|
||||||
|
var grid = $$('grid_partner_products')
|
||||||
|
var values = {
|
||||||
|
opt: 'create',
|
||||||
|
values: data,
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().sync().post('inventoryentries', values, {
|
||||||
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success:function(text, data, XmlHttpRequest){
|
||||||
|
var values = data.json();
|
||||||
|
if (values.ok) {
|
||||||
|
get_products()
|
||||||
|
$$('multi_invoices').setValue('products_home')
|
||||||
|
$$('lbl_partner').setValue('')
|
||||||
|
grid.clearAll()
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//~ Save add products
|
||||||
|
function cmd_save_products_add_click(id, e, node){
|
||||||
|
var grid = $$('grid_partner_products')
|
||||||
|
var count = 0
|
||||||
|
var products = []
|
||||||
|
var validate_import = false
|
||||||
|
var validate_cant = false
|
||||||
|
|
||||||
|
grid.eachRow(function(row){
|
||||||
|
var r = grid.getItem(row)
|
||||||
|
if(r.select){
|
||||||
|
var p = {}
|
||||||
|
count += 1
|
||||||
|
p.id_product = r.id_product
|
||||||
|
p.key = r.key
|
||||||
|
p.key_sat = r.key_sat1
|
||||||
|
p.description = r.description1
|
||||||
|
p.unit = r.unit
|
||||||
|
p.unit_value = r.unit_value1
|
||||||
|
p.cant = r.cant1
|
||||||
|
products.push(p)
|
||||||
|
|
||||||
|
if(p.unit_value < parseFloat(r.unit_value)){
|
||||||
|
validate_import = true
|
||||||
|
}
|
||||||
|
if(p.cant > r.cant){
|
||||||
|
validate_cant = true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if(!count){
|
||||||
|
msg = 'Selecciona al menos un registro'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(validate_import){
|
||||||
|
msg = 'El Valor Unitario no puede ser menor al Valor Unitario del proveedor'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(validate_cant){
|
||||||
|
msg = 'La Cantidad no puede ser mayor a la Cantidad del proveedor'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
partner: cfg_products['partner'],
|
||||||
|
products: products,
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = '¿Estás seguro de ingresar estos productos? <br/><br/>\
|
||||||
|
Esta acción no se puede deshacer.'
|
||||||
|
webix.confirm({
|
||||||
|
title: 'Agregar entrada',
|
||||||
|
ok: 'Si',
|
||||||
|
cancel: 'No',
|
||||||
|
type: 'confirm-error',
|
||||||
|
text: msg,
|
||||||
|
callback:function(result){
|
||||||
|
if(result){
|
||||||
|
_add_entries_inventory(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//~ Import from xml
|
||||||
|
function cmd_add_products_from_xml_click(){
|
||||||
|
win_add_products_from_xml.init()
|
||||||
|
$$('win_add_products_from_xml').show()
|
||||||
|
}
|
||||||
|
|
||||||
|
//~ Upload XML
|
||||||
|
function cmd_upload_products_from_xml_click(){
|
||||||
|
var form = $$('form_upload_products_from_xml')
|
||||||
|
var values = form.getValues()
|
||||||
|
var list = $$('lst_up_products_from_xml')
|
||||||
|
var upload = $$('up_products_from_xml')
|
||||||
|
|
||||||
|
if(!list.count()){
|
||||||
|
$$('win_add_products_from_xml').close()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(list.count() > 1){
|
||||||
|
msg = 'Selecciona solo un archivo'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var template = upload.files.getItem(upload.files.getFirstId())
|
||||||
|
|
||||||
|
if(template.type.toLowerCase() != 'xml'){
|
||||||
|
msg = 'Archivo inválido.\n\nSe requiere un archivo XML'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = '¿Estás seguro de importar este archivo? <br/><br/>\
|
||||||
|
Si hay datos previos seran reemplazados.'
|
||||||
|
webix.confirm({
|
||||||
|
title: 'Importar Productos',
|
||||||
|
ok: 'Si',
|
||||||
|
cancel: 'No',
|
||||||
|
type: 'confirm-error',
|
||||||
|
text: msg,
|
||||||
|
callback:function(result){
|
||||||
|
if(result){
|
||||||
|
upload.send()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function up_products_from_xml_upload_complete(response){
|
||||||
|
if(response.status != 'server'){
|
||||||
|
msg = 'Ocurrio un error al subir el archivo'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$$('win_add_products_from_xml').close()
|
||||||
|
|
||||||
|
if(response.error){
|
||||||
|
msg_error(response.error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var grid = $$('grid_partner_products')
|
||||||
|
var data = response.data
|
||||||
|
cfg_products['partner'] = data.emisor
|
||||||
|
//~ cfg_products['xml'] = data.xml
|
||||||
|
|
||||||
|
var html = '<span class="webix_icon fa-user"></span><span class="lbl_partner">'
|
||||||
|
html += data.emisor.nombre + ' (' + data.emisor.rfc + ')</span>'
|
||||||
|
$$('lbl_partner').setValue(html)
|
||||||
|
|
||||||
|
grid.clearAll()
|
||||||
|
grid.parse(data.conceptos, 'json')
|
||||||
|
grid.refresh()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_partner_product(grid, row){
|
||||||
|
grid.refresh(row.id)
|
||||||
|
|
||||||
|
var partner_id = cfg_products['partner'].id
|
||||||
|
var filters = {
|
||||||
|
opt: 'product',
|
||||||
|
partner: cfg_products['partner'],
|
||||||
|
product_key: row.key,
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!partner_id){
|
||||||
|
msg = 'El Proveedor no esta dado de alta'
|
||||||
|
msg_ok(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().get('/partnerproducts', filters, {
|
||||||
|
error: function(text, data, xhr) {
|
||||||
|
msg_error('Ocurrio un error, consulta a soporte técnico.')
|
||||||
|
},
|
||||||
|
success: function(text, data, xhr){
|
||||||
|
var values = data.json()
|
||||||
|
if(values.ok){
|
||||||
|
row['id_product'] = values.row.id_product
|
||||||
|
row['key_sat1'] = values.row.key_sat1
|
||||||
|
row['description1'] = values.row.description1
|
||||||
|
row['unit_value1'] = values.row.unit_value1
|
||||||
|
grid.refresh(row.id)
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function grid_partner_products_select(row_id, state){
|
||||||
|
var grid = $$('grid_partner_products')
|
||||||
|
var row = grid.getItem(row_id)
|
||||||
|
|
||||||
|
if(state){
|
||||||
|
row['key_sat1'] = row.key_sat
|
||||||
|
row['description1'] = row.description
|
||||||
|
row['cant1'] = row.cant
|
||||||
|
row['unit_value1'] = 0.0
|
||||||
|
get_partner_product(grid, row)
|
||||||
|
}else{
|
||||||
|
row['key_sat1'] = ''
|
||||||
|
row['description1'] = ''
|
||||||
|
row['cant1'] = ''
|
||||||
|
grid.refresh(row_id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_add_inventory_cancel_click(id, e, node){
|
||||||
|
$$('win_add_inventory').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_add_inventory_save_click(id, e, node){
|
||||||
|
var product_id = $$('txt_add_id').getValue()
|
||||||
|
//~ var product_key = $$('txt_add_key').getValue()
|
||||||
|
var new_cant = $$('txt_new_cant').getValue()
|
||||||
|
var warehouse = $$('lst_warehouses').getValue()
|
||||||
|
|
||||||
|
if(new_cant<=0) {
|
||||||
|
msg = 'La cantidad no puede ser cero'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if($$('lst_warehouses').isVisible()){
|
||||||
|
if(!warehouse){
|
||||||
|
msg = 'Selecciona un almacen'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = '¿Estas seguro de guardar esta entrada? <br/><br/>\
|
||||||
|
Esta acción no se puede deshacer'
|
||||||
|
|
||||||
|
webix.confirm({
|
||||||
|
title: 'Agregar entrada',
|
||||||
|
ok: 'Si',
|
||||||
|
cancel: 'No',
|
||||||
|
type: 'confirm-error',
|
||||||
|
text: msg,
|
||||||
|
callback:function(result){
|
||||||
|
if(result){
|
||||||
|
add_product_stock(product_id, new_cant, warehouse)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_product_stock(product_id, new_cant, warehouse){
|
||||||
|
var data = {
|
||||||
|
product_id: product_id,
|
||||||
|
cant: new_cant,
|
||||||
|
warehouse: warehouse,
|
||||||
|
}
|
||||||
|
_add_entries_inventory_manual(product_id, data)
|
||||||
|
$$('win_add_inventory').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _add_entries_inventory_manual(row_id, data){
|
||||||
|
var grid = $$('grid_products')
|
||||||
|
var values = {
|
||||||
|
opt: 'create_manual',
|
||||||
|
values: data,
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().sync().post('inventoryentries', values, {
|
||||||
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success:function(text, data, XmlHttpRequest){
|
||||||
|
var values = data.json();
|
||||||
|
if (values.ok) {
|
||||||
|
grid.updateItem(row_id, values.row)
|
||||||
|
grid.refresh()
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_adjust_stock_click(id, e, node){
|
||||||
|
var id_product = $$('txt_id_product').getValue()
|
||||||
|
var row = $$('grid_warehouse_exists').getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un Almacen origen')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var warehouse_source = row.id
|
||||||
|
var cant_to_adjust = $$('txt_cant_to_adjust').getValue()
|
||||||
|
|
||||||
|
if(cant_to_adjust == 0){
|
||||||
|
msg_error('La cantidad a ajustar no puede ser cero')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cant_to_adjust > row.exists){
|
||||||
|
msg_error('La cantidad a ajustar no puede ser mayor a la existencia')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var values = {
|
||||||
|
id_product: id_product,
|
||||||
|
cant: cant_to_adjust,
|
||||||
|
storage: warehouse_source,
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = '¿Estás seguro de hacer este ajuste?'
|
||||||
|
webix.confirm({
|
||||||
|
title: 'Ajuste de Almacen',
|
||||||
|
ok: 'Si',
|
||||||
|
cancel: 'No',
|
||||||
|
type: 'confirm-error',
|
||||||
|
text: msg,
|
||||||
|
callback:function(result){
|
||||||
|
if(result){
|
||||||
|
_adjust_stock(values)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _adjust_stock(args){
|
||||||
|
var grid = $$('grid_products')
|
||||||
|
var row = grid.getSelectedItem()
|
||||||
|
|
||||||
|
var values = {
|
||||||
|
opt: 'adjust_stock',
|
||||||
|
values: args,
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().sync().post('warehouseproduct', values, {
|
||||||
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success:function(text, data, XmlHttpRequest){
|
||||||
|
var values = data.json();
|
||||||
|
if (values.ok) {
|
||||||
|
$$('txt_cant_to_adjust').setValue(0)
|
||||||
|
$$('grid_warehouse_exists').load('warehouseproduct?opt=by_product&id=' + args.id_product)
|
||||||
|
$$('grid_warehouse_exists').clearSelection()
|
||||||
|
|
||||||
|
grid.updateItem(row['id'], values.row)
|
||||||
|
grid.refresh()
|
||||||
|
|
||||||
|
msg_ok('Ajuste realizado correctamente')
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ var last_forma_pago = ''
|
||||||
var tickets_controllers = {
|
var tickets_controllers = {
|
||||||
init: function(){
|
init: function(){
|
||||||
$$('cmd_nuevo_ticket').attachEvent('onItemClick', cmd_nuevo_ticket_click)
|
$$('cmd_nuevo_ticket').attachEvent('onItemClick', cmd_nuevo_ticket_click)
|
||||||
|
$$('cmd_ticket_from_ticket').attachEvent('onItemClick', cmd_ticket_from_ticket_click)
|
||||||
$$('cmd_ticket_to_invoice').attachEvent('onItemClick', cmd_ticket_to_invoice_click)
|
$$('cmd_ticket_to_invoice').attachEvent('onItemClick', cmd_ticket_to_invoice_click)
|
||||||
$$('cmd_ticket_report_pdf').attachEvent('onItemClick', cmd_ticket_report_pdf_click)
|
$$('cmd_ticket_report_pdf').attachEvent('onItemClick', cmd_ticket_report_pdf_click)
|
||||||
$$('cmd_ticket_report_xls').attachEvent('onItemClick', cmd_ticket_report_xls_click)
|
$$('cmd_ticket_report_xls').attachEvent('onItemClick', cmd_ticket_report_xls_click)
|
||||||
|
@ -148,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){
|
||||||
|
@ -183,6 +186,25 @@ function cmd_nuevo_ticket_click(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_ticket_from_ticket_click(){
|
||||||
|
var grid = $$('grid_tickets')
|
||||||
|
|
||||||
|
if(grid.count() == 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var row = grid.getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un ticket')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
configuracion_inicial_nuevo_ticket()
|
||||||
|
$$('multi_tickets').setValue('tickets_new')
|
||||||
|
$$('grid_tdetails').load('ticketsdetails?opt=by_ticket_id&id=' + row.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function cmd_ticket_to_invoice_click(){
|
function cmd_ticket_to_invoice_click(){
|
||||||
configuracion_inicial_ticket_to_invoice()
|
configuracion_inicial_ticket_to_invoice()
|
||||||
$$('multi_tickets').setValue('tickets_invoice')
|
$$('multi_tickets').setValue('tickets_invoice')
|
||||||
|
@ -342,22 +364,43 @@ function agregar_producto(values){
|
||||||
producto['valor_unitario'] = calcular_precio_con_impuestos(
|
producto['valor_unitario'] = calcular_precio_con_impuestos(
|
||||||
parseFloat(producto['valor_unitario']), taxes)
|
parseFloat(producto['valor_unitario']), taxes)
|
||||||
producto['importe'] = producto['valor_unitario']
|
producto['importe'] = producto['valor_unitario']
|
||||||
var id = grid.add(producto, 0)
|
//~ var id = grid.add(producto, 0)
|
||||||
edit_cant(id)
|
//~ edit_cant(id)
|
||||||
}else{
|
}else{
|
||||||
producto['cantidad'] = parseFloat(row.cantidad) + 1
|
producto['cantidad'] = parseFloat(row.cantidad) + 1
|
||||||
producto['descuento'] = parseFloat(row.descuento)
|
producto['descuento'] = parseFloat(row.descuento)
|
||||||
producto['valor_unitario'] = parseFloat(row.valor_unitario)
|
producto['valor_unitario'] = parseFloat(row.valor_unitario)
|
||||||
precio_final = producto['valor_unitario'] - producto['descuento']
|
precio_final = producto['valor_unitario'] - producto['descuento']
|
||||||
producto['importe'] = (precio_final * producto['cantidad']).round(DECIMALES)
|
producto['importe'] = (precio_final * producto['cantidad']).round(DECIMALES)
|
||||||
grid.updateItem(row.id, producto)
|
//~ grid.updateItem(row.id, producto)
|
||||||
}
|
}
|
||||||
form.setValues({tsearch_product_key: '', tsearch_product_name: ''}, true)
|
form.setValues({tsearch_product_key: '', tsearch_product_name: ''}, true)
|
||||||
|
|
||||||
|
//~ Validate stock
|
||||||
|
if(producto.inventario){
|
||||||
|
if(producto.cantidad > producto.existencia){
|
||||||
|
msg_error('No hay suficiente existencia de este producto')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(row == undefined){
|
||||||
|
var id = grid.add(producto, 0)
|
||||||
|
edit_cant(id)
|
||||||
|
}else{
|
||||||
|
grid.updateItem(row.id, producto)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function buscar_producto_key(key){
|
function buscar_producto_key(key){
|
||||||
webix.ajax().get('/values/productokey', {'key': key}, {
|
|
||||||
|
var filters = {
|
||||||
|
opt: 'by_key',
|
||||||
|
key: key,
|
||||||
|
}
|
||||||
|
|
||||||
|
webix.ajax().get('/products', filters, {
|
||||||
error: function(text, data, xhr) {
|
error: function(text, data, xhr) {
|
||||||
msg_error('Error al consultar')
|
msg_error('Error al consultar')
|
||||||
},
|
},
|
||||||
|
@ -371,6 +414,20 @@ function buscar_producto_key(key){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//~ webix.ajax().get('/values/productokey', {'key': key}, {
|
||||||
|
//~ error: function(text, data, xhr) {
|
||||||
|
//~ msg_error('Error al consultar')
|
||||||
|
//~ },
|
||||||
|
//~ success: function(text, data, xhr){
|
||||||
|
//~ var values = data.json()
|
||||||
|
//~ if (values.ok){
|
||||||
|
//~ agregar_producto(values)
|
||||||
|
//~ } else {
|
||||||
|
//~ msg = 'No se encontró la clave<BR><BR>' + key
|
||||||
|
//~ msg_error(msg)
|
||||||
|
//~ }
|
||||||
|
//~ }
|
||||||
|
//~ })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,6 +474,20 @@ function grid_tickets_details_before_edit_stop(state, editor){
|
||||||
grid.unblockEvent()
|
grid.unblockEvent()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//~ Validate stock
|
||||||
|
if(row['inventario']){
|
||||||
|
if(cantidad > row['existencia']){
|
||||||
|
msg = 'No hay suficiente existencia de este producto'
|
||||||
|
msg_error(msg)
|
||||||
|
grid.blockEvent()
|
||||||
|
state.value = state.old
|
||||||
|
grid.editCancel()
|
||||||
|
grid.unblockEvent()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var valor_unitario = parseFloat(row['valor_unitario'])
|
var valor_unitario = parseFloat(row['valor_unitario'])
|
||||||
var descuento = parseFloat(row['descuento'])
|
var descuento = parseFloat(row['descuento'])
|
||||||
}
|
}
|
||||||
|
@ -542,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){
|
||||||
|
@ -575,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)
|
||||||
|
@ -611,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',
|
||||||
|
@ -643,22 +735,30 @@ function grid_tickets_invoice_double_click(id, e, node){
|
||||||
|
|
||||||
|
|
||||||
function cmd_move_tickets_right_click(){
|
function cmd_move_tickets_right_click(){
|
||||||
$$('grid_tickets_active').eachRow(
|
var source = $$('grid_tickets_active')
|
||||||
function(row){
|
var target = $$('grid_tickets_invoice')
|
||||||
this.copy(row, -1, $$('grid_tickets_invoice'))
|
_move_tickets(source, target)
|
||||||
}
|
|
||||||
)
|
|
||||||
$$('grid_tickets_active').clearAll()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cmd_move_tickets_left_click(){
|
function cmd_move_tickets_left_click(){
|
||||||
$$('grid_tickets_invoice').eachRow(
|
var target = $$('grid_tickets_active')
|
||||||
function(row){
|
var source = $$('grid_tickets_invoice')
|
||||||
this.copy(row, -1, $$('grid_tickets_active'))
|
_move_tickets(source, target)
|
||||||
}
|
}
|
||||||
)
|
|
||||||
$$('grid_tickets_invoice').clearAll()
|
|
||||||
|
function _move_tickets(source, target){
|
||||||
|
var rows = source.getSelectedItem()
|
||||||
|
|
||||||
|
if(rows == undefined){
|
||||||
|
source.eachRow(
|
||||||
|
function(row){
|
||||||
|
this.copy(row, -1, target)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
source.clearAll()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 = {
|
||||||
|
@ -603,6 +640,12 @@ function lst_parse(lst, values){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function lst_parse2(lst_name, values){
|
||||||
|
obj = $$(lst_name)
|
||||||
|
obj.getList().parse(values)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function set_value(control, value){
|
function set_value(control, value){
|
||||||
obj = $$(control)
|
obj = $$(control)
|
||||||
obj.blockEvent()
|
obj.blockEvent()
|
||||||
|
@ -610,3 +653,44 @@ function set_value(control, value){
|
||||||
obj.unblockEvent()
|
obj.unblockEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function grid_parse(grid_name, values){
|
||||||
|
obj = $$(grid_name)
|
||||||
|
obj.clearAll()
|
||||||
|
obj.parse(values)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function activate_tab(parent, 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'},
|
||||||
|
]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//~ Empresa Libre
|
//~ Empresa Libre
|
||||||
//~ Copyright (C) 2016-2018 Mauricio Baeza Servin (web@correolibre.net)
|
//~ Copyright (C) 2016-2021 Mauricio Baeza Servin (public@correolibre.net)
|
||||||
//~
|
//~
|
||||||
//~ This program is free software: you can redistribute it and/or modify
|
//~ This program is free software: you can redistribute it and/or modify
|
||||||
//~ it under the terms of the GNU General Public License as published by
|
//~ it under the terms of the GNU General Public License as published by
|
||||||
|
@ -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',
|
||||||
|
@ -287,7 +289,7 @@ var emisor_certificado = [
|
||||||
{view: 'form', id: 'form_upload', rows: [
|
{view: 'form', id: 'form_upload', rows: [
|
||||||
{cols: [{},
|
{cols: [{},
|
||||||
{view: 'uploader', id: 'up_cert', autosend: false, link: 'lst_cert',
|
{view: 'uploader', id: 'up_cert', autosend: false, link: 'lst_cert',
|
||||||
value: 'Seleccionar certificado'}, {}]},
|
value: 'Seleccionar certificado (CER y KEY)'}, {}]},
|
||||||
{cols: [{},
|
{cols: [{},
|
||||||
{view: 'list', id: 'lst_cert', name: 'certificado',
|
{view: 'list', id: 'lst_cert', name: 'certificado',
|
||||||
type: 'uploader', autoheight:true, borderless: true}, {}]},
|
type: 'uploader', autoheight:true, borderless: true}, {}]},
|
||||||
|
@ -483,7 +485,9 @@ var emisor_correo = [
|
||||||
{}]},
|
{}]},
|
||||||
{cols: [
|
{cols: [
|
||||||
{view: 'checkbox', id: 'correo_ssl', name: 'correo_ssl',
|
{view: 'checkbox', id: 'correo_ssl', name: 'correo_ssl',
|
||||||
label: 'Usar TLS/SSL: '},
|
label: 'Usar TLS/SSL: ', maxWidth: 210},
|
||||||
|
{view: 'checkbox', id: 'correo_starttls', name: 'correo_starttls',
|
||||||
|
label: 'Usar STARTTLS: '},
|
||||||
{}]},
|
{}]},
|
||||||
{cols: [
|
{cols: [
|
||||||
{view: 'text', id: 'correo_usuario', name: 'correo_usuario',
|
{view: 'text', id: 'correo_usuario', name: 'correo_usuario',
|
||||||
|
@ -594,16 +598,34 @@ var type_make_pdf = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
//~ Templates
|
||||||
|
var opt_templates_cfdi = [
|
||||||
|
{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'}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
var options_templates = [
|
var options_templates = [
|
||||||
{maxHeight: 15},
|
{maxHeight: 25},
|
||||||
{cols: [{maxWidth: 20},
|
{cols: [{maxWidth: 20},
|
||||||
{view: 'search', id: 'txt_plantilla_factura_32', name: 'plantilla_factura_32',
|
{view: 'richselect', id: 'lst_templates_cfdi', label: 'Plantillas CFDI: ', labelWidth: 100, options: opt_templates_cfdi},
|
||||||
label: 'Plantilla Factura v3.2 (ODS): ', labelPosition: 'top',
|
{maxWidth: 10},
|
||||||
icon: 'file'}, {maxWidth: 25},
|
{view: 'button', id: 'cmd_template_upload', type: 'iconButton', icon: 'file', width: 35},
|
||||||
{view: 'search', id: 'txt_plantilla_factura_33', labelPosition: 'top',
|
{},
|
||||||
label: 'Plantilla Factura v3.3 (ODS): ', icon: 'file'},
|
|
||||||
{maxWidth: 20} ]},
|
{maxWidth: 20} ]},
|
||||||
{maxHeight: 20},
|
{maxHeight: 50},
|
||||||
{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',
|
||||||
|
@ -611,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},
|
||||||
|
@ -671,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,
|
||||||
|
@ -690,7 +691,19 @@ 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},
|
||||||
|
{view: 'checkbox', id: 'chk_cancel_invoices_by_admin', labelWidth: 0,
|
||||||
|
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},
|
||||||
|
|
||||||
|
@ -739,6 +752,11 @@ var options_admin_otros = [
|
||||||
{view: 'checkbox', id: 'chk_ticket_user_show_doc', labelWidth: 0,
|
{view: 'checkbox', id: 'chk_ticket_user_show_doc', labelWidth: 0,
|
||||||
labelRight: 'Usuarios pueden ver todos los documentos'}
|
labelRight: 'Usuarios pueden ver todos los documentos'}
|
||||||
]},
|
]},
|
||||||
|
{cols: [{maxWidth: 15},
|
||||||
|
{view: 'checkbox', id: 'chk_cancel_tickets_by_admin', labelWidth: 0,
|
||||||
|
labelRight: 'Solo admins pueden cancelar'},
|
||||||
|
{}
|
||||||
|
]},
|
||||||
{maxHeight: 20},
|
{maxHeight: 20},
|
||||||
{}]
|
{}]
|
||||||
|
|
||||||
|
@ -752,6 +770,31 @@ var options_admin_partners = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_warehouse_cols = [
|
||||||
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
|
{id: 'delete', header: '', width: 30, css: 'delete'},
|
||||||
|
{id: 'name', header: 'Nombre', fillspace: 1},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_warehouse = {
|
||||||
|
view: 'datatable',
|
||||||
|
id: 'grid_warehouse',
|
||||||
|
select: 'row',
|
||||||
|
adjust: true,
|
||||||
|
headermenu: true,
|
||||||
|
footer: true,
|
||||||
|
columns: grid_warehouse_cols,
|
||||||
|
on:{
|
||||||
|
'data->onStoreUpdated':function(){
|
||||||
|
this.data.each(function(obj, i){
|
||||||
|
obj.delete = '-'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var options_admin_products = [
|
var options_admin_products = [
|
||||||
{maxHeight: 20},
|
{maxHeight: 20},
|
||||||
{cols: [{view: 'checkbox', id: 'chk_config_cuenta_predial', labelWidth: 15,
|
{cols: [{view: 'checkbox', id: 'chk_config_cuenta_predial', labelWidth: 15,
|
||||||
|
@ -762,13 +805,28 @@ var options_admin_products = [
|
||||||
labelRight: 'Mostrar precio con impuestos'}]},
|
labelRight: 'Mostrar precio con impuestos'}]},
|
||||||
{cols: [{view: 'checkbox', id: 'chk_llevar_inventario', labelWidth: 15,
|
{cols: [{view: 'checkbox', id: 'chk_llevar_inventario', labelWidth: 15,
|
||||||
labelRight: 'Mostrar inventario'}]},
|
labelRight: 'Mostrar inventario'}]},
|
||||||
{cols: [{view: 'checkbox', id: 'chk_use_packing', labelWidth: 15,
|
{cols: [{maxWidth: 30}, {view: 'checkbox', id: 'chk_multi_stock', labelWidth: 15,
|
||||||
labelRight: 'Usar empaques'}]},
|
labelRight: 'Multialmacen', disabled: true}]},
|
||||||
|
{cols: [{maxWidth: 30}, {rows: [
|
||||||
|
{template: 'Agregar Almacen', type: 'section', id: 'template_add_warehouse'},
|
||||||
|
{cols: [
|
||||||
|
{view: 'text', id: 'txt_add_warehouse', label: 'Nombre: ',
|
||||||
|
labelPosition: 'left', required: true},
|
||||||
|
{view: 'button', id: 'cmd_add_warehouse', label: 'Agregar',
|
||||||
|
autowidth: true, type: 'iconButton', icon: 'plus'},
|
||||||
|
]},
|
||||||
|
{template: 'Almacenes', type: 'section'},
|
||||||
|
grid_warehouse,
|
||||||
|
]}, {},
|
||||||
|
]}
|
||||||
|
|
||||||
|
//~ {cols: [{view: 'checkbox', id: 'chk_use_packing', labelWidth: 15,
|
||||||
|
//~ labelRight: 'Usar empaques', hidden: true}]},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
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,
|
||||||
|
@ -778,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,
|
||||||
|
@ -790,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,
|
||||||
|
@ -817,6 +875,71 @@ var options_admin_complements = [
|
||||||
type: 'form', align: 'center', autowidth: true, disabled: true},
|
type: 'form', align: 'center', autowidth: true, disabled: true},
|
||||||
{}, {maxWidth: 15}
|
{}, {maxWidth: 15}
|
||||||
]},
|
]},
|
||||||
|
{maxHeight: 10},
|
||||||
|
{template: 'Complemento para Carta Porte', type: 'section'},
|
||||||
|
{cols: [{maxWidth: 15},
|
||||||
|
{view: 'checkbox', id: 'chk_config_carta_porte', labelWidth: 0,
|
||||||
|
labelRight: 'Usar el complemento Carta Porte'},
|
||||||
|
{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}]},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var controls_add_sucursal = [{cols: [
|
||||||
|
{maxWidth: 20},
|
||||||
|
{view: 'text', id: 'txt_sucursal_add_name', name: 'sucursal_add_name',
|
||||||
|
label: 'Nombre: ', labelPosition: 'top', required: true},
|
||||||
|
{view: 'richselect', id: 'lst_sucursal_add_invoice', name: 'sucursal_add_invoice',
|
||||||
|
label: 'Serie Facturas: ', labelPosition: 'top', required: true, options: []},
|
||||||
|
{view: 'text', id: 'txt_sucursal_add_ticket', name: 'sucursal_add_ticket',
|
||||||
|
required: true, label: 'Serie Tickets: ', labelPosition: 'top'},
|
||||||
|
{view: 'richselect', id: 'lst_sucursal_warehouse', name: 'sucursal_warehouse',
|
||||||
|
label: 'Almacen: ', labelPosition: 'top', required: false, options: [], hidden: true},
|
||||||
|
{view: 'button', id: 'cmd_add_sucursal', label: 'Agregar',
|
||||||
|
autowidth: true, type: 'iconButton', icon: 'plus'},
|
||||||
|
{maxWidth: 20},
|
||||||
|
]}]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_sucursales_cols = [
|
||||||
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
|
{id: 'delete', header: '', width: 30, css: 'delete'},
|
||||||
|
{id: 'name', header: 'Nombre', fillspace: 1},
|
||||||
|
{id: 'serie_invoice', header: 'Serie Facturas', fillspace: 1},
|
||||||
|
{id: 'serie_tickets', header: 'Serie Tickets', fillspace: 1},
|
||||||
|
{id: 'warehouse', header: 'Almacen', fillspace: 1, hidden: true},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_sucursales = {
|
||||||
|
view: 'datatable',
|
||||||
|
id: 'grid_sucursales',
|
||||||
|
select: 'row',
|
||||||
|
adjust: true,
|
||||||
|
headermenu: false,
|
||||||
|
footer: true,
|
||||||
|
columns: grid_sucursales_cols,
|
||||||
|
on:{
|
||||||
|
'data->onStoreUpdated':function(){
|
||||||
|
this.data.each(function(obj, i){
|
||||||
|
obj.delete = '-'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var options_admin_sucursales = [
|
||||||
|
{maxHeight: 10},
|
||||||
|
{template: 'Agregar Sucursal', type: 'section'},
|
||||||
|
{view: 'form', id: 'form_add_sucursal', rows: controls_add_sucursal},
|
||||||
|
{template: 'Sucursales', type: 'section'},
|
||||||
|
{cols: [{maxWidth: 10}, grid_sucursales, {maxWidth: 10}]},
|
||||||
|
{maxHeight: 20},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -835,24 +958,14 @@ var tab_options = {
|
||||||
view: 'scrollview', body: {rows: options_admin_complements}}},
|
view: 'scrollview', body: {rows: options_admin_complements}}},
|
||||||
{header: 'Otros', body: {id: 'tab_admin_otros', view: 'scrollview',
|
{header: 'Otros', body: {id: 'tab_admin_otros', view: 'scrollview',
|
||||||
body: {rows: options_admin_otros}}},
|
body: {rows: options_admin_otros}}},
|
||||||
|
{header: 'Sucursales', body: {id: 'tab_admin_sucursales', view: 'scrollview',
|
||||||
|
body: {rows: options_admin_sucursales}}},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var utilidades_archivos = [
|
var utilidades_archivos = [
|
||||||
{maxHeight: 15},
|
{maxHeight: 5},
|
||||||
{template: 'Cargar Base de Datos de Factura Libre', type: 'section'},
|
|
||||||
{view: 'form', id: 'form_upload_bdfl', rows: [
|
|
||||||
{cols: [{},
|
|
||||||
{view: 'uploader', id: 'up_bdfl', autosend: false, link: 'lst_bdfl',
|
|
||||||
value: 'Seleccionar base de datos', upload: '/files/bdfl'}, {}]},
|
|
||||||
{cols: [{},
|
|
||||||
{view: 'list', id: 'lst_bdfl', name: 'bdfl',
|
|
||||||
type: 'uploader', autoheight: true, borderless: true}, {}]},
|
|
||||||
{cols: [{}, {view: 'button', id: 'cmd_subir_bdfl',
|
|
||||||
label: 'Subir base de datos de Factura Libre'}, {}]},
|
|
||||||
]},
|
|
||||||
{maxHeight: 15},
|
|
||||||
{template: 'Importar archivo CFDI (XML)', type: 'section'},
|
{template: 'Importar archivo CFDI (XML)', type: 'section'},
|
||||||
{view: 'form', id: 'form_upload_cfdixml', rows: [
|
{view: 'form', id: 'form_upload_cfdixml', rows: [
|
||||||
{cols: [{},
|
{cols: [{},
|
||||||
|
@ -1021,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',
|
||||||
|
@ -1033,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',
|
||||||
|
@ -1055,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},
|
||||||
|
@ -1203,6 +1342,101 @@ 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 = {
|
||||||
|
view: 'gridsuggest',
|
||||||
|
id: 'grid_unidadpeso_found',
|
||||||
|
name: 'grid_unidadpeso_found',
|
||||||
|
body: {
|
||||||
|
autoConfig: false,
|
||||||
|
scroll:true,
|
||||||
|
autoheight:false,
|
||||||
|
header: true,
|
||||||
|
yCount: 10,
|
||||||
|
columns: [
|
||||||
|
{id: 'id', hidden: true},
|
||||||
|
{id: 'key', adjust: 'data', header: 'Clave'},
|
||||||
|
{id: 'name', adjust: 'data', header: 'Unidad'},
|
||||||
|
],
|
||||||
|
dataFeed:function(text){
|
||||||
|
if (text.length > 1){
|
||||||
|
this.load('/values/satunidadespeso?key=' + text)
|
||||||
|
}else{
|
||||||
|
this.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var buscar_carta_unidades_peso = {
|
||||||
|
view: 'search',
|
||||||
|
id: 'buscar_carta_unidades_peso',
|
||||||
|
label: 'Buscar Unidad de Peso en el catálogo del SAT',
|
||||||
|
labelPosition: 'top',
|
||||||
|
suggest: suggest_sat_unidades_peso,
|
||||||
|
placeholder: 'Por clave o descripción. Captura al menos tres letras',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var columns_carta_unidades_peso = [
|
||||||
|
{id: 'id', header: 'ID', hidden: true},
|
||||||
|
{id: 'delete', header: '', width: 30, css: 'delete'},
|
||||||
|
{id: 'key', header: 'Clave'},
|
||||||
|
{id: 'name', header: 'Nombre', adjust: 'data'},
|
||||||
|
{id: 'activo', header: 'Activo', template: '{common.checkbox()}',
|
||||||
|
editor: 'checkbox'},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_carta_unidades_peso = {
|
||||||
|
view: 'datatable',
|
||||||
|
id: 'grid_carta_unidades_peso',
|
||||||
|
url: 'satunidadespeso?opt=all',
|
||||||
|
select: 'cell',
|
||||||
|
adjust: true,
|
||||||
|
autowidth: true,
|
||||||
|
headermenu: true,
|
||||||
|
columns: columns_carta_unidades_peso,
|
||||||
|
on:{
|
||||||
|
'data->onStoreUpdated':function(){
|
||||||
|
this.data.each(function(obj, i){
|
||||||
|
obj.delete = '-'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var carta_porte_unidades_peso = [
|
||||||
|
{maxHeight: 20},
|
||||||
|
{cols: [{maxWidth: 15}, buscar_carta_unidades_peso, {}]},
|
||||||
|
{maxHeight: 20},
|
||||||
|
{cols: [{maxWidth: 15}, grid_carta_unidades_peso, {}]},
|
||||||
|
{maxHeight: 20},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var tab_sat_carta_porte = [{
|
||||||
|
view: 'tabview',
|
||||||
|
id: 'tab_sat_carta_porte',
|
||||||
|
multiview: true,
|
||||||
|
animate: true,
|
||||||
|
cells: [
|
||||||
|
{id: 'Unidades de Peso', rows: carta_porte_unidades_peso},
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
|
||||||
|
|
||||||
var tab_sat = {
|
var tab_sat = {
|
||||||
view: 'tabview',
|
view: 'tabview',
|
||||||
id: 'tab_sat',
|
id: 'tab_sat',
|
||||||
|
@ -1215,6 +1449,8 @@ 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},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1246,12 +1482,14 @@ var grid_usuarios_cols = [
|
||||||
hidden: true},
|
hidden: true},
|
||||||
{id: 'ultimo_ingreso', header: 'Ultimo Ingreso', fillspace: 1,
|
{id: 'ultimo_ingreso', header: 'Ultimo Ingreso', fillspace: 1,
|
||||||
hidden: true},
|
hidden: true},
|
||||||
|
{id: 'in_branch', header: 'En Sucursal', template: '{common.checkbox()}',
|
||||||
|
editor: 'checkbox', adjust: 'header', hidden: true},
|
||||||
{id: 'es_activo', header: 'Activo', template: '{common.checkbox()}',
|
{id: 'es_activo', header: 'Activo', template: '{common.checkbox()}',
|
||||||
editor: 'checkbox', adjust: 'header'},
|
editor: 'checkbox', adjust: 'header'},
|
||||||
{id: 'es_admin', header: 'Es Admin', template: '{common.checkbox()}',
|
{id: 'es_admin', header: 'Es Admin', template: '{common.checkbox()}',
|
||||||
editor: 'checkbox', adjust: 'header'},
|
editor: 'checkbox', adjust: 'header'},
|
||||||
{id: 'es_superusuario', header: 'Es SU', template: '{common.checkbox()}',
|
{id: 'es_superusuario', header: 'Es SU', template: '{common.checkbox()}',
|
||||||
editor: 'checkbox', adjust: 'header'},
|
editor: 'checkbox', adjust: 'header', hidden: true},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1260,7 +1498,7 @@ var grid_usuarios = {
|
||||||
id: 'grid_usuarios',
|
id: 'grid_usuarios',
|
||||||
select: 'row',
|
select: 'row',
|
||||||
adjust: true,
|
adjust: true,
|
||||||
headermenu: true,
|
headermenu: false,
|
||||||
footer: true,
|
footer: true,
|
||||||
columns: grid_usuarios_cols,
|
columns: grid_usuarios_cols,
|
||||||
on:{
|
on:{
|
||||||
|
@ -1518,3 +1756,35 @@ var admin_ui_leyendas_fiscales = {
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var body_set_branch_user = {rows: [{minHeight: 10},
|
||||||
|
{view: 'text', id: 'txt_user_id', readonly: true, hidden: true},
|
||||||
|
//~ {view: 'text', id: 'txt_user_name', label: 'Usuario', readonly: true},
|
||||||
|
{view: 'richselect', id: 'lst_branchs', name: 'lst_branchs',
|
||||||
|
label: 'Sucursales: ', required: true, options: []},
|
||||||
|
{minHeight: 10},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_set_branch_user_save', label: 'Guardar'}, {},
|
||||||
|
{view: 'button', id: 'cmd_set_branch_user_cancel', label: 'Cancelar', type: 'danger'}, {}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_set_branch_user = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_set_branch_user',
|
||||||
|
width: 400,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Asignar Sucursal',
|
||||||
|
body: body_set_branch_user,
|
||||||
|
})
|
||||||
|
$$('cmd_set_branch_user_save').attachEvent('onItemClick', cmd_set_branch_user_save_click)
|
||||||
|
$$('cmd_set_branch_user_cancel').attachEvent('onItemClick', cmd_set_branch_user_cancel_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ var grid_cfdi_pay_cols = [
|
||||||
{id: 'cliente', header: ['Razón Social'], fillspace: true},
|
{id: 'cliente', header: ['Razón Social'], fillspace: true},
|
||||||
{id: 'xml', header: 'XML', adjust: 'data', template: get_icon('xml')},
|
{id: 'xml', header: 'XML', adjust: 'data', template: get_icon('xml')},
|
||||||
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
||||||
{id: 'email', header: '', adjust: 'data', template: get_icon('email')}
|
{id: 'email', header: '@', adjust: 'data', template: get_icon('email')}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ var grid_bank_invoice_pay_cols = [
|
||||||
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
||||||
//~ {id: 'ods', header: 'ODS', adjust: 'data', template: get_icon('table')},
|
//~ {id: 'ods', header: 'ODS', adjust: 'data', template: get_icon('table')},
|
||||||
//~ {id: 'zip', header: 'ZIP', adjust: 'data', template: get_icon('zip')},
|
//~ {id: 'zip', header: 'ZIP', adjust: 'data', template: get_icon('zip')},
|
||||||
{id: 'email', header: '', adjust: 'data', template: get_icon('email')}
|
{id: 'email', header: '@', adjust: 'data', template: get_icon('email')}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -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'},
|
||||||
{},
|
{},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -608,3 +612,77 @@ var win_mov_description = {
|
||||||
$$('cmd_close_mov_description').attachEvent('onItemClick', cmd_close_mov_description_click)
|
$$('cmd_close_mov_description').attachEvent('onItemClick', cmd_close_mov_description_click)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var opt_reasons_cancel_pay = [
|
||||||
|
{id: '', value: ''},
|
||||||
|
{id: '01', value: '[01] Comprobante emitido con errores con relación'},
|
||||||
|
{id: '02', value: '[02] Comprobante emitido con errores sin relación'},
|
||||||
|
{id: '03', value: '[03] No se llevó acabo la operación'},
|
||||||
|
{id: '04', value: '[04] Operación nominativa relacionada en una factura global'},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
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: '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: '¿Estás seguro de continuar?', autowidth: true, align: 'center'},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_invoice_cancel_pay', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
|
||||||
|
{maxWidth: 25},
|
||||||
|
{view: 'button', id: 'cmd_win_cancel_pay_close', width: 100, label: 'Cerrar'},
|
||||||
|
{}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_invoice_cancel_pay = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_invoice_cancel_pay',
|
||||||
|
modal: true,
|
||||||
|
width: 400,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Cancelar CFDI',
|
||||||
|
body: body_invoice_cancel_pay,
|
||||||
|
})
|
||||||
|
$$('cmd_invoice_cancel_pay').attachEvent('onItemClick', cmd_invoice_cancel_pay_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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -59,9 +59,9 @@ var menu_user = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var link_blog = "<a class='link_default' target='_blank' href='https://blog.empresalibre.mx'>Blog</a>";
|
var link_blog = "<a class='link_default' target='_blank' href='https://empresalibre.net/blog'>Blog</a>";
|
||||||
var link_forum = "<a class='link_default' target='_blank' href='https://gitlab.com/mauriciobaeza/empresa-libre/issues'>Foro</a>";
|
var link_forum = "<a class='link_default' target='_blank' href='https://git.cuates.net/elmau/empresa-libre/issues'>Foro</a>";
|
||||||
var link_doc = "<a class='link_default' target='_blank' href='https://doc.empresalibre.mx'>Doc</a>";
|
var link_doc = "<a class='link_default' target='_blank' href='https://empresalibre.net/docs'>Doc</a>";
|
||||||
|
|
||||||
|
|
||||||
var ui_main = {
|
var ui_main = {
|
||||||
|
|
|
@ -245,3 +245,44 @@ var win_import_nomina = {
|
||||||
$$('up_nomina').attachEvent('onUploadComplete', up_nomina_upload_complete)
|
$$('up_nomina').attachEvent('onUploadComplete', up_nomina_upload_complete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var opt_reasons_cancel_nomina = [
|
||||||
|
{id: '', value: ''},
|
||||||
|
{id: '01', value: '[01] Comprobante emitido con errores con relación'},
|
||||||
|
{id: '02', value: '[02] Comprobante emitido con errores sin relación'},
|
||||||
|
{id: '03', value: '[03] No se llevó acabo la operación'},
|
||||||
|
{id: '04', value: '[04] Operación nominativa relacionada en una factura global'},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var body_invoice_cancel_nomina = {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: '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: '¿Estás segura de continuar?', autowidth: true, align: 'center'},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_invoice_cancel_nomina', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
|
||||||
|
{maxWidth: 25},
|
||||||
|
{view: 'button', id: 'cmd_win_cancel_nomina_close', width: 100, label: 'Cerrar'},
|
||||||
|
{}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_invoice_cancel_nomina = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_invoice_cancel_nomina',
|
||||||
|
modal: true,
|
||||||
|
width: 400,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Cancelar CFDI',
|
||||||
|
body: body_invoice_cancel_nomina,
|
||||||
|
})
|
||||||
|
$$('cmd_invoice_cancel_nomina').attachEvent('onItemClick', cmd_invoice_cancel_nomina_click)
|
||||||
|
$$('cmd_win_cancel_nomina_close').attachEvent('onItemClick', cmd_win_cancel_nomina_close_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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'},
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,6 +10,12 @@ var toolbar_products = [
|
||||||
{},
|
{},
|
||||||
{view: 'button', id: 'cmd_import_products', label: 'Importar',
|
{view: 'button', id: 'cmd_import_products', label: 'Importar',
|
||||||
type: 'iconButton', autowidth: true, icon: 'upload'},
|
type: 'iconButton', autowidth: true, icon: 'upload'},
|
||||||
|
{view: "button", id: "cmd_add_inventory", label: "Altas", hidden: true,
|
||||||
|
type: "iconButton", autowidth: true, icon: "plus"},
|
||||||
|
{view: "button", id: "cmd_products_add", label: "Altas CFDI", hidden: true,
|
||||||
|
type: "iconButton", autowidth: true, icon: "plus"},
|
||||||
|
{view: 'button', id: 'cmd_show_exists', label: 'Existencias', hidden: true,
|
||||||
|
type: 'iconButton', autowidth: true, icon: 'table'},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,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,
|
||||||
|
@ -135,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",
|
||||||
|
@ -158,7 +170,7 @@ var controls_generals = [
|
||||||
label: 'Inventario', labelAlign: 'right', labelWidth: 130},
|
label: 'Inventario', labelAlign: 'right', labelWidth: 130},
|
||||||
{view: 'counter', id: 'txt_existencia', name: 'existencia',
|
{view: 'counter', id: 'txt_existencia', name: 'existencia',
|
||||||
hidden: true, label: 'Existencia', step: 5, value: 0, min: 0,
|
hidden: true, label: 'Existencia', step: 5, value: 0, min: 0,
|
||||||
disabled: true},
|
disabled: true, readonly: true},
|
||||||
{view: 'counter', id: 'txt_minimo', name: 'minimo', hidden: true,
|
{view: 'counter', id: 'txt_minimo', name: 'minimo', hidden: true,
|
||||||
label: 'Mínimo', step: 5, value: 0, min: 0, disabled: true},
|
label: 'Mínimo', step: 5, value: 0, min: 0, disabled: true},
|
||||||
{},]},
|
{},]},
|
||||||
|
@ -176,8 +188,8 @@ var controls_products = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{rows: [
|
{rows: [
|
||||||
{ template:"", type: "section" },
|
{template: "", type: "section"},
|
||||||
{ margin: 10, cols: [{},
|
{margin: 10, cols: [{},
|
||||||
{view: "button", id: "cmd_save_product", label: "Guardar" , type: "form", autowidth: true, align:"center"},
|
{view: "button", id: "cmd_save_product", label: "Guardar" , type: "form", autowidth: true, align:"center"},
|
||||||
{view: "button", id: "cmd_cancel_product", label: "Cancelar" , type: "danger", autowidth: true, align:"center"},
|
{view: "button", id: "cmd_cancel_product", label: "Cancelar" , type: "danger", autowidth: true, align:"center"},
|
||||||
{}]
|
{}]
|
||||||
|
@ -202,6 +214,129 @@ var form_product = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var toolbar_products_add = {view: 'toolbar', elements: [{},
|
||||||
|
{view: 'button', id: 'cmd_add_products_from_xml', label: 'Desde XML',
|
||||||
|
type: 'iconButton', autowidth: true, icon: 'upload'},
|
||||||
|
{}]}
|
||||||
|
|
||||||
|
|
||||||
|
var rows_pro_add_partner = [
|
||||||
|
{view: 'fieldset', label: 'Buscar Proveedor', body: {rows: [
|
||||||
|
{cols: [
|
||||||
|
{view: 'search', id: 'search_partner_id', label: 'por Clave',
|
||||||
|
labelPosition: 'top', maxWidth: 200, placeholder: 'Captura la clave'},
|
||||||
|
{view: 'search', id: 'search_partner_name', label: 'por Nombre o RFC',
|
||||||
|
labelPosition: 'top', placeholder: 'Captura al menos tres letras'},
|
||||||
|
]},
|
||||||
|
{cols: [
|
||||||
|
{view: 'label', id: 'lbl_partner_title', label: 'Seleccionado: ', autowidth: true},
|
||||||
|
{view: 'label', id: 'lbl_partner', label: 'Ninguno'},
|
||||||
|
]}
|
||||||
|
]}},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_partner_products_cols = [
|
||||||
|
{id: 'select', header: '', template:'{common.checkbox()}', width:35},
|
||||||
|
{id: 'key', header: {text: 'Clave', css: 'center'}, width: 100,
|
||||||
|
adjust: 'data'},
|
||||||
|
{id: 'key_sat', header:{text: 'Clave SAT', css: 'center'}, width: 100,
|
||||||
|
adjust: 'data'},
|
||||||
|
{id: 'description', header:{text: 'Descripción', css: 'center'},
|
||||||
|
fillspace: true},
|
||||||
|
{id: "pedimento", header: 'Pedimento', editor: 'text', hidden: true},
|
||||||
|
{id: 'unit', header:{text: 'Unidad', css: 'center'}, width: 100,
|
||||||
|
adjust: 'data'},
|
||||||
|
{id: 'unit_value', header:{text: 'Valor Unitario', css: 'center'},
|
||||||
|
width: 100, format: format_currency, css: 'right'},
|
||||||
|
{id: 'cant', header: {text: 'Cantidad', css: 'center'}, width: 50,
|
||||||
|
format: webix.i18n.numberFormat, css: 'right'},
|
||||||
|
{id: 'separate', header: '', width: 25},
|
||||||
|
{id: 'id_product', header: '', hidden: true},
|
||||||
|
{id: 'key1', header:{text: 'Clave', css: 'center'}, width: 100,
|
||||||
|
adjust: true, editor: 'text', hidden: true},
|
||||||
|
{id: 'key_sat1', header:{text: 'Clave SAT', css: 'center'}, width: 100,
|
||||||
|
adjust: true, editor: 'text'},
|
||||||
|
{id: 'description1', header:{text: 'Descripción', css: 'center'},
|
||||||
|
fillspace: true, editor: 'popup'},
|
||||||
|
{id: 'unit_value1', header:{text: 'Valor Unitario', css: 'center'},
|
||||||
|
width: 100, format: format_currency, css: 'right', editor: 'text'},
|
||||||
|
{id: 'cant1', header: {text: 'Cantidad', css: 'center'}, width: 50,
|
||||||
|
format: webix.i18n.numberFormat, css: 'right', editor: 'text'},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_partner_products = {
|
||||||
|
view: 'datatable',
|
||||||
|
id: 'grid_partner_products',
|
||||||
|
select: 'row',
|
||||||
|
adjust: true,
|
||||||
|
autoheight: true,
|
||||||
|
editable: true,
|
||||||
|
columns: grid_partner_products_cols,
|
||||||
|
data: [],
|
||||||
|
fixedRowHeight: false,
|
||||||
|
on:{
|
||||||
|
onCheck:function(rowId, colId, state){
|
||||||
|
grid_partner_products_select(rowId, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var controls_products_add = [
|
||||||
|
{minHeight: 10, maxHeight: 10},
|
||||||
|
toolbar_products_add,
|
||||||
|
{minHeight: 10, maxHeight: 10},
|
||||||
|
{cols: [
|
||||||
|
{rows: rows_pro_add_partner},
|
||||||
|
{maxWidth: 10},
|
||||||
|
{},
|
||||||
|
]},
|
||||||
|
{view: 'label', label: 'Detalle', height: 30, align: 'left'},
|
||||||
|
{cols: [
|
||||||
|
grid_partner_products,
|
||||||
|
//~ grid_products_add,
|
||||||
|
]},
|
||||||
|
{rows: [
|
||||||
|
{template:"", type: "section" },
|
||||||
|
{margin: 10, cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_save_products_add', label: 'Guardar',
|
||||||
|
autowidth: true, align: 'center'},
|
||||||
|
{},
|
||||||
|
{view: 'button', id: 'cmd_close_products_add', label: 'Cancelar',
|
||||||
|
type: 'danger', autowidth: true, align: 'center'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var controls_form_products_add = [
|
||||||
|
{
|
||||||
|
view: 'tabview',
|
||||||
|
id: 'tv_invoice',
|
||||||
|
animate: true,
|
||||||
|
cells: [
|
||||||
|
{id: 'Altas a inventario', rows: controls_products_add},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var form_products_add = {
|
||||||
|
type: 'space',
|
||||||
|
responsive: true,
|
||||||
|
cols: [{
|
||||||
|
view: 'form',
|
||||||
|
id: 'form_products_add',
|
||||||
|
complexData: true,
|
||||||
|
scroll: true,
|
||||||
|
elements: controls_form_products_add,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var multi_products = {
|
var multi_products = {
|
||||||
id: "multi_products",
|
id: "multi_products",
|
||||||
animate: true,
|
animate: true,
|
||||||
|
@ -210,7 +345,8 @@ var multi_products = {
|
||||||
{view:"toolbar", elements: toolbar_products},
|
{view:"toolbar", elements: toolbar_products},
|
||||||
grid_products,
|
grid_products,
|
||||||
]},
|
]},
|
||||||
{id: "product_new", rows:[form_product]}
|
{id: "product_new", rows:[form_product]},
|
||||||
|
{id: "product_add", rows:[form_products_add]}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,3 +391,151 @@ var win_import_products = {
|
||||||
$$('up_products').attachEvent('onUploadComplete', up_products_upload_complete)
|
$$('up_products').attachEvent('onUploadComplete', up_products_upload_complete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var body_add_products_from_xml = {rows: [
|
||||||
|
{view: 'form', id: 'form_upload_products_from_xml', rows: [
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'uploader', id: 'up_products_from_xml', autosend: false,
|
||||||
|
link: 'lst_up_products_from_xml', value: 'Seleccionar Archivo',
|
||||||
|
upload: '/files/productsadd'}, {}]},
|
||||||
|
{cols: [
|
||||||
|
{view: 'list', id: 'lst_up_products_from_xml', type: 'uploader',
|
||||||
|
autoheight: true, borderless: true}]},
|
||||||
|
{cols: [{}, {view: 'button', id: 'cmd_upload_products_from_xml',
|
||||||
|
label: 'Cargar Productos'}, {}]},
|
||||||
|
]},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_add_products_from_xml = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_add_products_from_xml',
|
||||||
|
width: 400,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Agregar Productos desde XML',
|
||||||
|
body: body_add_products_from_xml,
|
||||||
|
})
|
||||||
|
$$('cmd_upload_products_from_xml').attachEvent('onItemClick', cmd_upload_products_from_xml_click)
|
||||||
|
$$('up_products_from_xml').attachEvent('onUploadComplete', up_products_from_xml_upload_complete)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var body_add_inventory = {rows: [{minHeight: 10},
|
||||||
|
{view: 'text', id: 'txt_add_id', readonly: true, hidden: true},
|
||||||
|
{cols: [
|
||||||
|
{view: 'text', id: 'txt_add_key', label: 'Clave',
|
||||||
|
labelPosition: 'top', readonly: true},
|
||||||
|
{view: 'text', id: 'txt_add_unit', label: 'Unidad',
|
||||||
|
labelPosition: 'top', readonly: true},
|
||||||
|
]},
|
||||||
|
{view: 'textarea', id: 'txt_add_description', height: 100,
|
||||||
|
label: 'Descripción', readonly: true, labelPosition: 'top'},
|
||||||
|
{minHeight: 10},
|
||||||
|
{cols: [
|
||||||
|
{view: 'counter', id: 'txt_new_cant', label: 'Cantidad a agregar',
|
||||||
|
labelWidth: 'auto', step: 1, value: 0, min: 0.01},
|
||||||
|
{view: 'richselect', id: 'lst_warehouses', label: 'Almacen: ',
|
||||||
|
labelPosition: 'left', required: false, options: [], hidden: false},
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_add_inventory_save', label: 'Guardar'}, {},
|
||||||
|
{view: 'button', id: 'cmd_add_inventory_cancel', label: 'Cancelar', type: 'danger'}, {}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_add_inventory = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_add_inventory',
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Agregar entrada manualmente',
|
||||||
|
body: body_add_inventory,
|
||||||
|
})
|
||||||
|
$$('cmd_add_inventory_save').attachEvent('onItemClick', cmd_add_inventory_save_click)
|
||||||
|
$$('cmd_add_inventory_cancel').attachEvent('onItemClick', cmd_add_inventory_cancel_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var grid_warehouse_exists_cols = [
|
||||||
|
{ id: 'id', header: 'ID', width: 75, hidden: true},
|
||||||
|
{ id: 'warehouse', header: ['Almacen'], fillspace:true,
|
||||||
|
footer: {text: 'Total', css: 'right'}},
|
||||||
|
{ id: 'exists', header: ['Existencia'], width: 100, sort: 'int',
|
||||||
|
format: webix.i18n.numberFormat, css: 'right',
|
||||||
|
footer: {content: 'summColumn', css: 'right'} },
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var grid_warehouse_exists = {
|
||||||
|
view: 'datatable',
|
||||||
|
id: 'grid_warehouse_exists',
|
||||||
|
adjust: true,
|
||||||
|
autoheight: true,
|
||||||
|
select: 'row',
|
||||||
|
footer: true,
|
||||||
|
columns: grid_warehouse_exists_cols,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var body_win_show_exists = {rows: [{maxHeight: 10, minHeight: 10},
|
||||||
|
{minWidth: 500},
|
||||||
|
{cols: [
|
||||||
|
{maxWidth: 10},
|
||||||
|
{view: 'text', id: 'txt_id_product', readonly: true, hidden: true},
|
||||||
|
grid_warehouse_exists,
|
||||||
|
{maxWidth: 10}
|
||||||
|
]},
|
||||||
|
{maxHeight: 10},
|
||||||
|
{cols: [{maxWidth: 10},
|
||||||
|
{view: 'label', id: 'lbl_title_move', label: 'Primero, selecciona el almacen origen en la tabla superior.'},
|
||||||
|
]},
|
||||||
|
{cols: [{maxWidth: 10},
|
||||||
|
{view: 'counter', id: 'txt_cant_to_move', label: 'Cantidad a mover:',
|
||||||
|
labelPosition: 'top', step: 1, value: 0, min: 0.01},
|
||||||
|
{view: 'richselect', id: 'lst_warehouse_target', label: 'Almacen destino: ',
|
||||||
|
labelPosition: 'top', required: false, options: []}, {maxWidth: 10},
|
||||||
|
{view: 'button', id: 'cmd_warehouse_move', label: 'Mover', maxWidth: 100},
|
||||||
|
{maxWidth: 10}]},
|
||||||
|
{minHeight: 25, maxHeight: 25},
|
||||||
|
{template: 'Ajuste de almacen', type: 'section'},
|
||||||
|
{cols: [{maxWidth: 10},
|
||||||
|
{view: 'counter', id: 'txt_cant_to_adjust', label: 'Cantidad a ajustar:',
|
||||||
|
labelPosition: 'top', step: 1, value: 0, min: -1000000},
|
||||||
|
{view: 'button', id: 'cmd_adjust_stock', label: 'Ajustar', maxWidth: 100},
|
||||||
|
{maxWidth: 10}]},
|
||||||
|
{maxHeight: 20, minHeight: 20},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_win_show_exists_close', label: 'Cerrar', type: 'danger'},
|
||||||
|
{}]},
|
||||||
|
{maxHeight: 20, minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_show_exists = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_show_exists',
|
||||||
|
width: 500,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Existencia por Almacen',
|
||||||
|
body: body_win_show_exists,
|
||||||
|
})
|
||||||
|
$$('cmd_win_show_exists_close').attachEvent('onItemClick', cmd_win_show_exists_close_click)
|
||||||
|
$$('cmd_warehouse_move').attachEvent('onItemClick', cmd_warehouse_move_click)
|
||||||
|
$$('cmd_adjust_stock').attachEvent('onItemClick', cmd_adjust_stock_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
var toolbar_tickets = [
|
var toolbar_tickets = [
|
||||||
{view: 'button', id: 'cmd_nuevo_ticket', label: 'Nuevo', type: 'iconButton',
|
{view: 'button', id: 'cmd_nuevo_ticket', label: 'Nuevo', type: 'iconButton',
|
||||||
autowidth: true, icon: 'plus'},
|
autowidth: true, icon: 'plus'},
|
||||||
|
{view: 'button', id: 'cmd_ticket_from_ticket', label: 'Regenerar',
|
||||||
|
type: 'iconButton', autowidth: true, icon: 'pencil'},
|
||||||
{view: 'button', id: 'cmd_ticket_to_invoice', label: 'Facturar',
|
{view: 'button', id: 'cmd_ticket_to_invoice', label: 'Facturar',
|
||||||
type: 'iconButton', autowidth: true, icon: 'file-code-o'},
|
type: 'iconButton', autowidth: true, icon: 'file-code-o'},
|
||||||
{},
|
{},
|
||||||
|
@ -145,6 +147,8 @@ var grid_tdetails_cols = [
|
||||||
{id: "importe", header:{text: 'Importe', css: 'center'}, width: 150,
|
{id: "importe", header:{text: 'Importe', css: 'center'}, width: 150,
|
||||||
format: webix.i18n.priceFormat, css: 'right',
|
format: webix.i18n.priceFormat, css: 'right',
|
||||||
footer: {content: 'summColumn', css: 'right_footer2'}},
|
footer: {content: 'summColumn', css: 'right_footer2'}},
|
||||||
|
{id: "inventario", hidden: true},
|
||||||
|
{id: "existencia", hidden: true},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -231,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'}
|
||||||
]}
|
]}
|
||||||
|
@ -302,6 +311,7 @@ var grid_tickets_active = {
|
||||||
view: 'datatable',
|
view: 'datatable',
|
||||||
id: 'grid_tickets_active',
|
id: 'grid_tickets_active',
|
||||||
select: 'row',
|
select: 'row',
|
||||||
|
multiselect: true,
|
||||||
adjust: true,
|
adjust: true,
|
||||||
footer: true,
|
footer: true,
|
||||||
drag: true,
|
drag: true,
|
||||||
|
@ -337,6 +347,7 @@ var grid_tickets_invoice = {
|
||||||
view: 'datatable',
|
view: 'datatable',
|
||||||
id: 'grid_tickets_invoice',
|
id: 'grid_tickets_invoice',
|
||||||
select: 'row',
|
select: 'row',
|
||||||
|
multiselect: true,
|
||||||
adjust: true,
|
adjust: true,
|
||||||
footer: true,
|
footer: true,
|
||||||
drag: true,
|
drag: true,
|
||||||
|
@ -478,4 +489,4 @@ var win_ticket_notes = {
|
||||||
})
|
})
|
||||||
$$('cmd_ticket_save_note').attachEvent('onItemClick', cmd_ticket_save_note_click)
|
$$('cmd_ticket_save_note').attachEvent('onItemClick', cmd_ticket_save_note_click)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ webix.ready(function(){
|
||||||
var value = data.json();
|
var value = data.json();
|
||||||
$$("title_login").setHTML(value);
|
$$("title_login").setHTML(value);
|
||||||
})
|
})
|
||||||
|
$$("txt_rfc").focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,346 +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="http://www.sat.gob.mx/sitio_internet/cfd/pfic/pfic.xslt"/>
|
||||||
<xsl:include href="ecc11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/TuristaPasajeroExtranjero/TuristaPasajeroExtranjero.xslt"/>
|
||||||
<xsl:include href="pfic.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xslt"/>
|
||||||
<xsl:include href="TuristaPasajeroExtranjero.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/pagoenespecie/pagoenespecie.xslt"/>
|
||||||
<xsl:include href="cfdiregistrofiscal.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/aerolineas/aerolineas.xslt"/>
|
||||||
<xsl:include href="pagoenespecie.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/valesdedespensa/valesdedespensa.xslt"/>
|
||||||
<xsl:include href="aerolineas.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/notariospublicos/notariospublicos.xslt"/>
|
||||||
<xsl:include href="valesdedespensa.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/vehiculousado/vehiculousado.xslt"/>
|
||||||
<xsl:include href="consumodecombustibles.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/servicioparcialconstruccion/servicioparcialconstruccion.xslt"/>
|
||||||
<xsl:include href="notariospublicos.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/renovacionysustitucionvehiculos/renovacionysustitucionvehiculos.xslt"/>
|
||||||
<xsl:include href="vehiculousado.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/certificadodestruccion/certificadodedestruccion.xslt"/>
|
||||||
<xsl:include href="servicioparcialconstruccion.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/arteantiguedades/obrasarteantiguedades.xslt"/>
|
||||||
<xsl:include href="renovacionysustitucionvehiculos.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/ventavehiculos/ventavehiculos11.xslt"/>
|
||||||
<xsl:include href="certificadodedestruccion.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/detallista/detallista.xslt"/>
|
||||||
<xsl:include href="obrasarteantiguedades.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc12.xslt"/>
|
||||||
<xsl:include href="ventavehiculos11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/consumodecombustibles/consumodeCombustibles11.xslt"/>
|
||||||
<xsl:include href="terceros11.xslt"/>
|
<xsl:include href="http://www.sat.gob.mx/sitio_internet/cfd/GastosHidrocarburos10/GastosHidrocarburos10.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="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@MetodoPago"/>
|
<xsl:with-param name="valor" select="./@Exportacion"/>
|
||||||
</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="./@MetodoPago"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Confirmacion"/>
|
<xsl:with-param name="valor" select="./@LugarExpedicion"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<!--
|
<xsl:call-template name="Opcional">
|
||||||
Llamadas para procesar al los sub nodos del comprobante
|
<xsl:with-param name="valor" select="./@Confirmacion"/>
|
||||||
-->
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="./cfdi:CfdiRelacionados"/>
|
<!--
|
||||||
<xsl:apply-templates select="./cfdi:Emisor"/>
|
Llamadas para procesar al los sub nodos del comprobante
|
||||||
<xsl:apply-templates select="./cfdi:Receptor"/>
|
-->
|
||||||
<xsl:apply-templates select="./cfdi:Conceptos"/>
|
<xsl:apply-templates select="./cfdi:InformacionGlobal"/>
|
||||||
<xsl:apply-templates select="./cfdi:Impuestos"/>
|
<xsl:apply-templates select="./cfdi:CfdiRelacionados"/>
|
||||||
<xsl:for-each select="./cfdi:Complemento">
|
<xsl:apply-templates select="./cfdi:Emisor"/>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:apply-templates select="./cfdi:Receptor"/>
|
||||||
</xsl:for-each>
|
<xsl:apply-templates select="./cfdi:Conceptos"/>
|
||||||
</xsl:template>
|
<xsl:apply-templates select="./cfdi:Impuestos"/>
|
||||||
|
<xsl:for-each select="./cfdi:Complemento">
|
||||||
<!-- Manejador de nodos tipo CFDIRelacionados -->
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:template match="cfdi:CfdiRelacionados">
|
</xsl:for-each>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del CFDIRelacionados -->
|
</xsl:template>
|
||||||
<xsl:call-template name="Requerido">
|
|
||||||
<xsl:with-param name="valor" select="./@TipoRelacion"/>
|
<!-- Manejador de nodos tipo InformacionGlobal -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:InformacionGlobal">
|
||||||
<xsl:for-each select="./cfdi:CfdiRelacionado">
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo InformacionGlobal -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@UUID"/>
|
<xsl:with-param name="valor" select="./@Periodicidad"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:template>
|
<xsl:with-param name="valor" select="./@Meses"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejador de nodos tipo Emisor -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:template match="cfdi:Emisor">
|
<xsl:with-param name="valor" select="./@Año"/>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Emisor -->
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:template>
|
||||||
<xsl:with-param name="valor" select="./@Rfc"/>
|
|
||||||
</xsl:call-template>
|
<!-- Manejador de nodos tipo CFDIRelacionados -->
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:template match="cfdi:CfdiRelacionados">
|
||||||
<xsl:with-param name="valor" select="./@Nombre"/>
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo CFDIRelacionados -->
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@TipoRelacion"/>
|
||||||
<xsl:with-param name="valor" select="./@RegimenFiscal"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:for-each select="./cfdi:CfdiRelacionado">
|
||||||
</xsl:template>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@UUID"/>
|
||||||
<!-- Manejador de nodos tipo Receptor -->
|
</xsl:call-template>
|
||||||
<xsl:template match="cfdi:Receptor">
|
</xsl:for-each>
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Receptor -->
|
</xsl:template>
|
||||||
<xsl:call-template name="Requerido">
|
|
||||||
<xsl:with-param name="valor" select="./@Rfc"/>
|
<!-- Manejador de nodos tipo Emisor -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:Emisor">
|
||||||
<xsl:call-template name="Opcional">
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo Emisor -->
|
||||||
<xsl:with-param name="valor" select="./@Nombre"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@ResidenciaFiscal"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@NumRegIdTrib"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@RegimenFiscal"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@UsoCFDI"/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@FacAtrAdquirente"/>
|
||||||
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Manejador de nodos tipo Conceptos -->
|
<!-- Manejador de nodos tipo Receptor -->
|
||||||
<xsl:template match="cfdi:Conceptos">
|
<xsl:template match="cfdi:Receptor">
|
||||||
<!-- Llamada para procesar los distintos nodos tipo Concepto -->
|
<!-- Iniciamos el tratamiento de los atributos del nodo tipo Receptor -->
|
||||||
<xsl:for-each select="./cfdi:Concepto">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:with-param name="valor" select="./@Rfc"/>
|
||||||
</xsl:for-each>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Nombre"/>
|
||||||
<!--Manejador de nodos tipo Concepto-->
|
</xsl:call-template>
|
||||||
<xsl:template match="cfdi:Concepto">
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Iniciamos el tratamiento de los atributos del Concepto -->
|
<xsl:with-param name="valor" select="./@DomicilioFiscalReceptor"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@ResidenciaFiscal"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@NumRegIdTrib"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Cantidad"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@RegimenFiscalReceptor"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@ClaveUnidad"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@UsoCFDI"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Unidad"/>
|
|
||||||
</xsl:call-template>
|
</xsl:template>
|
||||||
<xsl:call-template name="Requerido">
|
|
||||||
<xsl:with-param name="valor" select="./@Descripcion"/>
|
<!-- Manejador de nodos tipo Conceptos -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:Conceptos">
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Llamada para procesar los distintos nodos tipo Concepto -->
|
||||||
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
<xsl:for-each select="./cfdi:Concepto">
|
||||||
</xsl:call-template>
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:for-each>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
</xsl:template>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Opcional">
|
<!--Manejador de nodos tipo Concepto-->
|
||||||
<xsl:with-param name="valor" select="./@Descuento"/>
|
<xsl:template match="cfdi:Concepto">
|
||||||
</xsl:call-template>
|
<!-- Iniciamos el tratamiento de los atributos del Concepto -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejo de sub nodos de información Traslado de Conceptos:Concepto:Impuestos:Traslados-->
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
<xsl:for-each select="./cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado">
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@Base"/>
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
<xsl:with-param name="valor" select="./@Cantidad"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
<xsl:with-param name="valor" select="./@ClaveUnidad"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Opcional">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
<xsl:with-param name="valor" select="./@Unidad"/>
|
||||||
</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="./@Descripcion"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
<!-- Manejo de sub nodos de Retencion por cada una de los Conceptos:Concepto:Impuestos:Retenciones-->
|
</xsl:call-template>
|
||||||
<xsl:for-each select="./cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
<xsl:with-param name="valor" select="./@Base"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Descuento"/>
|
||||||
<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="./@ObjetoImp"/>
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
</xsl:call-template>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejo de sub nodos de información Traslado de Conceptos:Concepto:Impuestos:Traslados-->
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado">
|
||||||
</xsl:call-template>
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
<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="./@Impuesto"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejo de los distintos sub nodos de información aduanera de forma indistinta a su grado de dependencia -->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select="./cfdi:InformacionAduanera">
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Opcional">
|
||||||
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
<!-- Llamada al manejador de nodos de CuentaPredial en caso de existir -->
|
</xsl:call-template>
|
||||||
<xsl:if test="./cfdi:CuentaPredial">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:apply-templates select="./cfdi:CuentaPredial"/>
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
</xsl:if>
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
<!-- Llamada al manejador de nodos de ComplementoConcepto en caso de existir -->
|
|
||||||
<xsl:if test="./cfdi:ComplementoConcepto">
|
<!-- Manejo de sub nodos de Retencion por cada una de los Conceptos:Concepto:Impuestos:Retenciones-->
|
||||||
<xsl:apply-templates select="./cfdi:ComplementoConcepto"/>
|
<xsl:for-each select="./cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion">
|
||||||
</xsl:if>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Base"/>
|
||||||
<!-- Llamada al manejador de nodos de Parte en caso de existir -->
|
</xsl:call-template>
|
||||||
<xsl:for-each select=".//cfdi:Parte">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:with-param name="valor" select="./@Impuesto"/>
|
||||||
</xsl:for-each>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
||||||
<!-- Manejador de nodos tipo Información Aduanera -->
|
</xsl:call-template>
|
||||||
<xsl:template match="cfdi:InformacionAduanera">
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Manejo de los atributos de la información aduanera -->
|
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@NumeroPedimento"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@Importe"/>
|
||||||
</xsl:template>
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
<!-- Manejador de nodos tipo Información CuentaPredial -->
|
|
||||||
<xsl:template match="cfdi:CuentaPredial">
|
<!-- Manejo de los distintos sub nodos a cuenta de terceros de forma indistinta a su grado de dependencia -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:for-each select="./cfdi:ACuentaTerceros">
|
||||||
<xsl:with-param name="valor" select="./@Numero"/>
|
<xsl:apply-templates select="."/>
|
||||||
</xsl:call-template>
|
</xsl:for-each>
|
||||||
</xsl:template>
|
|
||||||
|
<!-- Manejo de los distintos sub nodos de información aduanera de forma indistinta a su grado de dependencia -->
|
||||||
<!-- Manejador de nodos tipo ComplementoConcepto -->
|
<xsl:for-each select="./cfdi:InformacionAduanera">
|
||||||
<xsl:template match="cfdi:ComplementoConcepto">
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:for-each select="./*">
|
</xsl:for-each>
|
||||||
<xsl:apply-templates select="."/>
|
|
||||||
</xsl:for-each>
|
<!-- Llamada al manejador de nodos de CuentaPredial en caso de existir -->
|
||||||
</xsl:template>
|
<xsl:if test="./cfdi:CuentaPredial">
|
||||||
|
<xsl:apply-templates select="./cfdi:CuentaPredial"/>
|
||||||
<!-- Manejador de nodos tipo Parte -->
|
</xsl:if>
|
||||||
<xsl:template match="cfdi:Parte">
|
|
||||||
<!-- Iniciamos el tratamiento de los atributos de Parte-->
|
<!-- Llamada al manejador de nodos de ComplementoConcepto en caso de existir -->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:if test="./cfdi:ComplementoConcepto">
|
||||||
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
<xsl:apply-templates select="./cfdi:ComplementoConcepto"/>
|
||||||
</xsl:call-template>
|
</xsl:if>
|
||||||
<xsl:call-template name="Opcional">
|
|
||||||
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
<!-- Llamada al manejador de nodos de Parte en caso de existir -->
|
||||||
</xsl:call-template>
|
<xsl:for-each select=".//cfdi:Parte">
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:with-param name="valor" select="./@Cantidad"/>
|
</xsl:for-each>
|
||||||
</xsl:call-template>
|
</xsl:template>
|
||||||
<xsl:call-template name="Opcional">
|
|
||||||
<xsl:with-param name="valor" select="./@Unidad"/>
|
<!-- Manejador de nodos tipo ACuentaTerceros -->
|
||||||
</xsl:call-template>
|
<xsl:template match="cfdi:ACuentaTerceros">
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejo de los atributos del nodo tipo ACuentaTerceros -->
|
||||||
<xsl:with-param name="valor" select="./@Descripcion"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@RfcACuentaTerceros"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@NombreACuentaTerceros"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:call-template name="Requerido">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@RegimenFiscalACuentaTerceros"/>
|
||||||
|
</xsl:call-template>
|
||||||
<!-- Manejador de nodos tipo InformacionAduanera-->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select=".//cfdi:InformacionAduanera">
|
<xsl:with-param name="valor" select="./@DomicilioFiscalACuentaTerceros"/>
|
||||||
<xsl:apply-templates select="."/>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
</xsl:template>
|
||||||
</xsl:template>
|
|
||||||
|
<!-- Manejador de nodos tipo Información Aduanera -->
|
||||||
<!-- Manejador de nodos tipo Complemento -->
|
<xsl:template match="cfdi:InformacionAduanera">
|
||||||
<xsl:template match="cfdi:Complemento">
|
<!-- Manejo de los atributos de la información aduanera -->
|
||||||
<xsl:for-each select="./*">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:with-param name="valor" select="./@NumeroPedimento"/>
|
||||||
</xsl:for-each>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Manejador de nodos tipo Domicilio fiscal -->
|
<!-- Manejador de nodos tipo Información CuentaPredial -->
|
||||||
<xsl:template match="cfdi:Impuestos">
|
<xsl:template match="cfdi:CuentaPredial">
|
||||||
<!-- Manejo de sub nodos de Retencion por cada una de los Impuestos:Retenciones-->
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:for-each select="./cfdi:Retenciones/cfdi:Retencion">
|
<xsl:with-param name="valor" select="./@Numero"/>
|
||||||
<xsl:call-template name="Requerido">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
</xsl:template>
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:call-template name="Requerido">
|
<!-- Manejador de nodos tipo ComplementoConcepto -->
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:template match="cfdi:ComplementoConcepto">
|
||||||
</xsl:call-template>
|
<xsl:for-each select="./*">
|
||||||
</xsl:for-each>
|
<xsl:apply-templates select="."/>
|
||||||
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosRetenidos-->
|
</xsl:for-each>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:template>
|
||||||
<xsl:with-param name="valor" select="./@TotalImpuestosRetenidos"/>
|
|
||||||
</xsl:call-template>
|
<!-- Manejador de nodos tipo Parte -->
|
||||||
<!-- Manejo de sub nodos de información Traslado de Impuestos:Traslados-->
|
<xsl:template match="cfdi:Parte">
|
||||||
<xsl:for-each select="./cfdi:Traslados/cfdi:Traslado">
|
<!-- Iniciamos el tratamiento de los atributos de Parte-->
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@Impuesto"/>
|
<xsl:with-param name="valor" select="./@ClaveProdServ"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@TipoFactor"/>
|
<xsl:with-param name="valor" select="./@NoIdentificacion"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Requerido">
|
||||||
<xsl:with-param name="valor" select="./@TasaOCuota"/>
|
<xsl:with-param name="valor" select="./@Cantidad"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="Requerido">
|
<xsl:call-template name="Opcional">
|
||||||
<xsl:with-param name="valor" select="./@Importe"/>
|
<xsl:with-param name="valor" select="./@Unidad"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
<xsl:call-template name="Requerido">
|
||||||
<!-- Iniciamos el tratamiento de los atributos de TotalImpuestosTrasladados-->
|
<xsl:with-param name="valor" select="./@Descripcion"/>
|
||||||
<xsl:call-template name="Opcional">
|
</xsl:call-template>
|
||||||
<xsl:with-param name="valor" select="./@TotalImpuestosTrasladados"/>
|
<xsl:call-template name="Opcional">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="valor" select="./@ValorUnitario"/>
|
||||||
</xsl:template>
|
</xsl:call-template>
|
||||||
</xsl:stylesheet>
|
<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="./@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,615 @@
|
||||||
|
<?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:cartaporte20="http://www.sat.gob.mx/CartaPorte20">
|
||||||
|
<xsl:template match="cartaporte20: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="./@TranspInternac"/>
|
||||||
|
</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>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia -->
|
||||||
|
<xsl:for-each select="./cartaporte20:Ubicaciones">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<xsl:for-each select="./cartaporte20:Mercancias">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<xsl:for-each select="./cartaporte20:FiguraTransporte">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Ubicaciones-->
|
||||||
|
<xsl:template match="cartaporte20:Ubicaciones">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de Ubicacion-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Ubicacion">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Ubicacion-->
|
||||||
|
<xsl:template match="cartaporte20: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 cartaporte20:Domicilio-->
|
||||||
|
<xsl:for-each select="./cartaporte20: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="cartaporte20:Mercancias">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Mercancia-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Mercancia">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Autotransporte-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Autotransporte">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:TransporteMaritimo-->
|
||||||
|
<xsl:for-each select="./cartaporte20:TransporteMaritimo">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:TransporteAereo-->
|
||||||
|
<xsl:for-each select="./cartaporte20:TransporteAereo">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:TransporteFerroviario-->
|
||||||
|
<xsl:for-each select="./cartaporte20:TransporteFerroviario">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Mercancia-->
|
||||||
|
<xsl:template match="cartaporte20:Mercancia">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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="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>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Pedimentos-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Pedimentos">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:GuiasIdentificacion-->
|
||||||
|
<xsl:for-each select="./cartaporte20:GuiasIdentificacion">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:CantidadTransporta-->
|
||||||
|
<xsl:for-each select="./cartaporte20:CantidadTransporta">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:DetalleMercancia-->
|
||||||
|
<xsl:for-each select="./cartaporte20:DetalleMercancia">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Pedimentos-->
|
||||||
|
<xsl:template match="cartaporte20:Pedimentos">
|
||||||
|
<!-- Iniciamos el manejo de los nodos dependientes -->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@Pedimento"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia GuiasIdentificacion-->
|
||||||
|
<xsl:template match="cartaporte20: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="cartaporte20: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="cartaporte20: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="cartaporte20:Autotransporte">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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 cartaporte20:IdentificacionVehicular-->
|
||||||
|
<xsl:for-each select="./cartaporte20:IdentificacionVehicular">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Seguros-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Seguros">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Remolques-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Remolques">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia IdentificacionVehicular-->
|
||||||
|
<xsl:template match="cartaporte20: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="./@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="cartaporte20: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="cartaporte20:Remolques">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Remolque-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Remolque">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia Remolque-->
|
||||||
|
<xsl:template match="cartaporte20: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="cartaporte20:TransporteMaritimo">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@NumCertITC"/>
|
||||||
|
</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="./@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>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Contenedor-->
|
||||||
|
<xsl:for-each select="./cartaporte20: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="./@MatriculaContenedor"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<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="./@NumPrecinto"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TransporteAereo-->
|
||||||
|
<xsl:template match="cartaporte20:TransporteAereo">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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="cartaporte20:TransporteFerroviario">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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 cartaporte20:DerechosDePaso-->
|
||||||
|
<xsl:for-each select="./cartaporte20:DerechosDePaso">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Carro-->
|
||||||
|
<xsl:for-each select="./cartaporte20:Carro">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia DerechosDePaso-->
|
||||||
|
<xsl:template match="cartaporte20: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="cartaporte20:Carro">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20: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 cartaporte20:Contenedor -->
|
||||||
|
<xsl:for-each select="./cartaporte20: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="cartaporte20:FiguraTransporte">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20:FiguraTransporte-->
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:TiposFigura-->
|
||||||
|
<xsl:for-each select="./cartaporte20:TiposFigura ">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:template>
|
||||||
|
<!-- Iniciamos el manejo de los elementos hijo en la secuencia TiposFigura-->
|
||||||
|
<xsl:template match="cartaporte20:TiposFigura">
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20: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="Opcional">
|
||||||
|
<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="./cartaporte20:PartesTransporte">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
<!-- Iniciamos el tratamiento de los atributos de cartaporte20:Domicilio -->
|
||||||
|
<xsl:for-each select="./cartaporte20: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="cartaporte20:PartesTransporte">
|
||||||
|
<!--Manejador de nodos tipo cartaporte20:PartesTransporte-->
|
||||||
|
<xsl:call-template name="Requerido">
|
||||||
|
<xsl:with-param name="valor" select="./@ParteTransporte"/>
|
||||||
|
</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