Commit 2603525db8f44a362b2f10b4ccc37a55fa00d536
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
nuevas imgs botonera See merge request !14
Showing
1 changed file
 
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 [ | 60 | return [ | 
| 61 | { | 61 | { | 
| 62 | label: 'Nota pedido', | 62 | label: 'Nota pedido', | 
| 63 | image: 'precios-condiciones.png' | 63 | image: 'notaDePedido.png' | 
| 64 | }, | 64 | }, | 
| 65 | { | 65 | { | 
| 66 | label: 'Vendedor', | 66 | label: 'Vendedor', | 
| 67 | image: 'vendedor.png' | 67 | image: 'vendedor.png' | 
| 68 | }, | 68 | }, | 
| 69 | { | 69 | { | 
| 70 | label: 'Cliente', | 70 | label: 'Cliente', | 
| 71 | image: 'cliente.png' | 71 | image: 'cliente.png' | 
| 72 | }, | 72 | }, | 
| 73 | { | 73 | { | 
| 74 | label: 'Proveedor', | 74 | label: 'Proveedor', | 
| 75 | image: 'proveedor.png' | 75 | image: 'proveedor.png' | 
| 76 | }, | 76 | }, | 
| 77 | { | 77 | { | 
| 78 | label: 'Moneda', | 78 | label: 'Moneda', | 
| 79 | image: 'moneda.png' | 79 | image: 'moneda.png' | 
| 80 | }, | 80 | }, | 
| 81 | { | 81 | { | 
| 82 | label: 'Precios y condiciones', | 82 | label: 'Precios y condiciones', | 
| 83 | image: 'precios-condiciones.png' | 83 | image: 'precios-condiciones.png' | 
| 84 | }, | 84 | }, | 
| 85 | { | 85 | { | 
| 86 | label: 'Flete', | 86 | label: 'Flete', | 
| 87 | image: 'flete.png' | 87 | image: 'flete.png' | 
| 88 | }, | 88 | }, | 
| 89 | { | 89 | { | 
| 90 | label: 'Productos', | 90 | label: 'Productos', | 
| 91 | image: 'productos.png' | 91 | image: 'productos.png' | 
| 92 | } | 92 | } | 
| 93 | ]; | 93 | ]; | 
| 94 | } | 94 | } | 
| 95 | }; | 95 | }; | 
| 96 | }]); | 96 | }]); | 
| 97 | 97 |