Commit 190383cd6c7e2c03ff0ac7d1ab2cfad210684150
1 parent
a464e39d20
Exists in
master
nameFile
Showing
3 changed files
with
7 additions
and
7 deletions
Show diff stats
debo/validacion.js
1 | -module.exports = function (fileString) { | |
1 | +module.exports = function (nameFile) { | |
2 | 2 | |
3 | 3 | return new Promise(function (resolve, reject) { |
4 | 4 | |
5 | - var nameFileDest = fileString.split('\\')[fileString.split('\').length - 1]; | |
5 | + var nameFileDest = nameFile.split('\\')[nameFile.split('\').length - 1]; | |
6 | 6 | |
7 | 7 | knex('planex_transacciones') |
8 | 8 | .where({ archivoRecibido: nameFileDest }) |
index.js
... | ... | @@ -30,7 +30,7 @@ function onGetFile(fileString, nameFile) { |
30 | 30 | |
31 | 31 | if (!fileString) return; |
32 | 32 | |
33 | - require('./debo/validacion')(fileString).then(function() { | |
33 | + require('./debo/validacion')(nameFile).then(function() { | |
34 | 34 | |
35 | 35 | var planex = require('./planex/index')(fileString); |
36 | 36 |
rutas/comprobantes.js
... | ... | @@ -53,10 +53,10 @@ router.post('/comprobante', function(req, res) { |
53 | 53 | delete req.body.cabecera.C_HD2; |
54 | 54 | delete req.body.cabecera.E_HD2; |
55 | 55 | |
56 | - //smalldatetime TODO: USAR MOMENT JS | |
57 | - req.body.cabecera.FEC = new Date(req.body.cabecera.FEC).toISOString().slice(0, 19).replace('T', ' '); | |
58 | - req.body.cabecera.FECCAI = new Date(req.body.cabecera.FECCAI).toISOString().slice(0, 19).replace('T', ' '); | |
59 | - req.body.cabecera.FECVEN = new Date(req.body.cabecera.FECVEN).toISOString().slice(0, 19).replace('T', ' '); | |
56 | + //smalldatetime | |
57 | + req.body.cabecera.FEC = moment(req.body.cabecera.FEC).format('YYYY-MM-DD HH:mm:ss'); | |
58 | + req.body.cabecera.FECCAI = moment(req.body.cabecera.FECCAI).format('YYYY-MM-DD HH:mm:ss'); | |
59 | + req.body.cabecera.FECVEN = moment(req.body.cabecera.FECVEN).format('YYYY-MM-DD HH:mm:ss'); | |
60 | 60 | |
61 | 61 | //datetime |
62 | 62 | req.body.cabecera.FEV = moment(req.body.cabecera.FEV).format('YYYYMMDD'); |