add: QR al ticket, datos para facturación
This commit is contained in:
parent
24b59f0b16
commit
31e4cd9214
276
package-lock.json
generated
276
package-lock.json
generated
@ -17,6 +17,7 @@
|
|||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"pinia": "^3.0.1",
|
"pinia": "^3.0.1",
|
||||||
"pusher-js": "^8.4.0",
|
"pusher-js": "^8.4.0",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
"tailwindcss": "^4.0",
|
"tailwindcss": "^4.0",
|
||||||
"toastr": "^2.1.4",
|
"toastr": "^2.1.4",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
@ -1450,11 +1451,19 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ansi-styles": {
|
"node_modules/ansi-styles": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"color-convert": "^2.0.1"
|
"color-convert": "^2.0.1"
|
||||||
@ -1659,6 +1668,15 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/camelcase": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001718",
|
"version": "1.0.30001718",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz",
|
||||||
@ -1739,11 +1757,21 @@
|
|||||||
"node": ">= 10.0"
|
"node": ">= 10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/cliui": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"strip-ansi": "^6.0.0",
|
||||||
|
"wrap-ansi": "^6.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/color-convert": {
|
"node_modules/color-convert": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"color-name": "~1.1.4"
|
"color-name": "~1.1.4"
|
||||||
@ -1756,7 +1784,6 @@
|
|||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/colorette": {
|
"node_modules/colorette": {
|
||||||
@ -1903,6 +1930,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/decamelize": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/delayed-stream": {
|
"node_modules/delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
@ -1921,6 +1957,12 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dijkstrajs": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/dom-serializer": {
|
"node_modules/dom-serializer": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
||||||
@ -2061,6 +2103,12 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/engine.io-client": {
|
"node_modules/engine.io-client": {
|
||||||
"version": "6.6.3",
|
"version": "6.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz",
|
||||||
@ -2313,6 +2361,19 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/find-up": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"locate-path": "^5.0.0",
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.9",
|
"version": "1.15.9",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||||
@ -2400,6 +2461,15 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/get-caller-file": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/get-intrinsic": {
|
"node_modules/get-intrinsic": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||||
@ -2585,6 +2655,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-fullwidth-code-point": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-glob": {
|
"node_modules/is-glob": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
@ -2925,6 +3004,18 @@
|
|||||||
"url": "https://opencollective.com/parcel"
|
"url": "https://opencollective.com/parcel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/locate-path": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-locate": "^4.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lower-case": {
|
"node_modules/lower-case": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
|
||||||
@ -3152,6 +3243,42 @@
|
|||||||
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/p-limit": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-locate": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-limit": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pako": {
|
"node_modules/pako": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
|
||||||
@ -3180,6 +3307,15 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/path-exists": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pathe": {
|
"node_modules/pathe": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz",
|
||||||
@ -3239,6 +3375,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pngjs": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.5.3",
|
"version": "8.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
||||||
@ -3289,6 +3434,23 @@
|
|||||||
"tweetnacl": "^1.0.3"
|
"tweetnacl": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/qrcode": {
|
||||||
|
"version": "1.5.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
|
||||||
|
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dijkstrajs": "^1.0.1",
|
||||||
|
"pngjs": "^5.0.0",
|
||||||
|
"yargs": "^15.3.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"qrcode": "bin/qrcode"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.9.7",
|
"version": "6.9.7",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz",
|
||||||
@ -3349,6 +3511,21 @@
|
|||||||
"node": ">= 0.10"
|
"node": ">= 0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/require-main-filename": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/reusify": {
|
"node_modules/reusify": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
|
||||||
@ -3445,6 +3622,12 @@
|
|||||||
"integrity": "sha512-lwsAIzOPlH8/7IIjjz3K0zYBk7aBVVcvjMwt3M4fLxpjMYyy7i3I97SLHebgn4YBjirkzfp3RvRDWSKsh/+WFw==",
|
"integrity": "sha512-lwsAIzOPlH8/7IIjjz3K0zYBk7aBVVcvjMwt3M4fLxpjMYyy7i3I97SLHebgn4YBjirkzfp3RvRDWSKsh/+WFw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/set-blocking": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/socket.io-client": {
|
"node_modules/socket.io-client": {
|
||||||
"version": "4.8.1",
|
"version": "4.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz",
|
||||||
@ -3524,6 +3707,32 @@
|
|||||||
"node": ">=0.1.14"
|
"node": ">=0.1.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/string-width": {
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/superjson": {
|
"node_modules/superjson": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.2.tgz",
|
||||||
@ -3943,6 +4152,26 @@
|
|||||||
"npm": ">=3.10.0"
|
"npm": ">=3.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which-module": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi": {
|
||||||
|
"version": "6.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||||
|
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.17.1",
|
"version": "8.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
|
||||||
@ -3974,6 +4203,12 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/y18n": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/yallist": {
|
"node_modules/yallist": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
||||||
@ -3983,6 +4218,41 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/yargs": {
|
||||||
|
"version": "15.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
|
||||||
|
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^6.0.0",
|
||||||
|
"decamelize": "^1.2.0",
|
||||||
|
"find-up": "^4.1.0",
|
||||||
|
"get-caller-file": "^2.0.1",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^2.0.0",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^4.0.0",
|
||||||
|
"yargs-parser": "^18.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-parser": {
|
||||||
|
"version": "18.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
|
||||||
|
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ziggy-js": {
|
"node_modules/ziggy-js": {
|
||||||
"version": "2.5.3",
|
"version": "2.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/ziggy-js/-/ziggy-js-2.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/ziggy-js/-/ziggy-js-2.5.3.tgz",
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"pinia": "^3.0.1",
|
"pinia": "^3.0.1",
|
||||||
"pusher-js": "^8.4.0",
|
"pusher-js": "^8.4.0",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
"tailwindcss": "^4.0",
|
"tailwindcss": "^4.0",
|
||||||
"toastr": "^2.1.4",
|
"toastr": "^2.1.4",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
|
|||||||
@ -458,7 +458,8 @@ export default {
|
|||||||
cashRegister: 'Caja',
|
cashRegister: 'Caja',
|
||||||
point: 'Punto de Venta',
|
point: 'Punto de Venta',
|
||||||
sales: 'Ventas',
|
sales: 'Ventas',
|
||||||
clients: 'Clientes'
|
clients: 'Clientes',
|
||||||
|
billingRequests: 'Solicitudes de Facturación'
|
||||||
},
|
},
|
||||||
cashRegister: {
|
cashRegister: {
|
||||||
title: 'Caja Registradora',
|
title: 'Caja Registradora',
|
||||||
|
|||||||
@ -42,6 +42,7 @@ onMounted(() => {
|
|||||||
to="pos.category.index"
|
to="pos.category.index"
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link
|
||||||
|
v-if="hasPermission('inventario.index')"
|
||||||
icon="inventory_2"
|
icon="inventory_2"
|
||||||
name="pos.inventory"
|
name="pos.inventory"
|
||||||
to="pos.inventory.index"
|
to="pos.inventory.index"
|
||||||
@ -61,6 +62,11 @@ onMounted(() => {
|
|||||||
name="pos.clients"
|
name="pos.clients"
|
||||||
to="pos.clients.index"
|
to="pos.clients.index"
|
||||||
/>
|
/>
|
||||||
|
<Link
|
||||||
|
icon="request_quote"
|
||||||
|
name="pos.billingRequests"
|
||||||
|
to="pos.billingRequests.index"
|
||||||
|
/>
|
||||||
</Section>
|
</Section>
|
||||||
<Section
|
<Section
|
||||||
v-if="hasPermission('users.index')"
|
v-if="hasPermission('users.index')"
|
||||||
|
|||||||
234
src/pages/POS/Clients/BillingRequestDetailModal.vue
Normal file
234
src/pages/POS/Clients/BillingRequestDetailModal.vue
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { formatCurrency, formatDate } from '@/utils/formatters';
|
||||||
|
|
||||||
|
import Modal from '@Holos/Modal.vue';
|
||||||
|
import GoogleIcon from '@Shared/GoogleIcon.vue';
|
||||||
|
|
||||||
|
/** Props */
|
||||||
|
const props = defineProps({
|
||||||
|
request: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/** Emits */
|
||||||
|
const emit = defineEmits(['close', 'refresh']);
|
||||||
|
|
||||||
|
/** Estado */
|
||||||
|
const processing = ref(false);
|
||||||
|
|
||||||
|
/** Computed */
|
||||||
|
const hasSales = computed(() => props.request.sales && props.request.sales.length > 0);
|
||||||
|
const latestSale = computed(() => hasSales.value ? props.request.sales[0] : null);
|
||||||
|
|
||||||
|
/** Métodos */
|
||||||
|
const closeModal = () => {
|
||||||
|
emit('close');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Modal :show="true" max-width="4xl" @close="closeModal">
|
||||||
|
<div class="p-6">
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="flex items-center justify-between mb-6">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="flex items-center justify-center w-12 h-12 rounded-full bg-blue-100 dark:bg-blue-900/30">
|
||||||
|
<GoogleIcon name="receipt_long" class="text-2xl text-blue-600 dark:text-blue-400" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">
|
||||||
|
Datos de Facturación
|
||||||
|
</h3>
|
||||||
|
<p class="text-sm text-gray-500 dark:text-gray-400" v-if="hasSales">
|
||||||
|
Última venta: {{ latestSale.invoice_number || `#${String(latestSale.id).padStart(6, '0')}` }}
|
||||||
|
</p>
|
||||||
|
<p class="text-sm text-gray-500 dark:text-gray-400" v-else>
|
||||||
|
Cliente con datos fiscales registrados
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
@click="closeModal"
|
||||||
|
class="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
|
||||||
|
>
|
||||||
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<div class="space-y-6">
|
||||||
|
<!-- Información del Cliente -->
|
||||||
|
<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-xl p-5 border border-gray-200 dark:border-gray-700">
|
||||||
|
<div class="flex items-center gap-2 mb-4">
|
||||||
|
<GoogleIcon name="person" class="text-xl text-gray-600 dark:text-gray-400" />
|
||||||
|
<h4 class="text-sm font-bold text-gray-700 dark:text-gray-300 uppercase tracking-wide">
|
||||||
|
Datos del Cliente
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1">
|
||||||
|
Nombre
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ request.name }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1">
|
||||||
|
Email
|
||||||
|
</label>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ request.email }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1">
|
||||||
|
Teléfono
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ request.phone || 'No especificado' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1">
|
||||||
|
Dirección
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ request.address || 'No especificada' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Información Fiscal -->
|
||||||
|
<div class="bg-gradient-to-br from-blue-50 to-blue-100 dark:from-blue-900/20 dark:to-blue-800/20 rounded-xl p-5 border border-blue-200 dark:border-blue-800">
|
||||||
|
<div class="flex items-center gap-2 mb-4">
|
||||||
|
<GoogleIcon name="account_balance" class="text-xl text-blue-600 dark:text-blue-400" />
|
||||||
|
<h4 class="text-sm font-bold text-blue-700 dark:text-blue-300 uppercase tracking-wide">
|
||||||
|
Datos Fiscales
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-blue-600 dark:text-blue-400 uppercase mb-1">
|
||||||
|
RFC
|
||||||
|
</label>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p class="text-sm font-mono font-bold text-blue-900 dark:text-blue-100">
|
||||||
|
{{ request.rfc }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-blue-600 dark:text-blue-400 uppercase mb-1">
|
||||||
|
Razón Social
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-blue-900 dark:text-blue-100">
|
||||||
|
{{ request.razon_social || 'No especificada' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-blue-600 dark:text-blue-400 uppercase mb-1">
|
||||||
|
Régimen Fiscal
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-blue-900 dark:text-blue-100">
|
||||||
|
{{ request.regimen_fiscal || 'No especificado' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-blue-600 dark:text-blue-400 uppercase mb-1">
|
||||||
|
Código Postal Fiscal
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-blue-900 dark:text-blue-100">
|
||||||
|
{{ request.cp_fiscal || 'No especificado' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="md:col-span-2">
|
||||||
|
<label class="block text-xs font-semibold text-blue-600 dark:text-blue-400 uppercase mb-1">
|
||||||
|
Uso de CFDI
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-blue-900 dark:text-blue-100">
|
||||||
|
{{ request.uso_cfdi || 'No especificado' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Información de la Venta -->
|
||||||
|
<div v-if="hasSales" class="bg-gradient-to-br from-green-50 to-green-100 dark:from-green-900/20 dark:to-green-800/20 rounded-xl p-5 border border-green-200 dark:border-green-800">
|
||||||
|
<div class="flex items-center gap-2 mb-4">
|
||||||
|
<GoogleIcon name="shopping_cart" class="text-xl text-green-600 dark:text-green-400" />
|
||||||
|
<h4 class="text-sm font-bold text-green-700 dark:text-green-300 uppercase tracking-wide">
|
||||||
|
Última Venta Registrada
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-green-600 dark:text-green-400 uppercase mb-1">
|
||||||
|
Folio
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-bold text-green-900 dark:text-green-100">
|
||||||
|
{{ latestSale.invoice_number || `#${String(latestSale.id).padStart(6, '0')}` }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-green-600 dark:text-green-400 uppercase mb-1">
|
||||||
|
Total
|
||||||
|
</label>
|
||||||
|
<p class="text-lg font-bold text-green-600 dark:text-green-400">
|
||||||
|
{{ formatCurrency(latestSale.total || 0) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-green-600 dark:text-green-400 uppercase mb-1">
|
||||||
|
Fecha de Venta
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-green-900 dark:text-green-100">
|
||||||
|
{{ formatDate(latestSale.created_at) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-3 pt-3 border-t border-green-200 dark:border-green-700" v-if="request.sales.length > 1">
|
||||||
|
<p class="text-xs text-green-600 dark:text-green-400">
|
||||||
|
Este cliente tiene {{ request.sales.length }} venta(s) registrada(s)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Fecha de Registro -->
|
||||||
|
<div class="flex items-center gap-3 p-4 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg">
|
||||||
|
<GoogleIcon name="schedule" class="text-2xl text-gray-600 dark:text-gray-400" />
|
||||||
|
<div>
|
||||||
|
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase">
|
||||||
|
Fecha de Registro
|
||||||
|
</label>
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ formatDate(request.created_at) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<div class="flex items-center justify-end gap-3 mt-8 pt-6 border-t border-gray-200 dark:border-gray-700">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
@click="closeModal"
|
||||||
|
:disabled="processing"
|
||||||
|
class="px-5 py-2.5 text-sm font-semibold text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
Cerrar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
160
src/pages/POS/Clients/BillingRequests.vue
Normal file
160
src/pages/POS/Clients/BillingRequests.vue
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
<script setup>
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { useSearcher, apiURL } from '@Services/Api';
|
||||||
|
import { formatDate } from '@/utils/formatters';
|
||||||
|
|
||||||
|
import SearcherHead from '@Holos/Searcher.vue';
|
||||||
|
import Table from '@Holos/Table.vue';
|
||||||
|
import GoogleIcon from '@Shared/GoogleIcon.vue';
|
||||||
|
import BillingRequestDetailModal from './BillingRequestDetailModal.vue';
|
||||||
|
|
||||||
|
/** Estado */
|
||||||
|
const billingRequests = ref([]);
|
||||||
|
const showDetailModal = ref(false);
|
||||||
|
const selectedRequest = ref(null);
|
||||||
|
|
||||||
|
/** Métodos */
|
||||||
|
const searcher = useSearcher({
|
||||||
|
url: apiURL('clients?with=sales'),
|
||||||
|
onSuccess: (r) => {
|
||||||
|
billingRequests.value = r.clients || r.data || [];
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error('❌ ERROR al cargar solicitudes de facturación:', error);
|
||||||
|
billingRequests.value = [];
|
||||||
|
window.Notify.error('Error al cargar solicitudes de facturación');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const openDetailModal = (request) => {
|
||||||
|
selectedRequest.value = request;
|
||||||
|
showDetailModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDetailModal = () => {
|
||||||
|
showDetailModal.value = false;
|
||||||
|
selectedRequest.value = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const refreshList = () => {
|
||||||
|
searcher.search();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Ciclo de vida */
|
||||||
|
onMounted(() => {
|
||||||
|
searcher.search();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<SearcherHead
|
||||||
|
:title="'Solicitudes de Facturación'"
|
||||||
|
placeholder="Buscar por folio, cliente o RFC..."
|
||||||
|
@search="(x) => searcher.search(x)"
|
||||||
|
>
|
||||||
|
</SearcherHead>
|
||||||
|
|
||||||
|
<div class="pt-2 w-full">
|
||||||
|
<Table
|
||||||
|
:items="billingRequests"
|
||||||
|
@send-pagination="(page) => searcher.pagination(page)"
|
||||||
|
>
|
||||||
|
<template #head>
|
||||||
|
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">CLIENTE</th>
|
||||||
|
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">RFC</th>
|
||||||
|
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">RAZÓN SOCIAL</th>
|
||||||
|
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">RÉGIMEN FISCAL</th>
|
||||||
|
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">FECHA REGISTRO</th>
|
||||||
|
<th class="px-6 py-3 text-center text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">ACCIONES</th>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #body="{items}">
|
||||||
|
<tr
|
||||||
|
v-for="request in items"
|
||||||
|
:key="request.id"
|
||||||
|
class="hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||||
|
>
|
||||||
|
<td class="px-6 py-4 text-left">
|
||||||
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ request.name }}
|
||||||
|
</p>
|
||||||
|
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||||
|
{{ request.email }}
|
||||||
|
</p>
|
||||||
|
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||||
|
{{ request.phone || 'N/A' }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="px-6 py-4 text-left">
|
||||||
|
<p class="text-sm text-gray-700 dark:text-gray-300 font-mono">
|
||||||
|
{{ request.rfc || 'N/A' }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="px-6 py-4 text-left">
|
||||||
|
<p class="text-sm text-gray-700 dark:text-gray-300">
|
||||||
|
{{ request.razon_social || 'N/A' }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="px-6 py-4 text-center">
|
||||||
|
<p class="text-sm text-gray-700 dark:text-gray-300">
|
||||||
|
{{ request.regimen_fiscal || 'N/A' }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="px-6 py-4 text-center">
|
||||||
|
<p class="text-sm text-gray-700 dark:text-gray-300">
|
||||||
|
{{ formatDate(request.created_at) }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="px-6 py-4 text-center">
|
||||||
|
<div class="flex items-center justify-center space-x-2">
|
||||||
|
<button
|
||||||
|
@click="openDetailModal(request)"
|
||||||
|
class="inline-flex items-center px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white text-xs font-medium rounded-md transition-colors"
|
||||||
|
title="Ver detalles"
|
||||||
|
>
|
||||||
|
<GoogleIcon name="visibility" class="text-base mr-1" />
|
||||||
|
Ver
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #empty>
|
||||||
|
<td colspan="6" class="table-cell text-center">
|
||||||
|
<div class="flex flex-col items-center justify-center py-12 text-gray-500">
|
||||||
|
<GoogleIcon
|
||||||
|
name="receipt"
|
||||||
|
class="text-6xl mb-3 opacity-50"
|
||||||
|
/>
|
||||||
|
<p class="font-semibold text-lg mb-1">
|
||||||
|
No hay solicitudes de facturación
|
||||||
|
</p>
|
||||||
|
<p class="text-sm text-gray-400">
|
||||||
|
Las solicitudes de facturación aparecerán aquí
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</template>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal de detalle -->
|
||||||
|
<BillingRequestDetailModal
|
||||||
|
v-if="showDetailModal"
|
||||||
|
:request="selectedRequest"
|
||||||
|
@close="closeDetailModal"
|
||||||
|
@refresh="refreshList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* Estilos adicionales si son necesarios */
|
||||||
|
</style>
|
||||||
319
src/pages/POS/Factura/Index.vue
Normal file
319
src/pages/POS/Factura/Index.vue
Normal file
@ -0,0 +1,319 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { apiURL } from '@Services/Api';
|
||||||
|
|
||||||
|
import GoogleIcon from '@Shared/GoogleIcon.vue';
|
||||||
|
import Loader from '@Shared/Loader.vue';
|
||||||
|
import Input from '@Holos/Form/Input.vue';
|
||||||
|
import PrimaryButton from '@Holos/Button/Primary.vue';
|
||||||
|
|
||||||
|
/** Definidores */
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
/** Estado */
|
||||||
|
const loading = ref(true);
|
||||||
|
const submitting = ref(false);
|
||||||
|
const submitted = ref(false);
|
||||||
|
const error = ref(null);
|
||||||
|
const saleData = ref(null);
|
||||||
|
const formErrors = ref({});
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
name: '',
|
||||||
|
email: '',
|
||||||
|
phone: '',
|
||||||
|
address: '',
|
||||||
|
rfc: '',
|
||||||
|
razon_social: '',
|
||||||
|
regimen_fiscal: '',
|
||||||
|
cp_fiscal: '',
|
||||||
|
uso_cfdi: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
/** Computed */
|
||||||
|
const invoiceNumber = computed(() => route.params.invoiceNumber);
|
||||||
|
|
||||||
|
/** Métodos */
|
||||||
|
const fetchSaleData = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
error.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(apiURL(`facturacion/${invoiceNumber.value}`), {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
if (response.status === 404) {
|
||||||
|
error.value = 'No se encontró la venta con el folio proporcionado.';
|
||||||
|
} else if (response.status === 400) {
|
||||||
|
const data = await response.json();
|
||||||
|
error.value = data.message || 'Esta venta ya fue facturada.';
|
||||||
|
} else {
|
||||||
|
error.value = 'Error al obtener los datos de la venta.';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
saleData.value = data.sale;
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error:', err);
|
||||||
|
error.value = 'Error de conexión. Por favor intente más tarde.';
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitForm = async () => {
|
||||||
|
submitting.value = true;
|
||||||
|
formErrors.value = {};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(apiURL(`facturacion/${invoiceNumber.value}`), {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Accept': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(form.value)
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
if (data.errors) {
|
||||||
|
formErrors.value = data.errors;
|
||||||
|
} else {
|
||||||
|
error.value = data.message || 'Error al enviar los datos.';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitted.value = true;
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error:', err);
|
||||||
|
error.value = 'Error de conexión. Por favor intente más tarde.';
|
||||||
|
} finally {
|
||||||
|
submitting.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatCurrency = (value) => {
|
||||||
|
return new Intl.NumberFormat('es-MX', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'MXN'
|
||||||
|
}).format(value || 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Ciclos */
|
||||||
|
onMounted(() => {
|
||||||
|
fetchSaleData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="min-h-screen bg-gray-100 dark:bg-gray-900 py-8 px-4">
|
||||||
|
<div class="max-w-2xl mx-auto">
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="text-center mb-8">
|
||||||
|
<div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary dark:bg-primary-d mb-4">
|
||||||
|
<GoogleIcon name="receipt_long" class="text-3xl text-white" />
|
||||||
|
</div>
|
||||||
|
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">
|
||||||
|
Solicitud de Factura
|
||||||
|
</h1>
|
||||||
|
<p class="text-gray-600 dark:text-gray-400 mt-2">
|
||||||
|
Complete sus datos fiscales para generar su factura
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Loading -->
|
||||||
|
<div v-if="loading" class="flex justify-center py-12">
|
||||||
|
<Loader />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Error -->
|
||||||
|
<div v-else-if="error" class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-8 text-center">
|
||||||
|
<div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-red-100 dark:bg-red-900/30 mb-4">
|
||||||
|
<GoogleIcon name="error" class="text-3xl text-red-500" />
|
||||||
|
</div>
|
||||||
|
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
|
||||||
|
No se puede procesar
|
||||||
|
</h2>
|
||||||
|
<p class="text-gray-600 dark:text-gray-400">
|
||||||
|
{{ error }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Submitted Success -->
|
||||||
|
<div v-else-if="submitted" class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-8 text-center">
|
||||||
|
<div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-green-100 dark:bg-green-900/30 mb-4">
|
||||||
|
<GoogleIcon name="check_circle" class="text-3xl text-green-500" />
|
||||||
|
</div>
|
||||||
|
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">
|
||||||
|
Solicitud Enviada
|
||||||
|
</h2>
|
||||||
|
<p class="text-gray-600 dark:text-gray-400 mb-4">
|
||||||
|
Sus datos han sido recibidos correctamente. Recibirá su factura en el correo electrónico proporcionado.
|
||||||
|
</p>
|
||||||
|
<p class="text-sm text-gray-500 dark:text-gray-500">
|
||||||
|
Folio: <span class="font-mono font-semibold">{{ invoiceNumber }}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form -->
|
||||||
|
<div v-else class="space-y-6">
|
||||||
|
<!-- Sale Info Card -->
|
||||||
|
<div v-if="saleData" class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
|
||||||
|
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center gap-2">
|
||||||
|
<GoogleIcon name="shopping_cart" class="text-xl" />
|
||||||
|
Datos de la Venta
|
||||||
|
</h2>
|
||||||
|
<div class="grid grid-cols-2 gap-4 text-sm">
|
||||||
|
<div>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400">Folio:</span>
|
||||||
|
<span class="ml-2 font-semibold text-gray-900 dark:text-white">{{ saleData.invoice_number }}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400">Fecha:</span>
|
||||||
|
<span class="ml-2 font-semibold text-gray-900 dark:text-white">
|
||||||
|
{{ new Date(saleData.created_at).toLocaleDateString('es-MX') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2">
|
||||||
|
<span class="text-gray-500 dark:text-gray-400">Total:</span>
|
||||||
|
<span class="ml-2 font-bold text-lg text-green-600 dark:text-green-400">
|
||||||
|
{{ formatCurrency(saleData.total) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Billing Form -->
|
||||||
|
<form @submit.prevent="submitForm" class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
|
||||||
|
<h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center gap-2">
|
||||||
|
<GoogleIcon name="description" class="text-xl" />
|
||||||
|
Datos de Facturación
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="grid gap-4 grid-cols-1 md:grid-cols-2">
|
||||||
|
<Input
|
||||||
|
v-model="form.name"
|
||||||
|
id="name"
|
||||||
|
title="name Completo"
|
||||||
|
placeholder="Juan Pérez García"
|
||||||
|
:onError="formErrors.name"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.email"
|
||||||
|
id="email"
|
||||||
|
title="Correo Electrónico"
|
||||||
|
type="email"
|
||||||
|
placeholder="correo@ejemplo.com"
|
||||||
|
:onError="formErrors.email"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.phone"
|
||||||
|
id="phone"
|
||||||
|
title="Teléfono"
|
||||||
|
type="tel"
|
||||||
|
placeholder="55 1234 5678"
|
||||||
|
:onError="formErrors.phone"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.rfc"
|
||||||
|
id="rfc"
|
||||||
|
title="RFC"
|
||||||
|
placeholder="XAXX010101000"
|
||||||
|
maxlength="13"
|
||||||
|
:onError="formErrors.rfc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.razon_social"
|
||||||
|
id="razon_social"
|
||||||
|
title="Razón Social"
|
||||||
|
placeholder="Como aparece en la Constancia Fiscal"
|
||||||
|
:onError="formErrors.razon_social"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.regimen_fiscal"
|
||||||
|
id="regimen_fiscal"
|
||||||
|
title="Régimen Fiscal"
|
||||||
|
placeholder="Ej: 601 - General de Ley"
|
||||||
|
:onError="formErrors.regimen_fiscal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.cp_fiscal"
|
||||||
|
id="cp_fiscal"
|
||||||
|
title="Código Postal Fiscal"
|
||||||
|
placeholder="06600"
|
||||||
|
maxlength="5"
|
||||||
|
:onError="formErrors.cp_fiscal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
v-model="form.uso_cfdi"
|
||||||
|
id="uso_cfdi"
|
||||||
|
title="Uso de CFDI"
|
||||||
|
placeholder="Ej: G03 - Gastos en general"
|
||||||
|
:onError="formErrors.uso_cfdi"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="md:col-span-2">
|
||||||
|
<Input
|
||||||
|
v-model="form.address"
|
||||||
|
id="address"
|
||||||
|
title="Dirección"
|
||||||
|
placeholder="Calle, Número, Colonia, Ciudad, Estado"
|
||||||
|
:onError="formErrors.address"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Submit Button -->
|
||||||
|
<div class="mt-6 flex justify-center">
|
||||||
|
<PrimaryButton
|
||||||
|
:class="{ 'opacity-25': submitting }"
|
||||||
|
:disabled="submitting"
|
||||||
|
>
|
||||||
|
<template v-if="submitting">
|
||||||
|
<svg class="animate-spin h-5 w-5 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||||
|
</svg>
|
||||||
|
Enviando...
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<GoogleIcon name="send" class="mr-2" />
|
||||||
|
Solicitar Factura
|
||||||
|
</template>
|
||||||
|
</PrimaryButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Info Note -->
|
||||||
|
<p class="mt-4 text-xs text-gray-500 dark:text-gray-400 text-center">
|
||||||
|
Al enviar este formulario, acepta que sus datos serán utilizados únicamente para la emisión de su factura fiscal.
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<div class="mt-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
<p>¿Tiene dudas? Contáctenos</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
16
src/pages/POS/Factura/Module.js
Normal file
16
src/pages/POS/Factura/Module.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { hasPermission } from '@Plugins/RolePermission.js';
|
||||||
|
|
||||||
|
// Ruta API
|
||||||
|
const apiTo = (name, params = {}) => route(`factura.${name}`, params)
|
||||||
|
|
||||||
|
// Ruta visual
|
||||||
|
const viewTo = ({ name = '', params = {}, query = {} }) => ({ name: `pos.factura.${name}`, params, query })
|
||||||
|
|
||||||
|
// Determina si un usuario puede hacer algo en base a los permisos
|
||||||
|
const can = (permission) => hasPermission(`factura.${permission}`)
|
||||||
|
|
||||||
|
export {
|
||||||
|
can,
|
||||||
|
viewTo,
|
||||||
|
apiTo
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useSearcher, apiURL } from '@Services/Api';
|
import { useSearcher, apiURL } from '@Services/Api';
|
||||||
import { formatCurrency } from '@/utils/formatters';
|
import { formatCurrency } from '@/utils/formatters';
|
||||||
|
import { can } from './Module.js';
|
||||||
|
|
||||||
import SearcherHead from '@Holos/Searcher.vue';
|
import SearcherHead from '@Holos/Searcher.vue';
|
||||||
import Table from '@Holos/Table.vue';
|
import Table from '@Holos/Table.vue';
|
||||||
@ -112,6 +113,7 @@ onMounted(() => {
|
|||||||
@search="(x) => searcher.search(x)"
|
@search="(x) => searcher.search(x)"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
|
v-if="can('import')"
|
||||||
class="flex items-center gap-2 px-3 py-2 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-lg transition-colors shadow-sm"
|
class="flex items-center gap-2 px-3 py-2 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-lg transition-colors shadow-sm"
|
||||||
@click="openImportModal"
|
@click="openImportModal"
|
||||||
title="Importar productos desde Excel"
|
title="Importar productos desde Excel"
|
||||||
@ -120,6 +122,7 @@ onMounted(() => {
|
|||||||
Importar
|
Importar
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
v-if="can('create')"
|
||||||
class="flex items-center gap-2 px-3 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-semibold rounded-lg transition-colors shadow-sm"
|
class="flex items-center gap-2 px-3 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-semibold rounded-lg transition-colors shadow-sm"
|
||||||
@click="openCreateModal"
|
@click="openCreateModal"
|
||||||
>
|
>
|
||||||
@ -128,36 +131,6 @@ onMounted(() => {
|
|||||||
</button>
|
</button>
|
||||||
</SearcherHead>
|
</SearcherHead>
|
||||||
|
|
||||||
<!-- Modal de Crear Producto -->
|
|
||||||
<CreateModal
|
|
||||||
:show="showCreateModal"
|
|
||||||
@close="closeCreateModal"
|
|
||||||
@created="onProductSaved"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- Modal de Editar Producto -->
|
|
||||||
<EditModal
|
|
||||||
:show="showEditModal"
|
|
||||||
:product="editingProduct"
|
|
||||||
@close="closeEditModal"
|
|
||||||
@updated="onProductSaved"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- Modal de Eliminar Producto -->
|
|
||||||
<DeleteModal
|
|
||||||
:show="showDeleteModal"
|
|
||||||
:product="deletingProduct"
|
|
||||||
@close="closeDeleteModal"
|
|
||||||
@confirm="confirmDelete"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- Modal de Importar Productos -->
|
|
||||||
<ImportModal
|
|
||||||
:show="showImportModal"
|
|
||||||
@close="closeImportModal"
|
|
||||||
@imported="onProductsImported"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="pt-2 w-full">
|
<div class="pt-2 w-full">
|
||||||
<Table
|
<Table
|
||||||
:items="models"
|
:items="models"
|
||||||
@ -216,6 +189,7 @@ onMounted(() => {
|
|||||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||||
<div class="flex items-center justify-center gap-2">
|
<div class="flex items-center justify-center gap-2">
|
||||||
<button
|
<button
|
||||||
|
v-if="can('edit')"
|
||||||
@click="openEditModal(model)"
|
@click="openEditModal(model)"
|
||||||
class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300 transition-colors"
|
class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300 transition-colors"
|
||||||
title="Editar producto"
|
title="Editar producto"
|
||||||
@ -223,6 +197,7 @@ onMounted(() => {
|
|||||||
<GoogleIcon name="edit" class="text-xl" />
|
<GoogleIcon name="edit" class="text-xl" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
v-if="can('destroy')"
|
||||||
@click="openDeleteModal(model)"
|
@click="openDeleteModal(model)"
|
||||||
class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300 transition-colors"
|
class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300 transition-colors"
|
||||||
title="Eliminar producto"
|
title="Eliminar producto"
|
||||||
@ -248,5 +223,39 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal de Crear Producto -->
|
||||||
|
<CreateModal
|
||||||
|
v-if="can('create')"
|
||||||
|
:show="showCreateModal"
|
||||||
|
@close="closeCreateModal"
|
||||||
|
@created="onProductSaved"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Modal de Editar Producto -->
|
||||||
|
<EditModal
|
||||||
|
v-if="can('edit')"
|
||||||
|
:show="showEditModal"
|
||||||
|
:product="editingProduct"
|
||||||
|
@close="closeEditModal"
|
||||||
|
@updated="onProductSaved"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Modal de Eliminar Producto -->
|
||||||
|
<DeleteModal
|
||||||
|
v-if="can('destroy')"
|
||||||
|
:show="showDeleteModal"
|
||||||
|
:product="deletingProduct"
|
||||||
|
@close="closeDeleteModal"
|
||||||
|
@confirm="confirmDelete"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Modal de Importar Productos -->
|
||||||
|
<ImportModal
|
||||||
|
v-if="can('import')"
|
||||||
|
:show="showImportModal"
|
||||||
|
@close="closeImportModal"
|
||||||
|
@imported="onProductsImported"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
16
src/pages/POS/Inventory/Module.js
Normal file
16
src/pages/POS/Inventory/Module.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { hasPermission } from '@Plugins/RolePermission.js';
|
||||||
|
|
||||||
|
// Ruta API
|
||||||
|
const apiTo = (name, params = {}) => route(`inventario.${name}`, params)
|
||||||
|
|
||||||
|
// Ruta visual
|
||||||
|
const viewTo = ({ name = '', params = {}, query = {} }) => ({ name: `pos.inventory.${name}`, params, query })
|
||||||
|
|
||||||
|
// Determina si un usuario puede hacer algo en base a los permisos
|
||||||
|
const can = (permission) => hasPermission(`inventario.${permission}`)
|
||||||
|
|
||||||
|
export {
|
||||||
|
can,
|
||||||
|
viewTo,
|
||||||
|
apiTo
|
||||||
|
}
|
||||||
@ -142,7 +142,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
<span class="text-sm font-mono font-semibold text-gray-900 dark:text-gray-100">
|
<span class="text-sm font-mono font-semibold text-gray-900 dark:text-gray-100">
|
||||||
#{{ String(model.id).padStart(6, '0') }}
|
#{{ model.invoice_number }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
|||||||
@ -39,6 +39,7 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: 'inventory',
|
path: 'inventory',
|
||||||
name: 'pos.inventory.index',
|
name: 'pos.inventory.index',
|
||||||
|
beforeEnter: (to, from, next) => can(next, 'inventario.index'),
|
||||||
component: () => import('@Pages/POS/Inventory/Index.vue')
|
component: () => import('@Pages/POS/Inventory/Index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -75,6 +76,11 @@ const router = createRouter({
|
|||||||
path: 'clients',
|
path: 'clients',
|
||||||
name: 'pos.clients.index',
|
name: 'pos.clients.index',
|
||||||
component: () => import('@Pages/POS/Clients/Index.vue')
|
component: () => import('@Pages/POS/Clients/Index.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'billing-requests',
|
||||||
|
name: 'pos.billingRequests.index',
|
||||||
|
component: () => import('@Pages/POS/Clients/BillingRequests.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -185,6 +191,11 @@ const router = createRouter({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/facturacion/:invoiceNumber',
|
||||||
|
name: 'facturacion.index',
|
||||||
|
component: () => import('@Pages/POS/Factura/Index.vue')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/auth',
|
path: '/auth',
|
||||||
component: () => import('@Holos/Layout/Auth.vue'),
|
component: () => import('@Holos/Layout/Auth.vue'),
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import jsPDF from 'jspdf';
|
import jsPDF from 'jspdf';
|
||||||
|
import QRCode from 'qrcode';
|
||||||
import { formatMoney, PAYMENT_METHODS } from '@/utils/formatters';
|
import { formatMoney, PAYMENT_METHODS } from '@/utils/formatters';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +87,7 @@ const ticketService = {
|
|||||||
doc.setTextColor(...darkGrayColor);
|
doc.setTextColor(...darkGrayColor);
|
||||||
|
|
||||||
// Folio
|
// Folio
|
||||||
const folio = saleData.invoice_number || `INV-${String(saleData.id || '').padStart(12, '0')}`;
|
const folio = saleData.invoice_number || `INV-${String(saleData.id || '').padStart(7, '0')}`;
|
||||||
doc.text(`Folio: ${folio}`, leftMargin, yPosition);
|
doc.text(`Folio: ${folio}`, leftMargin, yPosition);
|
||||||
yPosition += 4;
|
yPosition += 4;
|
||||||
|
|
||||||
@ -274,6 +275,53 @@ const ticketService = {
|
|||||||
doc.text(`Impreso: ${currentDate}`, centerX, yPosition, { align: 'center' });
|
doc.text(`Impreso: ${currentDate}`, centerX, yPosition, { align: 'center' });
|
||||||
yPosition += 3;
|
yPosition += 3;
|
||||||
doc.text(`ID de venta: ${saleData.id || 'N/A'}`, centerX, yPosition, { align: 'center' });
|
doc.text(`ID de venta: ${saleData.id || 'N/A'}`, centerX, yPosition, { align: 'center' });
|
||||||
|
yPosition += 8;
|
||||||
|
|
||||||
|
// ===== QR =====
|
||||||
|
const invoiceNumber = saleData.invoice_number || saleData.id;
|
||||||
|
const facturacionUrl = `${window.location.origin}/#/facturacion/${invoiceNumber}`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Generar QR como data URL
|
||||||
|
const qrDataUrl = await QRCode.toDataURL(facturacionUrl, {
|
||||||
|
width: 150,
|
||||||
|
margin: 1,
|
||||||
|
color: {
|
||||||
|
dark: '#000000',
|
||||||
|
light: '#ffffff'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Línea separadora antes del QR
|
||||||
|
doc.setDrawColor(...darkGrayColor);
|
||||||
|
doc.setLineWidth(0.2);
|
||||||
|
doc.line(leftMargin, yPosition, rightMargin, yPosition);
|
||||||
|
yPosition += 5;
|
||||||
|
|
||||||
|
// Texto invitación a facturar
|
||||||
|
doc.setFontSize(8);
|
||||||
|
doc.setFont('helvetica', 'bold');
|
||||||
|
doc.setTextColor(...blackColor);
|
||||||
|
doc.text('¿Necesitas factura?', centerX, yPosition, { align: 'center' });
|
||||||
|
yPosition += 4;
|
||||||
|
|
||||||
|
doc.setFontSize(7);
|
||||||
|
doc.setFont('helvetica', 'normal');
|
||||||
|
doc.setTextColor(...darkGrayColor);
|
||||||
|
doc.text('Escanea el código QR para', centerX, yPosition, { align: 'center' });
|
||||||
|
yPosition += 3;
|
||||||
|
doc.text('enviar tus datos de facturación', centerX, yPosition, { align: 'center' });
|
||||||
|
yPosition += 5;
|
||||||
|
|
||||||
|
// Agregar imagen QR centrada
|
||||||
|
const qrSize = 25;
|
||||||
|
const qrX = centerX - (qrSize / 2);
|
||||||
|
doc.addImage(qrDataUrl, 'PNG', qrX, yPosition, qrSize, qrSize);
|
||||||
|
yPosition += qrSize + 3;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error generando QR:', error);
|
||||||
|
}
|
||||||
|
|
||||||
// Guardar o retornar el PDF
|
// Guardar o retornar el PDF
|
||||||
if (autoDownload) {
|
if (autoDownload) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user