Commit dda069c73f8c5927ac81e2fb84106178287bc90b
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request !12
Showing
2 changed files
Show diff stats
data/index.js
... | ... | @@ -25,6 +25,9 @@ module.exports = function(config) { |
25 | 25 | |
26 | 26 | guardarComprobante: function (body) { |
27 | 27 | |
28 | + console.log('recibo datos guardarComprobante en estación'); | |
29 | + console.log(body); | |
30 | + | |
28 | 31 | return new Promise((resolve, reject) => { |
29 | 32 | |
30 | 33 | delete body.cabecera.idTransaccion; |
... | ... | @@ -105,9 +108,9 @@ module.exports = function(config) { |
105 | 108 | ID_MOTIVO_NANB: 0 |
106 | 109 | })); |
107 | 110 | }; |
108 | - | |
111 | + | |
109 | 112 | cuerpo.estado == 'rechazado' ? cuerpo.cantidadRecibida = 0 : false; |
110 | - | |
113 | + | |
111 | 114 | delete cuerpo.GLN; |
112 | 115 | delete cuerpo.C_HD2; |
113 | 116 | delete cuerpo.E_HD2; |
index.js
... | ... | @@ -13,7 +13,7 @@ client.on('open', function open() { |
13 | 13 | client.on('message', function incoming(message) { |
14 | 14 | |
15 | 15 | message = JSON.parse(message.toString('utf8')); |
16 | - console.log(message); | |
16 | + | |
17 | 17 | switch (message.action) { |
18 | 18 | case 'getEntity': |
19 | 19 | |
... | ... | @@ -28,8 +28,8 @@ client.on('open', function open() { |
28 | 28 | data.guardarComprobante(message.req).then(() => { |
29 | 29 | console.log('se guardó'); |
30 | 30 | client.send(JSON.stringify('ok')); |
31 | - }).catch(() => { | |
32 | - console.log('no se guardó'); | |
31 | + }).catch((ee) => { | |
32 | + console.log('no se guardó' + ee); | |
33 | 33 | client.send(JSON.stringify('bad')); |
34 | 34 | }); |
35 | 35 |