Commit b36cbe778b4d997612fb830487cacc69c904fb3f
1 parent
14139f376a
Exists in
master
fix cantidad recibida, gln de sucursal
Showing
4 changed files
with
7 additions
and
8 deletions
Show diff stats
db/index.js
... | ... | @@ -27,7 +27,7 @@ module.exports = function(comprobante, nameFile) { |
27 | 27 | fs.rename(nameFile, pathDest, function(err) { |
28 | 28 | |
29 | 29 | if(err) console.log(err); |
30 | - console.log('COMPROBANTE GUARDADO CON ÉXITO'); | |
30 | + console.log('COMPROBANTE PROCESADO Y GUARDADO EN PMAEFACT_TEMP CON ÉXITO'); | |
31 | 31 | }); |
32 | 32 | }).catch(function(e) { |
33 | 33 | console.log(e); |
debo/relaciones.js
... | ... | @@ -8,8 +8,8 @@ module.exports = function(planex, wsServer) { |
8 | 8 | var digitoVerificador = planex.identificaxEmisor.cuit[planex.identificaxEmisor.cuit.length - 1]; |
9 | 9 | var cuitToDebo = tipoCuit + '-' + planex.identificaxEmisor.cuit.slice(2, 10) + '-' + digitoVerificador; |
10 | 10 | |
11 | - var promiseProveedores = wsServer.getEntidad(planex.identificaxReceptorFactura.glnReceptor, 'PROVEED', {CUIT: cuitToDebo}); | |
12 | - var promiseEmp = wsServer.getEntidad(planex.identificaxReceptorFactura.glnReceptor, 'APAREMP'); | |
11 | + var promiseProveedores = wsServer.getEntidad(planex.identificaxSucursalReceptorFactura.glnSucursal, 'PROVEED', {CUIT: cuitToDebo}); | |
12 | + var promiseEmp = wsServer.getEntidad(planex.identificaxSucursalReceptorFactura.glnSucursal, 'APAREMP'); | |
13 | 13 | |
14 | 14 | planex.itemsFactura.forEach(item => { |
15 | 15 | |
... | ... | @@ -18,7 +18,7 @@ module.exports = function(planex, wsServer) { |
18 | 18 | item.codigoUPCEAN13 + '\''; |
19 | 19 | |
20 | 20 | promesasArticulo.push( |
21 | - wsServer.getEntidad(planex.identificaxReceptorFactura.glnReceptor, null, {}, queryString) | |
21 | + wsServer.getEntidad(planex.identificaxSucursalReceptorFactura.glnSucursal, null, {}, queryString) | |
22 | 22 | ); |
23 | 23 | }); |
24 | 24 | |
... | ... | @@ -48,9 +48,7 @@ module.exports = function(planex, wsServer) { |
48 | 48 | |
49 | 49 | resolve({planex, values}); |
50 | 50 | |
51 | - }).catch(function(e) { | |
52 | - reject(e); | |
53 | - }); | |
51 | + }).catch(reject); | |
54 | 52 | |
55 | 53 | }); |
56 | 54 | } |
index.js
rutas/comprobantes.js
... | ... | @@ -125,7 +125,7 @@ router.post('/comprobante', function(req, res) { |
125 | 125 | })); |
126 | 126 | }; |
127 | 127 | |
128 | - cuerpo.estado == 'rechazado' ? cuerpo.CAN = 0 : false; | |
128 | + cuerpo.estado == 'rechazado' ? cuerpo.cantidadRecibida = 0 : false; | |
129 | 129 | |
130 | 130 | delete cuerpo.GLN; |
131 | 131 | delete cuerpo.C_HD2; |