Commit d9248794c51b06cd0b17b1cbbfdd15f1bb48cfe4
1 parent
8461a54d2d
Exists in
master
and in
2 other branches
botones con imagenes
Showing
1 changed file
with
34 additions
and
2 deletions
Show diff stats
src/js/service.js
| 1 | angular.module('focaCrearRemito') | 1 | angular.module('focaCrearRemito') |
| 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
| 3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
| 4 | return { | 4 | return { |
| 5 | crearRemito: function(remito) { | 5 | crearRemito: function(remito) { |
| 6 | // TODO: Cambiar para usar el servicio /remito | 6 | // TODO: Cambiar para usar el servicio /remito |
| 7 | return $http.post(route + '/remito', remito); | 7 | return $http.post(route + '/remito', remito); |
| 8 | }, | 8 | }, |
| 9 | obtenerRemito: function() { | 9 | obtenerRemito: function() { |
| 10 | return $http.get(route +'/nota-pedido'); | 10 | return $http.get(route +'/nota-pedido'); |
| 11 | }, | 11 | }, |
| 12 | setRemito: function(remito) { | 12 | setRemito: function(remito) { |
| 13 | this.remito = remito; | 13 | this.remito = remito; |
| 14 | }, | 14 | }, |
| 15 | clearRemito: function() { | 15 | clearRemito: function() { |
| 16 | this.remito = undefined; | 16 | this.remito = undefined; |
| 17 | }, | 17 | }, |
| 18 | getRemito: function() { | 18 | getRemito: function() { |
| 19 | return this.remito; | 19 | return this.remito; |
| 20 | }, | 20 | }, |
| 21 | getArticulosByIdRemito: function(id) { | 21 | getArticulosByIdRemito: function(id) { |
| 22 | return $http.get(route+'/articulos/nota-pedido/'+id); | 22 | return $http.get(route+'/articulos/nota-pedido/'+id); |
| 23 | }, | 23 | }, |
| 24 | crearArticulosParaRemito: function(articuloRemito) { | 24 | crearArticulosParaRemito: function(articuloRemito) { |
| 25 | return $http.post(route + '/articulos/remito', | 25 | return $http.post(route + '/articulos/remito', |
| 26 | {articuloRemito: articuloRemito}); | 26 | {articuloRemito: articuloRemito}); |
| 27 | }, | 27 | }, |
| 28 | getDomiciliosByIdRemito: function(id) { | 28 | getDomiciliosByIdRemito: function(id) { |
| 29 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 29 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
| 30 | }, | 30 | }, |
| 31 | getDomiciliosByIdCliente: function(id) { | 31 | getDomiciliosByIdCliente: function(id) { |
| 32 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) | 32 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) |
| 33 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); | 33 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); |
| 34 | }, | 34 | }, |
| 35 | getPrecioCondicion: function() { | 35 | getPrecioCondicion: function() { |
| 36 | return $http.get(route + '/precio-condicion'); | 36 | return $http.get(route + '/precio-condicion'); |
| 37 | }, | 37 | }, |
| 38 | getPrecioCondicionById: function(id) { | 38 | getPrecioCondicionById: function(id) { |
| 39 | return $http.get(route + '/precio-condicion/' + id); | 39 | return $http.get(route + '/precio-condicion/' + id); |
| 40 | }, | 40 | }, |
| 41 | getPlazoPagoByPrecioCondicion: function(id) { | 41 | getPlazoPagoByPrecioCondicion: function(id) { |
| 42 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 42 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
| 43 | }, | 43 | }, |
| 44 | crearFlete: function(flete) { | 44 | crearFlete: function(flete) { |
| 45 | return $http.post(route + '/flete', {flete : flete}); | 45 | return $http.post(route + '/flete', {flete : flete}); |
| 46 | }, | 46 | }, |
| 47 | crearPlazosParaRemito: function(plazos) { | 47 | crearPlazosParaRemito: function(plazos) { |
| 48 | return $http.post(route + '/plazo-pago/remito', plazos); | 48 | return $http.post(route + '/plazo-pago/remito', plazos); |
| 49 | }, | 49 | }, |
| 50 | getCotizacionByIdMoneda: function(id) { | 50 | getCotizacionByIdMoneda: function(id) { |
| 51 | return $http.get(route + '/moneda/' + id); | 51 | return $http.get(route + '/moneda/' + id); |
| 52 | }, | 52 | }, |
| 53 | crearEstadoParaRemito: function(estado) { | 53 | crearEstadoParaRemito: function(estado) { |
| 54 | return $http.post(route + '/estado', {estado: estado}); | 54 | return $http.post(route + '/estado', {estado: estado}); |
| 55 | }, | 55 | }, |
| 56 | getNumeroRemito: function() { | 56 | getNumeroRemito: function() { |
| 57 | return $http.get(route + '/remito/numero-siguiente'); | 57 | return $http.get(route + '/remito/numero-siguiente'); |
| 58 | }, | 58 | }, |
| 59 | getBotonera: function() { | 59 | getBotonera: function() { |
| 60 | return ['Nota pedido', 'Vendedor', 'Cliente', 'Proveedor', | 60 | return [ |
| 61 | 'Moneda', 'Precios y condiciones', 'Flete', 'Productos']; | 61 | { |
| 62 | label: 'Nota pedido', | ||
| 63 | image: 'precios-condiciones.png' | ||
| 64 | }, | ||
| 65 | { | ||
| 66 | label: 'Vendedor', | ||
| 67 | image: 'vendedor.png' | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | label: 'Cliente', | ||
| 71 | image: 'cliente.png' | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | label: 'Proveedor', | ||
| 75 | image: 'proveedor.png' | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | label: 'Moneda', | ||
| 79 | image: 'moneda.png' | ||
| 80 | }, | ||
| 81 | { | ||
| 82 | label: 'Precios y condiciones', | ||
| 83 | image: 'precios-condiciones.png' | ||
| 84 | }, | ||
| 85 | { | ||
| 86 | label: 'Flete', | ||
| 87 | image: 'flete.png' | ||
| 88 | }, | ||
| 89 | { | ||
| 90 | label: 'Productos', | ||
| 91 | image: 'productos.png' | ||
| 92 | } | ||
| 93 | ]; | ||
| 62 | } | 94 | } |
| 63 | }; | 95 | }; |
| 64 | }]); | 96 | }]); |
| 65 | 97 |