service.js
2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
angular.module('focaModalInforme')
.factory('focaModalInformeChoferService', [
'$http',
'API_ENDPOINT',
function($http, API_ENDPOINT) {
return {
getDescargas: function(fechaDesde, fechaHasta) {
return $http.post(API_ENDPOINT.URL + '/informe/chofer',
{fechaDesde: fechaDesde, fechaHasta: fechaHasta});
},
getEmpresa: function(id) {
return $http.get(API_ENDPOINT.URL + '/empresa/' + id);
},
getDistanciaPorIdRemito: function(ids) {
return $http.post(API_ENDPOINT.URL + '/remito/distancia', {ids: ids});
}
};
}
])
.factory('focaModalInformeGeneralUnidadService', [
'$http',
'API_ENDPOINT',
function($http, API_ENDPOINT) {
return {
getEmpresa: function(id) {
return $http.get(API_ENDPOINT.URL + '/empresa/' + id);
},
getInformeData: function(params) {
return $http.post(API_ENDPOINT.URL + '/informe/general-unidad-reparto',
{params: params});
}
};
}
])
.factory('focaModalInformeLitrosKmUnidadService', [
'$http',
'API_ENDPOINT',
function($http, API_ENDPOINT) {
return {
getDescargas: function(idVehiculo, fechaDesde, fechaHasta) {
return $http.post(API_ENDPOINT.URL + '/informe/litros-por-km',
{idVehiculo: idVehiculo, fechaDesde: fechaDesde, fechaHasta: fechaHasta});
},
getEmpresa: function(id) {
return $http.get(API_ENDPOINT.URL + '/empresa/' + id);
},
getDistanciaPorIdRemito: function(ids) {
return $http.post(API_ENDPOINT.URL + '/remito/distancia', {ids: ids});
}
};
}
])
.factory('focaModalInformeHojaRutaService', [
'$http',
'API_ENDPOINT',
function($http, API_ENDPOINT) {
return {
getHojasRuta: function(fechaDesde, fechaHasta) {
return $http.get(API_ENDPOINT.URL + '/hoja-ruta/listar/' +
fechaDesde + '/' + fechaHasta);
},
getEmpresa: function(id) {
return $http.get(API_ENDPOINT.URL + '/empresa/' + id);
}
};
}
])
.factory('focaModalInformeRepartoOptimoService', [
'$http',
'API_ENDPOINT',
function($http, API_ENDPOINT) {
return {
getInformeData: function(params) {
return $http.post(API_ENDPOINT.URL + '/informe/reparto-optimo',
{params: params});
}
};
}
]);