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