TIPS-SA / facturacionelectronicapy-xmlgen

Módulo NodeJS que genera el archivo XML para enviar a la SET
MIT License
52 stars 33 forks source link

TypeError: xmlgen.generateXMLDE is not a function #1

Closed jrgonzalez3 closed 2 years ago

jrgonzalez3 commented 2 years ago

TypeError: xmlgen.generateXMLDE is not a function at C:\xampp\htdocs\fe\src\routes\index.js:46:10 at Layer.handle [as handle_request] (C:\xampp\htdocs\fe\node_modules\express\lib\router\layer.js:95:5) at next (C:\xampp\htdocs\fe\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\xampp\htdocs\fe\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\xampp\htdocs\fe\node_modules\express\lib\router\layer.js:95:5) at C:\xampp\htdocs\fe\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\xampp\htdocs\fe\node_modules\express\lib\router\index.js:341:12) at next (C:\xampp\htdocs\fe\node_modules\express\lib\router\index.js:275:10) at Function.handle (C:\xampp\htdocs\fe\node_modules\express\lib\router\index.js:174:3) at router (C:\xampp\htdocs\fe\node_modules\express\lib\router\index.js:47:12)

//res.status(200).send(req.body); //esto devuelve bien, el json data recibido

const xmlgen = require('facturacionelectronicapy-xmlgen'); //esto tmb trae bien. envia a este declare class DE { generateXMLDE: (params: any, data: any, defaultValues?: boolean | undefined) => Promise; generateXMLEvento: (params: any, data: any) => Promise; consultarDepartamentos: () => Promise; consultarDistritos: (departamento: number) => Promise; consultarCiudades: (distrito: number) => Promise; consultarTiposRegimenes: () => Promise; getNombreDepartamento: (departamentoId: number) => string; getNombreDistrito: (distritoId: number) => string; getNombreCiudad: (ciudadId: number) => string; } declare const _default: DE; export default _default;

xmlgen.generateXMLDE(params, req.body).then(xml => { const jsonResult = { success: true, xml } res.status(200).send(jsonResult); }).catch(error => { console.log(error); const jsonResult = { success: false, error: error } res.status(200).send(jsonResult); })

jrgonzalez3 commented 2 years ago

https://www.awesomescreenshot.com/video/6971363?key=79c50d33a52ad811c4ebc9d7ca81f3e2

video del error