Commit 84e5fd0867d828fbac681687976c2acca8989976
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request !2
Showing
6 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: undefined, |
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 | query: '/sector', | 149 | query: '/sector', |
150 | columnas: [ | 150 | columnas: [ |
151 | { | 151 | { |
152 | nombre: 'Código', | 152 | nombre: 'Código', |
153 | propiedad: 'ID' | 153 | propiedad: 'ID' |
154 | }, | 154 | }, |
155 | { | 155 | { |
156 | nombre: 'Nombre', | 156 | nombre: 'Nombre', |
157 | propiedad: 'NOMBRE' | 157 | propiedad: 'NOMBRE' |
158 | } | 158 | } |
159 | ], | 159 | ], |
160 | size: 'md' | 160 | size: 'md' |
161 | }; | 161 | }; |
162 | focaModalService.modal(parametrosModal).then( | 162 | focaModalService.modal(parametrosModal).then( |
163 | function(sector) { | 163 | function(sector) { |
164 | $scope.params.sector = sector; | 164 | $scope.params.sector = sector; |
165 | }, function() {} | 165 | }, function() {} |
166 | ); | 166 | ); |
167 | } | 167 | } |
168 | }; | 168 | }; |
169 | $scope.volver = function() { | 169 | $scope.volver = function() { |
170 | $scope.buscar = true; | 170 | $scope.buscar = true; |
171 | }; | 171 | }; |
172 | $scope.cancel = function() { | 172 | $scope.cancel = function() { |
173 | $uibModalInstance.dismiss('Cancelar'); | 173 | $uibModalInstance.dismiss('Cancelar'); |
174 | }; | 174 | }; |
175 | $scope.clearSector = function() { | ||
176 | $scope.params.sector = undefined; | ||
177 | }; | ||
175 | 178 | ||
176 | function unirProductos(productos) { | 179 | function unirProductos(productos) { |
177 | var result = [{fechas: []}]; | 180 | var result = [{fechas: []}]; |
178 | productos.forEach(function(producto) { | 181 | productos.forEach(function(producto) { |
179 | producto.fechas.forEach(function(fecha) { | 182 | producto.fechas.forEach(function(fecha) { |
180 | var existe = result[0].fechas.filter(function(result) { | 183 | var existe = result[0].fechas.filter(function(result) { |
181 | return result.fecha === fecha.fecha; | 184 | return result.fecha === fecha.fecha; |
182 | }); | 185 | }); |
183 | if (existe.length) { | 186 | if (existe.length) { |
184 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 187 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
185 | } else { | 188 | } else { |
186 | result[0].fechas.push(fecha); | 189 | result[0].fechas.push(fecha); |
187 | } | 190 | } |
188 | 191 | ||
189 | }); | 192 | }); |
190 | }); | 193 | }); |
191 | result[0].fechas.forEach(function(fecha) { | 194 | result[0].fechas.forEach(function(fecha) { |
192 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); | 195 | fecha.vehiculos = unirVehiculos(fecha.vehiculos); |
193 | }); | 196 | }); |
194 | return result; | 197 | return result; |
195 | } | 198 | } |
196 | 199 | ||
197 | function unirFechas(fechas) { | 200 | function unirFechas(fechas) { |
198 | var results = []; | 201 | var results = []; |
199 | fechas.forEach(function(fecha) { | 202 | fechas.forEach(function(fecha) { |
200 | var existe = results.filter(function(result) { | 203 | var existe = results.filter(function(result) { |
201 | return result.year === fecha.year; | 204 | return result.year === fecha.year; |
202 | }); | 205 | }); |
203 | 206 | ||
204 | if (existe.length) { | 207 | if (existe.length) { |
205 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); | 208 | existe[0].vehiculos = existe[0].vehiculos.concat(fecha.vehiculos); |
206 | } else { | 209 | } else { |
207 | results.push({ | 210 | results.push({ |
208 | year: fecha.year, | 211 | year: fecha.year, |
209 | vehiculos: fecha.vehiculos | 212 | vehiculos: fecha.vehiculos |
210 | }); | 213 | }); |
211 | } | 214 | } |
212 | }); | 215 | }); |
213 | 216 | ||
214 | results.forEach(function(result) { | 217 | results.forEach(function(result) { |
215 | result.vehiculos = unirVehiculos(result.vehiculos); | 218 | result.vehiculos = unirVehiculos(result.vehiculos); |
216 | }); | 219 | }); |
217 | return results; | 220 | return results; |
218 | } | 221 | } |
219 | 222 | ||
220 | function unirVehiculos(vehiculos) { | 223 | function unirVehiculos(vehiculos) { |
221 | var results = []; | 224 | var results = []; |
222 | vehiculos.forEach(function(vehiculo) { | 225 | vehiculos.forEach(function(vehiculo) { |
223 | var existe = results.filter(function(result) { | 226 | var existe = results.filter(function(result) { |
224 | return result.vehiculo === vehiculo.vehiculo; | 227 | return result.vehiculo === vehiculo.vehiculo; |
225 | }); | 228 | }); |
226 | 229 | ||
227 | if (existe.length) { | 230 | if (existe.length) { |
228 | existe[0].data.kms += vehiculo.data.kms; | 231 | existe[0].data.kms += vehiculo.data.kms; |
229 | existe[0].data.lts += vehiculo.data.lts; | 232 | existe[0].data.lts += vehiculo.data.lts; |
230 | existe[0].data.viajes += vehiculo.data.viajes; | 233 | existe[0].data.viajes += vehiculo.data.viajes; |
231 | } else { | 234 | } else { |
232 | results.push(vehiculo); | 235 | results.push(vehiculo); |
233 | } | 236 | } |
234 | }); | 237 | }); |
235 | return results; | 238 | return results; |
236 | } | 239 | } |
237 | 240 | ||
238 | 241 | ||
239 | } | 242 | } |
240 | ] | 243 | ] |
241 | ); | 244 | ); |
242 | 245 |
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.informe = {}; | 21 | $scope.informe = {}; |
22 | i18nService.setCurrentLang('es'); | 22 | i18nService.setCurrentLang('es'); |
23 | $scope.gridOptions = { | 23 | $scope.gridOptions = { |
24 | enableGridMenu: true, | 24 | enableGridMenu: true, |
25 | exporterMenuCsv: false, | 25 | exporterMenuCsv: false, |
26 | exporterPdfPageSize: 'A4', | 26 | exporterPdfPageSize: 'A4', |
27 | exporterPdfFooter: function (currentPage, pageCount) { | 27 | exporterPdfFooter: function (currentPage, pageCount) { |
28 | return { | 28 | return { |
29 | columns: [ | 29 | columns: [ |
30 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), | 30 | {text: $filter('date')(new Date(), 'dd/MM/yyyy'), |
31 | margin: [40, 0]}, | 31 | margin: [40, 0]}, |
32 | {text: currentPage + ' de ' + pageCount, | 32 | {text: currentPage + ' de ' + pageCount, |
33 | margin: [28, 0], alignment: 'right'} | 33 | margin: [28, 0], alignment: 'right'} |
34 | ] | 34 | ] |
35 | }; | 35 | }; |
36 | }, | 36 | }, |
37 | columnDefs: [ | 37 | columnDefs: [ |
38 | { | 38 | { |
39 | field: 'fecha', | 39 | field: 'fecha', |
40 | enableSorting: false, | 40 | enableSorting: false, |
41 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 41 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
42 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) | 42 | if (grid.getCellValue(row,col).indexOf('Sector:') !== -1) |
43 | return 'yellow w-100'; | 43 | return 'yellow w-100'; |
44 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) | 44 | if (grid.getCellValue(row,col).indexOf('Producto:') !== -1) |
45 | return 'red w-100'; | 45 | return 'red w-100'; |
46 | } | 46 | } |
47 | }, | 47 | }, |
48 | { | 48 | { |
49 | field: 'litrosRepartidos', | 49 | field: 'litrosRepartidos', |
50 | enableSorting: false, | 50 | enableSorting: false, |
51 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 51 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
52 | if (!grid.getCellValue(row,col)) | 52 | if (!grid.getCellValue(row,col)) |
53 | return 'd-none'; | 53 | return 'd-none'; |
54 | } | 54 | } |
55 | }, | 55 | }, |
56 | { | 56 | { |
57 | field: 'kmRecorridos', | 57 | field: 'kmRecorridos', |
58 | enableSorting: false, | 58 | enableSorting: false, |
59 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 59 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
60 | if (!grid.getCellValue(row,col)) | 60 | if (!grid.getCellValue(row,col)) |
61 | return 'd-none'; | 61 | return 'd-none'; |
62 | } | 62 | } |
63 | }, | 63 | }, |
64 | { | 64 | { |
65 | field: 'lts/Km', | 65 | field: 'lts/Km', |
66 | enableSorting: false, | 66 | enableSorting: false, |
67 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { | 67 | cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) { |
68 | if (!grid.getCellValue(row,col)) | 68 | if (!grid.getCellValue(row,col)) |
69 | return 'd-none'; | 69 | return 'd-none'; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | ] | 72 | ] |
73 | 73 | ||
74 | }; | 74 | }; |
75 | $scope.generarInforme = function() { | 75 | $scope.generarInforme = function() { |
76 | if(!$scope.unidad){ | 76 | if(!$scope.unidad){ |
77 | focaModalService.alert('Primero seleccione una unidad'); | 77 | focaModalService.alert('Primero seleccione una unidad'); |
78 | return; | 78 | return; |
79 | } | 79 | } |
80 | $scope.generando = true; | 80 | $scope.generando = true; |
81 | focaModalInformeLitrosKmUnidadService | 81 | focaModalInformeLitrosKmUnidadService |
82 | .getDescargas( | 82 | .getDescargas( |
83 | $scope.unidad.id, | 83 | $scope.unidad.id, |
84 | $scope.fechaDesde.toISOString().split('.')[0], | 84 | $scope.fechaDesde.toISOString().split('.')[0], |
85 | $scope.fechaHasta.toISOString().split('.')[0] | 85 | $scope.fechaHasta.toISOString().split('.')[0] |
86 | ) | 86 | ) |
87 | .then(function(res) { | 87 | .then(function(res) { |
88 | var result = []; | 88 | var result = []; |
89 | res.data.forEach(function(sector) { | 89 | res.data.forEach(function(sector) { |
90 | result.push({ | 90 | result.push({ |
91 | fecha: 'Sector: ' + | 91 | fecha: 'Sector: ' + |
92 | $filter('rellenarDigitos')(sector[0].articulo.CodSec, 2, '0') + | 92 | $filter('rellenarDigitos')(sector[0].articulo.CodSec, 2, '0') + |
93 | ' - ' + sector[0].articulo.sector.NOMBRE.trim() | 93 | ' - ' + sector[0].articulo.sector.NOMBRE.trim() |
94 | }); | 94 | }); |
95 | sector.forEach(function(cisternaCarga) { | 95 | sector.forEach(function(cisternaCarga) { |
96 | result.push({ | 96 | result.push({ |
97 | fecha: 'Producto: ' + | 97 | fecha: 'Producto: ' + |
98 | cisternaCarga.articulo.CodArt + | 98 | cisternaCarga.articulo.CodArt + |
99 | ' - ' + cisternaCarga.articulo.DetArt | 99 | ' - ' + cisternaCarga.articulo.DetArt |
100 | }); | 100 | }); |
101 | cisternaCarga.cisternaMovimientos.forEach(function(cisternaMovimiento) { | 101 | cisternaCarga.cisternaMovimientos.forEach(function(cisternaMovimiento) { |
102 | var lts = cisternaMovimiento.lts; | 102 | var lts = cisternaMovimiento.lts; |
103 | var kms = cisternaMovimiento.kms; | 103 | var kms = cisternaMovimiento.kms; |
104 | 104 | ||
105 | result.push({ | 105 | result.push({ |
106 | fecha: meses[cisternaMovimiento.month] + ' - ' + cisternaMovimiento.year, | 106 | fecha: meses[cisternaMovimiento.month] + ' - ' + cisternaMovimiento.year, |
107 | litrosRepartidos: $filter('number')(lts, 2), | 107 | litrosRepartidos: $filter('number')(lts, 2), |
108 | kmRecorridos: $filter('number')(kms, 2), | 108 | kmRecorridos: $filter('number')(kms, 2), |
109 | 'lts/Km': (kms) ? $filter('number')(lts / kms, 2) : lts | 109 | 'lts/Km': (kms) ? $filter('number')(lts / kms, 2) : lts |
110 | }); | 110 | }); |
111 | }); | 111 | }); |
112 | }); | 112 | }); |
113 | }); | 113 | }); |
114 | $scope.gridOptions.data = result; | 114 | $scope.gridOptions.data = result; |
115 | $scope.generando = false; | 115 | $scope.generando = false; |
116 | $scope.buscar = false; | 116 | $scope.buscar = false; |
117 | }); | 117 | }); |
118 | }; | 118 | }; |
119 | $scope.seleccionarTransportista = function() { | 119 | $scope.seleccionarTransportista = function() { |
120 | var parametrosModal = { | 120 | var parametrosModal = { |
121 | titulo: 'Búsqueda de Transportista', | 121 | titulo: 'Búsqueda de Transportista', |
122 | query: '/transportista', | 122 | query: '/transportista', |
123 | columnas: [ | 123 | columnas: [ |
124 | { | 124 | { |
125 | propiedad: 'COD', | 125 | propiedad: 'COD', |
126 | nombre: 'Código', | 126 | nombre: 'Código', |
127 | filtro: { | 127 | filtro: { |
128 | nombre: 'rellenarDigitos', | 128 | nombre: 'rellenarDigitos', |
129 | parametro: 5 | 129 | parametro: 5 |
130 | } | 130 | } |
131 | }, | 131 | }, |
132 | { | 132 | { |
133 | propiedad: 'NOM', | 133 | propiedad: 'NOM', |
134 | nombre: 'Nombre' | 134 | nombre: 'Nombre' |
135 | }, | 135 | }, |
136 | { | 136 | { |
137 | propiedad: 'CUIT', | 137 | propiedad: 'CUIT', |
138 | nombre: 'CUIT' | 138 | nombre: 'CUIT' |
139 | } | 139 | } |
140 | ], | 140 | ], |
141 | size: 'md' | 141 | size: 'md' |
142 | }; | 142 | }; |
143 | return focaModalService.modal(parametrosModal) | 143 | return focaModalService.modal(parametrosModal) |
144 | }; | 144 | }; |
145 | 145 | ||
146 | $scope.seleccionarUnidad = function() { | 146 | $scope.seleccionarUnidad = function() { |
147 | $scope.seleccionarTransportista().then( | 147 | $scope.seleccionarTransportista().then( |
148 | function(transportista) { | 148 | function(transportista) { |
149 | $scope.transportista = transportista; | ||
149 | var parametrosModal = { | 150 | var parametrosModal = { |
150 | titulo: 'Búsqueda de vehículos', | 151 | titulo: 'Búsqueda de vehículos', |
151 | query: '/vehiculo/transportista/' + transportista.COD, | 152 | query: '/vehiculo/transportista/' + transportista.COD, |
152 | columnas: [ | 153 | columnas: [ |
153 | { | 154 | { |
154 | propiedad: 'codigo', | 155 | propiedad: 'codigo', |
155 | nombre: 'Código' | 156 | nombre: 'Código' |
156 | }, | 157 | }, |
157 | { | 158 | { |
158 | propiedad: 'tractor', | 159 | propiedad: 'tractor', |
159 | nombre: 'Tractor' | 160 | nombre: 'Tractor' |
160 | }, | 161 | }, |
161 | { | 162 | { |
162 | propiedad: 'semi', | 163 | propiedad: 'semi', |
163 | nombre: 'Semi' | 164 | nombre: 'Semi' |
164 | }, | 165 | }, |
165 | { | 166 | { |
166 | propiedad: 'tractor', | 167 | propiedad: 'tractor', |
167 | nombre: 'Tractor' | 168 | nombre: 'Tractor' |
168 | } | 169 | } |
169 | ], | 170 | ], |
170 | size: 'md' | 171 | size: 'md' |
171 | }; | 172 | }; |
172 | focaModalService.modal(parametrosModal).then( | 173 | focaModalService.modal(parametrosModal).then( |
173 | function(unidad) { | 174 | function(unidad) { |
174 | $scope.unidad = unidad; | 175 | $scope.unidad = unidad; |
175 | }, function() { | 176 | }, function() { |
176 | $scope.seleccionarUnidad(); | 177 | $scope.seleccionarUnidad(); |
177 | }); | 178 | }); |
178 | }); | 179 | }); |
179 | }; | 180 | }; |
180 | $scope.volver = function() { | 181 | $scope.volver = function() { |
181 | $scope.buscar = true; | 182 | $scope.buscar = true; |
182 | }; | 183 | }; |
183 | $scope.cancel = function() { | 184 | $scope.cancel = function() { |
184 | $uibModalInstance.dismiss('Cancelar'); | 185 | $uibModalInstance.dismiss('Cancelar'); |
185 | }; | 186 | }; |
186 | } | 187 | } |
187 | ] | 188 | ] |
188 | ); | 189 | ); |
189 | 190 |
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-6" ng-bind="informe.nombreEmpresa" ng-hide="buscar"></div> | ||
4 | <div class="col-6 text-right" ng-bind="informe.direccionEmpresa" ng-hide="buscar"></div> | ||
5 | <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> |
6 | <div class="col-12" ng-hide="buscar">Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}} Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}</div> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | ||
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} | ||
7 | </div> | ||
7 | </div> | 8 | </div> |
8 | </div> | 9 | </div> |
9 | <div class="modal-body" id="modal-body"> | 10 | <div class="modal-body" id="modal-body"> |
10 | <div class="input-group row" | 11 | <div class="input-group row" |
11 | ng-show="buscar"> | 12 | ng-show="buscar"> |
12 | <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> |
13 | <div class="col-md-4 col-8 input-group mb-2"> | 14 | <div class="col-md-4 col-8 input-group mb-2"> |
14 | <div class="input-group-prepend"> | 15 | <div class="input-group-prepend"> |
15 | <div class="input-group-text form-control-sm"> | 16 | <div class="input-group-text form-control-sm"> |
16 | <i class="fa fa-calendar"></i> | 17 | <i class="fa fa-calendar"></i> |
17 | </div> | 18 | </div> |
18 | </div> | 19 | </div> |
19 | <input | 20 | <input |
20 | class="form-control form-control-sm" | 21 | class="form-control form-control-sm" |
21 | id="inlineFormInputGroup" | 22 | id="inlineFormInputGroup" |
22 | type="text" | 23 | type="text" |
23 | ng-model="fechaDesde" | 24 | ng-model="fechaDesde" |
24 | ng-required="true" | 25 | ng-required="true" |
25 | uib-datepicker-popup="dd/MM/yyyy" | 26 | uib-datepicker-popup="dd/MM/yyyy" |
26 | show-button-bar="false" | 27 | show-button-bar="false" |
27 | is-open="datepickerOpen" | 28 | is-open="datepickerOpen" |
28 | on-open-focus="false" | 29 | on-open-focus="false" |
29 | ng-focus="datepickerOpen = true" | 30 | ng-focus="datepickerOpen = true" |
30 | datepicker-options="dateOptions" | 31 | datepicker-options="dateOptions" |
31 | /> | 32 | /> |
32 | </div> | 33 | </div> |
33 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 34 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
34 | <div class="col-md-4 col-8 input-group mb-2"> | 35 | <div class="col-md-4 col-8 input-group mb-2"> |
35 | <div class="input-group-prepend"> | 36 | <div class="input-group-prepend"> |
36 | <div class="input-group-text form-control-sm"> | 37 | <div class="input-group-text form-control-sm"> |
37 | <i class="fa fa-calendar"></i> | 38 | <i class="fa fa-calendar"></i> |
38 | </div> | 39 | </div> |
39 | </div> | 40 | </div> |
40 | <input | 41 | <input |
41 | class="form-control form-control-sm" | 42 | class="form-control form-control-sm" |
42 | id="inlineFormInputGroup" | 43 | id="inlineFormInputGroup" |
43 | type="text" | 44 | type="text" |
44 | ng-model="fechaHasta" | 45 | ng-model="fechaHasta" |
45 | ng-required="true" | 46 | ng-required="true" |
46 | uib-datepicker-popup="dd/MM/yyyy" | 47 | uib-datepicker-popup="dd/MM/yyyy" |
47 | show-button-bar="false" | 48 | show-button-bar="false" |
48 | is-open="datepicker2Open" | 49 | is-open="datepicker2Open" |
49 | on-open-focus="false" | 50 | on-open-focus="false" |
50 | ng-focus="datepicker2Open = true" | 51 | ng-focus="datepicker2Open = true" |
51 | /> | 52 | /> |
52 | </div> | 53 | </div> |
53 | </div> | 54 | </div> |
54 | <div | 55 | <div |
55 | ng-if="!buscar" | 56 | ng-if="!buscar" |
56 | class="row"> | 57 | class="row"> |
57 | <div class="col-12"> | 58 | <div class="col-12"> |
58 | <div | 59 | <div |
59 | class="gridInforme" | 60 | class="gridInforme" |
60 | ui-grid="gridOptions" | 61 | ui-grid="gridOptions" |
61 | ui-grid-exporter | 62 | ui-grid-exporter |
62 | ui-grid-resize-columns | 63 | ui-grid-resize-columns |
63 | ></div> | 64 | ></div> |
64 | </div> | 65 | </div> |
65 | </div> | 66 | </div> |
66 | </div> | 67 | </div> |
67 | <div class="modal-footer py-1"> | 68 | <div class="modal-footer py-1"> |
68 | <button | 69 | <button |
69 | class="btn btn-sm btn-secondary" | 70 | class="btn btn-sm btn-secondary" |
70 | type="button" | 71 | type="button" |
71 | ng-click="cancel()" | 72 | ng-click="cancel()" |
72 | ng-show="buscar">Cancelar</button> | 73 | ng-show="buscar">Cancelar</button> |
73 | <button | 74 | <button |
74 | ladda="generando" | 75 | ladda="generando" |
75 | class="btn btn-sm btn-secondary" | 76 | class="btn btn-sm btn-secondary" |
76 | type="button" | 77 | type="button" |
77 | ng-click="generarInforme()" | 78 | ng-click="generarInforme()" |
78 | ng-show="buscar">Generar</button> | 79 | ng-show="buscar">Generar</button> |
79 | <button | 80 | <button |
80 | class="btn btn-sm btn-secondary" | 81 | class="btn btn-sm btn-secondary" |
81 | type="button" | 82 | type="button" |
82 | ng-click="volver()" | 83 | ng-click="volver()" |
83 | ng-hide="buscar">Volver</button> | 84 | ng-hide="buscar">Volver</button> |
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-6" ng-bind="informe.nombreEmpresa" ng-hide="buscar"></div> | ||
4 | <div class="col-6 text-right" ng-bind="informe.direccionEmpresa" ng-hide="buscar"></div> | ||
5 | <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> |
6 | <div class="col-12" ng-hide="buscar">Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}} Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}}</div> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{params.fechaDesde | date: 'dd/MM/yyyy'}}, | ||
6 | Fecha hasta: {{params.fechaHasta | date: 'dd/MM/yyyy'}} | ||
7 | <span ng-if="params.sector">, Sector: {{params.sector.NOMBRE}}</span> | ||
8 | <span ng-if="params.diferenciarProductos">, Productos diferenciados</span> | ||
9 | <span ng-if="params.diferenciarMeses">, Meses diferenciados</span> | ||
10 | </div> | ||
7 | </div> | 11 | </div> |
8 | </div> | 12 | </div> |
9 | <div class="modal-body" id="modal-body"> | 13 | <div class="modal-body" id="modal-body"> |
10 | 14 | ||
11 | <div class="input-group row" | 15 | <div class="input-group row" |
12 | ng-show="buscar"> | 16 | ng-show="buscar"> |
13 | <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> |
14 | <div class="col-md-4 col-8 input-group mb-2"> | 18 | <div class="col-md-4 col-8 input-group mb-2"> |
15 | <div class="input-group-prepend"> | 19 | <div class="input-group-prepend"> |
16 | <div class="input-group-text form-control-sm"> | 20 | <div class="input-group-text form-control-sm"> |
17 | <i class="fa fa-calendar"></i> | 21 | <i class="fa fa-calendar"></i> |
18 | </div> | 22 | </div> |
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="params.fechaDesde" | 28 | ng-model="params.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-2"> |
36 | <div class="input-group-prepend"> | 40 | <div class="input-group-prepend"> |
37 | <div class="input-group-text form-control-sm"> | 41 | <div class="input-group-text form-control-sm"> |
38 | <i class="fa fa-calendar"></i> | 42 | <i class="fa fa-calendar"></i> |
39 | </div> | 43 | </div> |
40 | </div> | 44 | </div> |
41 | <input | 45 | <input |
42 | class="form-control form-control-sm" | 46 | class="form-control form-control-sm" |
43 | id="inlineFormInputGroup" | 47 | id="inlineFormInputGroup" |
44 | type="text" | 48 | type="text" |
45 | ng-model="params.fechaHasta" | 49 | ng-model="params.fechaHasta" |
46 | ng-required="true" | 50 | ng-required="true" |
47 | uib-datepicker-popup="dd/MM/yyyy" | 51 | uib-datepicker-popup="dd/MM/yyyy" |
48 | show-button-bar="false" | 52 | show-button-bar="false" |
49 | is-open="datepicker2Open" | 53 | is-open="datepicker2Open" |
50 | on-open-focus="false" | 54 | on-open-focus="false" |
51 | ng-focus="datepicker2Open = true" | 55 | ng-focus="datepicker2Open = true" |
52 | /> | 56 | /> |
53 | </div> | 57 | </div> |
54 | <small class="col-md-2 col-4 text-left my-1">Sector</small> | 58 | <small class="col-md-2 col-4 text-left my-1">Sector</small> |
55 | <div class="col-md-4 col-8 input-group mb-2"> | 59 | <div class="col-md-4 col-8 input-group mb-2"> |
56 | <input | 60 | <input |
57 | class="form-control form-control-sm" | 61 | class="form-control form-control-sm" |
58 | id="inlineFormInputGroup" | 62 | id="inlineFormInputGroup" |
59 | type="text" | 63 | type="text" |
60 | ng-model="params.sector.NOMBRE" | 64 | ng-model="params.sector.NOMBRE" |
61 | ng-required="true" | 65 | ng-required="true" |
62 | ng-keypress="seleccionarSector($event.keyCode)" | 66 | ng-keypress="seleccionarSector($event.keyCode)" |
63 | /> | 67 | /> |
68 | <button type="button" class="clear-input text-danger" ng-click="clearSector()"> | ||
69 | <i class="fa fa-times"></i> | ||
70 | </button> | ||
64 | <div class="input-group-append"> | 71 | <div class="input-group-append"> |
65 | <div class="input-group-append" ng-hide="ingreso"> | 72 | <div class="input-group-append" ng-hide="ingreso"> |
66 | <button | 73 | <button |
67 | ladda="searchLoading" | 74 | ladda="searchLoading" |
68 | data-spinner-color="#FF0000" | 75 | data-spinner-color="#FF0000" |
69 | class="btn btn-outline-secondary" | 76 | class="btn btn-outline-secondary" |
70 | type="button" | 77 | type="button" |
71 | ng-click="seleccionarSector(13)"> | 78 | ng-click="seleccionarSector(13)"> |
72 | <i class="fa fa-search" aria-hidden="true"></i> | 79 | <i class="fa fa-search" aria-hidden="true"></i> |
73 | </button> | 80 | </button> |
74 | </div> | 81 | </div> |
75 | </div> | 82 | </div> |
76 | </div> | 83 | </div> |
77 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> | 84 | <small class="col-md-4 col-8 text-left my-1">Diferenciar productos</small> |
78 | <div class="col-md-2 col-4 input-group mb-2"> | 85 | <div class="col-md-2 col-4 input-group mb-2"> |
79 | <div class="custom-control custom-checkbox ml-auto"> | 86 | <div class="custom-control custom-checkbox ml-auto"> |
80 | <input | 87 | <input |
81 | type="checkbox" | 88 | type="checkbox" |
82 | class="custom-control-input" | 89 | class="custom-control-input" |
83 | ng-model="params.diferenciarProductos" | 90 | ng-model="params.diferenciarProductos" |
84 | id="customCheck1"> | 91 | id="customCheck1"> |
85 | <label class="custom-control-label" for="customCheck1"></label> | 92 | <label class="custom-control-label" for="customCheck1"></label> |
86 | </div> | 93 | </div> |
87 | </div> | 94 | </div> |
88 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> | 95 | <small class="col-md-4 col-8 text-left my-1">Detallar por mes</small> |
89 | <div class="col-md-2 col-4 input-group mb-2"> | 96 | <div class="col-md-2 col-4 input-group mb-2"> |
90 | <div class="custom-control custom-checkbox ml-auto"> | 97 | <div class="custom-control custom-checkbox ml-auto"> |
91 | <input | 98 | <input |
92 | type="checkbox" | 99 | type="checkbox" |
93 | class="custom-control-input" | 100 | class="custom-control-input" |
94 | ng-model="params.diferenciarMeses" | 101 | ng-model="params.diferenciarMeses" |
95 | id="customCheck2"> | 102 | id="customCheck2"> |
96 | <label class="custom-control-label" for="customCheck2"></label> | 103 | <label class="custom-control-label" for="customCheck2"></label> |
97 | </div> | 104 | </div> |
98 | </div> | 105 | </div> |
99 | </div> | 106 | </div> |
100 | <div | 107 | <div |
101 | ng-if="!buscar" | 108 | ng-if="!buscar" |
102 | class="row"> | 109 | class="row"> |
103 | <div class="col-12"> | 110 | <div class="col-12"> |
104 | <div | 111 | <div |
105 | class="gridInforme" | 112 | class="gridInforme" |
106 | ui-grid="gridOptions" | 113 | ui-grid="gridOptions" |
107 | ui-grid-exporter | 114 | ui-grid-exporter |
108 | ui-grid-resize-columns | 115 | ui-grid-resize-columns |
109 | ></div> | 116 | ></div> |
110 | </div> | 117 | </div> |
111 | </div> | 118 | </div> |
112 | </div> | 119 | </div> |
113 | <div class="modal-footer py-1"> | 120 | <div class="modal-footer py-1"> |
114 | <button | 121 | <button |
115 | class="btn btn-sm btn-secondary" | 122 | class="btn btn-sm btn-secondary" |
116 | type="button" | 123 | type="button" |
117 | ng-click="cancel()" | 124 | ng-click="cancel()" |
118 | ng-show="buscar">Cancelar</button> | 125 | ng-show="buscar">Cancelar</button> |
119 | <button | 126 | <button |
120 | ladda="generando" | 127 | ladda="generando" |
121 | class="btn btn-sm btn-secondary" | 128 | class="btn btn-sm btn-secondary" |
122 | type="button" | 129 | type="button" |
123 | ng-click="generarInforme()" | 130 | ng-click="generarInforme()" |
124 | ng-show="buscar">Generar</button> | 131 | ng-show="buscar">Generar</button> |
125 | <button | 132 | <button |
126 | class="btn btn-sm btn-secondary" | 133 | class="btn btn-sm btn-secondary" |
127 | type="button" | 134 | type="button" |
128 | ng-click="volver()" | 135 | ng-click="volver()" |
129 | ng-hide="buscar">Volver</button> | 136 | ng-hide="buscar">Volver</button> |
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-6" ng-bind="informe.nombreEmpresa" ng-hide="buscar"></div> | ||
4 | <div class="col-6 text-right" ng-bind="informe.direccionEmpresa" ng-hide="buscar"></div> | ||
5 | <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> |
6 | <div class="col-12" ng-hide="buscar">Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}} Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}</div> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | ||
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}} | ||
7 | </div> | ||
7 | </div> | 8 | </div> |
8 | </div> | 9 | </div> |
9 | <div class="modal-body" id="modal-body"> | 10 | <div class="modal-body" id="modal-body"> |
10 | 11 | ||
11 | <div class="input-group row" | 12 | <div class="input-group row" |
12 | ng-show="buscar"> | 13 | ng-show="buscar"> |
13 | <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> |
14 | <div class="col-md-4 col-8 input-group mb-2"> | 15 | <div class="col-md-4 col-8 input-group mb-2"> |
15 | <div class="input-group-prepend"> | 16 | <div class="input-group-prepend"> |
16 | <div class="input-group-text form-control-sm"> | 17 | <div class="input-group-text form-control-sm"> |
17 | <i class="fa fa-calendar"></i> | 18 | <i class="fa fa-calendar"></i> |
18 | </div> | 19 | </div> |
19 | </div> | 20 | </div> |
20 | <input | 21 | <input |
21 | class="form-control form-control-sm" | 22 | class="form-control form-control-sm" |
22 | id="inlineFormInputGroup" | 23 | id="inlineFormInputGroup" |
23 | ladda="searchLoading" | 24 | ladda="searchLoading" |
24 | type="text" | 25 | type="text" |
25 | ng-model="fechaDesde" | 26 | ng-model="fechaDesde" |
26 | ng-required="true" | 27 | ng-required="true" |
27 | uib-datepicker-popup="dd/MM/yyyy" | 28 | uib-datepicker-popup="dd/MM/yyyy" |
28 | show-button-bar="false" | 29 | show-button-bar="false" |
29 | is-open="datepickerOpen" | 30 | is-open="datepickerOpen" |
30 | on-open-focus="false" | 31 | on-open-focus="false" |
31 | ng-focus="datepickerOpen = true" | 32 | ng-focus="datepickerOpen = true" |
32 | datepicker-options="dateOptions" | 33 | datepicker-options="dateOptions" |
33 | /> | 34 | /> |
34 | </div> | 35 | </div> |
35 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 36 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
36 | <div class="col-md-4 col-8 input-group mb-2"> | 37 | <div class="col-md-4 col-8 input-group mb-2"> |
37 | <div class="input-group-prepend"> | 38 | <div class="input-group-prepend"> |
38 | <div class="input-group-text form-control-sm"> | 39 | <div class="input-group-text form-control-sm"> |
39 | <i class="fa fa-calendar"></i> | 40 | <i class="fa fa-calendar"></i> |
40 | </div> | 41 | </div> |
41 | </div> | 42 | </div> |
42 | <input | 43 | <input |
43 | class="form-control form-control-sm" | 44 | class="form-control form-control-sm" |
44 | id="inlineFormInputGroup" | 45 | id="inlineFormInputGroup" |
45 | ladda="searchLoading" | 46 | ladda="searchLoading" |
46 | type="text" | 47 | type="text" |
47 | ng-model="fechaHasta" | 48 | ng-model="fechaHasta" |
48 | ng-required="true" | 49 | ng-required="true" |
49 | uib-datepicker-popup="dd/MM/yyyy" | 50 | uib-datepicker-popup="dd/MM/yyyy" |
50 | show-button-bar="false" | 51 | show-button-bar="false" |
51 | is-open="datepicker2Open" | 52 | is-open="datepicker2Open" |
52 | on-open-focus="false" | 53 | on-open-focus="false" |
53 | ng-focus="datepicker2Open = true" | 54 | ng-focus="datepicker2Open = true" |
54 | /> | 55 | /> |
55 | </div> | 56 | </div> |
56 | </div> | 57 | </div> |
57 | <div | 58 | <div |
58 | ng-if="!buscar" | 59 | ng-if="!buscar" |
59 | class="row"> | 60 | class="row"> |
60 | <div class="col-12"> | 61 | <div class="col-12"> |
61 | <div | 62 | <div |
62 | class="gridInforme" | 63 | class="gridInforme" |
63 | ui-grid="gridOptions" | 64 | ui-grid="gridOptions" |
64 | ui-grid-exporter | 65 | ui-grid-exporter |
65 | ui-grid-resize-columns | 66 | ui-grid-resize-columns |
66 | ></div> | 67 | ></div> |
67 | </div> | 68 | </div> |
68 | </div> | 69 | </div> |
69 | </div> | 70 | </div> |
70 | <div class="modal-footer py-1"> | 71 | <div class="modal-footer py-1"> |
71 | <button | 72 | <button |
72 | class="btn btn-sm btn-secondary" | 73 | class="btn btn-sm btn-secondary" |
73 | type="button" | 74 | type="button" |
74 | ng-click="cancel()" | 75 | ng-click="cancel()" |
75 | ng-show="buscar">Cancelar</button> | 76 | ng-show="buscar">Cancelar</button> |
76 | <button | 77 | <button |
77 | class="btn btn-sm btn-secondary" | 78 | class="btn btn-sm btn-secondary" |
78 | type="button" | 79 | type="button" |
79 | ng-click="generarInforme()" | 80 | ng-click="generarInforme()" |
80 | ng-show="buscar">Generar</button> | 81 | ng-show="buscar">Generar</button> |
81 | <button | 82 | <button |
82 | class="btn btn-sm btn-secondary" | 83 | class="btn btn-sm btn-secondary" |
83 | type="button" | 84 | type="button" |
84 | ng-click="volver()" | 85 | ng-click="volver()" |
85 | ng-hide="buscar">Volver</button> | 86 | ng-hide="buscar">Volver</button> |
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-6" ng-bind="informe.nombreEmpresa" ng-hide="buscar"></div> | ||
4 | <div class="col-6 text-right" ng-bind="informe.direccionEmpresa" ng-hide="buscar"></div> | ||
5 | <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> |
6 | <div class="col-12" ng-hide="buscar">Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}} Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}</div> | 4 | <div class="col-12" ng-hide="buscar"> |
5 | Filtros: Fecha desde: {{fechaDesde | date: 'dd/MM/yyyy'}}, | ||
6 | Fecha hasta: {{fechaHasta | date: 'dd/MM/yyyy'}}, | ||
7 | Transportista : {{transportista.NOM}}, | ||
8 | Unidad: {{unidad.codigo}} | ||
9 | </div> | ||
7 | </div> | 10 | </div> |
8 | </div> | 11 | </div> |
9 | <div class="modal-body" id="modal-body"> | 12 | <div class="modal-body" id="modal-body"> |
10 | <div class="input-group row" | 13 | <div class="input-group row" |
11 | ng-show="buscar"> | 14 | ng-show="buscar"> |
12 | <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> |
13 | <div class="col-md-4 col-8 input-group mb-2"> | 16 | <div class="col-md-4 col-8 input-group mb-2"> |
14 | <div class="input-group-prepend"> | 17 | <div class="input-group-prepend"> |
15 | <div class="input-group-text form-control-sm"> | 18 | <div class="input-group-text form-control-sm"> |
16 | <i class="fa fa-calendar"></i> | 19 | <i class="fa fa-calendar"></i> |
17 | </div> | 20 | </div> |
18 | </div> | 21 | </div> |
19 | <input | 22 | <input |
20 | class="form-control form-control-sm" | 23 | class="form-control form-control-sm" |
21 | id="inlineFormInputGroup" | 24 | id="inlineFormInputGroup" |
22 | type="text" | 25 | type="text" |
23 | ng-model="fechaDesde" | 26 | ng-model="fechaDesde" |
24 | ng-required="true" | 27 | ng-required="true" |
25 | uib-datepicker-popup="dd/MM/yyyy" | 28 | uib-datepicker-popup="dd/MM/yyyy" |
26 | show-button-bar="false" | 29 | show-button-bar="false" |
27 | is-open="datepickerOpen" | 30 | is-open="datepickerOpen" |
28 | on-open-focus="false" | 31 | on-open-focus="false" |
29 | ng-focus="datepickerOpen = true" | 32 | ng-focus="datepickerOpen = true" |
30 | datepicker-options="dateOptions" | 33 | datepicker-options="dateOptions" |
31 | /> | 34 | /> |
32 | </div> | 35 | </div> |
33 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 36 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
34 | <div class="col-md-4 col-8 input-group mb-2"> | 37 | <div class="col-md-4 col-8 input-group mb-2"> |
35 | <div class="input-group-prepend"> | 38 | <div class="input-group-prepend"> |
36 | <div class="input-group-text form-control-sm"> | 39 | <div class="input-group-text form-control-sm"> |
37 | <i class="fa fa-calendar"></i> | 40 | <i class="fa fa-calendar"></i> |
38 | </div> | 41 | </div> |
39 | </div> | 42 | </div> |
40 | <input | 43 | <input |
41 | class="form-control form-control-sm" | 44 | class="form-control form-control-sm" |
42 | id="inlineFormInputGroup" | 45 | id="inlineFormInputGroup" |
43 | type="text" | 46 | type="text" |
44 | ng-model="fechaHasta" | 47 | ng-model="fechaHasta" |
45 | ng-required="true" | 48 | ng-required="true" |
46 | uib-datepicker-popup="dd/MM/yyyy" | 49 | uib-datepicker-popup="dd/MM/yyyy" |
47 | show-button-bar="false" | 50 | show-button-bar="false" |
48 | is-open="datepicker2Open" | 51 | is-open="datepicker2Open" |
49 | on-open-focus="false" | 52 | on-open-focus="false" |
50 | ng-focus="datepicker2Open = true" | 53 | ng-focus="datepicker2Open = true" |
51 | /> | 54 | /> |
52 | </div> | 55 | </div> |
53 | <small class="col-md-2 col-4 text-left my-1">Unidad</small> | 56 | <small class="col-md-2 col-4 text-left my-1">Unidad</small> |
54 | <div class="col-md-4 col-8 input-group mb-2"> | 57 | <div class="col-md-4 col-8 input-group mb-2"> |
55 | <input | 58 | <input |
56 | class="form-control form-control-sm" | 59 | class="form-control form-control-sm" |
57 | id="inlineFormInputGroup" | 60 | id="inlineFormInputGroup" |
58 | type="text" | 61 | type="text" |
59 | ng-model="unidad.codigo" | 62 | ng-model="unidad.codigo" |
60 | ng-required="true" | 63 | ng-required="true" |
61 | ng-keypress="seleccionarUnidad($event.keyCode)" | 64 | ng-keypress="seleccionarUnidad($event.keyCode)" |
62 | /> | 65 | /> |
63 | <div class="input-group-append"> | 66 | <div class="input-group-append"> |
64 | <div class="input-group-append" ng-hide="ingreso"> | 67 | <div class="input-group-append" ng-hide="ingreso"> |
65 | <button | 68 | <button |
66 | ladda="searchLoading" | 69 | ladda="searchLoading" |
67 | data-spinner-color="#FF0000" | 70 | data-spinner-color="#FF0000" |
68 | class="btn btn-outline-secondary" | 71 | class="btn btn-outline-secondary" |
69 | type="button" | 72 | type="button" |
70 | ng-click="seleccionarUnidad(13)"> | 73 | ng-click="seleccionarUnidad(13)"> |
71 | <i class="fa fa-search" aria-hidden="true"></i> | 74 | <i class="fa fa-search" aria-hidden="true"></i> |
72 | </button> | 75 | </button> |
73 | </div> | 76 | </div> |
74 | </div> | 77 | </div> |
75 | </div> | 78 | </div> |
76 | </div> | 79 | </div> |
77 | <div | 80 | <div |
78 | ng-if="!buscar" | 81 | ng-if="!buscar" |
79 | class="row"> | 82 | class="row"> |
80 | <div class="col-12"> | 83 | <div class="col-12"> |
81 | <div | 84 | <div |
82 | class="gridInforme" | 85 | class="gridInforme" |
83 | ui-grid="gridOptions" | 86 | ui-grid="gridOptions" |
84 | ui-grid-exporter | 87 | ui-grid-exporter |
85 | ui-grid-resize-columns | 88 | ui-grid-resize-columns |
86 | ></div> | 89 | ></div> |
87 | </div> | 90 | </div> |
88 | </div> | 91 | </div> |
89 | </div> | 92 | </div> |
90 | <div class="modal-footer py-1"> | 93 | <div class="modal-footer py-1"> |
91 | <button | 94 | <button |
92 | class="btn btn-sm btn-secondary" | 95 | class="btn btn-sm btn-secondary" |
93 | type="button" | 96 | type="button" |
94 | ng-click="cancel()" | 97 | ng-click="cancel()" |
95 | ng-show="buscar">Cancelar</button> | 98 | ng-show="buscar">Cancelar</button> |
96 | <button | 99 | <button |
97 | ladda="generando" | 100 | ladda="generando" |
98 | class="btn btn-sm btn-secondary" | 101 | class="btn btn-sm btn-secondary" |
99 | type="button" | 102 | type="button" |
100 | ng-click="generarInforme()" | 103 | ng-click="generarInforme()" |
101 | ng-show="buscar">Generar</button> | 104 | ng-show="buscar">Generar</button> |
102 | <button | 105 | <button |
103 | class="btn btn-sm btn-secondary" | 106 | class="btn btn-sm btn-secondary" |
104 | type="button" | 107 | type="button" |
105 | ng-click="volver()" | 108 | ng-click="volver()" |
106 | ng-hide="buscar">Volver</button> | 109 | ng-hide="buscar">Volver</button> |