Commit 058d352c0a78b962b9ef62429548624c03ff4f47

Authored by Luigi
1 parent 491f30ff84
Exists in master

Moneda por defecto

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
1 angular.module('focaParametros') 1 angular.module('focaParametros')
2 .factory('focaParametrosService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) { 2 .factory('focaParametrosService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) {
3 return { 3 return {
4 getNotasPedido: function (fechaDesde, fechaHasta) { 4 getNotasPedido: function (fechaDesde, fechaHasta) {
5 return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar/' + fechaDesde + '/' + 5 return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar/' + fechaDesde + '/' +
6 fechaHasta + '/sin-remito'); 6 fechaHasta + '/sin-remito');
7 }, 7 },
8 getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { 8 getPuntosDescargaByClienDom: function(idDomicilio, idCliente) {
9 return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + 9 return $http.get(API_ENDPOINT.URL + '/punto-descarga/' +
10 idDomicilio + '/' + idCliente); 10 idDomicilio + '/' + idCliente);
11 }, 11 },
12 saveParametros: function(parametros) { 12 saveParametros: function(parametros) {
13 return $http.post(API_ENDPOINT.URL + '/parametros', parametros); 13 return $http.post(API_ENDPOINT.URL + '/parametros', parametros);
14 }, 14 },
15 getParametros: function() { 15 getParametros: function() {
16 return $http.get(API_ENDPOINT.URL + '/parametros'); 16 return $http.get(API_ENDPOINT.URL + '/parametros');
17 }, 17 },
18 plazoToString: function(plazos) { 18 plazoToString: function(plazos) {
19 19
20 var result = ''; 20 var result = '';
21 21
22 for(var i = 0; i < plazos.length; i++) { 22 for(var i = 0; i < plazos.length; i++) {
23 result += plazos[i].dias + ' '; 23 result += plazos[i].dias + ' ';
24 } 24 }
25 25
26 return result.trim(); 26 return result.trim();
27 }, 27 },
28 getBotones: function (modulo) { 28 getBotones: function (modulo) {
29 var botones = [ 29 var botones = [
30 { 30 {
31 label: 'Vendedor', 31 label: 'Vendedor',
32 variable: 'vendedor', 32 variable: 'vendedor',
33 image: 'vendedor.png', 33 image: 'vendedor.png',
34 modulo: [1, 2] 34 modulo: [1, 2]
35 }, 35 },
36 { 36 {
37 label: 'Cliente', 37 label: 'Cliente',
38 image: 'cliente.png', 38 image: 'cliente.png',
39 variable: 'cliente', 39 variable: 'cliente',
40 modulo: [1, 2] 40 modulo: [1, 2]
41 }, 41 },
42 { 42 {
43 label: 'Proveedor', 43 label: 'Proveedor',
44 image: 'proveedor.png', 44 image: 'proveedor.png',
45 variable: 'proveedor', 45 variable: 'proveedor',
46 modulo: [1, 2] 46 modulo: [1, 2]
47 }, 47 },
48 { 48 {
49 label: 'Flete', 49 label: 'Flete',
50 image: 'flete.png', 50 image: 'flete.png',
51 variable: 'flete', 51 variable: 'flete',
52 modulo: [1, 2] 52 modulo: [1, 2]
53 }, 53 },
54 { 54 {
55 label: 'Moneda', 55 label: 'Moneda',
56 image: 'moneda.png', 56 image: 'moneda.png',
57 variable: 'cotizacion', 57 variable: 'cotizacion',
58 modulo: [1, 2] 58 modulo: [1, 2, 3]
59 }, 59 },
60 { 60 {
61 label: 'Precios y condiciones', 61 label: 'Precios y condiciones',
62 image: 'precios-condiciones.png', 62 image: 'precios-condiciones.png',
63 variable: 'precioCondicion', 63 variable: 'precioCondicion',
64 modulo: [1, 2] 64 modulo: [1, 2]
65 }, 65 },
66 { 66 {
67 label: 'Observaciones', 67 label: 'Observaciones',
68 image: 'botonObservaciones.png', 68 image: 'botonObservaciones.png',
69 variable: 'observaciones', 69 variable: 'observaciones',
70 modulo: [1] 70 modulo: [1]
71 }, 71 },
72 { 72 {
73 label: 'Transportista', 73 label: 'Transportista',
74 image: 'proveedor.png', 74 image: 'proveedor.png',
75 variable: 'transportista', 75 variable: 'transportista',
76 modulo: [3] 76 modulo: [3]
77 }, 77 },
78 { 78 {
79 label: 'Tarifario', 79 label: 'Tarifario',
80 image: 'tarifario.png', 80 image: 'tarifario.png',
81 variable: 'tarifario', 81 variable: 'tarifario',
82 modulo: [3] 82 modulo: [3]
83 } 83 }
84 ]; 84 ];
85 85
86 // Devuelvo solo los botones correspondietes 86 // Devuelvo solo los botones correspondietes
87 // Modulo 1 = nota de pedido, 2 remito, 3 ambos 87 // Modulo 1 = nota de pedido, 2 remito, 3 ambos
88 return botones.filter(function (p) { 88 return botones.filter(function (p) {
89 return p.modulo.includes(modulo); 89 return p.modulo.includes(modulo);
90 }); 90 });
91 }, 91 },
92 getBotonesPrincipal: [ 92 getBotonesPrincipal: [
93 { 93 {
94 label: 'Nota de Pedido', 94 label: 'Nota de Pedido',
95 image: 'notaPedido.png', 95 image: 'notaPedido.png',
96 modulo: 1, 96 modulo: 1,
97 variable: 'notaPedido' 97 variable: 'notaPedido'
98 }, 98 },
99 { 99 {
100 label: 'Remito', 100 label: 'Remito',
101 image: 'remito.png', 101 image: 'remito.png',
102 modulo: 2, 102 modulo: 2,
103 variable: 'remito' 103 variable: 'remito'
104 }, 104 },
105 { 105 {
106 label: 'Hoja ruta', 106 label: 'Hoja ruta',
107 image: 'hoja-ruta.png', 107 image: 'hoja-ruta.png',
108 modulo: 3, 108 modulo: 3,
109 variable: 'hojaRuta' 109 variable: 'hojaRuta'
110 } 110 }
111 ] 111 ]
112 }; 112 };
113 }]); 113 }]);
114 114