service.js
4.4 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
angular.module('focaCrearHojaRuta')
.service('focaCrearHojaRutaService', ['$http', 'API_ENDPOINT',
function($http, API_ENDPOINT) {
var route = API_ENDPOINT.URL;
return {
crearHojaRuta: function(hojaRuta) {
return $http.post(route + '/hoja-ruta', hojaRuta);
},
obtenerHojaRuta: function() {
return $http.get(route +'/hoja-ruta');
},
setHojaRuta: function(hojaRuta) {
this.hojaRuta = hojaRuta;
},
clearHojaRuta: function() {
this.hojaRuta = undefined;
},
getHojaRuta: function() {
return this.hojaRuta;
},
getArticulosByIdHojaRuta: function(id) {
return $http.get(route+'/articulos/hoja-ruta/'+id);
},
crearArticulosParaHojaRuta: function(articuloHojaRuta) {
return $http.post(route + '/articulos/hoja-ruta',
{articuloHojaRuta: articuloHojaRuta});
},
getDomiciliosByIdHojaRuta: function(id) {
return $http.get(route +'/hoja-ruta/' + id + '/domicilios');
},
getDomiciliosByIdCliente: function(id) {
var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega)
return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id );
},
getPrecioCondicion: function() {
return $http.get(route + '/precio-condicion');
},
getPrecioCondicionById: function(id) {
return $http.get(route + '/precio-condicion/' + id);
},
getPlazoPagoByPrecioCondicion: function(id) {
return $http.get(route + '/plazo-pago/precio-condicion/' + id);
},
crearFlete: function(flete) {
return $http.post(route + '/flete', {flete : flete});
},
crearPlazosParaHojaRuta: function(plazos) {
return $http.post(route + '/plazo-pago/hoja-ruta', plazos);
},
getCotizacionByIdMoneda: function(id) {
return $http.get(route + '/moneda/' + id);
},
crearEstadoParaHojaRuta: function(estado) {
return $http.post(route + '/estado', {estado: estado});
},
getNumeroHojaRuta: function() {
return $http.get(route + '/hoja-ruta/numero-siguiente');
},
getRemitosByIdVehiculo: function(idVehiculo, fechaReparto, sinConfirmar) {
var noCofirmados = sinConfirmar ? '/sinConfirmar' : '';
return $http.get(route + '/vehiculo/obtener/remitos/' +
idVehiculo + '/' + fechaReparto.toISOString().substring(0, 10) + noCofirmados);
},
desasociarRemitos: function(idsRemitos, idVehiculo, sinRemitos) {
return $http.post(route + '/vehiculo/desasociar-remitos',
{
idsRemitos: idsRemitos,
idVehiculo: idVehiculo,
vehiculoSinRemitos: sinRemitos
});
},
getBotonera: function() {
return [
{
label: 'Fecha Entrega',
image: 'fechaDeReparto.png'
},
{
label: 'Transportista',
image: 'transportista.png'
},
{
label: 'Chofer',
image: 'chofer.png'
},
{
label: 'Vehiculo',
image: 'vehiculos.png'
},
{
label: 'Tarifario',
image: 'tarifario.png'
},
{
label: 'Remitos',
image: 'remito.png'
},
{
label: 'Vehiculos precargados',
image: 'vehiculos.png'
},
{
label: 'Datos extra',
image: 'tarifario.png'
}
];
}
};
}]);