Commit f4e3fe7269f6a0cfa4d24f71dd9b04d4ee7eee4a
Exists in
master
Merge branch 'master' into 'develop'
Master See merge request !64
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -297,28 +297,10 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
297 | 297 | .guardarCobranza(cobranza) |
298 | 298 | .then( |
299 | 299 | function(result) { |
300 | - var cliente = angular.copy($scope.cobranza.cliente); | |
301 | 300 | focaBotoneraLateralService.endGuardar(true); |
302 | 301 | $scope.saveLoading = false; |
303 | 302 | |
304 | - focaModalService | |
305 | - .prompt({ | |
306 | - titulo: 'Ingrese los emails separados por' + | |
307 | - ' coma para enviar comprobante', | |
308 | - value: cliente.MAIL, | |
309 | - email: true | |
310 | - }) | |
311 | - .then(function(res) { | |
312 | - return Promise.all([ | |
313 | - focaCrearCobranzaService | |
314 | - .enviarComprobantePorMail(res, cobranzaMail), | |
315 | - focaCrearCobranzaService | |
316 | - .actualizarEmail(res, cliente.COD) | |
317 | - ]); | |
318 | - }) | |
319 | - .then(function() { | |
320 | - focaModalService.alert('Mensaje enviado correctamente'); | |
321 | - }); | |
303 | + enviarMail(cobranzaMail); | |
322 | 304 | |
323 | 305 | focaSeguimientoService.guardarPosicion( |
324 | 306 | 'Cobranza', |
... | ... | @@ -368,7 +350,7 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
368 | 350 | templateUrl: 'modal-resumen-cuenta.html', |
369 | 351 | controller: 'focaModalResumenCuentaController', |
370 | 352 | resolve: { |
371 | - idCliente: function() { return $scope.cobranza.cliente.COD; } | |
353 | + cliente: function() { return $scope.cobranza.cliente; } | |
372 | 354 | }, |
373 | 355 | size: 'lg' |
374 | 356 | } |
... | ... | @@ -400,7 +382,8 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
400 | 382 | var clienteMayus = { |
401 | 383 | COD: cliente.cod, |
402 | 384 | NOM: cliente.nom, |
403 | - CUIT: cliente.cuit | |
385 | + CUIT: cliente.cuit, | |
386 | + MAIL: cliente.mail | |
404 | 387 | }; |
405 | 388 | |
406 | 389 | $scope.$broadcast('addCabecera', { |
... | ... | @@ -780,5 +763,24 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
780 | 763 | delete $localStorage.cobranza; |
781 | 764 | } |
782 | 765 | } |
766 | + | |
767 | + function enviarMail(recibo) { | |
768 | + focaModalService.mail( | |
769 | + { | |
770 | + titulo: 'Enviar recibo', | |
771 | + descarga: { | |
772 | + nombre: recibo.recibo.PVE + '-' + recibo.recibo.NCO + '.pdf', | |
773 | + url: '/mail/recibo/descargar', | |
774 | + }, | |
775 | + envio: { | |
776 | + mailCliente: recibo.cliente.MAIL, | |
777 | + url: '/mail/recibo', | |
778 | + }, | |
779 | + options: { | |
780 | + recibo: recibo | |
781 | + } | |
782 | + } | |
783 | + ); | |
784 | + } | |
783 | 785 | } |
784 | 786 | ]); |
src/js/service.js
... | ... | @@ -14,10 +14,6 @@ angular.module('focaCrearCobranza') |
14 | 14 | getCobradorById: function(id) { |
15 | 15 | return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + id); |
16 | 16 | }, |
17 | - enviarComprobantePorMail: function(mail, data) { | |
18 | - return $http.post(API_ENDPOINT.URL + '/mail/comprobante', | |
19 | - {receiver: mail, comprobante: data}); | |
20 | - }, | |
21 | 17 | actualizarEmail: function(mail, idCliente) { |
22 | 18 | return $http.post(API_ENDPOINT.URL + '/cliente/update/email', |
23 | 19 | {mail: mail, id: idCliente}); |