Commit 9c10e5f964db63e4f85a831b9cab154244c5ed51

Authored by Eric Fernandez
1 parent 63836a4b97
Exists in master

nuevo boton

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
1 angular.module('focaCrearHojaRuta') 1 angular.module('focaCrearHojaRuta')
2 .service('focaCrearHojaRutaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { 2 .service('focaCrearHojaRutaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
3 var route = API_ENDPOINT.URL; 3 var route = API_ENDPOINT.URL;
4 return { 4 return {
5 crearHojaRuta: function(hojaRuta) { 5 crearHojaRuta: function(hojaRuta) {
6 return $http.post(route + '/hoja-ruta', hojaRuta); 6 return $http.post(route + '/hoja-ruta', hojaRuta);
7 }, 7 },
8 obtenerHojaRuta: function() { 8 obtenerHojaRuta: function() {
9 return $http.get(route +'/hoja-ruta'); 9 return $http.get(route +'/hoja-ruta');
10 }, 10 },
11 setHojaRuta: function(hojaRuta) { 11 setHojaRuta: function(hojaRuta) {
12 this.hojaRuta = hojaRuta; 12 this.hojaRuta = hojaRuta;
13 }, 13 },
14 clearHojaRuta: function() { 14 clearHojaRuta: function() {
15 this.hojaRuta = undefined; 15 this.hojaRuta = undefined;
16 }, 16 },
17 getHojaRuta: function() { 17 getHojaRuta: function() {
18 return this.hojaRuta; 18 return this.hojaRuta;
19 }, 19 },
20 getArticulosByIdHojaRuta: function(id) { 20 getArticulosByIdHojaRuta: function(id) {
21 return $http.get(route+'/articulos/hoja-ruta/'+id); 21 return $http.get(route+'/articulos/hoja-ruta/'+id);
22 }, 22 },
23 crearArticulosParaHojaRuta: function(articuloHojaRuta) { 23 crearArticulosParaHojaRuta: function(articuloHojaRuta) {
24 return $http.post(route + '/articulos/hoja-ruta', 24 return $http.post(route + '/articulos/hoja-ruta',
25 {articuloHojaRuta: articuloHojaRuta}); 25 {articuloHojaRuta: articuloHojaRuta});
26 }, 26 },
27 getDomiciliosByIdHojaRuta: function(id) { 27 getDomiciliosByIdHojaRuta: function(id) {
28 return $http.get(route +'/hoja-ruta/' + id + '/domicilios'); 28 return $http.get(route +'/hoja-ruta/' + id + '/domicilios');
29 }, 29 },
30 getDomiciliosByIdCliente: function(id) { 30 getDomiciliosByIdCliente: function(id) {
31 var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) 31 var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega)
32 return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); 32 return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id );
33 }, 33 },
34 getPrecioCondicion: function() { 34 getPrecioCondicion: function() {
35 return $http.get(route + '/precio-condicion'); 35 return $http.get(route + '/precio-condicion');
36 }, 36 },
37 getPrecioCondicionById: function(id) { 37 getPrecioCondicionById: function(id) {
38 return $http.get(route + '/precio-condicion/' + id); 38 return $http.get(route + '/precio-condicion/' + id);
39 }, 39 },
40 getPlazoPagoByPrecioCondicion: function(id) { 40 getPlazoPagoByPrecioCondicion: function(id) {
41 return $http.get(route + '/plazo-pago/precio-condicion/' + id); 41 return $http.get(route + '/plazo-pago/precio-condicion/' + id);
42 }, 42 },
43 crearFlete: function(flete) { 43 crearFlete: function(flete) {
44 return $http.post(route + '/flete', {flete : flete}); 44 return $http.post(route + '/flete', {flete : flete});
45 }, 45 },
46 crearPlazosParaHojaRuta: function(plazos) { 46 crearPlazosParaHojaRuta: function(plazos) {
47 return $http.post(route + '/plazo-pago/hoja-ruta', plazos); 47 return $http.post(route + '/plazo-pago/hoja-ruta', plazos);
48 }, 48 },
49 getCotizacionByIdMoneda: function(id) { 49 getCotizacionByIdMoneda: function(id) {
50 return $http.get(route + '/moneda/' + id); 50 return $http.get(route + '/moneda/' + id);
51 }, 51 },
52 crearEstadoParaHojaRuta: function(estado) { 52 crearEstadoParaHojaRuta: function(estado) {
53 return $http.post(route + '/estado', {estado: estado}); 53 return $http.post(route + '/estado', {estado: estado});
54 }, 54 },
55 getNumeroHojaRuta: function() { 55 getNumeroHojaRuta: function() {
56 return $http.get(route + '/hoja-ruta/numero-siguiente'); 56 return $http.get(route + '/hoja-ruta/numero-siguiente');
57 }, 57 },
58 getRemitosByIdVehiculo: function(idVehiculo, fechaReparto) { 58 getRemitosByIdVehiculo: function(idVehiculo, fechaReparto) {
59 return $http.get(route + '/vehiculo/obtener/remitos/' + 59 return $http.get(route + '/vehiculo/obtener/remitos/' +
60 idVehiculo + '/' + fechaReparto.toISOString().substring(0, 10)); 60 idVehiculo + '/' + fechaReparto.toISOString().substring(0, 10));
61 }, 61 },
62 getBotonera: function() { 62 getBotonera: function() {
63 return [ 63 return [
64 { 64 {
65 label: 'Fecha Entrega', 65 label: 'Fecha Entrega',
66 image: 'fechaDeReparto.png' 66 image: 'fechaDeReparto.png'
67 }, 67 },
68 { 68 {
69 label: 'Transportista', 69 label: 'Transportista',
70 image: 'transportista.png' 70 image: 'transportista.png'
71 }, 71 },
72 { 72 {
73 label: 'Chofer', 73 label: 'Chofer',
74 image: 'chofer.png' 74 image: 'chofer.png'
75 }, 75 },
76 { 76 {
77 label: 'Vehiculo', 77 label: 'Vehiculo',
78 image: 'vehiculos.png' 78 image: 'vehiculos.png'
79 }, 79 },
80 { 80 {
81 label: 'Tarifario', 81 label: 'Tarifario',
82 image: 'tarifario.png' 82 image: 'tarifario.png'
83 }, 83 },
84 { 84 {
85 label: 'Remitos', 85 label: 'Remitos',
86 image: 'remito.png' 86 image: 'remito.png'
87 }, 87 },
88 { 88 {
89 label: 'Vehiculos precargados', 89 label: 'Vehiculos precargados',
90 image: 'vehiculos.png' 90 image: 'vehiculos.png'
91 },
92 {
93 label: 'Datos extra',
94 image: 'tarifario.png'
91 } 95 }
92 ]; 96 ];
93 } 97 }
94 }; 98 };
95 }]); 99 }]);
96 100