Commit cdd21a929b141b19e19eca8eab0daf519056b129
Exists in
master
Merge branch 'develop' into 'master'
Develop See merge request !13
Showing
10 changed files
Show diff stats
src/js/controller-general-unidad.js
1 | angular.module('focaModalInforme') | 1 | angular.module('focaModalInforme') |
2 | .controller('focaModalInformeGeneralUnidadController', | 2 | .controller('focaModalInformeGeneralUnidadController', |
3 | [ | 3 | [ |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalInformeGeneralUnidadService', | 7 | 'focaModalInformeGeneralUnidadService', |
8 | 'i18nService', | 8 | 'i18nService', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | function($filter, $scope, $uibModalInstance, | 10 | function($filter, $scope, $uibModalInstance, |
11 | focaModalInformeGeneralUnidadService, i18nService, focaModalService | 11 | focaModalInformeGeneralUnidadService, i18nService, focaModalService |
12 | ) { | 12 | ) { |
13 | i18nService.setCurrentLang('es'); | 13 | i18nService.setCurrentLang('es'); |
14 | var fecha = new Date(); | 14 | var fecha = new Date(); |
15 | $scope.generando = false; | 15 | $scope.generando = false; |
16 | $scope.buscar = true; | 16 | $scope.buscar = true; |
17 | $scope.informe = {}; | 17 | $scope.informe = {}; |
18 | $scope.params = { | 18 | $scope.params = { |
19 | fechaHasta: new Date(), | 19 | fechaHasta: new Date(), |
20 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), | 20 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), |
21 | sector: undefined, | 21 | sector: String, |
22 | diferenciarProductos: false, | 22 | diferenciarProductos: false, |
23 | diferenciarMeses: false | 23 | diferenciarMeses: false |
24 | }; | 24 | }; |
25 | $scope.gridOptions = { | 25 | $scope.gridOptions = { |
26 | enableGridMenu: true, | 26 | enableGridMenu: true, |
27 | exporterMenuCsv: false, | 27 | exporterMenuCsv: false, |
28 | exporterPdfPageSize: 'A4', | 28 | exporterPdfPageSize: 'A4', |
29 | exporterPdfFooter: function (currentPage, pageCount) { | 29 | exporterPdfFooter: function (currentPage, pageCount) { |
30 | return { | 30 | return { |
31 | columns: [ | 31 | columns: [ |
32 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), | 32 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), |
33 | margin: [40, 0]}, | 33 | margin: [40, 0]}, |
34 | {text: currentPage + ' de ' + pageCount, | 34 | {text: currentPage + ' de ' + pageCount, |
35 | margin: [28, 0], alignment: 'right'} | 35 | margin: [28, 0], alignment: 'right'} |
36 | ] | 36 | ] |
37 | }; | 37 | }; |
38 | }, | 38 | }, |
39 | columnDefs: [ | 39 | columnDefs: [ |
40 | { | 40 | { |
41 | field: 'vehiculo', | 41 | field: 'vehiculo', |
42 | enableSorting: false, | 42 | enableSorting: false, |
43 | cellClass: function(grid, row, col) { | 43 | cellClass: function(grid, row, col) { |
44 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) | 44 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) |
45 | return 'yellow w-100'; | 45 | return 'yellow w-100'; |
46 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) | 46 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) |
47 | return 'red w-100'; | 47 | return 'red w-100'; |
48 | if (grid.getCellValue(row,col).indexOf('Fecha:') !== -1) | 48 | if (grid.getCellValue(row,col).indexOf('Fecha:') !== -1) |
49 | return 'green w-100'; | 49 | return 'green w-100'; |
50 | } | 50 | } |
51 | }, | 51 | }, |
52 | { | 52 | { |
53 | field: 'kmRecorridos', | 53 | field: 'kmRecorridos', |
54 | enableSorting: false, | 54 | enableSorting: false, |
55 | cellClass: function(grid, row, col) { | 55 | cellClass: function(grid, row, col) { |
56 | if (!grid.getCellValue(row,col)) | 56 | if (!grid.getCellValue(row,col)) |
57 | return 'd-none'; | 57 | return 'd-none'; |
58 | } | 58 | } |
59 | }, | 59 | }, |
60 | { | 60 | { |
61 | field: 'litrosRepartidos', | 61 | field: 'litrosRepartidos', |
62 | enableSorting: false, | 62 | enableSorting: false, |
63 | cellClass: function(grid, row, col) { | 63 | cellClass: function(grid, row, col) { |
64 | if (!grid.getCellValue(row,col)) | 64 | if (!grid.getCellValue(row,col)) |
65 | return 'd-none'; | 65 | return 'd-none'; |
66 | } | 66 | } |
67 | }, | 67 | }, |
68 | { | 68 | { |
69 | field: 'viajes', | 69 | field: 'viajes', |
70 | enableSorting: false, | 70 | enableSorting: false, |
71 | cellClass: function(grid, row, col) { | 71 | cellClass: function(grid, row, col) { |
72 | if (!grid.getCellValue(row,col)) | 72 | if (!grid.getCellValue(row,col)) |
73 | return 'd-none'; | 73 | return 'd-none'; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | ] | 76 | ] |
77 | }; | 77 | }; |
78 | $scope.generarInforme = function() { | 78 | $scope.generarInforme = function() { |
79 | $scope.generando = true; | 79 | $scope.generando = true; |
80 | focaModalInformeGeneralUnidadService | 80 | focaModalInformeGeneralUnidadService |
81 | .getInformeData($scope.params) | 81 | .getInformeData($scope.params) |
82 | .then(function(res) { | 82 | .then(function(res) { |
83 | var result = []; | 83 | var result = []; |
84 | 84 | ||
85 | res.data.forEach(function(sector) { | 85 | res.data.forEach(function(sector) { |
86 | if (!$scope.params.sector || | 86 | if (!$scope.params.sector || |
87 | $scope.params.sector.ID === sector.idSector) { | 87 | $scope.params.sector.ID === sector.idSector) { |
88 | //AGREGO SECTORES | 88 | //AGREGO SECTORES |
89 | result.push({ | 89 | result.push({ |
90 | vehiculo: 'Sector: ' + | 90 | vehiculo: 'Sector: ' + |
91 | $filter('rellenarDigitos')(sector.idSector, 2, '0') + | 91 | $filter('rellenarDigitos')(sector.idSector, 2, '0') + |
92 | ' - ' + sector.sector.trim() | 92 | ' - ' + sector.sector.trim() |
93 | }); | 93 | }); |
94 | if (!$scope.params.diferenciarProductos) | 94 | if (!$scope.params.diferenciarProductos) |
95 | sector.productos = unirProductos(sector.productos); | 95 | sector.productos = unirProductos(sector.productos); |
96 | 96 | ||
97 | sector.productos.forEach(function(producto) { | 97 | sector.productos.forEach(function(producto) { |
98 | //AGREGO PRODUCTOS | 98 | //AGREGO PRODUCTOS |
99 | if ($scope.params.diferenciarProductos){ | 99 | if ($scope.params.diferenciarProductos){ |
100 | result.push({ | 100 | result.push({ |
101 | vehiculo: 'Producto: ' + | 101 | vehiculo: 'Producto: ' + |
102 | producto.idProducto + | 102 | producto.idProducto + |
103 | ' - ' + producto.producto | 103 | ' - ' + producto.producto |
104 | }); | 104 | }); |
105 | } | 105 | } |
106 | if (!$scope.params.diferenciarMeses) { | 106 | if (!$scope.params.diferenciarMeses) { |
107 | producto.fechas = unirFechas(producto.fechas); | 107 | producto.fechas = unirFechas(producto.fechas); |
108 | } | 108 | } |
109 | producto.fechas.forEach(function(fecha) { | 109 | producto.fechas.forEach(function(fecha) { |
110 | //AGREGO FECHAS | 110 | //AGREGO FECHAS |
111 | if ($scope.params.diferenciarMeses) { | 111 | if ($scope.params.diferenciarMeses) { |
112 | result.push({ | 112 | result.push({ |
113 | vehiculo: | 113 | vehiculo: |
114 | 'Fecha: ' + fecha.month + ' - ' + fecha.year | 114 | 'Fecha: ' + fecha.month + ' - ' + fecha.year |
115 | }); | 115 | }); |
116 | } else { | 116 | } else { |
117 | result.push({ | 117 | result.push({ |
118 | vehiculo: | 118 | vehiculo: |
119 | 'Fecha: ' + fecha.year | 119 | 'Fecha: ' + fecha.year |
120 | }); | 120 | }); |
121 | } | 121 | } |
122 | fecha.vehiculos.forEach(function(vehiculo) { | 122 | fecha.vehiculos.forEach(function(vehiculo) { |
123 | //AGREGO VEHICULOS | 123 | //AGREGO VEHICULOS |
124 | result.push({ | 124 | result.push({ |
125 | vehiculo: vehiculo.vehiculo, | 125 | vehiculo: vehiculo.vehiculo, |
126 | kmRecorridos: | 126 | kmRecorridos: |
127 | $filter('number')(vehiculo.data.kms, 2), | 127 | $filter('number')(vehiculo.data.kms, 2), |
128 | litrosRepartidos: | 128 | litrosRepartidos: |
129 | $filter('number')(vehiculo.data.lts, 2), | 129 | $filter('number')(vehiculo.data.lts, 2), |
130 | viajes: | 130 | viajes: |
131 | $filter('number')(vehiculo.data.viajes, 0) | 131 | $filter('number')(vehiculo.data.viajes, 0) |
132 | }); | 132 | }); |
133 | }); | 133 | }); |
134 | }); | 134 | }); |
135 | }); | 135 | }); |
136 | } | 136 | } |
137 | }); | 137 | }); |
138 | 138 | ||
139 | $scope.gridOptions.data = result; | 139 | $scope.gridOptions.data = result; |
140 | $scope.generando = false; | 140 | $scope.generando = false; |
141 | $scope.buscar = false; | 141 | $scope.buscar = false; |
142 | }); | 142 | }); |
143 | }; | 143 | }; |
144 | 144 | ||
145 | $scope.seleccionarSector = function(key) { | 145 | $scope.seleccionarSector = function(key) { |
146 | if (key === 13) { | 146 | if (key === 13) { |
147 | var parametrosModal = { | 147 | var parametrosModal = { |
148 | titulo: 'Búsqueda de Sector', | 148 | titulo: 'Búsqueda de Sector', |
149 | searchText: $scope.params.sector.NOMBRE, | 149 | searchText: $scope.params.sector.NOMBRE, |
150 | query: '/sector', | 150 | query: '/sector', |
151 | columnas: [ | 151 | columnas: [ |
152 | { | 152 | { |
153 | nombre: 'Código', | 153 | nombre: 'Código', |
154 | propiedad: 'ID' | 154 | propiedad: 'ID' |
155 | }, | 155 | }, |
156 | { | 156 | { |
157 | nombre: 'Nombre', | 157 | nombre: 'Nombre', |
158 | propiedad: 'NOMBRE' | 158 | propiedad: 'NOMBRE' |
159 | } | 159 | } |
160 | ], | 160 | ], |
161 | size: 'md' | 161 | size: 'md' |
162 | }; | 162 | }; |
163 | focaModalService.modal(parametrosModal).then( | 163 | focaModalService.modal(parametrosModal).then( |
164 | function(sector) { | 164 | function(sector) { |
165 | $scope.params.sector = sector; | 165 | $scope.params.sector = sector; |
166 | }, function() {} | 166 | }, function() {} |
167 | ); | 167 | ); |
168 | } | 168 | } |
169 | }; | 169 | }; |
170 | $scope.volver = function() { | 170 | $scope.volver = function() { |
171 | $scope.buscar = true; | 171 | $scope.buscar = true; |
172 | }; | 172 | }; |
173 | $scope.cancel = function() { | 173 | $scope.cancel = function() { |
174 | $uibModalInstance.dismiss('Cancelar'); | 174 | $uibModalInstance.dismiss('Cancelar'); |
175 | }; | 175 | }; |
176 | $scope.clearSector = function() { | ||
177 | $scope.params.sector = undefined; | ||
178 | }; | ||
179 | 176 | ||
180 | function unirProductos(productos) { | 177 | function unirProductos(productos) { |
181 | var result = [{fechas: []}]; | 178 | var result = [{fechas: []}]; |
182 | productos.forEach(function(producto) { | 179 | productos.forEach(function(producto) { |
183 | producto.fechas.forEach(function(fecha) { | 180 | producto.fechas.forEach(function(fecha) { |
184 | var existe = result[0].fechas.filter(function(result) { | 181 | var existe = result[0].fechas.filter(function(result) { |
185 | return result.fecha === fecha.fecha; | 182 | return result.fecha === fecha.fecha; |
186 | }); | 183 | }); |
187 | if (existe.length) { | 184 | if (existe.length) { |
188 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 185 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
189 | } else { | 186 | } else { |
190 | result[0].fechas.push(fecha); | 187 | result[0].fechas.push(fecha); |
191 | } | 188 | } |
192 | 189 | ||
193 | }); | 190 | }); |
194 | }); | 191 | }); |
195 | result[0].fechas.forEach(function(fecha) { | 192 | result[0].fechas.forEach(function(fecha) { |
196 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); | 193 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); |
197 | }); | 194 | }); |
198 | return result; | 195 | return result; |
199 | } | 196 | } |
200 | 197 | ||
201 | function unirFechas(fechas) { | 198 | function unirFechas(fechas) { |
202 | var results = []; | 199 | var results = []; |
203 | fechas.forEach(function(fecha) { | 200 | fechas.forEach(function(fecha) { |
204 | var existe = results.filter(function(result) { | 201 | var existe = results.filter(function(result) { |
205 | return result.year === fecha.year; | 202 | return result.year === fecha.year; |
206 | }); | 203 | }); |
207 | 204 | ||
208 | if (existe.length) { | 205 | if (existe.length) { |
209 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 206 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
210 | } else { | 207 | } else { |
211 | results.push({ | 208 | results.push({ |
212 | year: fecha.year, | 209 | year: fecha.year, |
213 | vehiculos: fecha.vehiculos | 210 | vehiculos: fecha.vehiculos |
214 | }); | 211 | }); |
215 | } | 212 | } |
216 | }); | 213 | }); |
217 | 214 | ||
218 | results.forEach(function(result) { | 215 | results.forEach(function(result) { |
219 | result.vehiculos = unirVehiculos(result.vehiculos); | 216 | result.vehiculos = unirVehiculos(result.vehiculos); |
220 | }); | 217 | }); |
221 | return results; | 218 | return results; |
222 | } | 219 | } |
223 | 220 | ||
224 | function unirVehiculos(vehiculos) { | 221 | function unirVehiculos(vehiculos) { |
225 | var results = []; | 222 | var results = []; |
226 | vehiculos.forEach(function(vehiculo) { | 223 | vehiculos.forEach(function(vehiculo) { |
227 | var existe = results.filter(function(result) { | 224 | var existe = results.filter(function(result) { |
228 | return result.vehiculo === vehiculo.vehiculo; | 225 | return result.vehiculo === vehiculo.vehiculo; |
229 | }); | 226 | }); |
230 | 227 | ||
231 | if (existe.length) { | 228 | if (existe.length) { |
232 | existe[0].data.kms += vehiculo.data.kms; | 229 | existe[0].data.kms += vehiculo.data.kms; |
233 | existe[0].data.lts += vehiculo.data.lts; | 230 | existe[0].data.lts += vehiculo.data.lts; |
234 | existe[0].data.viajes += vehiculo.data.viajes; | 231 | existe[0].data.viajes += vehiculo.data.viajes; |
235 | } else { | 232 | } else { |
236 | results.push(vehiculo); | 233 | results.push(vehiculo); |
237 | } | 234 | } |
238 | }); | 235 | }); |
239 | return results; | 236 | return results; |
240 | } | 237 | } |
241 | } | 238 | } |
242 | ] | 239 | ] |
243 | ); | 240 | ); |
244 | 241 |
src/js/controller-litros-km-unidad.js
1 | angular.module('focaModalInforme') | 1 | angular.module('focaModalInforme') |
2 | .controller('focaModalInformeLitrosKmUnidadController', | 2 | .controller('focaModalInformeLitrosKmUnidadController', |
3 | [ | 3 | [ |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalInformeLitrosKmUnidadService', | 7 | 'focaModalInformeLitrosKmUnidadService', |
8 | 'i18nService', | 8 | 'i18nService', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | '$uibModal', | 10 | '$uibModal', |
11 | function($filter, $scope, $uibModalInstance, focaModalInformeLitrosKmUnidadService, | 11 | function($filter, $scope, $uibModalInstance, focaModalInformeLitrosKmUnidadService, |
12 | i18nService, focaModalService, $uibModal | 12 | i18nService, focaModalService, $uibModal |
13 | ) { | 13 | ) { |
14 | var meses = ['ene', 'feb', 'mar', 'abr', 'may', 'jun', | 14 | var meses = ['ene', 'feb', 'mar', 'abr', 'may', 'jun', |
15 | 'jul', 'ago', 'sep', 'oct', 'nov', 'dic']; | 15 | 'jul', 'ago', 'sep', 'oct', 'nov', 'dic']; |
16 | var fecha = new Date(); | 16 | var fecha = new Date(); |
17 | $scope.generando = false; | 17 | $scope.generando = false; |
18 | $scope.fechaHasta = new Date(); | 18 | $scope.fechaHasta = new Date(); |
19 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); | 19 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); |
20 | $scope.buscar = true; | 20 | $scope.buscar = true; |
21 | $scope.unidad = { | ||
22 | codigo: '' | ||
23 | }; | ||
21 | $scope.informe = {}; | 24 | $scope.informe = {}; |
22 | i18nService.setCurrentLang('es'); | 25 | i18nService.setCurrentLang('es'); |
23 | $scope.gridOptions = { | 26 | $scope.gridOptions = { |
24 | enableGridMenu: true, | 27 | enableGridMenu: true, |
25 | exporterMenuCsv: false, | 28 | exporterMenuCsv: false, |
26 | exporterPdfPageSize: 'A4', | 29 | exporterPdfPageSize: 'A4', |
27 | exporterPdfFooter: function (currentPage, pageCount) { | 30 | exporterPdfFooter: function (currentPage, pageCount) { |
28 | return { | 31 | return { |
29 | columns: [ | 32 | columns: [ |
30 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), | 33 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), |
31 | margin: [40, 0]}, | 34 | margin: [40, 0]}, |
32 | {text: currentPage + ' de ' + pageCount, | 35 | {text: currentPage + ' de ' + pageCount, |
33 | margin: [28, 0], alignment: 'right'} | 36 | margin: [28, 0], alignment: 'right'} |
34 | ] | 37 | ] |
35 | }; | 38 | }; |
36 | }, | 39 | }, |
37 | columnDefs: [ | 40 | columnDefs: [ |
38 | { | 41 | { |
39 | field: 'fecha', | 42 | field: 'fecha', |
40 | enableSorting: false, | 43 | enableSorting: false, |
41 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 44 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
42 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) | 45 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) |
43 | return 'yellow w-100'; | 46 | return 'yellow w-100'; |
44 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) | 47 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) |
45 | return 'red w-100'; | 48 | return 'red w-100'; |
46 | } | 49 | } |
47 | }, | 50 | }, |
48 | { | 51 | { |
49 | field: 'litrosRepartidos', | 52 | field: 'litrosRepartidos', |
50 | enableSorting: false, | 53 | enableSorting: false, |
51 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 54 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
52 | if (!grid.getCellValue(row,col)) | 55 | if (!grid.getCellValue(row,col)) |
53 | return 'd-none'; | 56 | return 'd-none'; |
54 | } | 57 | } |
55 | }, | 58 | }, |
56 | { | 59 | { |
57 | field: 'kmRecorridos', | 60 | field: 'kmRecorridos', |
58 | enableSorting: false, | 61 | enableSorting: false, |
59 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 62 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
60 | if (!grid.getCellValue(row,col)) | 63 | if (!grid.getCellValue(row,col)) |
61 | return 'd-none'; | 64 | return 'd-none'; |
62 | } | 65 | } |
63 | }, | 66 | }, |
64 | { | 67 | { |
65 | field: 'lts/Km', | 68 | field: 'lts/Km', |
66 | enableSorting: false, | 69 | enableSorting: false, |
67 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 70 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
68 | if (!grid.getCellValue(row,col)) | 71 | if (!grid.getCellValue(row,col)) |
69 | return 'd-none'; | 72 | return 'd-none'; |
70 | } | 73 | } |
71 | } | 74 | } |
72 | ] | 75 | ] |
73 | 76 | ||
74 | }; | 77 | }; |
75 | $scope.generarInforme = function() { | 78 | $scope.generarInforme = function() { |
76 | if(!$scope.unidad){ | 79 | if(!$scope.unidad){ |
77 | focaModalService.alert('Primero seleccione una unidad'); | 80 | focaModalService.alert('Primero seleccione una unidad'); |
78 | return; | 81 | return; |
79 | } | 82 | } |
80 | $scope.generando = true; | 83 | $scope.generando = true; |
81 | focaModalInformeLitrosKmUnidadService | 84 | focaModalInformeLitrosKmUnidadService |
82 | .getDescargas( | 85 | .getDescargas( |
83 | $scope.unidad.id, | 86 | $scope.unidad.id, |
84 | $scope.fechaDesde.toISOString().split('.')[0], | 87 | $scope.fechaDesde.toISOString().split('.')[0], |
85 | $scope.fechaHasta.toISOString().split('.')[0] | 88 | $scope.fechaHasta.toISOString().split('.')[0] |
86 | ) | 89 | ) |
87 | .then(function(res) { | 90 | .then(function(res) { |
88 | var result = []; | 91 | var result = []; |
89 | res.data.forEach(function(sector) { | 92 | res.data.forEach(function(sector) { |
90 | result.push({ | 93 | result.push({ |
91 | fecha: 'Sector: ' + | 94 | fecha: 'Sector: ' + |
92 | $filter('rellenarDigitos')(sector[0].articulo.CodSec, 2, '0') + | 95 | $filter('rellenarDigitos')(sector[0].articulo.CodSec, 2, '0') + |
93 | ' - ' + sector[0].articulo.sector.NOMBRE.trim() | 96 | ' - ' + sector[0].articulo.sector.NOMBRE.trim() |
94 | }); | 97 | }); |
95 | sector.forEach(function(cisternaCarga) { | 98 | sector.forEach(function(cisternaCarga) { |
96 | result.push({ | 99 | result.push({ |
97 | fecha: 'Producto: ' + | 100 | fecha: 'Producto: ' + |
98 | cisternaCarga.articulo.CodArt + | 101 | cisternaCarga.articulo.CodArt + |
99 | ' - ' + cisternaCarga.articulo.DetArt | 102 | ' - ' + cisternaCarga.articulo.DetArt |
100 | }); | 103 | }); |
101 | cisternaCarga.cisternaMovimientos.forEach(function(cisternaMovimiento) { | 104 | cisternaCarga.cisternaMovimientos.forEach(function(cisternaMovimiento) { |
102 | var lts = cisternaMovimiento.lts; | 105 | var lts = cisternaMovimiento.lts; |
103 | var kms = cisternaMovimiento.kms; | 106 | var kms = cisternaMovimiento.kms; |
104 | 107 | ||
105 | result.push({ | 108 | result.push({ |
106 | fecha: meses[cisternaMovimiento.month] + ' - ' + cisternaMovimiento.year, | 109 | fecha: meses[cisternaMovimiento.month] + ' - ' + cisternaMovimiento.year, |
107 | litrosRepartidos: $filter('number')(lts, 2), | 110 | litrosRepartidos: $filter('number')(lts, 2), |
108 | kmRecorridos: $filter('number')(kms, 2), | 111 | kmRecorridos: $filter('number')(kms, 2), |
109 | 'lts/Km': (kms) ? $filter('number')(lts / kms, 2) : lts | 112 | 'lts/Km': (kms) ? $filter('number')(lts / kms, 2) : lts |
110 | }); | 113 | }); |
111 | }); | 114 | }); |
112 | }); | 115 | }); |
113 | }); | 116 | }); |
114 | $scope.gridOptions.data = result; | 117 | $scope.gridOptions.data = result; |
115 | $scope.generando = false; | 118 | $scope.generando = false; |
116 | $scope.buscar = false; | 119 | $scope.buscar = false; |
117 | }); | 120 | }); |
118 | }; | 121 | }; |
119 | $scope.seleccionarTransportista = function() { | 122 | $scope.seleccionarTransportista = function() { |
120 | var parametrosModal = { | 123 | var parametrosModal = { |
121 | titulo: 'Búsqueda de Transportista', | 124 | titulo: 'Búsqueda de Transportista', |
122 | query: '/transportista', | 125 | query: '/transportista', |
123 | columnas: [ | 126 | columnas: [ |
124 | { | 127 | { |
125 | propiedad: 'COD', | 128 | propiedad: 'COD', |
126 | nombre: 'Código', | 129 | nombre: 'Código', |
127 | filtro: { | 130 | filtro: { |
128 | nombre: 'rellenarDigitos', | 131 | nombre: 'rellenarDigitos', |
129 | parametro: 5 | 132 | parametro: 5 |
130 | } | 133 | } |
131 | }, | 134 | }, |
132 | { | 135 | { |
133 | propiedad: 'NOM', | 136 | propiedad: 'NOM', |
134 | nombre: 'Nombre' | 137 | nombre: 'Nombre' |
135 | }, | 138 | }, |
136 | { | 139 | { |
137 | propiedad: 'CUIT', | 140 | propiedad: 'CUIT', |
138 | nombre: 'CUIT' | 141 | nombre: 'CUIT' |
139 | } | 142 | } |
140 | ], | 143 | ], |
141 | size: 'md' | 144 | size: 'md' |
142 | }; | 145 | }; |
143 | return focaModalService.modal(parametrosModal) | 146 | return focaModalService.modal(parametrosModal) |
144 | }; | 147 | }; |
145 | 148 | ||
146 | $scope.seleccionarUnidad = function(key) { | 149 | $scope.seleccionarUnidad = function(key) { |
147 | if (key === 13) { | 150 | if (key === 13) { |
148 | $scope.seleccionarTransportista().then( | 151 | $scope.seleccionarTransportista().then( |
149 | function(transportista) { | 152 | function(transportista) { |
150 | $scope.transportista = transportista; | 153 | $scope.transportista = transportista; |
151 | var parametrosModal = { | 154 | var parametrosModal = { |
152 | titulo: 'Búsqueda de vehículos', | 155 | titulo: 'Búsqueda de vehículos', |
153 | searchText: $scope.unidad.codigo, | 156 | searchText: $scope.unidad.codigo, |
154 | query: '/vehiculo/transportista/' + transportista.COD, | 157 | query: '/vehiculo/transportista/' + transportista.COD, |
155 | columnas: [ | 158 | columnas: [ |
156 | { | 159 | { |
157 | propiedad: 'codigo', | 160 | propiedad: 'codigo', |
158 | nombre: 'Código' | 161 | nombre: 'Código' |
159 | }, | 162 | }, |
160 | { | 163 | { |
161 | propiedad: 'tractor', | 164 | propiedad: 'tractor', |
162 | nombre: 'Tractor' | 165 | nombre: 'Tractor' |
163 | }, | 166 | }, |
164 | { | 167 | { |
165 | propiedad: 'semi', | 168 | propiedad: 'semi', |
166 | nombre: 'Semi' | 169 | nombre: 'Semi' |
167 | }, | 170 | }, |
168 | { | 171 | { |
169 | propiedad: 'tractor', | 172 | propiedad: 'tractor', |
170 | nombre: 'Tractor' | 173 | nombre: 'Tractor' |
171 | } | 174 | } |
172 | ], | 175 | ], |
173 | size: 'md' | 176 | size: 'md' |
174 | }; | 177 | }; |
175 | focaModalService.modal(parametrosModal).then( | 178 | focaModalService.modal(parametrosModal).then( |
176 | function(unidad) { | 179 | function(unidad) { |
177 | $scope.unidad = unidad; | 180 | $scope.unidad = unidad; |
178 | }, function() { | 181 | }, function() { |
179 | $scope.seleccionarUnidad(); | 182 | $scope.seleccionarUnidad(); |
180 | }); | 183 | }); |
181 | }); | 184 | }); |
182 | } | 185 | } |
183 | }; | 186 | }; |
184 | $scope.volver = function() { | 187 | $scope.volver = function() { |
185 | $scope.buscar = true; | 188 | $scope.buscar = true; |
186 | }; | 189 | }; |
187 | $scope.cancel = function() { | 190 | $scope.cancel = function() { |
188 | $uibModalInstance.dismiss('Cancelar'); | 191 | $uibModalInstance.dismiss('Cancelar'); |
189 | }; | 192 | }; |
190 | } | 193 | } |
191 | ] | 194 | ] |
192 | ); | 195 | ); |
193 | 196 |
src/js/controller-productividad.js
1 | angular.module('focaModalInforme') | 1 | angular.module('focaModalInforme') |
2 | .controller('focaModalInformeProductividadController', | 2 | .controller('focaModalInformeProductividadController', |
3 | [ | 3 | [ |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalInformeProductividadService', | 7 | 'focaModalInformeProductividadService', |
8 | 'i18nService', | 8 | 'i18nService', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | function($filter, $scope, $uibModalInstance, | 10 | function($filter, $scope, $uibModalInstance, |
11 | focaModalInformeProductividadService, i18nService, focaModalService | 11 | focaModalInformeProductividadService, i18nService, focaModalService |
12 | ) { | 12 | ) { |
13 | i18nService.setCurrentLang('es'); | 13 | i18nService.setCurrentLang('es'); |
14 | var fecha = new Date(); | 14 | var fecha = new Date(); |
15 | $scope.generando = false; | 15 | $scope.generando = false; |
16 | $scope.buscar = true; | 16 | $scope.buscar = true; |
17 | $scope.informe = {}; | 17 | $scope.informe = {}; |
18 | $scope.params = { | 18 | $scope.params = { |
19 | fechaHasta: new Date(), | 19 | fechaHasta: new Date(), |
20 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), | 20 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), |
21 | sector: undefined, | 21 | sector: undefined, |
22 | diferenciarProductos: false, | 22 | diferenciarProductos: false, |
23 | diferenciarMeses: false | 23 | diferenciarMeses: false, |
24 | entidad:{ | ||
25 | label: '' | ||
26 | } | ||
24 | }; | 27 | }; |
25 | $scope.gridOptions = { | 28 | $scope.gridOptions = { |
26 | enableGridMenu: true, | 29 | enableGridMenu: true, |
27 | exporterMenuCsv: false, | 30 | exporterMenuCsv: false, |
28 | exporterPdfPageSize: 'A4', | 31 | exporterPdfPageSize: 'A4', |
29 | exporterPdfFooter: function (currentPage, pageCount) { | 32 | exporterPdfFooter: function (currentPage, pageCount) { |
30 | return { | 33 | return { |
31 | columns: [ | 34 | columns: [ |
32 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), | 35 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), |
33 | margin: [40, 0]}, | 36 | margin: [40, 0]}, |
34 | {text: currentPage + ' de ' + pageCount, | 37 | {text: currentPage + ' de ' + pageCount, |
35 | margin: [28, 0], alignment: 'right'} | 38 | margin: [28, 0], alignment: 'right'} |
36 | ] | 39 | ] |
37 | }; | 40 | }; |
38 | }, | 41 | }, |
39 | columnDefs: [ | 42 | columnDefs: [ |
40 | { | 43 | { |
41 | field: 'cliente', | 44 | field: 'cliente', |
42 | enableSorting: false, | 45 | enableSorting: false, |
43 | cellClass: function(grid, row, col) { | 46 | cellClass: function(grid, row, col) { |
44 | var value = grid.getCellValue(row,col); | 47 | var value = grid.getCellValue(row,col); |
45 | 48 | ||
46 | if (value.indexOf('Vendedores') !== -1 || | 49 | if (value.indexOf('Vendedores') !== -1 || |
47 | value.indexOf('Cobradores') !== -1 || | 50 | value.indexOf('Cobradores') !== -1 || |
48 | value.indexOf('Transportistas') !== -1) | 51 | value.indexOf('Transportistas') !== -1) |
49 | return 'yellow w-100'; | 52 | return 'yellow w-100'; |
50 | if (value.indexOf('Vendedor:') !== -1 || | 53 | if (value.indexOf('Vendedor:') !== -1 || |
51 | value.indexOf('Cobrador:') !== -1 || | 54 | value.indexOf('Cobrador:') !== -1 || |
52 | value.indexOf('Transportista:') !== -1) | 55 | value.indexOf('Transportista:') !== -1) |
53 | return 'red w-100'; | 56 | return 'red w-100'; |
54 | if (value.indexOf('Fecha:') !== -1) | 57 | if (value.indexOf('Fecha:') !== -1) |
55 | return 'green w-100'; | 58 | return 'green w-100'; |
56 | } | 59 | } |
57 | }, | 60 | }, |
58 | { | 61 | { |
59 | field: 'fecha', | 62 | field: 'fecha', |
60 | enableSorting: false, | 63 | enableSorting: false, |
61 | cellClass: function(grid, row, col) { | 64 | cellClass: function(grid, row, col) { |
62 | if (!grid.getCellValue(row,col)) | 65 | if (!grid.getCellValue(row,col)) |
63 | return 'd-none'; | 66 | return 'd-none'; |
64 | } | 67 | } |
65 | }, | 68 | }, |
66 | { | 69 | { |
67 | field: 'kmRecorridos', | 70 | field: 'kmRecorridos', |
68 | enableSorting: false, | 71 | enableSorting: false, |
69 | cellClass: function(grid, row, col) { | 72 | cellClass: function(grid, row, col) { |
70 | if (!grid.getCellValue(row,col)) | 73 | if (!grid.getCellValue(row,col)) |
71 | return 'd-none'; | 74 | return 'd-none'; |
72 | } | 75 | } |
73 | }, | 76 | }, |
74 | { | 77 | { |
75 | field: 'geolocalizacion', | 78 | field: 'geolocalizacion', |
76 | enableSorting: false, | 79 | enableSorting: false, |
77 | cellClass: function(grid, row, col) { | 80 | cellClass: function(grid, row, col) { |
78 | if (!grid.getCellValue(row,col)) | 81 | if (!grid.getCellValue(row,col)) |
79 | return 'd-none'; | 82 | return 'd-none'; |
80 | } | 83 | } |
81 | } | 84 | } |
82 | ] | 85 | ] |
83 | }; | 86 | }; |
84 | $scope.seleccionarTipo = function() { | 87 | $scope.seleccionarTipo = function() { |
85 | var data = [ | 88 | var parametrosModal = { |
86 | { | 89 | searchText: $scope.params.entidad.label, |
87 | id: 0, | ||
88 | label: 'Todos' | ||
89 | }, | ||
90 | { | ||
91 | id: 1, | ||
92 | label: 'Vendedores' | ||
93 | }, | ||
94 | { | ||
95 | id: 2, | ||
96 | label: 'Cobradores' | ||
97 | }, | ||
98 | { | ||
99 | id: 3, | ||
100 | label: 'Transportistas' | ||
101 | } | ||
102 | ]; | ||
103 | focaModalService.modal({ | ||
104 | titulo: 'Seleccionar entidad', | ||
105 | data: data, | ||
106 | columnas: [ | 90 | columnas: [ |
107 | { | 91 | { |
108 | propiedad: 'label', | 92 | propiedad: 'label', |
109 | nombre: 'Entidad' | 93 | nombre: 'Entidad' |
110 | } | 94 | } |
111 | ], | 95 | ], |
112 | }).then(function(res) { | 96 | titulo: 'Seleccionar entidad', |
97 | size: 'md', | ||
98 | data: [ | ||
99 | { | ||
100 | id: 0, | ||
101 | label: 'Todos' | ||
102 | }, | ||
103 | { | ||
104 | id: 1, | ||
105 | label: 'Vendedores' | ||
106 | }, | ||
107 | { | ||
108 | id: 2, | ||
109 | label: 'Cobradores' | ||
110 | }, | ||
111 | { | ||
112 | id: 3, | ||
113 | label: 'Transportistas' | ||
114 | } | ||
115 | ] | ||
116 | }; | ||
117 | |||
118 | focaModalService.modal(parametrosModal).then(function(res) { | ||
113 | $scope.params.entidad = res; | 119 | $scope.params.entidad = res; |
114 | }); | 120 | }); |
115 | }; | 121 | }; |
116 | $scope.generarInforme = function() { | 122 | $scope.generarInforme = function() { |
117 | if (!$scope.params.entidad) { | 123 | if ($scope.params.entidad.id === undefined) { |
118 | focaModalService.alert('Seleccione una entidad'); | 124 | focaModalService.alert('Seleccione una entidad'); |
119 | return; | 125 | return; |
120 | } | 126 | } |
121 | $scope.generando = true; | 127 | $scope.generando = true; |
122 | focaModalInformeProductividadService | 128 | focaModalInformeProductividadService |
123 | .getInformeData($scope.params) | 129 | .getInformeData($scope.params) |
124 | .then(function(res) { | 130 | .then(function(res) { |
125 | var result = []; | 131 | var result = []; |
126 | 132 | ||
127 | if ($scope.params.entidad.id === 1 || !$scope.params.entidad.id) { | 133 | if ($scope.params.entidad.id === 1 || !$scope.params.entidad.id) { |
128 | result.push({ | 134 | result.push({ |
129 | cliente: 'Vendedores' | 135 | cliente: 'Vendedores' |
130 | }); | 136 | }); |
131 | res.data.vendedores.forEach(function(vendedor) { | 137 | res.data.vendedores.forEach(function(vendedor) { |
132 | result.push({ | 138 | result.push({ |
133 | cliente: 'Vendedor: ' + vendedor.NOM | 139 | cliente: 'Vendedor: ' + vendedor.NOM |
134 | }); | 140 | }); |
135 | vendedor.notasPedido.forEach(function(notaPedido) { | 141 | vendedor.notasPedido.forEach(function(notaPedido) { |
136 | var seguimiento = notaPedido.seguimiento; | 142 | var seguimiento = notaPedido.seguimiento; |
137 | result.push({ | 143 | result.push({ |
138 | cliente: notaPedido.cliente.NOM, | 144 | cliente: notaPedido.cliente.NOM, |
139 | fecha: seguimiento ? $filter('date')(seguimiento.fecha) : $filter('date')(notaPedido.fechaCarga), | 145 | fecha: seguimiento ? $filter('date')(seguimiento.fecha) : $filter('date')(notaPedido.fechaCarga), |
140 | kmRecorridos: seguimiento ? $filter('number')(seguimiento.kmRecorridos || 0, 2) : $filter('number')(0, 2), | 146 | kmRecorridos: seguimiento ? $filter('number')(seguimiento.kmRecorridos || 0, 2) : $filter('number')(0, 2), |
141 | geolocalizacion: seguimiento ? seguimiento.latitud + ', ' + seguimiento.longitud : '' | 147 | geolocalizacion: seguimiento ? seguimiento.latitud + ', ' + seguimiento.longitud : '' |
142 | }); | 148 | }); |
143 | }); | 149 | }); |
144 | }); | 150 | }); |
145 | } | 151 | } |
146 | if ($scope.params.entidad.id === 2 || !$scope.params.entidad.id) { | 152 | if ($scope.params.entidad.id === 2 || !$scope.params.entidad.id) { |
147 | result.push({ | 153 | result.push({ |
148 | cliente: 'Cobradores' | 154 | cliente: 'Cobradores' |
149 | }); | 155 | }); |
150 | res.data.cobradores.forEach(function(cobrador) { | 156 | res.data.cobradores.forEach(function(cobrador) { |
151 | result.push({ | 157 | result.push({ |
152 | cliente: 'Cobrador: ' + cobrador.NOM | 158 | cliente: 'Cobrador: ' + cobrador.NOM |
153 | }); | 159 | }); |
154 | cobrador.cobranzas.forEach(function(cobranza) { | 160 | cobrador.cobranzas.forEach(function(cobranza) { |
155 | var seguimiento = cobranza.seguimiento; | 161 | var seguimiento = cobranza.seguimiento; |
156 | result.push({ | 162 | result.push({ |
157 | cliente: cobranza.cliente.NOM, | 163 | cliente: cobranza.cliente.NOM, |
158 | fecha: seguimiento ? $filter('date')(seguimiento.fecha, 'dd/MM/yyyy') : $filter('date')(cobranza.FEC), | 164 | fecha: seguimiento ? $filter('date')(seguimiento.fecha, 'dd/MM/yyyy') : $filter('date')(cobranza.FEC), |
159 | kmRecorridos: seguimiento ? $filter('number')(seguimiento.kmRecorridos || 0, 2) : $filter('number')(0, 2), | 165 | kmRecorridos: seguimiento ? $filter('number')(seguimiento.kmRecorridos || 0, 2) : $filter('number')(0, 2), |
160 | geolocalizacion: seguimiento ? seguimiento.latitud + ', ' + seguimiento.longitud : '' | 166 | geolocalizacion: seguimiento ? seguimiento.latitud + ', ' + seguimiento.longitud : '' |
161 | }); | 167 | }); |
162 | }); | 168 | }); |
163 | }); | 169 | }); |
164 | } | 170 | } |
165 | if ($scope.params.entidad.id === 3 || !$scope.params.entidad.id) { | 171 | if ($scope.params.entidad.id === 3 || !$scope.params.entidad.id) { |
166 | result.push({ | 172 | result.push({ |
167 | cliente: 'Transportistas' | 173 | cliente: 'Transportistas' |
168 | }); | 174 | }); |
169 | res.data.transportistas.forEach(function(transportista) { | 175 | res.data.transportistas.forEach(function(transportista) { |
170 | result.push({ | 176 | result.push({ |
171 | cliente: 'Transportista: ' + transportista.NOM | 177 | cliente: 'Transportista: ' + transportista.NOM |
172 | }); | 178 | }); |
173 | transportista.remitos.forEach(function(remito) { | 179 | transportista.remitos.forEach(function(remito) { |
174 | var kms = 0, | 180 | var kms = 0, |
175 | geolocalizacion; | 181 | geolocalizacion; |
176 | remito.hojaRutaMovimiento.forEach(function(movimiento) { | 182 | remito.hojaRutaMovimiento.forEach(function(movimiento) { |
177 | kms += movimiento.seguimiento.kmRecorridos || 0; | 183 | kms += movimiento.seguimiento.kmRecorridos || 0; |
178 | geolocalizacion = geolocalizacion || | 184 | geolocalizacion = geolocalizacion || |
179 | movimiento.seguimiento.latitud + ', ' + | 185 | movimiento.seguimiento.latitud + ', ' + |
180 | movimiento.seguimiento.longitud; | 186 | movimiento.seguimiento.longitud; |
181 | }); | 187 | }); |
182 | result.push({ | 188 | result.push({ |
183 | cliente: remito.cliente.NOM, | 189 | cliente: remito.cliente.NOM, |
184 | fecha: $filter('date')(remito.fechaRemito, 'dd/MM/yyyy'), | 190 | fecha: $filter('date')(remito.fechaRemito, 'dd/MM/yyyy'), |
185 | kmRecorridos: $filter('number')(kms, 2), | 191 | kmRecorridos: $filter('number')(kms, 2), |
186 | geolocalizacion: geolocalizacion | 192 | geolocalizacion: geolocalizacion |
187 | }); | 193 | }); |
188 | }); | 194 | }); |
189 | }); | 195 | }); |
190 | } | 196 | } |
191 | $scope.gridOptions.data = result; | 197 | $scope.gridOptions.data = result; |
src/js/controller-reparto-optimo.js
1 | angular.module('focaModalInforme') | 1 | angular.module('focaModalInforme') |
2 | .controller('focaModalInformeRepartoOptimoController', | 2 | .controller('focaModalInformeRepartoOptimoController', |
3 | [ | 3 | [ |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalInformeRepartoOptimoService', | 7 | 'focaModalInformeRepartoOptimoService', |
8 | 'i18nService', | 8 | 'i18nService', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | '$uibModal', | 10 | '$uibModal', |
11 | function($filter, $scope, $uibModalInstance, focaModalInformeRepartoOptimoService, | 11 | function($filter, $scope, $uibModalInstance, focaModalInformeRepartoOptimoService, |
12 | i18nService, focaModalService, $uibModal | 12 | i18nService, focaModalService, $uibModal |
13 | ) { | 13 | ) { |
14 | var fecha = new Date(); | 14 | var fecha = new Date(); |
15 | $scope.generando = false; | 15 | $scope.generando = false; |
16 | $scope.buscar = true; | 16 | $scope.buscar = true; |
17 | $scope.params = { | 17 | $scope.params = { |
18 | fechaHasta: new Date(), | 18 | fechaHasta: new Date(), |
19 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), | 19 | fechaDesde: new Date(fecha.setMonth(fecha.getMonth() - 1)), |
20 | sector: undefined, | 20 | sector: String, |
21 | diferenciarProductos: false, | 21 | diferenciarProductos: false, |
22 | diferenciarMeses: false | 22 | diferenciarMeses: false |
23 | }; | 23 | }; |
24 | i18nService.setCurrentLang('es'); | 24 | i18nService.setCurrentLang('es'); |
25 | $scope.gridOptions = { | 25 | $scope.gridOptions = { |
26 | enableGridMenu: true, | 26 | enableGridMenu: true, |
27 | exporterMenuCsv: false, | 27 | exporterMenuCsv: false, |
28 | exporterPdfPageSize: 'A4', | 28 | exporterPdfPageSize: 'A4', |
29 | exporterPdfFooter: function (currentPage, pageCount) { | 29 | exporterPdfFooter: function (currentPage, pageCount) { |
30 | return { | 30 | return { |
31 | columns: [ | 31 | columns: [ |
32 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), | 32 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), |
33 | margin: [40, 0]}, | 33 | margin: [40, 0]}, |
34 | {text: currentPage + ' de ' + pageCount, | 34 | {text: currentPage + ' de ' + pageCount, |
35 | margin: [28, 0], alignment: 'right'} | 35 | margin: [28, 0], alignment: 'right'} |
36 | ] | 36 | ] |
37 | }; | 37 | }; |
38 | }, | 38 | }, |
39 | columnDefs: [ | 39 | columnDefs: [ |
40 | { | 40 | { |
41 | field: 'vehiculo', | 41 | field: 'vehiculo', |
42 | enableSorting: false, | 42 | enableSorting: false, |
43 | cellClass: function(grid, row, col) { | 43 | cellClass: function(grid, row, col) { |
44 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) | 44 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) |
45 | return 'yellow w-100'; | 45 | return 'yellow w-100'; |
46 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) | 46 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) |
47 | return 'red w-100'; | 47 | return 'red w-100'; |
48 | if (grid.getCellValue(row,col).indexOf('Fecha:') !== -1) | 48 | if (grid.getCellValue(row,col).indexOf('Fecha:') !== -1) |
49 | return 'green w-100'; | 49 | return 'green w-100'; |
50 | } | 50 | } |
51 | }, | 51 | }, |
52 | { | 52 | { |
53 | field: 'ltsRepartidos', | 53 | field: 'ltsRepartidos', |
54 | enableSorting: false, | 54 | enableSorting: false, |
55 | cellClass: function(grid, row, col) { | 55 | cellClass: function(grid, row, col) { |
56 | if (!grid.getCellValue(row,col)) | 56 | if (!grid.getCellValue(row,col)) |
57 | return 'd-none'; | 57 | return 'd-none'; |
58 | } | 58 | } |
59 | }, | 59 | }, |
60 | { | 60 | { |
61 | field: 'ltsOptimos', | 61 | field: 'ltsOptimos', |
62 | enableSorting: false, | 62 | enableSorting: false, |
63 | cellClass: function(grid, row, col) { | 63 | cellClass: function(grid, row, col) { |
64 | if (!grid.getCellValue(row,col)) | 64 | if (!grid.getCellValue(row,col)) |
65 | return 'd-none'; | 65 | return 'd-none'; |
66 | } | 66 | } |
67 | }, | 67 | }, |
68 | { | 68 | { |
69 | field: 'diferencia', | 69 | field: 'diferencia', |
70 | enableSorting: false, | 70 | enableSorting: false, |
71 | cellClass: function(grid, row, col) { | 71 | cellClass: function(grid, row, col) { |
72 | if (!grid.getCellValue(row,col)) | 72 | if (!grid.getCellValue(row,col)) |
73 | return 'd-none'; | 73 | return 'd-none'; |
74 | } | 74 | } |
75 | }, | 75 | }, |
76 | { | 76 | { |
77 | field: 'porcentaje', | 77 | field: 'porcentaje', |
78 | enableSorting: false, | 78 | enableSorting: false, |
79 | cellClass: function(grid, row, col) { | 79 | cellClass: function(grid, row, col) { |
80 | if (!grid.getCellValue(row,col)) | 80 | if (!grid.getCellValue(row,col)) |
81 | return 'd-none'; | 81 | return 'd-none'; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | ] | 84 | ] |
85 | }; | 85 | }; |
86 | 86 | ||
87 | $scope.generarInforme = function() { | 87 | $scope.generarInforme = function() { |
88 | $scope.generando = true; | 88 | $scope.generando = true; |
89 | focaModalInformeRepartoOptimoService | 89 | focaModalInformeRepartoOptimoService |
90 | .getInformeData($scope.params) | 90 | .getInformeData($scope.params) |
91 | .then(function(res) { | 91 | .then(function(res) { |
92 | var result = []; | 92 | var result = []; |
93 | 93 | ||
94 | res.data.forEach(function(sector) { | 94 | res.data.forEach(function(sector) { |
95 | if (!$scope.params.sector || | 95 | if (!$scope.params.sector || |
96 | $scope.params.sector.ID === sector.idSector) { | 96 | $scope.params.sector.ID === sector.idSector) { |
97 | //AGREGO SECTORES | 97 | //AGREGO SECTORES |
98 | result.push({ | 98 | result.push({ |
99 | vehiculo: 'Sector: ' + | 99 | vehiculo: 'Sector: ' + |
100 | $filter('rellenarDigitos')(sector.idSector, 2, '0') + | 100 | $filter('rellenarDigitos')(sector.idSector, 2, '0') + |
101 | ' - ' + sector.sector.trim() | 101 | ' - ' + sector.sector.trim() |
102 | }); | 102 | }); |
103 | if (!$scope.params.diferenciarProductos) | 103 | if (!$scope.params.diferenciarProductos) |
104 | sector.productos = unirProductos(sector.productos); | 104 | sector.productos = unirProductos(sector.productos); |
105 | 105 | ||
106 | sector.productos.forEach(function(producto) { | 106 | sector.productos.forEach(function(producto) { |
107 | //AGREGO PRODUCTOS | 107 | //AGREGO PRODUCTOS |
108 | if ($scope.params.diferenciarProductos) { | 108 | if ($scope.params.diferenciarProductos) { |
109 | result.push({ | 109 | result.push({ |
110 | vehiculo: 'Producto: ' + | 110 | vehiculo: 'Producto: ' + |
111 | producto.idProducto + | 111 | producto.idProducto + |
112 | ' - ' + producto.producto | 112 | ' - ' + producto.producto |
113 | }); | 113 | }); |
114 | } | 114 | } |
115 | if (!$scope.params.diferenciarMeses) { | 115 | if (!$scope.params.diferenciarMeses) { |
116 | producto.fechas = unirFechas(producto.fechas); | 116 | producto.fechas = unirFechas(producto.fechas); |
117 | } | 117 | } |
118 | producto.fechas.forEach(function(fecha) { | 118 | producto.fechas.forEach(function(fecha) { |
119 | //AGREGO FECHAS | 119 | //AGREGO FECHAS |
120 | if ($scope.params.diferenciarMeses) { | 120 | if ($scope.params.diferenciarMeses) { |
121 | result.push({ | 121 | result.push({ |
122 | vehiculo: | 122 | vehiculo: |
123 | 'Fecha: ' + fecha.month + ' - ' + fecha.year | 123 | 'Fecha: ' + fecha.month + ' - ' + fecha.year |
124 | }); | 124 | }); |
125 | } else { | 125 | } else { |
126 | result.push({ | 126 | result.push({ |
127 | vehiculo: | 127 | vehiculo: |
128 | 'Fecha: ' + fecha.year | 128 | 'Fecha: ' + fecha.year |
129 | }); | 129 | }); |
130 | } | 130 | } |
131 | fecha.vehiculos.forEach(function(vehiculo) { | 131 | fecha.vehiculos.forEach(function(vehiculo) { |
132 | //AGREGO VEHICULOS | 132 | //AGREGO VEHICULOS |
133 | result.push({ | 133 | result.push({ |
134 | vehiculo: vehiculo.vehiculo, | 134 | vehiculo: vehiculo.vehiculo, |
135 | ltsRepartidos: | 135 | ltsRepartidos: |
136 | $filter('number') | 136 | $filter('number') |
137 | (vehiculo.data.ltsRepartidos, 2), | 137 | (vehiculo.data.ltsRepartidos, 2), |
138 | ltsOptimos: | 138 | ltsOptimos: |
139 | $filter('number') | 139 | $filter('number') |
140 | (vehiculo.data.ltsOptimos, 2), | 140 | (vehiculo.data.ltsOptimos, 2), |
141 | diferencia: | 141 | diferencia: |
142 | $filter('number') | 142 | $filter('number') |
143 | (vehiculo.data.diferencia, 2), | 143 | (vehiculo.data.diferencia, 2), |
144 | porcentaje: | 144 | porcentaje: |
145 | $filter('number') | 145 | $filter('number') |
146 | (vehiculo.data.porcentaje, 2) + '%' | 146 | (vehiculo.data.porcentaje, 2) + '%' |
147 | }); | 147 | }); |
148 | }); | 148 | }); |
149 | }); | 149 | }); |
150 | }); | 150 | }); |
151 | } | 151 | } |
152 | }); | 152 | }); |
153 | 153 | ||
154 | $scope.gridOptions.data = result; | 154 | $scope.gridOptions.data = result; |
155 | $scope.generando = false; | 155 | $scope.generando = false; |
156 | $scope.buscar = false; | 156 | $scope.buscar = false; |
157 | }); | 157 | }); |
158 | }; | 158 | }; |
159 | 159 | ||
160 | $scope.seleccionarSector = function(key) { | 160 | $scope.seleccionarSector = function(key) { |
161 | if (key === 13) { | 161 | if (key === 13) { |
162 | var parametrosModal = { | 162 | var parametrosModal = { |
163 | titulo: 'Búsqueda de Sector', | 163 | titulo: 'Búsqueda de Sector', |
164 | searchText: $scope.params.sector.NOMBRE, | 164 | searchText: $scope.params.sector.NOMBRE, |
165 | query: '/sector', | 165 | query: '/sector', |
166 | columnas: [ | 166 | columnas: [ |
167 | { | 167 | { |
168 | nombre: 'Código', | 168 | nombre: 'Código', |
169 | propiedad: 'ID' | 169 | propiedad: 'ID' |
170 | }, | 170 | }, |
171 | { | 171 | { |
172 | nombre: 'Nombre', | 172 | nombre: 'Nombre', |
173 | propiedad: 'NOMBRE' | 173 | propiedad: 'NOMBRE' |
174 | } | 174 | } |
175 | ], | 175 | ], |
176 | size: 'md' | 176 | size: 'md' |
177 | }; | 177 | }; |
178 | focaModalService.modal(parametrosModal).then( | 178 | focaModalService.modal(parametrosModal).then( |
179 | function(sector) { | 179 | function(sector) { |
180 | $scope.params.sector = sector; | 180 | $scope.params.sector = sector; |
181 | }, function() {} | 181 | }, function() {} |
182 | ); | 182 | ); |
183 | } | 183 | } |
184 | }; | 184 | }; |
185 | $scope.clearSector = function() { | ||
186 | $scope.params.sector = undefined; | ||
187 | }; | ||
188 | $scope.volver = function() { | 185 | $scope.volver = function() { |
189 | $scope.buscar = true; | 186 | $scope.buscar = true; |
190 | }; | 187 | }; |
191 | $scope.cancel = function() { | 188 | $scope.cancel = function() { |
192 | $uibModalInstance.dismiss('Cancelar'); | 189 | $uibModalInstance.dismiss('Cancelar'); |
193 | }; | 190 | }; |
194 | 191 | ||
195 | function unirProductos(productos) { | 192 | function unirProductos(productos) { |
196 | var result = [{fechas: []}]; | 193 | var result = [{fechas: []}]; |
197 | productos.forEach(function(producto) { | 194 | productos.forEach(function(producto) { |
198 | producto.fechas.forEach(function(fecha) { | 195 | producto.fechas.forEach(function(fecha) { |
199 | var existe = result[0].fechas.filter(function(result) { | 196 | var existe = result[0].fechas.filter(function(result) { |
200 | return result.fecha === fecha.fecha; | 197 | return result.fecha === fecha.fecha; |
201 | }); | 198 | }); |
202 | if (existe.length) { | 199 | if (existe.length) { |
203 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 200 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
204 | } else { | 201 | } else { |
205 | result[0].fechas.push(fecha); | 202 | result[0].fechas.push(fecha); |
206 | } | 203 | } |
207 | 204 | ||
208 | }); | 205 | }); |
209 | }); | 206 | }); |
210 | result[0].fechas.forEach(function(fecha) { | 207 | result[0].fechas.forEach(function(fecha) { |
211 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); | 208 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); |
212 | }); | 209 | }); |
213 | return result; | 210 | return result; |
214 | } | 211 | } |
215 | 212 | ||
216 | function unirFechas(fechas) { | 213 | function unirFechas(fechas) { |
217 | var results = []; | 214 | var results = []; |
218 | fechas.forEach(function(fecha) { | 215 | fechas.forEach(function(fecha) { |
219 | var existe = results.filter(function(result) { | 216 | var existe = results.filter(function(result) { |
220 | return result.year === fecha.year; | 217 | return result.year === fecha.year; |
221 | }); | 218 | }); |
222 | 219 | ||
223 | if (existe.length) { | 220 | if (existe.length) { |
224 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 221 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
225 | } else { | 222 | } else { |
226 | results.push({ | 223 | results.push({ |
227 | year: fecha.year, | 224 | year: fecha.year, |
228 | vehiculos: fecha.vehiculos | 225 | vehiculos: fecha.vehiculos |
229 | }); | 226 | }); |
230 | } | 227 | } |
231 | }); | 228 | }); |
232 | 229 | ||
233 | results.forEach(function(result) { | 230 | results.forEach(function(result) { |
234 | result.vehiculos = unirVehiculos(result.vehiculos); | 231 | result.vehiculos = unirVehiculos(result.vehiculos); |
235 | }); | 232 | }); |
236 | return results; | 233 | return results; |
237 | } | 234 | } |
238 | 235 | ||
239 | function unirVehiculos(vehiculos) { | 236 | function unirVehiculos(vehiculos) { |
240 | var results = []; | 237 | var results = []; |
241 | vehiculos.forEach(function(vehiculo) { | 238 | vehiculos.forEach(function(vehiculo) { |
242 | var existe = results.filter(function(result) { | 239 | var existe = results.filter(function(result) { |
243 | return result.vehiculo === vehiculo.vehiculo; | 240 | return result.vehiculo === vehiculo.vehiculo; |
244 | }); | 241 | }); |
245 | 242 | ||
246 | if (existe.length) { | 243 | if (existe.length) { |
247 | existe[0].data.kms += vehiculo.data.kms; | 244 | existe[0].data.kms += vehiculo.data.kms; |
248 | existe[0].data.lts += vehiculo.data.lts; | 245 | existe[0].data.lts += vehiculo.data.lts; |
249 | existe[0].data.viajes += vehiculo.data.viajes; | 246 | existe[0].data.viajes += vehiculo.data.viajes; |
250 | } else { | 247 | } else { |
251 | results.push(vehiculo); | 248 | results.push(vehiculo); |
252 | } | 249 | } |
253 | }); | 250 | }); |
254 | return results; | 251 | return results; |
255 | } | 252 | } |
256 | } | 253 | } |
257 | ] | 254 | ] |
258 | ); | 255 | ); |
259 | 256 |
src/views/informe-chofer.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe de choferes</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe de choferes</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} | 6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} |
7 | </div> | 7 | </div> |
8 | </div> | 8 | </div> |
9 | </div> | 9 | </div> |
10 | <div class="modal-body" id="modal-body"> | 10 | <div class="modal-body" id="modal-body"> |
11 | <div class="input-group row" | 11 | <div class="input-group row" |
12 | ng-show="buscar"> | 12 | ng-show="buscar"> |
13 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 13 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
14 | <div class="col-md-4 col-8 input-group mb-2"> | 14 | <div class="col-md-4 col-8 input-group mb-3"> |
15 | <div class="input-group-prepend"> | 15 | <div class="input-group-prepend"> |
16 | <div class="input-group-text form-control-sm"> | 16 | <button |
17 | class="input-group-text" | ||
18 | type="button" | ||
19 | ng-click="datepickerOpen = true" | ||
20 | > | ||
17 | <i class="fa fa-calendar"></i> | 21 | <i class="fa fa-calendar"></i> |
18 | </div> | 22 | </button> |
19 | </div> | 23 | </div> |
20 | <input | 24 | <input |
21 | class="form-control form-control-sm" | 25 | class="form-control form-control-sm" |
22 | id="inlineFormInputGroup" | 26 | id="inlineFormInputGroup" |
23 | type="text" | 27 | type="text" |
24 | ng-model="fechaDesde" | 28 | ng-model="fechaDesde" |
25 | ng-required="true" | 29 | ng-required="true" |
26 | uib-datepicker-popup="dd/MM/yyyy" | 30 | uib-datepicker-popup="dd/MM/yyyy" |
27 | show-button-bar="false" | 31 | show-button-bar="false" |
28 | is-open="datepickerOpen" | 32 | is-open="datepickerOpen" |
29 | on-open-focus="false" | 33 | on-open-focus="false" |
30 | ng-focus="datepickerOpen = true" | 34 | ng-focus="datepickerOpen = true" |
31 | datepicker-options="dateOptions" | 35 | datepicker-options="dateOptions" |
32 | /> | 36 | /> |
33 | </div> | 37 | </div> |
34 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 38 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
35 | <div class="col-md-4 col-8 input-group mb-2"> | 39 | <div class="col-md-4 col-8 input-group mb-3"> |
36 | <div class="input-group-prepend"> | 40 | <div class="input-group-prepend"> |
37 | <div class="input-group-text form-control-sm"> | 41 | <button |
42 | class="input-group-text" | ||
43 | type="button" | ||
44 | ng-click="datepicker2Open = true" | ||
45 | > | ||
38 | <i class="fa fa-calendar"></i> | 46 | <i class="fa fa-calendar"></i> |
39 | </div> | 47 | </button> |
40 | </div> | 48 | </div> |
41 | <input | 49 | <input |
42 | class="form-control form-control-sm" | 50 | class="form-control form-control-sm" |
43 | id="inlineFormInputGroup" | 51 | id="inlineFormInputGroup" |
44 | type="text" | 52 | type="text" |
45 | ng-model="fechaHasta" | 53 | ng-model="fechaHasta" |
46 | ng-required="true" | 54 | ng-required="true" |
47 | uib-datepicker-popup="dd/MM/yyyy" | 55 | uib-datepicker-popup="dd/MM/yyyy" |
48 | show-button-bar="false" | 56 | show-button-bar="false" |
49 | is-open="datepicker2Open" | 57 | is-open="datepicker2Open" |
50 | on-open-focus="false" | 58 | on-open-focus="false" |
51 | ng-focus="datepicker2Open = true" | 59 | ng-focus="datepicker2Open = true" |
52 | /> | 60 | /> |
53 | </div> | 61 | </div> |
54 | </div> | 62 | </div> |
55 | <div | 63 | <div |
56 | ng-if="!buscar" | 64 | ng-if="!buscar" |
57 | class="row"> | 65 | class="row"> |
58 | <div class="col-12"> | 66 | <div class="col-12"> |
59 | <div | 67 | <div |
60 | class="gridInforme" | 68 | class="gridInforme" |
61 | ui-grid="gridOptions" | 69 | ui-grid="gridOptions" |
62 | ui-grid-exporter | 70 | ui-grid-exporter |
63 | ui-grid-resize-columns | 71 | ui-grid-resize-columns |
64 | ></div> | 72 | ></div> |
65 | </div> | 73 | </div> |
66 | </div> | 74 | </div> |
67 | </div> | 75 | </div> |
68 | <div class="modal-footer py-1"> | 76 | <div class="modal-footer py-1"> |
69 | <button | 77 | <button |
70 | ladda="generando" | 78 | ladda="generando" |
71 | class="btn btn-sm btn-secondary" | 79 | class="btn btn-sm btn-secondary" |
72 | type="button" | 80 | type="button" |
73 | ng-click="generarInforme()" | 81 | ng-click="generarInforme()" |
74 | ng-show="buscar">Generar</button> | 82 | ng-show="buscar">Generar</button> |
75 | <button | 83 | <button |
76 | class="btn btn-sm btn-secondary" | 84 | class="btn btn-sm btn-secondary" |
77 | type="button" | 85 | type="button" |
78 | ng-click="cancel()" | 86 | ng-click="cancel()" |
79 | ng-show="buscar">Salir</button> | 87 | ng-show="buscar">Salir</button> |
80 | <button | 88 | <button |
81 | class="btn btn-sm btn-secondary" | 89 | class="btn btn-sm btn-secondary" |
82 | type="button" | 90 | type="button" |
83 | ng-click="volver()" | 91 | ng-click="volver()" |
84 | ng-hide="buscar">Volver</button> | 92 | ng-hide="buscar">Volver</button> |
85 | </div> | 93 | </div> |
86 | 94 |
src/views/informe-general-unidad.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe general por unidad de reparto</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe general por unidad de reparto</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}} | 6 | Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}} |
7 | <span ng-if="params.sector">, Sector: {{params.sector.NOMBRE}}</span> | 7 | <span ng-if="params.sector">, Sector: {{params.sector.NOMBRE}}</span> |
8 | <span ng-if="params.diferenciarProductos">, Productos diferenciados</span> | 8 | <span ng-if="params.diferenciarProductos">, Productos diferenciados</span> |
9 | <span ng-if="params.diferenciarMeses">, Meses diferenciados</span> | 9 | <span ng-if="params.diferenciarMeses">, Meses diferenciados</span> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | <div class="modal-body" id="modal-body"> | 13 | <div class="modal-body" id="modal-body"> |
14 | 14 | ||
15 | <div class="input-group row" | 15 | <div class="input-group row" |
16 | ng-show="buscar"> | 16 | ng-show="buscar"> |
17 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 17 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
18 | <div class="col-md-4 col-8 input-group mb-2"> | 18 | <div class="col-md-4 col-8 input-group mb-3"> |
19 | <div class="input-group-prepend"> | 19 | <div class="input-group-prepend"> |
20 | <div class="input-group-text form-control-sm"> | 20 | <button |
21 | class="input-group-text" | ||
22 | type="button" | ||
23 | ng-click="datepickerOpen = true" | ||
24 | > | ||
21 | <i class="fa fa-calendar"></i> | 25 | <i class="fa fa-calendar"></i> |
22 | </div> | 26 | </button> |
23 | </div> | 27 | </div> |
24 | <input | 28 | <input |
25 | class="form-control form-control-sm" | 29 | class="form-control form-control-sm" |
26 | id="inlineFormInputGroup" | 30 | id="inlineFormInputGroup" |
27 | type="text" | 31 | type="text" |
28 | ng-model="params.fechaDesde" | 32 | ng-model="params.fechaDesde" |
29 | ng-required="true" | 33 | ng-required="true" |
30 | uib-datepicker-popup="dd/MM/yyyy" | 34 | uib-datepicker-popup="dd/MM/yyyy" |
31 | show-button-bar="false" | 35 | show-button-bar="false" |
32 | is-open="datepickerOpen" | 36 | is-open="datepickerOpen" |
33 | on-open-focus="false" | 37 | on-open-focus="false" |
34 | ng-focus="datepickerOpen = true" | 38 | ng-focus="datepickerOpen = true" |
35 | datepicker-options="dateOptions" | 39 | datepicker-options="dateOptions" |
36 | /> | 40 | /> |
37 | </div> | 41 | </div> |
38 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 42 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
39 | <div class="col-md-4 col-8 input-group mb-2"> | 43 | <div class="col-md-4 col-8 input-group mb-3"> |
40 | <div class="input-group-prepend"> | 44 | <div class="input-group-prepend"> |
41 | <div class="input-group-text form-control-sm"> | 45 | <button |
46 | class="input-group-text" | ||
47 | type="button" | ||
48 | ng-click="datepicker2Open = true" | ||
49 | > | ||
42 | <i class="fa fa-calendar"></i> | 50 | <i class="fa fa-calendar"></i> |
43 | </div> | 51 | </button> |
44 | </div> | 52 | </div> |
45 | <input | 53 | <input |
46 | class="form-control form-control-sm" | 54 | class="form-control form-control-sm" |
47 | id="inlineFormInputGroup" | 55 | id="inlineFormInputGroup" |
48 | type="text" | 56 | type="text" |
49 | ng-model="params.fechaHasta" | 57 | ng-model="params.fechaHasta" |
50 | ng-required="true" | 58 | ng-required="true" |
51 | uib-datepicker-popup="dd/MM/yyyy" | 59 | uib-datepicker-popup="dd/MM/yyyy" |
52 | show-button-bar="false" | 60 | show-button-bar="false" |
53 | is-open="datepicker2Open" | 61 | is-open="datepicker2Open" |
54 | on-open-focus="false" | 62 | on-open-focus="false" |
55 | ng-focus="datepicker2Open = true" | 63 | ng-focus="datepicker2Open = true" |
56 | /> | 64 | /> |
57 | </div> | 65 | </div> |
58 | <small class="col-md-2 col-4 text-left my-1">Sector</small> | 66 | <small class="col-md-2 col-4 text-left my-1">Sector</small> |
59 | <div class="col-md-4 col-8 input-group mb-2"> | 67 | <div class="col-md-4 col-8 input-group mb-3"> |
60 | <input | 68 | <input |
61 | class="form-control form-control-sm" | 69 | class="form-control form-control-sm" |
62 | id="inlineFormInputGroup" | 70 | id="inlineFormInputGroup" |
63 | type="text" | 71 | type="text" |
64 | ng-model="params.sector.NOMBRE" | 72 | ng-model="params.sector.NOMBRE" |
65 | ng-required="true" | 73 | ng-required="true" |
66 | ng-keypress="seleccionarSector($event.keyCode)" | 74 | ng-keypress="seleccionarSector($event.keyCode)" |
67 | /> | 75 | /> |
68 | <button type="button" class="clear-input text-danger" ng-click="clearSector()"> | 76 | <button |
69 | <i class="fa fa-times"></i> | 77 | ng-show="params.sector.NOMBRE.length >= 1" |
70 | </button> | 78 | type="button" |
79 | class="clear-input" | ||
80 | ng-click="params.sector.NOMBRE = ''" | ||
81 | > | ||
82 | <i class="fa fa-times"></i> | ||
83 | </button> | ||
71 | <div class="input-group-append"> | 84 | <div class="input-group-append"> |
72 | <div class="input-group-append" ng-hide="ingreso"> | 85 | <div class="input-group-append" ng-hide="ingreso"> |
73 | <button | 86 | <button |
74 | ladda="searchLoading" | 87 | ladda="searchLoading" |
75 | data-spinner-color="#FF0000" | 88 | data-spinner-color="#FF0000" |
76 | class="btn btn-outline-secondary" | 89 | class="btn btn-outline-secondary" |
77 | type="button" | 90 | type="button" |
78 | ng-click="seleccionarSector(13)"> | 91 | ng-click="seleccionarSector(13)"> |
79 | <i class="fa fa-search" aria-hidden="true"></i> | 92 | <i class="fa fa-search" aria-hidden="true"></i> |
80 | </button> | 93 | </button> |
81 | </div> | 94 | </div> |
82 | </div> | 95 | </div> |
83 | </div> | 96 | </div> |
84 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> | 97 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> |
85 | <div class="col-md-2 col-4 input-group mb-2"> | 98 | <div class="col-md-2 col-4 input-group mb-2"> |
86 | <div class="custom-control custom-checkbox ml-auto"> | 99 | <div class="custom-control custom-checkbox ml-auto"> |
87 | <input | 100 | <input |
88 | type="checkbox" | 101 | type="checkbox" |
89 | class="custom-control-input" | 102 | class="custom-control-input" |
90 | ng-model="params.diferenciarProductos" | 103 | ng-model="params.diferenciarProductos" |
91 | id="customCheck1"> | 104 | id="customCheck1"> |
92 | <label class="custom-control-label" for="customCheck1"></label> | 105 | <label class="custom-control-label" for="customCheck1"></label> |
93 | </div> | 106 | </div> |
94 | </div> | 107 | </div> |
95 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> | 108 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> |
96 | <div class="col-md-2 col-4 input-group mb-2"> | 109 | <div class="col-md-2 col-4 input-group mb-2"> |
97 | <div class="custom-control custom-checkbox ml-auto"> | 110 | <div class="custom-control custom-checkbox ml-auto"> |
98 | <input | 111 | <input |
99 | type="checkbox" | 112 | type="checkbox" |
100 | class="custom-control-input" | 113 | class="custom-control-input" |
101 | ng-model="params.diferenciarMeses" | 114 | ng-model="params.diferenciarMeses" |
102 | id="customCheck2"> | 115 | id="customCheck2"> |
103 | <label class="custom-control-label" for="customCheck2"></label> | 116 | <label class="custom-control-label" for="customCheck2"></label> |
104 | </div> | 117 | </div> |
105 | </div> | 118 | </div> |
106 | </div> | 119 | </div> |
107 | <div | 120 | <div |
108 | ng-if="!buscar" | 121 | ng-if="!buscar" |
109 | class="row"> | 122 | class="row"> |
110 | <div class="col-12"> | 123 | <div class="col-12"> |
111 | <div | 124 | <div |
112 | class="gridInforme" | 125 | class="gridInforme" |
113 | ui-grid="gridOptions" | 126 | ui-grid="gridOptions" |
114 | ui-grid-exporter | 127 | ui-grid-exporter |
115 | ui-grid-resize-columns | 128 | ui-grid-resize-columns |
116 | ></div> | 129 | ></div> |
117 | </div> | 130 | </div> |
118 | </div> | 131 | </div> |
119 | </div> | 132 | </div> |
120 | <div class="modal-footer py-1"> | 133 | <div class="modal-footer py-1"> |
121 | <button | 134 | <button |
122 | ladda="generando" | 135 | ladda="generando" |
123 | class="btn btn-sm btn-secondary" | 136 | class="btn btn-sm btn-secondary" |
124 | type="button" | 137 | type="button" |
125 | ng-click="generarInforme()" | 138 | ng-click="generarInforme()" |
126 | ng-show="buscar">Generar</button> | 139 | ng-show="buscar">Generar</button> |
127 | <button | 140 | <button |
128 | class="btn btn-sm btn-secondary" | 141 | class="btn btn-sm btn-secondary" |
129 | type="button" | 142 | type="button" |
130 | ng-click="cancel()" | 143 | ng-click="cancel()" |
131 | ng-show="buscar">Salir</button> | 144 | ng-show="buscar">Salir</button> |
132 | <button | 145 | <button |
133 | class="btn btn-sm btn-secondary" | 146 | class="btn btn-sm btn-secondary" |
134 | type="button" | 147 | type="button" |
135 | ng-click="volver()" | 148 | ng-click="volver()" |
136 | ng-hide="buscar">Volver</button> | 149 | ng-hide="buscar">Volver</button> |
137 | </div> | 150 | </div> |
138 | 151 |
src/views/informe-hoja-ruta.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe de correlatividad de hojas de ruta</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe de correlatividad de hojas de ruta</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} | 6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} |
7 | </div> | 7 | </div> |
8 | </div> | 8 | </div> |
9 | </div> | 9 | </div> |
10 | <div class="modal-body" id="modal-body"> | 10 | <div class="modal-body" id="modal-body"> |
11 | 11 | ||
12 | <div class="input-group row" | 12 | <div class="input-group row" |
13 | ng-show="buscar"> | 13 | ng-show="buscar"> |
14 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 14 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
15 | <div class="col-md-4 col-8 input-group mb-2"> | 15 | <div class="col-md-4 col-8 input-group mb-3"> |
16 | <div class="input-group-prepend"> | 16 | <div class="input-group-prepend"> |
17 | <div class="input-group-text form-control-sm"> | 17 | <button |
18 | class="input-group-text" | ||
19 | type="button" | ||
20 | ng-click="datepickerOpen = true" | ||
21 | > | ||
18 | <i class="fa fa-calendar"></i> | 22 | <i class="fa fa-calendar"></i> |
19 | </div> | 23 | </button> |
20 | </div> | 24 | </div> |
21 | <input | 25 | <input |
22 | class="form-control form-control-sm" | 26 | class="form-control form-control-sm" |
23 | id="inlineFormInputGroup" | 27 | id="inlineFormInputGroup" |
24 | ladda="searchLoading" | 28 | ladda="searchLoading" |
25 | type="text" | 29 | type="text" |
26 | ng-model="fechaDesde" | 30 | ng-model="fechaDesde" |
27 | ng-required="true" | 31 | ng-required="true" |
28 | uib-datepicker-popup="dd/MM/yyyy" | 32 | uib-datepicker-popup="dd/MM/yyyy" |
29 | show-button-bar="false" | 33 | show-button-bar="false" |
30 | is-open="datepickerOpen" | 34 | is-open="datepickerOpen" |
31 | on-open-focus="false" | 35 | on-open-focus="false" |
32 | ng-focus="datepickerOpen = true" | 36 | ng-focus="datepickerOpen = true" |
33 | datepicker-options="dateOptions" | 37 | datepicker-options="dateOptions" |
34 | /> | 38 | /> |
35 | </div> | 39 | </div> |
36 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 40 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
37 | <div class="col-md-4 col-8 input-group mb-2"> | 41 | <div class="col-md-4 col-8 input-group mb-3"> |
38 | <div class="input-group-prepend"> | 42 | <div class="input-group-prepend"> |
39 | <div class="input-group-text form-control-sm"> | 43 | <button |
44 | class="input-group-text" | ||
45 | type="button" | ||
46 | ng-click="datepicker2Open = true" | ||
47 | > | ||
40 | <i class="fa fa-calendar"></i> | 48 | <i class="fa fa-calendar"></i> |
41 | </div> | 49 | </button> |
42 | </div> | 50 | </div> |
43 | <input | 51 | <input |
44 | class="form-control form-control-sm" | 52 | class="form-control form-control-sm" |
45 | id="inlineFormInputGroup" | 53 | id="inlineFormInputGroup" |
46 | ladda="searchLoading" | 54 | ladda="searchLoading" |
47 | type="text" | 55 | type="text" |
48 | ng-model="fechaHasta" | 56 | ng-model="fechaHasta" |
49 | ng-required="true" | 57 | ng-required="true" |
50 | uib-datepicker-popup="dd/MM/yyyy" | 58 | uib-datepicker-popup="dd/MM/yyyy" |
51 | show-button-bar="false" | 59 | show-button-bar="false" |
52 | is-open="datepicker2Open" | 60 | is-open="datepicker2Open" |
53 | on-open-focus="false" | 61 | on-open-focus="false" |
54 | ng-focus="datepicker2Open = true" | 62 | ng-focus="datepicker2Open = true" |
55 | /> | 63 | /> |
56 | </div> | 64 | </div> |
57 | </div> | 65 | </div> |
58 | <div | 66 | <div |
59 | ng-if="!buscar" | 67 | ng-if="!buscar" |
60 | class="row"> | 68 | class="row"> |
61 | <div class="col-12"> | 69 | <div class="col-12"> |
62 | <div | 70 | <div |
63 | class="gridInforme" | 71 | class="gridInforme" |
64 | ui-grid="gridOptions" | 72 | ui-grid="gridOptions" |
65 | ui-grid-exporter | 73 | ui-grid-exporter |
66 | ui-grid-resize-columns | 74 | ui-grid-resize-columns |
67 | ></div> | 75 | ></div> |
68 | </div> | 76 | </div> |
69 | </div> | 77 | </div> |
70 | </div> | 78 | </div> |
71 | <div class="modal-footer py-1"> | 79 | <div class="modal-footer py-1"> |
72 | <button | 80 | <button |
73 | class="btn btn-sm btn-secondary" | 81 | class="btn btn-sm btn-secondary" |
74 | type="button" | 82 | type="button" |
75 | ng-click="generarInforme()" | 83 | ng-click="generarInforme()" |
76 | ng-show="buscar">Generar</button> | 84 | ng-show="buscar">Generar</button> |
77 | <button | 85 | <button |
78 | class="btn btn-sm btn-secondary" | 86 | class="btn btn-sm btn-secondary" |
79 | type="button" | 87 | type="button" |
80 | ng-click="cancel()" | 88 | ng-click="cancel()" |
81 | ng-show="buscar">Salir</button> | 89 | ng-show="buscar">Salir</button> |
82 | <button | 90 | <button |
83 | class="btn btn-sm btn-secondary" | 91 | class="btn btn-sm btn-secondary" |
84 | type="button" | 92 | type="button" |
85 | ng-click="volver()" | 93 | ng-click="volver()" |
86 | ng-hide="buscar">Volver</button> | 94 | ng-hide="buscar">Volver</button> |
87 | </div> | 95 | </div> |
88 | 96 |
src/views/informe-litros-km-unidad.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe de litros por km recorrido por unidad de reparto</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe de litros por km recorrido por unidad de reparto</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}, | 6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}, |
7 | Transportista : {{transportista.NOM}}, | 7 | Transportista : {{transportista.NOM}}, |
8 | Unidad: {{unidad.codigo}} | 8 | Unidad: {{unidad.codigo}} |
9 | </div> | 9 | </div> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | <div class="modal-body" id="modal-body"> | 12 | <div class="modal-body" id="modal-body"> |
13 | <div class="input-group row" | 13 | <div class="input-group row" |
14 | ng-show="buscar"> | 14 | ng-show="buscar"> |
15 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 15 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
16 | <div class="col-md-4 col-8 input-group mb-2"> | 16 | <div class="col-md-4 col-8 input-group mb-3"> |
17 | <div class="input-group-prepend"> | 17 | <div class="input-group-prepend"> |
18 | <div class="input-group-text form-control-sm"> | 18 | <button |
19 | class="input-group-text" | ||
20 | type="button" | ||
21 | ng-click="datepickerOpen = true" | ||
22 | > | ||
19 | <i class="fa fa-calendar"></i> | 23 | <i class="fa fa-calendar"></i> |
20 | </div> | 24 | </button> |
21 | </div> | 25 | </div> |
22 | <input | 26 | <input |
23 | class="form-control form-control-sm" | 27 | class="form-control form-control-sm" |
24 | id="inlineFormInputGroup" | 28 | id="inlineFormInputGroup" |
25 | type="text" | 29 | type="text" |
26 | ng-model="fechaDesde" | 30 | ng-model="fechaDesde" |
27 | ng-required="true" | 31 | ng-required="true" |
28 | uib-datepicker-popup="dd/MM/yyyy" | 32 | uib-datepicker-popup="dd/MM/yyyy" |
29 | show-button-bar="false" | 33 | show-button-bar="false" |
30 | is-open="datepickerOpen" | 34 | is-open="datepickerOpen" |
31 | on-open-focus="false" | 35 | on-open-focus="false" |
32 | ng-focus="datepickerOpen = true" | 36 | ng-focus="datepickerOpen = true" |
33 | datepicker-options="dateOptions" | 37 | datepicker-options="dateOptions" |
34 | /> | 38 | /> |
35 | </div> | 39 | </div> |
36 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 40 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
37 | <div class="col-md-4 col-8 input-group mb-2"> | 41 | <div class="col-md-4 col-8 input-group mb-3"> |
38 | <div class="input-group-prepend"> | 42 | <div class="input-group-prepend"> |
39 | <div class="input-group-text form-control-sm"> | 43 | <button |
44 | class="input-group-text" | ||
45 | type="button" | ||
46 | ng-click="datepicker2Open = true" | ||
47 | > | ||
40 | <i class="fa fa-calendar"></i> | 48 | <i class="fa fa-calendar"></i> |
41 | </div> | 49 | </button> |
42 | </div> | 50 | </div> |
43 | <input | 51 | <input |
44 | class="form-control form-control-sm" | 52 | class="form-control form-control-sm" |
45 | id="inlineFormInputGroup" | 53 | id="inlineFormInputGroup" |
46 | type="text" | 54 | type="text" |
47 | ng-model="fechaHasta" | 55 | ng-model="fechaHasta" |
48 | ng-required="true" | 56 | ng-required="true" |
49 | uib-datepicker-popup="dd/MM/yyyy" | 57 | uib-datepicker-popup="dd/MM/yyyy" |
50 | show-button-bar="false" | 58 | show-button-bar="false" |
51 | is-open="datepicker2Open" | 59 | is-open="datepicker2Open" |
52 | on-open-focus="false" | 60 | on-open-focus="false" |
53 | ng-focus="datepicker2Open = true" | 61 | ng-focus="datepicker2Open = true" |
54 | /> | 62 | /> |
55 | </div> | 63 | </div> |
56 | <small class="col-md-2 col-4 text-left my-1">Unidad</small> | 64 | <small class="col-md-2 col-4 text-left my-1">Unidad</small> |
57 | <div class="col-md-4 col-8 input-group mb-2"> | 65 | <div class="col-md-4 col-8 input-group mb-2"> |
58 | <input | 66 | <input |
59 | class="form-control form-control-sm" | 67 | class="form-control form-control-sm" |
60 | id="inlineFormInputGroup" | 68 | id="inlineFormInputGroup" |
61 | type="text" | 69 | type="text" |
62 | ng-model="unidad.codigo" | 70 | ng-model="unidad.codigo" |
63 | ng-required="true" | 71 | ng-required="true" |
64 | ng-keypress="seleccionarUnidad($event.keyCode)" | 72 | ng-keypress="seleccionarUnidad($event.keyCode)" |
65 | /> | 73 | /> |
74 | <button | ||
75 | ng-show="unidad.codigo.length >= 1" | ||
76 | type="button" | ||
77 | class="clear-input" | ||
78 | ng-click="unidad.codigo = ''" | ||
79 | > | ||
80 | <i class="fa fa-times"></i> | ||
81 | </button> | ||
66 | <div class="input-group-append"> | 82 | <div class="input-group-append"> |
67 | <div class="input-group-append" ng-hide="ingreso"> | 83 | <div class="input-group-append" ng-hide="ingreso"> |
68 | <button | 84 | <button |
69 | ladda="searchLoading" | 85 | ladda="searchLoading" |
70 | data-spinner-color="#FF0000" | 86 | data-spinner-color="#FF0000" |
71 | class="btn btn-outline-secondary" | 87 | class="btn btn-outline-secondary" |
72 | type="button" | 88 | type="button" |
73 | ng-click="seleccionarUnidad(13)"> | 89 | ng-click="seleccionarUnidad(13)"> |
74 | <i class="fa fa-search" aria-hidden="true"></i> | 90 | <i class="fa fa-search" aria-hidden="true"></i> |
75 | </button> | 91 | </button> |
76 | </div> | 92 | </div> |
77 | </div> | 93 | </div> |
78 | </div> | 94 | </div> |
79 | </div> | 95 | </div> |
80 | <div | 96 | <div |
81 | ng-if="!buscar" | 97 | ng-if="!buscar" |
82 | class="row"> | 98 | class="row"> |
83 | <div class="col-12"> | 99 | <div class="col-12"> |
84 | <div | 100 | <div |
85 | class="gridInforme" | 101 | class="gridInforme" |
86 | ui-grid="gridOptions" | 102 | ui-grid="gridOptions" |
87 | ui-grid-exporter | 103 | ui-grid-exporter |
88 | ui-grid-resize-columns | 104 | ui-grid-resize-columns |
89 | ></div> | 105 | ></div> |
90 | </div> | 106 | </div> |
91 | </div> | 107 | </div> |
92 | </div> | 108 | </div> |
93 | <div class="modal-footer py-1"> | 109 | <div class="modal-footer py-1"> |
94 | <button | 110 | <button |
95 | ladda="generando" | 111 | ladda="generando" |
96 | class="btn btn-sm btn-secondary" | 112 | class="btn btn-sm btn-secondary" |
97 | type="button" | 113 | type="button" |
98 | ng-click="generarInforme()" | 114 | ng-click="generarInforme()" |
99 | ng-show="buscar">Generar</button> | 115 | ng-show="buscar">Generar</button> |
100 | <button | 116 | <button |
101 | class="btn btn-sm btn-secondary" | 117 | class="btn btn-sm btn-secondary" |
102 | type="button" | 118 | type="button" |
103 | ng-click="cancel()" | 119 | ng-click="cancel()" |
104 | ng-show="buscar">Salir</button> | 120 | ng-show="buscar">Salir</button> |
105 | <button | 121 | <button |
106 | class="btn btn-sm btn-secondary" | 122 | class="btn btn-sm btn-secondary" |
107 | type="button" | 123 | type="button" |
108 | ng-click="volver()" | 124 | ng-click="volver()" |
109 | ng-hide="buscar">Volver</button> | 125 | ng-hide="buscar">Volver</button> |
110 | </div> | 126 | </div> |
111 | 127 |
src/views/informe-productividad.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe de productividad</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe de productividad</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}} | 6 | Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}} |
7 | <span ng-if="params.sector">, Sector: {{params.sector.NOMBRE}}</span> | 7 | <span ng-if="params.sector">, Sector: {{params.sector.NOMBRE}}</span> |
8 | <span ng-if="params.diferenciarProductos">, Productos diferenciados</span> | 8 | <span ng-if="params.diferenciarProductos">, Productos diferenciados</span> |
9 | <span ng-if="params.diferenciarMeses">, Meses diferenciados</span> | 9 | <span ng-if="params.diferenciarMeses">, Meses diferenciados</span> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | <div class="modal-body" id="modal-body"> | 13 | <div class="modal-body" id="modal-body"> |
14 | 14 | ||
15 | <div class="input-group row" | 15 | <div class="input-group row" |
16 | ng-show="buscar"> | 16 | ng-show="buscar"> |
17 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 17 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
18 | <div class="col-md-4 col-8 input-group mb-2"> | 18 | <div class="col-md-4 col-8 input-group mb-3"> |
19 | <div class="input-group-prepend"> | 19 | <div class="input-group-prepend"> |
20 | <div class="input-group-text form-control-sm"> | 20 | <button |
21 | class="input-group-text" | ||
22 | type="button" | ||
23 | ng-click="datepickerOpen = true" | ||
24 | > | ||
21 | <i class="fa fa-calendar"></i> | 25 | <i class="fa fa-calendar"></i> |
22 | </div> | 26 | </button> |
23 | </div> | 27 | </div> |
24 | <input | 28 | <input |
25 | class="form-control form-control-sm" | 29 | class="form-control form-control-sm" |
26 | id="inlineFormInputGroup" | 30 | id="inlineFormInputGroup" |
27 | type="text" | 31 | type="text" |
28 | ng-model="params.fechaDesde" | 32 | ng-model="params.fechaDesde" |
29 | ng-required="true" | 33 | ng-required="true" |
30 | uib-datepicker-popup="dd/MM/yyyy" | 34 | uib-datepicker-popup="dd/MM/yyyy" |
31 | show-button-bar="false" | 35 | show-button-bar="false" |
32 | is-open="datepickerOpen" | 36 | is-open="datepickerOpen" |
33 | on-open-focus="false" | 37 | on-open-focus="false" |
34 | ng-focus="datepickerOpen = true" | 38 | ng-focus="datepickerOpen = true" |
35 | datepicker-options="dateOptions" | 39 | datepicker-options="dateOptions" |
36 | /> | 40 | /> |
37 | </div> | 41 | </div> |
38 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 42 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
39 | <div class="col-md-4 col-8 input-group mb-2"> | 43 | <div class="col-md-4 col-8 input-group mb-3"> |
40 | <div class="input-group-prepend"> | 44 | <div class="input-group-prepend"> |
41 | <div class="input-group-text form-control-sm"> | 45 | <button |
46 | class="input-group-text" | ||
47 | type="button" | ||
48 | ng-click="datepicker2Open = true" | ||
49 | > | ||
42 | <i class="fa fa-calendar"></i> | 50 | <i class="fa fa-calendar"></i> |
43 | </div> | 51 | </button> |
44 | </div> | 52 | </div> |
45 | <input | 53 | <input |
46 | class="form-control form-control-sm" | 54 | class="form-control form-control-sm" |
47 | id="inlineFormInputGroup" | 55 | id="inlineFormInputGroup" |
48 | type="text" | 56 | type="text" |
49 | ng-model="params.fechaHasta" | 57 | ng-model="params.fechaHasta" |
50 | ng-required="true" | 58 | ng-required="true" |
51 | uib-datepicker-popup="dd/MM/yyyy" | 59 | uib-datepicker-popup="dd/MM/yyyy" |
52 | show-button-bar="false" | 60 | show-button-bar="false" |
53 | is-open="datepicker2Open" | 61 | is-open="datepicker2Open" |
54 | on-open-focus="false" | 62 | on-open-focus="false" |
55 | ng-focus="datepicker2Open = true" | 63 | ng-focus="datepicker2Open = true" |
56 | /> | 64 | /> |
57 | </div> | 65 | </div> |
58 | <small class="col-md-2 col-4 text-left my-1">Entidad</small> | 66 | <small class="col-md-2 col-4 text-left my-1">Entidad</small> |
59 | <div class="col-md-4 col-8 input-group mb-2"> | 67 | <div class="col-md-4 col-8 input-group mb-3"> |
60 | <input type="text" class="form-control" ng-model="params.entidad.label" readonly> | 68 | <input type="text" class="form-control form-control-sm" ng-model="params.entidad.label"> |
61 | <button type="button" class="clear-input text-danger" ng-click="clearEntidad()"> | 69 | <button |
70 | ng-show="params.entidad.label.length >= 1" | ||
71 | type="button" | ||
72 | class="clear-input" | ||
73 | ng-click="clearEntidad()" | ||
74 | > | ||
62 | <i class="fa fa-times"></i> | 75 | <i class="fa fa-times"></i> |
63 | </button> | 76 | </button> |
64 | <div class="input-group-append"> | 77 | <div class="input-group-append"> |
65 | <div class="input-group-append" ng-hide="ingreso"> | 78 | <div class="input-group-append" ng-hide="ingreso"> |
66 | <button | 79 | <button |
67 | ladda="searchLoading" | 80 | ladda="searchLoading" |
68 | data-spinner-color="#FF0000" | 81 | data-spinner-color="#FF0000" |
69 | class="btn btn-outline-secondary" | 82 | class="btn btn-outline-secondary" |
70 | type="button" | 83 | type="button" |
71 | ng-click="seleccionarTipo()"> | 84 | ng-click="seleccionarTipo()"> |
72 | <i class="fa fa-search" aria-hidden="true"></i> | 85 | <i class="fa fa-search" aria-hidden="true"></i> |
73 | </button> | 86 | </button> |
74 | </div> | 87 | </div> |
75 | </div> | 88 | </div> |
76 | </div> | 89 | </div> |
77 | </div> | 90 | </div> |
78 | <div | 91 | <div |
79 | ng-if="!buscar" | 92 | ng-if="!buscar" |
80 | class="row"> | 93 | class="row"> |
81 | <div class="col-12"> | 94 | <div class="col-12"> |
82 | <div | 95 | <div |
83 | class="gridInforme" | 96 | class="gridInforme" |
84 | ui-grid="gridOptions" | 97 | ui-grid="gridOptions" |
85 | ui-grid-exporter | 98 | ui-grid-exporter |
86 | ui-grid-resize-columns | 99 | ui-grid-resize-columns |
87 | ></div> | 100 | ></div> |
88 | </div> | 101 | </div> |
89 | </div> | 102 | </div> |
90 | </div> | 103 | </div> |
91 | <div class="modal-footer py-1"> | 104 | <div class="modal-footer py-1"> |
92 | <button | 105 | <button |
93 | ladda="generando" | 106 | ladda="generando" |
94 | class="btn btn-sm btn-secondary" | 107 | class="btn btn-sm btn-secondary" |
95 | type="button" | 108 | type="button" |
96 | ng-click="generarInforme()" | 109 | ng-click="generarInforme()" |
97 | ng-show="buscar">Generar</button> | 110 | ng-show="buscar">Generar</button> |
98 | <button | 111 | <button |
99 | class="btn btn-sm btn-secondary" | 112 | class="btn btn-sm btn-secondary" |
100 | type="button" | 113 | type="button" |
101 | ng-click="cancel()" | 114 | ng-click="cancel()" |
102 | ng-show="buscar">Salir</button> | 115 | ng-show="buscar">Salir</button> |
103 | <button | 116 | <button |
104 | class="btn btn-sm btn-secondary" | 117 | class="btn btn-sm btn-secondary" |
105 | type="button" | 118 | type="button" |
106 | ng-click="volver()" | 119 | ng-click="volver()" |
107 | ng-hide="buscar">Volver</button> | 120 | ng-hide="buscar">Volver</button> |
108 | </div> | 121 | </div> |
109 | 122 |
src/views/informe-reparto-optimo.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-12"><h5 class="modal-title">Informe de reparto óptimo detallado</h5></div> | 3 | <div class="col-12"><h5 class="modal-title">Informe de reparto óptimo detallado</h5></div> |
4 | <div class="col-12" ng-hide="buscar"> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | 5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, |
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}, | 6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}, |
7 | Transportista : {{transportista.NOM}}, | 7 | Transportista : {{transportista.NOM}}, |
8 | Unidad: {{unidad.codigo}} | 8 | Unidad: {{unidad.codigo}} |
9 | </div> | 9 | </div> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | <div class="modal-body" id="modal-body"> | 12 | <div class="modal-body" id="modal-body"> |
13 | <div class="input-group row" | 13 | <div class="input-group row" |
14 | ng-show="buscar"> | 14 | ng-show="buscar"> |
15 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 15 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
16 | <div class="col-md-4 col-8 input-group mb-2"> | 16 | <div class="col-md-4 col-8 input-group mb-3"> |
17 | <div class="input-group-prepend"> | 17 | <div class="input-group-prepend"> |
18 | <div class="input-group-text form-control-sm"> | 18 | <button |
19 | class="input-group-text" | ||
20 | type="button" | ||
21 | ng-click="datepickerOpen = true" | ||
22 | > | ||
19 | <i class="fa fa-calendar"></i> | 23 | <i class="fa fa-calendar"></i> |
20 | </div> | 24 | </button> |
21 | </div> | 25 | </div> |
22 | <input | 26 | <input |
23 | class="form-control form-control-sm" | 27 | class="form-control form-control-sm" |
24 | id="inlineFormInputGroup" | 28 | id="inlineFormInputGroup" |
25 | type="text" | 29 | type="text" |
26 | ng-model="params.fechaDesde" | 30 | ng-model="params.fechaDesde" |
27 | ng-required="true" | 31 | ng-required="true" |
28 | uib-datepicker-popup="dd/MM/yyyy" | 32 | uib-datepicker-popup="dd/MM/yyyy" |
29 | show-button-bar="false" | 33 | show-button-bar="false" |
30 | is-open="datepickerOpen" | 34 | is-open="datepickerOpen" |
31 | on-open-focus="false" | 35 | on-open-focus="false" |
32 | ng-focus="datepickerOpen = true" | 36 | ng-focus="datepickerOpen = true" |
33 | datepicker-options="dateOptions" | 37 | datepicker-options="dateOptions" |
34 | /> | 38 | /> |
35 | </div> | 39 | </div> |
36 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 40 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
37 | <div class="col-md-4 col-8 input-group mb-2"> | 41 | <div class="col-md-4 col-8 input-group mb-3"> |
38 | <div class="input-group-prepend"> | 42 | <div class="input-group-prepend"> |
39 | <div class="input-group-text form-control-sm"> | 43 | <button |
44 | class="input-group-text" | ||
45 | type="button" | ||
46 | ng-click="datepicker2Open = true" | ||
47 | > | ||
40 | <i class="fa fa-calendar"></i> | 48 | <i class="fa fa-calendar"></i> |
41 | </div> | 49 | </button> |
42 | </div> | 50 | </div> |
43 | <input | 51 | <input |
44 | class="form-control form-control-sm" | 52 | class="form-control form-control-sm" |
45 | id="inlineFormInputGroup" | 53 | id="inlineFormInputGroup" |
46 | type="text" | 54 | type="text" |
47 | ng-model="params.fechaHasta" | 55 | ng-model="params.fechaHasta" |
48 | ng-required="true" | 56 | ng-required="true" |
49 | uib-datepicker-popup="dd/MM/yyyy" | 57 | uib-datepicker-popup="dd/MM/yyyy" |
50 | show-button-bar="false" | 58 | show-button-bar="false" |
51 | is-open="datepicker2Open" | 59 | is-open="datepicker2Open" |
52 | on-open-focus="false" | 60 | on-open-focus="false" |
53 | ng-focus="datepicker2Open = true" | 61 | ng-focus="datepicker2Open = true" |
54 | /> | 62 | /> |
55 | </div> | 63 | </div> |
56 | <small class="col-md-2 col-4 text-left my-1">Sector</small> | 64 | <small class="col-md-2 col-4 text-left my-1">Sector</small> |
57 | <div class="col-md-4 col-8 input-group mb-2"> | 65 | <div class="col-md-4 col-8 input-group mb-3"> |
58 | <input | 66 | <input |
59 | class="form-control form-control-sm" | 67 | class="form-control form-control-sm" |
60 | id="inlineFormInputGroup" | 68 | id="inlineFormInputGroup" |
61 | type="text" | 69 | type="text" |
62 | ng-model="params.sector.NOMBRE" | 70 | ng-model="params.sector.NOMBRE" |
63 | ng-required="true" | 71 | ng-required="true" |
64 | ng-keypress="seleccionarSector($event.keyCode)" | 72 | ng-keypress="seleccionarSector($event.keyCode)" |
65 | /> | 73 | /> |
66 | <button type="button" class="clear-input text-danger" ng-click="clearSector()"> | 74 | <button |
75 | ng-show="params.sector.NOMBRE.length >= 1" | ||
76 | type="button" | ||
77 | class="clear-input" | ||
78 | ng-click="params.sector.NOMBRE = ''" | ||
79 | > | ||
67 | <i class="fa fa-times"></i> | 80 | <i class="fa fa-times"></i> |
68 | </button> | 81 | </button> |
69 | <div class="input-group-append"> | 82 | <div class="input-group-append"> |
70 | <div class="input-group-append" ng-hide="ingreso"> | 83 | <div class="input-group-append" ng-hide="ingreso"> |
71 | <button | 84 | <button |
72 | ladda="searchLoading" | 85 | ladda="searchLoading" |
73 | data-spinner-color="#FF0000" | 86 | data-spinner-color="#FF0000" |
74 | class="btn btn-outline-secondary" | 87 | class="btn btn-outline-secondary" |
75 | type="button" | 88 | type="button" |
76 | ng-click="seleccionarSector(13)"> | 89 | ng-click="seleccionarSector(13)"> |
77 | <i class="fa fa-search" aria-hidden="true"></i> | 90 | <i class="fa fa-search" aria-hidden="true"></i> |
78 | </button> | 91 | </button> |
79 | </div> | 92 | </div> |
80 | </div> | 93 | </div> |
81 | </div> | 94 | </div> |
82 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> | 95 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> |
83 | <div class="col-md-2 col-4 input-group mb-2"> | 96 | <div class="col-md-2 col-4 input-group mb-2"> |
84 | <div class="custom-control custom-checkbox ml-auto"> | 97 | <div class="custom-control custom-checkbox ml-auto"> |
85 | <input | 98 | <input |
86 | type="checkbox" | 99 | type="checkbox" |
87 | class="custom-control-input" | 100 | class="custom-control-input" |
88 | ng-model="params.diferenciarProductos" | 101 | ng-model="params.diferenciarProductos" |
89 | id="customCheck1"> | 102 | id="customCheck1"> |
90 | <label class="custom-control-label" for="customCheck1"></label> | 103 | <label class="custom-control-label" for="customCheck1"></label> |
91 | </div> | 104 | </div> |
92 | </div> | 105 | </div> |
93 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> | 106 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> |
94 | <div class="col-md-2 col-4 input-group mb-2"> | 107 | <div class="col-md-2 col-4 input-group mb-2"> |
95 | <div class="custom-control custom-checkbox ml-auto"> | 108 | <div class="custom-control custom-checkbox ml-auto"> |
96 | <input | 109 | <input |
97 | type="checkbox" | 110 | type="checkbox" |
98 | class="custom-control-input" | 111 | class="custom-control-input" |
99 | ng-model="params.diferenciarMeses" | 112 | ng-model="params.diferenciarMeses" |
100 | id="customCheck2"> | 113 | id="customCheck2"> |
101 | <label class="custom-control-label" for="customCheck2"></label> | 114 | <label class="custom-control-label" for="customCheck2"></label> |
102 | </div> | 115 | </div> |
103 | </div> | 116 | </div> |
104 | </div> | 117 | </div> |
105 | <div | 118 | <div |
106 | ng-if="!buscar" | 119 | ng-if="!buscar" |
107 | class="row"> | 120 | class="row"> |
108 | <div class="col-12"> | 121 | <div class="col-12"> |
109 | <div | 122 | <div |
110 | class="gridInforme" | 123 | class="gridInforme" |
111 | ui-grid="gridOptions" | 124 | ui-grid="gridOptions" |
112 | ui-grid-exporter | 125 | ui-grid-exporter |
113 | ui-grid-resize-columns | 126 | ui-grid-resize-columns |
114 | ></div> | 127 | ></div> |
115 | </div> | 128 | </div> |
116 | </div> | 129 | </div> |
117 | </div> | 130 | </div> |
118 | <div class="modal-footer py-1"> | 131 | <div class="modal-footer py-1"> |
119 | <button | 132 | <button |
120 | ladda="generando" | 133 | ladda="generando" |
121 | class="btn btn-sm btn-secondary" | 134 | class="btn btn-sm btn-secondary" |
122 | type="button" | 135 | type="button" |
123 | ng-click="generarInforme()" | 136 | ng-click="generarInforme()" |
124 | ng-show="buscar">Generar</button> | 137 | ng-show="buscar">Generar</button> |
125 | <button | 138 | <button |
126 | class="btn btn-sm btn-secondary" | 139 | class="btn btn-sm btn-secondary" |
127 | type="button" | 140 | type="button" |
128 | ng-click="cancel()" | 141 | ng-click="cancel()" |
129 | ng-show="buscar">Salir</button> | 142 | ng-show="buscar">Salir</button> |
130 | <button | 143 | <button |
131 | class="btn btn-sm btn-secondary" | 144 | class="btn btn-sm btn-secondary" |
132 | type="button" | 145 | type="button" |
133 | ng-click="volver()" | 146 | ng-click="volver()" |
134 | ng-hide="buscar">Volver</button> | 147 | ng-hide="buscar">Volver</button> |
135 | </div> | 148 | </div> |
136 | 149 |