service.js
3.43 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
angular.module('focaParametros')
.factory('focaParametrosService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) {
return {
getNotasPedido: function (fechaDesde, fechaHasta) {
return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar/' + fechaDesde + '/' +
fechaHasta + '/sin-remito');
},
getPuntosDescargaByClienDom: function(idDomicilio, idCliente) {
return $http.get(API_ENDPOINT.URL + '/punto-descarga/' +
idDomicilio + '/' + idCliente);
},
saveParametros: function(parametros) {
return $http.post(API_ENDPOINT.URL + '/parametros', parametros);
},
getParametros: function() {
return $http.get(API_ENDPOINT.URL + '/parametros');
},
plazoToString: function(plazos) {
var result = '';
for(var i = 0; i < plazos.length; i++) {
result += plazos[i].dias + ' ';
}
return result.trim();
},
getBotones: function (modulo) {
var botones = [
{
label: 'Vendedor',
variable: 'vendedor',
image: 'vendedor.png',
modulo: [1, 2]
},
{
label: 'Cliente',
image: 'cliente.png',
variable: 'cliente',
modulo: [1, 2]
},
{
label: 'Proveedor',
image: 'proveedor.png',
variable: 'proveedor',
modulo: [1, 2]
},
{
label: 'Flete',
image: 'flete.png',
variable: 'flete',
modulo: [1, 2]
},
{
label: 'Moneda',
image: 'moneda.png',
variable: 'cotizacion',
modulo: [1, 2]
},
{
label: 'Precios y condiciones',
image: 'precios-condiciones.png',
variable: 'precioCondicion',
modulo: [1, 2]
},
{
label: 'Observaciones',
image: 'botonObservaciones.png',
variable: 'observaciones',
modulo: [1]
}
];
// Devuelvo solo los botones correspondietes
// Modulo 1 = nota de pedido, 2 remito, 3 ambos
return botones.filter(function (p) {
return p.modulo.includes(modulo);
});
},
getBotonesPrincipal: [
{
label: 'Nota de Pedido',
image: 'notaPedido.png',
modulo: 1,
variable: 'notaPedido'
},
{
label: 'Remito',
image: 'remito.png',
modulo: 2,
variable: 'remito'
}
]
};
}]);