Commit 322dd4bd0253a8fcdd4e0f361ba142ce740fbcce
1 parent
1ec4e9a4af
Exists in
master
img
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/js/service.js
| 1 | angular.module('focaCrearRemito') | 1 | angular.module('focaCrearRemito') |
| 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', | 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', |
| 3 | function($http, API_ENDPOINT) { | 3 | function($http, API_ENDPOINT) { |
| 4 | var route = API_ENDPOINT.URL; | 4 | var route = API_ENDPOINT.URL; |
| 5 | return { | 5 | return { |
| 6 | crearRemito: function(remito) { | 6 | crearRemito: function(remito) { |
| 7 | // TODO: Cambiar para usar el servicio /remito | 7 | // TODO: Cambiar para usar el servicio /remito |
| 8 | return $http.post(route + '/remito', remito); | 8 | return $http.post(route + '/remito', remito); |
| 9 | }, | 9 | }, |
| 10 | getRemitoById: function(id) { | 10 | getRemitoById: function(id) { |
| 11 | return $http.get(route + '/remito/obtener/' + id); | 11 | return $http.get(route + '/remito/obtener/' + id); |
| 12 | }, | 12 | }, |
| 13 | obtenerRemito: function() { | 13 | obtenerRemito: function() { |
| 14 | return $http.get(route +'/nota-pedido'); | 14 | return $http.get(route +'/nota-pedido'); |
| 15 | }, | 15 | }, |
| 16 | setRemito: function(remito) { | 16 | setRemito: function(remito) { |
| 17 | this.remito = remito; | 17 | this.remito = remito; |
| 18 | }, | 18 | }, |
| 19 | clearRemito: function() { | 19 | clearRemito: function() { |
| 20 | this.remito = undefined; | 20 | this.remito = undefined; |
| 21 | }, | 21 | }, |
| 22 | getRemito: function() { | 22 | getRemito: function() { |
| 23 | return this.remito; | 23 | return this.remito; |
| 24 | }, | 24 | }, |
| 25 | getArticulosByIdRemito: function(id) { | 25 | getArticulosByIdRemito: function(id) { |
| 26 | return $http.get(route+'/articulos/nota-pedido/'+id); | 26 | return $http.get(route+'/articulos/nota-pedido/'+id); |
| 27 | }, | 27 | }, |
| 28 | crearArticulosParaRemito: function(articuloRemito) { | 28 | crearArticulosParaRemito: function(articuloRemito) { |
| 29 | return $http.post(route + '/articulos/remito', | 29 | return $http.post(route + '/articulos/remito', |
| 30 | {articuloRemito: articuloRemito}); | 30 | {articuloRemito: articuloRemito}); |
| 31 | }, | 31 | }, |
| 32 | getDomiciliosByIdRemito: function(id) { | 32 | getDomiciliosByIdRemito: function(id) { |
| 33 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 33 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
| 34 | }, | 34 | }, |
| 35 | getDomiciliosByIdCliente: function(id) { | 35 | getDomiciliosByIdCliente: function(id) { |
| 36 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) | 36 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) |
| 37 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); | 37 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); |
| 38 | }, | 38 | }, |
| 39 | getPrecioCondicion: function() { | 39 | getPrecioCondicion: function() { |
| 40 | return $http.get(route + '/precio-condicion'); | 40 | return $http.get(route + '/precio-condicion'); |
| 41 | }, | 41 | }, |
| 42 | getPrecioCondicionById: function(id) { | 42 | getPrecioCondicionById: function(id) { |
| 43 | return $http.get(route + '/precio-condicion/' + id); | 43 | return $http.get(route + '/precio-condicion/' + id); |
| 44 | }, | 44 | }, |
| 45 | getPlazoPagoByPrecioCondicion: function(id) { | 45 | getPlazoPagoByPrecioCondicion: function(id) { |
| 46 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 46 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
| 47 | }, | 47 | }, |
| 48 | crearFlete: function(flete) { | 48 | crearFlete: function(flete) { |
| 49 | return $http.post(route + '/flete', {flete : flete}); | 49 | return $http.post(route + '/flete', {flete : flete}); |
| 50 | }, | 50 | }, |
| 51 | crearPlazosParaRemito: function(plazos) { | 51 | crearPlazosParaRemito: function(plazos) { |
| 52 | return $http.post(route + '/plazo-pago/remito', plazos); | 52 | return $http.post(route + '/plazo-pago/remito', plazos); |
| 53 | }, | 53 | }, |
| 54 | getCotizacionByIdMoneda: function(id) { | 54 | getCotizacionByIdMoneda: function(id) { |
| 55 | return $http.get(route + '/moneda/' + id); | 55 | return $http.get(route + '/moneda/' + id); |
| 56 | }, | 56 | }, |
| 57 | crearEstadoParaRemito: function(estado) { | 57 | crearEstadoParaRemito: function(estado) { |
| 58 | return $http.post(route + '/estado', {estado: estado}); | 58 | return $http.post(route + '/estado', {estado: estado}); |
| 59 | }, | 59 | }, |
| 60 | getNumeroRemito: function() { | 60 | getNumeroRemito: function() { |
| 61 | return $http.get(route + '/remito/numero-siguiente'); | 61 | return $http.get(route + '/remito/numero-siguiente'); |
| 62 | }, | 62 | }, |
| 63 | imprimirRemitoByIdRemito: function(idRemito, original) { | 63 | imprimirRemitoByIdRemito: function(idRemito, original) { |
| 64 | var tipo = original ? '/original' : ''; | 64 | var tipo = original ? '/original' : ''; |
| 65 | return $http.get(route + '/remito/comprobante/' + idRemito + tipo, { | 65 | return $http.get(route + '/remito/comprobante/' + idRemito + tipo, { |
| 66 | responseType: 'arraybuffer' | 66 | responseType: 'arraybuffer' |
| 67 | }); | 67 | }); |
| 68 | }, | 68 | }, |
| 69 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { | 69 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { |
| 70 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + | 70 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + |
| 71 | idDomicilio + '/' + idCliente); | 71 | idDomicilio + '/' + idCliente); |
| 72 | }, | 72 | }, |
| 73 | enviarCorreo: function(options) { | 73 | enviarCorreo: function(options) { |
| 74 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); | 74 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); |
| 75 | }, | 75 | }, |
| 76 | getBotonera: function() { | 76 | getBotonera: function() { |
| 77 | return [ | 77 | return [ |
| 78 | { | 78 | { |
| 79 | label: 'Nota pedido', | 79 | label: 'Nota pedido', |
| 80 | image: 'notaDePedido.png' | 80 | image: 'notaDePedido.png' |
| 81 | }, | 81 | }, |
| 82 | { | 82 | { |
| 83 | label: 'Cliente', | 83 | label: 'Cliente', |
| 84 | image: 'cliente.png' | 84 | image: 'cliente.png' |
| 85 | }, | 85 | }, |
| 86 | { | 86 | { |
| 87 | label: 'Transportista', | 87 | label: 'Transportista', |
| 88 | image: 'proveedor.png' | 88 | image: 'proveedor.png' |
| 89 | }, | 89 | }, |
| 90 | { | 90 | { |
| 91 | label: 'Moneda', | 91 | label: 'Moneda', |
| 92 | image: 'moneda.png' | 92 | image: 'moneda.png' |
| 93 | }, | 93 | }, |
| 94 | { | 94 | { |
| 95 | label: 'Precios y condiciones', | 95 | label: 'Precios y condiciones', |
| 96 | image: 'precios-condiciones.png' | 96 | image: 'precios-condiciones.png' |
| 97 | }, | 97 | }, |
| 98 | { | 98 | { |
| 99 | label: 'Productos', | 99 | label: 'Productos', |
| 100 | image: 'productos.png' | 100 | image: 'productos.png' |
| 101 | }, | 101 | }, |
| 102 | { | 102 | { |
| 103 | label: 'Observaciones', | 103 | label: 'Observaciones', |
| 104 | image: 'productos.png', | 104 | image: 'botonObservaciones.png', |
| 105 | disable: true | 105 | disable: true |
| 106 | } | 106 | } |
| 107 | ]; | 107 | ]; |
| 108 | } | 108 | } |
| 109 | }; | 109 | }; |
| 110 | }]); | 110 | }]); |
| 111 | 111 |