Commit 18d87d47ebdcca7b96d732941d8d894a55799ca1
1 parent
c6c811247a
Exists in
master
aplico foca-modal mail
Showing
1 changed file
with
35 additions
and
25 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -39,34 +39,44 @@ angular.module('focaModalResumenCuenta') |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | 41 | $scope.enviarMail = function(factura) { |
| 42 | - focaModalService | |
| 43 | - .prompt({ | |
| 44 | - titulo: 'Ingrese los emails separados por coma para enviar comprobante', | |
| 45 | - value: factura.cliente.MAIL, | |
| 46 | - email: true | |
| 47 | - }) | |
| 48 | - .then(function(res) { | |
| 49 | - return focaModalResumenCuentaService.enviarFacturaPorMail(res, factura); | |
| 50 | - }) | |
| 51 | - .then(function() { | |
| 52 | - focaModalService.alert('Mensaje enviado correctamente'); | |
| 53 | - }); | |
| 42 | + focaModalService.mail( | |
| 43 | + { | |
| 44 | + titulo: 'Enviar comprobante', | |
| 45 | + //TODO: CONFIGURAR DESCARGA | |
| 46 | + descarga: { | |
| 47 | + nombre: factura.numeroFactura + '.pdf', | |
| 48 | + url: '/mail/comprobante/descargar', | |
| 49 | + }, | |
| 50 | + envio: { | |
| 51 | + //TODO: TOMAR EMAIL DEL CLIENTE | |
| 52 | + mailCliente: 'jpinto@focasoftware.com', | |
| 53 | + url: '/mail/comprobante' | |
| 54 | + }, | |
| 55 | + options: { | |
| 56 | + factura: factura | |
| 57 | + } | |
| 58 | + } | |
| 59 | + ); | |
| 54 | 60 | }; |
| 55 | 61 | |
| 56 | 62 | $scope.enviarResumen = function() { |
| 57 | - focaModalService | |
| 58 | - .prompt({ | |
| 59 | - titulo: 'Ingrese los emails separados por coma para enviar comprobante', | |
| 60 | - value: $scope.results.facturas[0].cliente.MAIL, | |
| 61 | - email: true | |
| 62 | - }) | |
| 63 | - .then(function(res) { | |
| 64 | - return focaModalResumenCuentaService.enviarResumenPorMail(res, | |
| 65 | - $scope.results); | |
| 66 | - }) | |
| 67 | - .then(function() { | |
| 68 | - focaModalService.alert('Mensaje enviado correctamente'); | |
| 69 | - }); | |
| 63 | + focaModalService.mail( | |
| 64 | + { | |
| 65 | + titulo: 'Enviar resumen de cuenta', | |
| 66 | + descarga: { | |
| 67 | + nombre: 'resumen-de-cuenta.pdf', | |
| 68 | + url: '/mail/resumen-cuenta/descargar', | |
| 69 | + }, | |
| 70 | + envio: { | |
| 71 | + //TODO: TOMAR EMAIL DEL CLIENTE | |
| 72 | + mailCliente: 'jpinto@focasoftware.com', | |
| 73 | + url: '/mail/resumen-cuenta', | |
| 74 | + }, | |
| 75 | + options: { | |
| 76 | + resumen: $scope.results | |
| 77 | + } | |
| 78 | + } | |
| 79 | + ); | |
| 70 | 80 | }; |
| 71 | 81 | |
| 72 | 82 | $scope.verFactura = function(factura) { |