Commit 6fda5af79c5ee9b61fa1f4801f44c053f49b5e7b
1 parent
faaeecf95f
Exists in
master
and in
2 other branches
arreglos de espacios
Showing
2 changed files
with
27 additions
and
29 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaModalRemito') | 1 | angular.module('focaModalRemito') |
2 | .controller('focaModalRemitoController', | 2 | .controller('focaModalRemitoController', |
3 | [ | 3 | [ |
4 | '$timeout', | 4 | '$timeout', |
5 | '$filter', | 5 | '$filter', |
6 | '$scope', | 6 | '$scope', |
7 | '$uibModalInstance', | 7 | '$uibModalInstance', |
8 | 'focaModalRemitoService', | 8 | 'focaModalRemitoService', |
9 | 'usadoPor', | 9 | 'usadoPor', |
10 | 'focaModalService', | 10 | 'focaModalService', |
11 | function($timeout, $filter, $scope, $uibModalInstance, | 11 | function ($timeout, $filter, $scope, $uibModalInstance, |
12 | focaModalRemitoService, usadoPor, focaModalService | 12 | focaModalRemitoService, usadoPor, focaModalService |
13 | ) { | 13 | ) { |
14 | var fecha = new Date(); | 14 | var fecha = new Date(); |
15 | $scope.fechaHasta = new Date(); | 15 | $scope.fechaHasta = new Date(); |
16 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); | 16 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); |
17 | $scope.filtersCliente = ''; | 17 | $scope.filtersCliente = ''; |
18 | $scope.filtersRemito = ''; | 18 | $scope.filtersRemito = ''; |
19 | $scope.remitos = []; | 19 | $scope.remitos = []; |
20 | $scope.isCollapsed = false; | 20 | $scope.isCollapsed = false; |
21 | $scope.verProductos = {}; | 21 | $scope.verProductos = {}; |
22 | $scope.primerBusqueda = false; | 22 | $scope.primerBusqueda = false; |
23 | $scope.searchLoading = false; | 23 | $scope.searchLoading = false; |
24 | // pagination | 24 | // pagination |
25 | $scope.numPerPage = 10; | 25 | $scope.numPerPage = 10; |
26 | $scope.currentPage = 1; | 26 | $scope.currentPage = 1; |
27 | $scope.filteredRemitos = []; | 27 | $scope.filteredRemitos = []; |
28 | $scope.currentPageRemitos = []; | 28 | $scope.currentPageRemitos = []; |
29 | $scope.selectedRemito = -1; | 29 | $scope.selectedRemito = -1; |
30 | 30 | ||
31 | //METODOS | 31 | //METODOS |
32 | $scope.busquedaPress = function(key) { | 32 | $scope.busquedaPress = function (key) { |
33 | if (key === 13) { | 33 | if (key === 13) { |
34 | if(!$scope.fechaDesde) { | 34 | if (!$scope.fechaDesde) { |
35 | focaModalService | 35 | focaModalService |
36 | .alert('INGRESE FECHA DESDE'); | 36 | .alert('INGRESE FECHA DESDE'); |
37 | return; | 37 | return; |
38 | } | 38 | } |
39 | if(!$scope.fechaHasta) { | 39 | if (!$scope.fechaHasta) { |
40 | focaModalService | 40 | focaModalService |
41 | .alert('INGRESE FECHA HASTA'); | 41 | .alert('INGRESE FECHA HASTA'); |
42 | return; | 42 | return; |
43 | } | 43 | } |
44 | if($scope.fechaDesde > $scope.fechaHasta) { | 44 | if ($scope.fechaDesde > $scope.fechaHasta) { |
45 | focaModalService | 45 | focaModalService |
46 | .alert('La fecha desde no puede ser mayor a la fecha hasta'); | 46 | .alert('La fecha desde no puede ser mayor a la fecha hasta'); |
47 | return; | 47 | return; |
48 | } | 48 | } |
49 | $scope.searchLoading = true; | 49 | $scope.searchLoading = true; |
50 | //TODO: usar filtros en vez de toISOString | 50 | //TODO: usar filtros en vez de toISOString |
51 | focaModalRemitoService | 51 | focaModalRemitoService |
52 | .getRemitos(usadoPor, $scope.fechaDesde.toISOString().split('.')[0], | 52 | .getRemitos(usadoPor, $scope.fechaDesde.toISOString().split('.')[0], |
53 | $scope.fechaHasta.toISOString().split('.')[0]) | 53 | $scope.fechaHasta.toISOString().split('.')[0]) |
54 | .then(llenarDatos); | 54 | .then(llenarDatos); |
55 | } | 55 | } |
56 | }; | 56 | }; |
57 | 57 | ||
58 | function llenarDatos(res) { | 58 | function llenarDatos(res) { |
59 | $scope.remitos = []; | 59 | $scope.remitos = []; |
60 | $scope.filteredRemitos = []; | 60 | $scope.filteredRemitos = []; |
61 | $scope.currentPageRemitos = []; | 61 | $scope.currentPageRemitos = []; |
62 | $scope.selectedRemito = -1; | 62 | $scope.selectedRemito = -1; |
63 | $scope.searchLoading = false; | 63 | $scope.searchLoading = false; |
64 | $scope.primerBusqueda = true; | 64 | $scope.primerBusqueda = true; |
65 | $scope.remitos = res.data; | 65 | $scope.remitos = res.data; |
66 | $scope.search(true); | 66 | $scope.search(true); |
67 | primera(); | 67 | primera(); |
68 | } | 68 | } |
69 | 69 | ||
70 | $scope.searchRemito = function(pressed) { | 70 | $scope.searchRemito = function (pressed) { |
71 | if($scope.remitos.length > 0) { | 71 | if ($scope.remitos.length > 0) { |
72 | $scope.filteredRemitos = $filter('filter')( | 72 | $scope.filteredRemitos = $filter('filter')( |
73 | $scope.remitos, | 73 | $scope.remitos, |
74 | {numeroRemito: $scope.filtersRemito} | 74 | { numeroRemito: $scope.filtersRemito } |
75 | ); | 75 | ); |
76 | 76 | ||
77 | if(pressed && $scope.filteredRemitos.length === 0){ | 77 | if (pressed && $scope.filteredRemitos.length === 0) { |
78 | $timeout(function() { | 78 | $timeout(function () { |
79 | angular.element('#search')[0].focus(); | 79 | angular.element('#search')[0].focus(); |
80 | $scope.filtersRemito = ''; | 80 | $scope.filtersRemito = ''; |
81 | }); | 81 | }); |
82 | } | 82 | } |
83 | 83 | ||
84 | $scope.lastPage = Math.ceil( | 84 | $scope.lastPage = Math.ceil( |
85 | $scope.filteredRemitos.length / $scope.numPerPage | 85 | $scope.filteredRemitos.length / $scope.numPerPage |
86 | ); | 86 | ); |
87 | 87 | ||
88 | $scope.resetPage(); | 88 | $scope.resetPage(); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | $scope.searchCliente = function(pressed) { | 92 | $scope.searchCliente = function (pressed) { |
93 | if($scope.remitos.length > 0) { | 93 | if ($scope.remitos.length > 0) { |
94 | $scope.filteredRemitos = $filter('filter')( | 94 | $scope.filteredRemitos = $filter('filter')( |
95 | $scope.remitos, | 95 | $scope.remitos, |
96 | {nombreCliente: $scope.filtersCliente} | 96 | { nombreCliente: $scope.filtersCliente } |
97 | ); | 97 | ); |
98 | 98 | ||
99 | if(pressed && $scope.filteredRemitos.length === 0){ | 99 | if (pressed && $scope.filteredRemitos.length === 0) { |
100 | $timeout(function() { | 100 | $timeout(function () { |
101 | angular.element('#search')[0].focus(); | 101 | angular.element('#search')[0].focus(); |
102 | $scope.filtersCliente = ''; | 102 | $scope.filtersCliente = ''; |
103 | }); | 103 | }); |
104 | } | 104 | } |
105 | 105 | ||
106 | $scope.lastPage = Math.ceil( | 106 | $scope.lastPage = Math.ceil( |
107 | $scope.filteredRemitos.length / $scope.numPerPage | 107 | $scope.filteredRemitos.length / $scope.numPerPage |
108 | ); | 108 | ); |
109 | 109 | ||
110 | $scope.resetPage(); | 110 | $scope.resetPage(); |
111 | } | 111 | } |
112 | }; | 112 | }; |
113 | 113 | ||
114 | $scope.resetPage = function() { | 114 | $scope.resetPage = function () { |
115 | $scope.currentPage = 1; | 115 | $scope.currentPage = 1; |
116 | $scope.selectPage(1); | 116 | $scope.selectPage(1); |
117 | }; | 117 | }; |
118 | 118 | ||
119 | $scope.selectPage = function(page) { | 119 | $scope.selectPage = function (page) { |
120 | var start = (page - 1) * $scope.numPerPage; | 120 | var start = (page - 1) * $scope.numPerPage; |
121 | var end = start + $scope.numPerPage; | 121 | var end = start + $scope.numPerPage; |
122 | $scope.paginas = []; | 122 | $scope.paginas = []; |
123 | $scope.paginas = calcularPages(page); | 123 | $scope.paginas = calcularPages(page); |
124 | $scope.currentPageRemitos = $scope.filteredRemitos.slice(start, end); | 124 | $scope.currentPageRemitos = $scope.filteredRemitos.slice(start, end); |
125 | $scope.currentPage = page; | 125 | $scope.currentPage = page; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | $scope.select = function(remito) { | 128 | $scope.select = function (remito) { |
129 | $uibModalInstance.close(remito); | 129 | $uibModalInstance.close(remito); |
130 | }; | 130 | }; |
131 | 131 | ||
132 | $scope.cancel = function() { | 132 | $scope.cancel = function () { |
133 | $uibModalInstance.dismiss('cancel'); | 133 | $uibModalInstance.dismiss('cancel'); |
134 | }; | 134 | }; |
135 | 135 | ||
136 | $scope.busquedaDown = function(key) { | 136 | $scope.busquedaDown = function (key) { |
137 | if (key === 40) { | 137 | if (key === 40) { |
138 | primera(key); | 138 | primera(key); |
139 | } | 139 | } |
140 | }; | 140 | }; |
141 | 141 | ||
142 | $scope.itemRemito = function(key) { | 142 | $scope.itemRemito = function (key) { |
143 | if (key === 38) { | 143 | if (key === 38) { |
144 | anterior(key); | 144 | anterior(key); |
145 | } | 145 | } |
146 | 146 | ||
147 | if (key === 40) { | 147 | if (key === 40) { |
148 | siguiente(key); | 148 | siguiente(key); |
149 | } | 149 | } |
150 | 150 | ||
151 | if (key === 37) { | 151 | if (key === 37) { |
152 | retrocederPagina(); | 152 | retrocederPagina(); |
153 | } | 153 | } |
154 | 154 | ||
155 | if (key === 39) { | 155 | if (key === 39) { |
156 | avanzarPagina(); | 156 | avanzarPagina(); |
157 | } | 157 | } |
158 | }; | 158 | }; |
159 | 159 | ||
160 | function calcularPages(paginaActual) { | 160 | function calcularPages(paginaActual) { |
161 | var paginas = []; | 161 | var paginas = []; |
162 | paginas.push(paginaActual); | 162 | paginas.push(paginaActual); |
163 | 163 | ||
164 | if (paginaActual - 1 > 1) { | 164 | if (paginaActual - 1 > 1) { |
165 | 165 | ||
166 | paginas.unshift(paginaActual - 1); | 166 | paginas.unshift(paginaActual - 1); |
167 | if (paginaActual - 2 > 1) { | 167 | if (paginaActual - 2 > 1) { |
168 | paginas.unshift(paginaActual - 2); | 168 | paginas.unshift(paginaActual - 2); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | if (paginaActual + 1 < $scope.lastPage) { | 172 | if (paginaActual + 1 < $scope.lastPage) { |
173 | paginas.push(paginaActual + 1); | 173 | paginas.push(paginaActual + 1); |
174 | if (paginaActual + 2 < $scope.lastPage) { | 174 | if (paginaActual + 2 < $scope.lastPage) { |
175 | paginas.push(paginaActual + 2); | 175 | paginas.push(paginaActual + 2); |
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | if (paginaActual !== 1) { | 179 | if (paginaActual !== 1) { |
180 | paginas.unshift(1); | 180 | paginas.unshift(1); |
181 | } | 181 | } |
182 | 182 | ||
183 | if (paginaActual !== $scope.lastPage) { | 183 | if (paginaActual !== $scope.lastPage) { |
184 | paginas.push($scope.lastPage); | 184 | paginas.push($scope.lastPage); |
185 | } | 185 | } |
186 | 186 | ||
187 | return paginas; | 187 | return paginas; |
188 | } | 188 | } |
189 | 189 | ||
190 | function primera() { | 190 | function primera() { |
191 | $scope.selectedRemito = 0; | 191 | $scope.selectedRemito = 0; |
192 | } | 192 | } |
193 | 193 | ||
194 | function anterior() { | 194 | function anterior() { |
195 | if ($scope.selectedRemito === 0 && $scope.currentPage > 1) { | 195 | if ($scope.selectedRemito === 0 && $scope.currentPage > 1) { |
196 | retrocederPagina(); | 196 | retrocederPagina(); |
197 | } else { | 197 | } else { |
198 | $scope.selectedRemito--; | 198 | $scope.selectedRemito--; |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
202 | function siguiente() { | 202 | function siguiente() { |
203 | if ($scope.selectedRemito < $scope.currentPageRemitos.length - 1 ) { | 203 | if ($scope.selectedRemito < $scope.currentPageRemitos.length - 1) { |
204 | $scope.selectedRemito++; | 204 | $scope.selectedRemito++; |
205 | } else { | 205 | } else { |
206 | avanzarPagina(); | 206 | avanzarPagina(); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | function retrocederPagina() { | 210 | function retrocederPagina() { |
211 | if ($scope.currentPage > 1) { | 211 | if ($scope.currentPage > 1) { |
212 | $scope.selectPage($scope.currentPage - 1); | 212 | $scope.selectPage($scope.currentPage - 1); |
213 | $scope.selectedRemito = $scope.numPerPage - 1; | 213 | $scope.selectedRemito = $scope.numPerPage - 1; |
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
217 | function avanzarPagina() { | 217 | function avanzarPagina() { |
218 | if ($scope.currentPage < $scope.lastPage) { | 218 | if ($scope.currentPage < $scope.lastPage) { |
219 | $scope.selectPage($scope.currentPage + 1); | 219 | $scope.selectPage($scope.currentPage + 1); |
220 | $scope.selectedRemito = 0; | 220 | $scope.selectedRemito = 0; |
221 | } | 221 | } |
222 | } | 222 | } |
223 | } | 223 | } |
224 | ] | 224 | ] |
225 | ); | 225 | ); |
226 | 226 |
src/views/foca-modal-remito.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-lg-6"> | 3 | <div class="col-lg-6"> |
4 | <h5 class="modal-title my-1">Búsqueda de Remito</h5> | 4 | <h5 class="modal-title my-1">Búsqueda de Remito</h5> |
5 | </div> | 5 | </div> |
6 | <div class="input-group col-lg-6 pr-0 my-2"> | 6 | <div class="input-group col-lg-6 pr-0 my-2"> |
7 | <div class="mr-4"> | 7 | <div class="mr-4"> |
8 | <input | 8 | <input |
9 | ladda="searchLoading" | 9 | ladda="searchLoading" |
10 | type="text" | 10 | type="text" |
11 | class="form-control form-control-sm" | 11 | class="form-control form-control-sm" |
12 | placeholder="CLIENTE" | 12 | placeholder="CLIENTE" |
13 | ng-model="filtersCliente" | 13 | ng-model="filtersCliente" |
14 | ng-change="searchCliente()" | 14 | ng-change="searchCliente()" |
15 | ng-keydown="busquedaDown($event.keyCode)" | 15 | ng-keydown="busquedaDown($event.keyCode)" |
16 | ng-keypress="busquedaPress($event.keyCode)" | 16 | ng-keypress="busquedaPress($event.keyCode)" |
17 | foca-focus="selectedRemito == -1" | 17 | foca-focus="selectedRemito == -1" |
18 | ng-focus="selectedRemito = -1" | 18 | ng-focus="selectedRemito = -1" |
19 | id="search" | 19 | id="search" |
20 | teclado-virtual | 20 | teclado-virtual |
21 | > | 21 | > |
22 | <button | 22 | <button |
23 | ng-show="filtersCliente.length >= 1" | 23 | ng-show="filtersCliente.length >= 1" |
24 | type="button" | 24 | type="button" |
25 | class="clear-input" | 25 | class="clear-input" |
26 | ng-click="filtersCliente = ''" | 26 | ng-click="filtersCliente = ''" |
27 | > | 27 | > |
28 | <i class="fa fa-times"></i> | 28 | <i class="fa fa-times"></i> |
29 | </button> | 29 | </button> |
30 | </div> | 30 | </div> |
31 | <input | 31 | <input |
32 | ladda="searchLoading" | 32 | ladda="searchLoading" |
33 | type="text" | 33 | type="text" |
34 | class="form-control form-control-sm" | 34 | class="form-control form-control-sm" |
35 | placeholder="REMITO" | 35 | placeholder="REMITO" |
36 | ng-model="filtersRemito" | 36 | ng-model="filtersRemito" |
37 | ng-change="searchRemito()" | 37 | ng-change="searchRemito()" |
38 | ng-keydown="busquedaDown($event.keyCode)" | 38 | ng-keydown="busquedaDown($event.keyCode)" |
39 | ng-keypress="busquedaPress($event.keyCode)" | 39 | ng-keypress="busquedaPress($event.keyCode)" |
40 | foca-focus="selectedRemito == -1" | 40 | foca-focus="selectedRemito == -1" |
41 | ng-focus="selectedRemito = -1" | 41 | ng-focus="selectedRemito = -1" |
42 | id="search" | 42 | id="search" |
43 | teclado-virtual | 43 | teclado-virtual |
44 | > | 44 | > |
45 | |||
46 | <button | 45 | <button |
47 | ng-show="filtersRemito.length >= 1" | 46 | ng-show="filtersRemito.length >= 1" |
48 | type="button" | 47 | type="button" |
49 | class="clear-input" | 48 | class="clear-input" |
50 | ng-click="filtersRemito = ''" | 49 | ng-click="filtersRemito = ''" |
51 | > | 50 | > |
52 | <i class="fa fa-times"></i> | 51 | <i class="fa fa-times"></i> |
53 | </button> | 52 | </button> |
54 | <div class="input-group-append"> | 53 | <div class="input-group-append"> |
55 | <button | 54 | <button |
56 | ladda="searchLoading" | 55 | ladda="searchLoading" |
57 | data-spinner-color="#FF0000" | 56 | data-spinner-color="#FF0000" |
58 | class="btn btn-outline-secondary" | 57 | class="btn btn-outline-secondary" |
59 | type="button" | 58 | type="button" |
60 | ng-click="busquedaPress(13)" | 59 | ng-click="busquedaPress(13)" |
61 | > | 60 | > |
62 | <i class="fa fa-search" aria-hidden="true"></i> | 61 | <i class="fa fa-search" aria-hidden="true"></i> |
63 | </button> | 62 | </button> |
64 | </div> | 63 | </div> |
65 | |||
66 | </div> | 64 | </div> |
67 | </div> | 65 | </div> |
68 | </div> | 66 | </div> |
69 | <div class="modal-body" id="modal-body"> | 67 | <div class="modal-body" id="modal-body"> |
70 | <div class="input-group row"> | 68 | <div class="input-group row"> |
71 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 69 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
72 | <div class="col-md-4 col-8 input-group mb-3"> | 70 | <div class="col-md-4 col-8 input-group mb-3"> |
73 | <div class="input-group-prepend"> | 71 | <div class="input-group-prepend"> |
74 | <button | 72 | <button |
75 | class="input-group-text" | 73 | class="input-group-text" |
76 | type="button" | 74 | type="button" |
77 | ng-click="datepickerOpen = true" | 75 | ng-click="datepickerOpen = true" |
78 | > | 76 | > |
79 | <i class="fa fa-calendar"></i> | 77 | <i class="fa fa-calendar"></i> |
80 | </button> | 78 | </button> |
81 | </div> | 79 | </div> |
82 | <input | 80 | <input |
83 | class="form-control form-control-sm" | 81 | class="form-control form-control-sm" |
84 | id="inlineFormInputGroup" | 82 | id="inlineFormInputGroup" |
85 | ladda="searchLoading" | 83 | ladda="searchLoading" |
86 | type="text" | 84 | type="text" |
87 | ng-model="fechaDesde" | 85 | ng-model="fechaDesde" |
88 | ng-required="true" | 86 | ng-required="true" |
89 | uib-datepicker-popup="dd/MM/yyyy" | 87 | uib-datepicker-popup="dd/MM/yyyy" |
90 | show-button-bar="false" | 88 | show-button-bar="false" |
91 | is-open="datepickerOpen" | 89 | is-open="datepickerOpen" |
92 | on-open-focus="false" | 90 | on-open-focus="false" |
93 | ng-focus="datepickerOpen = true" | 91 | ng-focus="datepickerOpen = true" |
94 | /> | 92 | /> |
95 | </div> | 93 | </div> |
96 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> | 94 | <small class="col-md-2 col-4 text-left my-1">Fecha Hasta</small> |
97 | <div class="col-md-4 col-8 input-group mb-3"> | 95 | <div class="col-md-4 col-8 input-group mb-3"> |
98 | <div class="input-group-prepend"> | 96 | <div class="input-group-prepend"> |
99 | <button | 97 | <button |
100 | class="input-group-text" | 98 | class="input-group-text" |
101 | type="button" | 99 | type="button" |
102 | ng-click="datepicker2Open = true" | 100 | ng-click="datepicker2Open = true" |
103 | > | 101 | > |
104 | <i class="fa fa-calendar"></i> | 102 | <i class="fa fa-calendar"></i> |
105 | </button> | 103 | </button> |
106 | </div> | 104 | </div> |
107 | <input | 105 | <input |
108 | class="form-control form-control-sm" | 106 | class="form-control form-control-sm" |
109 | id="inlineFormInputGroup" | 107 | id="inlineFormInputGroup" |
110 | ladda="searchLoading" | 108 | ladda="searchLoading" |
111 | type="text" | 109 | type="text" |
112 | ng-model="fechaHasta" | 110 | ng-model="fechaHasta" |
113 | ng-required="true" | 111 | ng-required="true" |
114 | uib-datepicker-popup="dd/MM/yyyy" | 112 | uib-datepicker-popup="dd/MM/yyyy" |
115 | show-button-bar="false" | 113 | show-button-bar="false" |
116 | is-open="datepicker2Open" | 114 | is-open="datepicker2Open" |
117 | on-open-focus="false" | 115 | on-open-focus="false" |
118 | ng-focus="datepicker2Open = true" | 116 | ng-focus="datepicker2Open = true" |
119 | /> | 117 | /> |
120 | </div> | 118 | </div> |
121 | </div> | 119 | </div> |
122 | <table ng-show="primerBusqueda" class="table table-hover table-sm"> | 120 | <table ng-show="primerBusqueda" class="table table-hover table-sm"> |
123 | <thead> | 121 | <thead> |
124 | <tr> | 122 | <tr> |
125 | <th>Fecha</th> | 123 | <th>Fecha</th> |
126 | <th>Cliente</th> | 124 | <th>Cliente</th> |
127 | <th>Comprobante</th> | 125 | <th>Comprobante</th> |
128 | <th>Importe</th> | 126 | <th>Importe</th> |
129 | <th></th> | 127 | <th></th> |
130 | <th></th> | 128 | <th></th> |
131 | </tr> | 129 | </tr> |
132 | </thead> | 130 | </thead> |
133 | <tbody> | 131 | <tbody> |
134 | <tr ng-show="currentPageRemitos.length == 0 && primerBusqueda"> | 132 | <tr ng-show="currentPageRemitos.length == 0 && primerBusqueda"> |
135 | <td colspan="5"> | 133 | <td colspan="5"> |
136 | No se encontraron resultados. | 134 | No se encontraron resultados. |
137 | </td> | 135 | </td> |
138 | </tr> | 136 | </tr> |
139 | <tr class="selectable" | 137 | <tr class="selectable" |
140 | ng-repeat-start="(key, remito) in currentPageRemitos" | 138 | ng-repeat-start="(key, remito) in currentPageRemitos" |
141 | > | 139 | > |
142 | <td ng-bind="remito.fechaRemito | date : 'dd/MM/yyyy'"></td> | 140 | <td ng-bind="remito.fechaRemito | date : 'dd/MM/yyyy'"></td> |
143 | <td ng-bind="remito.nombreCliente"></td> | 141 | <td ng-bind="remito.nombreCliente"></td> |
144 | <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> | 142 | <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> |
145 | <td ng-bind="remito.total | number: 2"></td> | 143 | <td ng-bind="remito.total | number: 2"></td> |
146 | <td> | 144 | <td> |
147 | <button | 145 | <button |
148 | type="button" | 146 | type="button" |
149 | class="btn btn-secondary btn-xs p-1" | 147 | class="btn btn-secondary btn-xs p-1" |
150 | ng-click="isCollapsed = !isCollapsed ; verProductos = remito.articulosRemito" | 148 | ng-click="isCollapsed = !isCollapsed ; verProductos = remito.articulosRemito" |
151 | ><i class="fa fa-eye"></i> | 149 | ><i class="fa fa-eye"></i> |
152 | </button> | 150 | </button> |
153 | </td> | 151 | </td> |
154 | <td> | 152 | <td> |
155 | <button ng-click="select(remito);" | 153 | <button ng-click="select(remito);" |
156 | type="button" | 154 | type="button" |
157 | class="btn btn-xs p-1 float-right" | 155 | class="btn btn-xs p-1 float-right" |
158 | ng-class="{ | 156 | ng-class="{ |
159 | 'btn-secondary': selectedRemito != key, | 157 | 'btn-secondary': selectedRemito != key, |
160 | 'btn-primary': selectedRemito == key | 158 | 'btn-primary': selectedRemito == key |
161 | }" | 159 | }" |
162 | foca-focus="selectedRemito == {{key}}" | 160 | foca-focus="selectedRemito == {{key}}" |
163 | ng-keydown="itemRemito($event.keyCode)" | 161 | ng-keydown="itemRemito($event.keyCode)" |
164 | > | 162 | > |
165 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 163 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
166 | </button> | 164 | </button> |
167 | </td> | 165 | </td> |
168 | </tr> | 166 | </tr> |
169 | <tr ng-repeat-end uib-collapse="!isCollapsed"> | 167 | <tr ng-repeat-end uib-collapse="!isCollapsed"> |
170 | <td colspan="6"> | 168 | <td colspan="6"> |
171 | <table class="table table-sm"> | 169 | <table class="table table-sm"> |
172 | <thead> | 170 | <thead> |
173 | <tr> | 171 | <tr> |
174 | <th>Código</th> | 172 | <th>Código</th> |
175 | <th>Descripción</th> | 173 | <th>Descripción</th> |
176 | <th>Cantidad</th> | 174 | <th>Cantidad</th> |
177 | </tr> | 175 | </tr> |
178 | </thead> | 176 | </thead> |
179 | <tbody> | 177 | <tbody> |
180 | <tr ng-repeat="(key, articulo) in verProductos"> | 178 | <tr ng-repeat="(key, articulo) in verProductos"> |
181 | <td>{{articulo.codigo}}</td> | 179 | <td>{{articulo.codigo}}</td> |
182 | <td>{{articulo.descripcion}}</td> | 180 | <td>{{articulo.descripcion}}</td> |
183 | <td>{{articulo.cantidad}}</td> | 181 | <td>{{articulo.cantidad}}</td> |
184 | </tr> | 182 | </tr> |
185 | </tbody> | 183 | </tbody> |
186 | </table> | 184 | </table> |
187 | </td> | 185 | </td> |
188 | </tr> | 186 | </tr> |
189 | </tbody> | 187 | </tbody> |
190 | </table> | 188 | </table> |
191 | </div> | 189 | </div> |
192 | <div class="modal-footer py-1"> | 190 | <div class="modal-footer py-1"> |
193 | <nav ng-show="currentPageRemitos.length > 0 && primerBusqueda" class="mr-auto"> | 191 | <nav ng-show="currentPageRemitos.length > 0 && primerBusqueda" class="mr-auto"> |
194 | <ul class="pagination pagination-sm justify-content mb-0"> | 192 | <ul class="pagination pagination-sm justify-content mb-0"> |
195 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 193 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
196 | <a | 194 | <a |
197 | class="page-link" | 195 | class="page-link" |
198 | href="javascript:void();" | 196 | href="javascript:void();" |
199 | ng-click="selectPage(currentPage - 1)" | 197 | ng-click="selectPage(currentPage - 1)" |
200 | > | 198 | > |
201 | <span aria-hidden="true">«</span> | 199 | <span aria-hidden="true">«</span> |
202 | <span class="sr-only">Anterior</span> | 200 | <span class="sr-only">Anterior</span> |
203 | </a> | 201 | </a> |
204 | </li> | 202 | </li> |
205 | <li | 203 | <li |
206 | class="page-item" | 204 | class="page-item" |
207 | ng-repeat="pagina in paginas" | 205 | ng-repeat="pagina in paginas" |
208 | ng-class="{'active': pagina == currentPage}" | 206 | ng-class="{'active': pagina == currentPage}" |
209 | > | 207 | > |
210 | <a | 208 | <a |
211 | class="page-link" | 209 | class="page-link" |
212 | href="javascript:void();" | 210 | href="javascript:void();" |
213 | ng-click="selectPage(pagina)" | 211 | ng-click="selectPage(pagina)" |
214 | ng-bind="pagina" | 212 | ng-bind="pagina" |
215 | ></a> | 213 | ></a> |
216 | </li> | 214 | </li> |
217 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 215 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
218 | <a | 216 | <a |
219 | class="page-link" | 217 | class="page-link" |
220 | href="javascript:void();" | 218 | href="javascript:void();" |
221 | ng-click="selectPage(currentPage + 1)" | 219 | ng-click="selectPage(currentPage + 1)" |
222 | > | 220 | > |
223 | <span aria-hidden="true">»</span> | 221 | <span aria-hidden="true">»</span> |
224 | <span class="sr-only">Siguiente</span> | 222 | <span class="sr-only">Siguiente</span> |
225 | </a> | 223 | </a> |
226 | </li> | 224 | </li> |
227 | </ul> | 225 | </ul> |
228 | </nav> | 226 | </nav> |
229 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 227 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
230 | </div> | 228 | </div> |
231 | 229 |