Commit 577a371ed7d328bafc6390f8488d19804b7fdf6c

Authored by Mauricio Cattafi
Exists in master

Merge branch 'develop' into 'master'

Develop

See merge request !15
1 { 1 {
2 "name": "foca-modal-remito", 2 "name": "foca-modal-remito",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "Modal para seleccion de remitos", 4 "description": "Modal para seleccion de remitos",
5 "scripts": { 5 "scripts": {
6 "refresh": "gulp uglify && cp tmp/foca-modal-remito.js ../wrapper-demo/node_modules/foca-modal-remito/dist/foca-modal-remito.min.js",
6 "test": "echo \"Error: no test specified\" && exit 1", 7 "test": "echo \"Error: no test specified\" && exit 1",
7 "gulp-pre-commit": "gulp pre-commit", 8 "gulp-pre-commit": "gulp pre-commit",
8 "compile": "gulp uglify", 9 "compile": "gulp uglify",
9 "postinstall": "npm run compile && gulp clean-post-install", 10 "postinstall": "npm run compile && gulp clean-post-install",
10 "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+ssh://git@git.focasoftware.com:npm/foca-directivas" 11 "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+ssh://git@git.focasoftware.com:npm/foca-directivas"
11 }, 12 },
12 "pre-commit": [ 13 "pre-commit": [
13 "gulp-pre-commit" 14 "gulp-pre-commit"
14 ], 15 ],
15 "repository": { 16 "repository": {
16 "type": "git", 17 "type": "git",
17 "url": "https://debo.suite.repo/modulos-npm/foca-modal-remito" 18 "url": "https://debo.suite.repo/modulos-npm/foca-modal-remito"
18 }, 19 },
19 "author": "Nicolás Guarnieri", 20 "author": "Nicolás Guarnieri",
20 "license": "ISC", 21 "license": "ISC",
21 "peerDependencies": { 22 "peerDependencies": {
22 "angular": "^1.7.4", 23 "angular": "^1.7.4",
23 "bootstrap": "^4.1.3", 24 "bootstrap": "^4.1.3",
24 "font-awesome": "^4.7.0", 25 "font-awesome": "^4.7.0",
25 "ui-bootstrap4": "^3.0.4", 26 "ui-bootstrap4": "^3.0.4",
26 "gulp": "^3.9.1", 27 "gulp": "^3.9.1",
27 "gulp-angular-templatecache": "^2.2.1", 28 "gulp-angular-templatecache": "^2.2.1",
28 "gulp-concat": "^2.6.1", 29 "gulp-concat": "^2.6.1",
29 "gulp-connect": "^5.6.1", 30 "gulp-connect": "^5.6.1",
30 "gulp-htmlmin": "^5.0.1", 31 "gulp-htmlmin": "^5.0.1",
31 "gulp-rename": "^1.4.0", 32 "gulp-rename": "^1.4.0",
32 "gulp-replace": "^1.0.0", 33 "gulp-replace": "^1.0.0",
33 "gulp-uglify": "^3.0.1", 34 "gulp-uglify": "^3.0.1",
34 "jquery": "^3.3.1", 35 "jquery": "^3.3.1",
35 "pump": "^3.0.0", 36 "pump": "^3.0.0",
36 "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git" 37 "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git"
37 }, 38 },
38 "devDependencies": { 39 "devDependencies": {
39 "angular": "^1.7.5", 40 "angular": "^1.7.5",
40 "angular-ladda": "^0.4.3", 41 "angular-ladda": "^0.4.3",
41 "bootstrap": "^4.1.3", 42 "bootstrap": "^4.1.3",
42 "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git", 43 "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git",
43 "font-awesome": "^4.7.0", 44 "font-awesome": "^4.7.0",
44 "gulp": "^3.9.1", 45 "gulp": "^3.9.1",
45 "gulp-angular-templatecache": "^2.2.5", 46 "gulp-angular-templatecache": "^2.2.5",
46 "gulp-clean": "^0.4.0", 47 "gulp-clean": "^0.4.0",
47 "gulp-concat": "^2.6.1", 48 "gulp-concat": "^2.6.1",
48 "gulp-connect": "^5.6.1", 49 "gulp-connect": "^5.6.1",
49 "gulp-htmlmin": "^5.0.1", 50 "gulp-htmlmin": "^5.0.1",
50 "gulp-jshint": "^2.1.0", 51 "gulp-jshint": "^2.1.0",
51 "gulp-rename": "^1.4.0", 52 "gulp-rename": "^1.4.0",
52 "gulp-replace": "^1.0.0", 53 "gulp-replace": "^1.0.0",
53 "gulp-uglify": "^3.0.1", 54 "gulp-uglify": "^3.0.1",
54 "jasmine-core": "^3.3.0", 55 "jasmine-core": "^3.3.0",
55 "jquery": "^3.3.1", 56 "jquery": "^3.3.1",
56 "jshint": "^2.9.6", 57 "jshint": "^2.9.6",
57 "ladda": "1.0.6", 58 "ladda": "1.0.6",
58 "pre-commit": "^1.2.2", 59 "pre-commit": "^1.2.2",
59 "pump": "^3.0.0", 60 "pump": "^3.0.0",
60 "ui-bootstrap4": "^3.0.5" 61 "ui-bootstrap4": "^3.0.5"
61 } 62 }
62 } 63 }
63 64
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.filters = ''; 17 $scope.filtersCliente = '';
18 $scope.filtersRemito = '';
18 $scope.remitos = []; 19 $scope.remitos = [];
19 $scope.isCollapsed = false; 20 $scope.isCollapsed = false;
20 $scope.verProductos = {}; 21 $scope.verProductos = {};
21 $scope.primerBusqueda = false; 22 $scope.primerBusqueda = false;
22 $scope.searchLoading = false; 23 $scope.searchLoading = false;
23 // pagination 24 // pagination
24 $scope.numPerPage = 10; 25 $scope.numPerPage = 10;
25 $scope.currentPage = 1; 26 $scope.currentPage = 1;
26 $scope.filteredRemitos = []; 27 $scope.filteredRemitos = [];
27 $scope.currentPageRemitos = []; 28 $scope.currentPageRemitos = [];
28 $scope.selectedRemito = -1; 29 $scope.selectedRemito = -1;
29 30
30 //METODOS 31 //METODOS
31 $scope.busquedaPress = function(key) { 32 $scope.busquedaPress = function (key) {
32 if (key === 13) { 33 if (key === 13) {
33 if(!$scope.fechaDesde) { 34 if (!$scope.fechaDesde) {
34 focaModalService 35 focaModalService
35 .alert('INGRESE FECHA DESDE'); 36 .alert('INGRESE FECHA DESDE');
36 return; 37 return;
37 } 38 }
38 if(!$scope.fechaHasta) { 39 if (!$scope.fechaHasta) {
39 focaModalService 40 focaModalService
40 .alert('INGRESE FECHA HASTA'); 41 .alert('INGRESE FECHA HASTA');
41 return; 42 return;
42 } 43 }
43 if($scope.fechaDesde > $scope.fechaHasta) { 44 if ($scope.fechaDesde > $scope.fechaHasta) {
44 focaModalService 45 focaModalService
45 .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');
46 return; 47 return;
47 } 48 }
48 $scope.searchLoading = true; 49 $scope.searchLoading = true;
49 //TODO: usar filtros en vez de toISOString 50 //TODO: usar filtros en vez de toISOString
50 focaModalRemitoService 51 focaModalRemitoService
51 .getRemitos(usadoPor, $scope.fechaDesde.toISOString().split('.')[0], 52 .getRemitos(usadoPor, $scope.fechaDesde.toISOString().split('.')[0],
52 $scope.fechaHasta.toISOString().split('.')[0]) 53 $scope.fechaHasta.toISOString().split('.')[0])
53 .then(llenarDatos); 54 .then(llenarDatos);
54 } 55 }
55 }; 56 };
57
56 function llenarDatos(res) { 58 function llenarDatos(res) {
57 $scope.remitos = []; 59 $scope.remitos = [];
58 $scope.filteredRemitos = []; 60 $scope.filteredRemitos = [];
59 $scope.currentPageRemitos = []; 61 $scope.currentPageRemitos = [];
60 $scope.selectedRemito = -1; 62 $scope.selectedRemito = -1;
61 $scope.searchLoading = false; 63 $scope.searchLoading = false;
62 $scope.primerBusqueda = true; 64 $scope.primerBusqueda = true;
63 $scope.remitos = res.data; 65 $scope.remitos = res.data;
64 $scope.search(true); 66 $scope.search(true);
65 primera(); 67 primera();
66 } 68 }
67 $scope.search = function(pressed) { 69
68 if($scope.remitos.length > 0) { 70 $scope.searchRemito = function (pressed) {
71 if ($scope.remitos.length > 0) {
69 $scope.filteredRemitos = $filter('filter')( 72 $scope.filteredRemitos = $filter('filter')(
70 $scope.remitos, 73 $scope.remitos,
71 {$: $scope.filters} 74 { numeroRemito: $scope.filtersRemito }
72 ); 75 );
73 76
74 if(pressed && $scope.filteredRemitos.length === 0){ 77 if (pressed && $scope.filteredRemitos.length === 0) {
75 $timeout(function() { 78 $timeout(function () {
76 angular.element('#search')[0].focus(); 79 angular.element('#search')[0].focus();
77 $scope.filters = ''; 80 $scope.filtersRemito = '';
81 });
82 }
83
84 $scope.lastPage = Math.ceil(
85 $scope.filteredRemitos.length / $scope.numPerPage
86 );
87
88 $scope.resetPage();
89 }
90 }
91
92 $scope.searchCliente = function (pressed) {
93 if ($scope.remitos.length > 0) {
94 $scope.filteredRemitos = $filter('filter')(
95 $scope.remitos,
96 { nombreCliente: $scope.filtersCliente }
97 );
98
99 if (pressed && $scope.filteredRemitos.length === 0) {
100 $timeout(function () {
101 angular.element('#search')[0].focus();
102 $scope.filtersCliente = '';
78 }); 103 });
79 } 104 }
80 105
81 $scope.lastPage = Math.ceil( 106 $scope.lastPage = Math.ceil(
82 $scope.filteredRemitos.length / $scope.numPerPage 107 $scope.filteredRemitos.length / $scope.numPerPage
83 ); 108 );
84 109
85 $scope.resetPage(); 110 $scope.resetPage();
86 } 111 }
87 }; 112 };
88 113
89 $scope.resetPage = function() { 114 $scope.resetPage = function () {
90 $scope.currentPage = 1; 115 $scope.currentPage = 1;
91 $scope.selectPage(1); 116 $scope.selectPage(1);
92 }; 117 };
93 118
94 $scope.selectPage = function(page) { 119 $scope.selectPage = function (page) {
95 var start = (page - 1) * $scope.numPerPage; 120 var start = (page - 1) * $scope.numPerPage;
96 var end = start + $scope.numPerPage; 121 var end = start + $scope.numPerPage;
97 $scope.paginas = []; 122 $scope.paginas = [];
98 $scope.paginas = calcularPages(page); 123 $scope.paginas = calcularPages(page);
99 $scope.currentPageRemitos = $scope.filteredRemitos.slice(start, end); 124 $scope.currentPageRemitos = $scope.filteredRemitos.slice(start, end);
100 $scope.currentPage = page; 125 $scope.currentPage = page;
101 }; 126 };
102 127
103 $scope.select = function(remito) { 128 $scope.select = function (remito) {
104 $uibModalInstance.close(remito); 129 $uibModalInstance.close(remito);
105 }; 130 };
106 131
107 $scope.cancel = function() { 132 $scope.cancel = function () {
108 $uibModalInstance.dismiss('cancel'); 133 $uibModalInstance.dismiss('cancel');
109 }; 134 };
110 135
111 $scope.busquedaDown = function(key) { 136 $scope.busquedaDown = function (key) {
112 if (key === 40) { 137 if (key === 40) {
113 primera(key); 138 primera(key);
114 } 139 }
115 }; 140 };
116 141
117 $scope.itemRemito = function(key) { 142 $scope.itemRemito = function (key) {
118 if (key === 38) { 143 if (key === 38) {
119 anterior(key); 144 anterior(key);
120 } 145 }
121 146
122 if (key === 40) { 147 if (key === 40) {
123 siguiente(key); 148 siguiente(key);
124 } 149 }
125 150
126 if (key === 37) { 151 if (key === 37) {
127 retrocederPagina(); 152 retrocederPagina();
128 } 153 }
129 154
130 if (key === 39) { 155 if (key === 39) {
131 avanzarPagina(); 156 avanzarPagina();
132 } 157 }
133 }; 158 };
134 159
135 function calcularPages(paginaActual) { 160 function calcularPages(paginaActual) {
136 var paginas = []; 161 var paginas = [];
137 paginas.push(paginaActual); 162 paginas.push(paginaActual);
138 163
139 if (paginaActual - 1 > 1) { 164 if (paginaActual - 1 > 1) {
140 165
141 paginas.unshift(paginaActual - 1); 166 paginas.unshift(paginaActual - 1);
142 if (paginaActual - 2 > 1) { 167 if (paginaActual - 2 > 1) {
143 paginas.unshift(paginaActual - 2); 168 paginas.unshift(paginaActual - 2);
144 } 169 }
145 } 170 }
146 171
147 if (paginaActual + 1 < $scope.lastPage) { 172 if (paginaActual + 1 < $scope.lastPage) {
148 paginas.push(paginaActual + 1); 173 paginas.push(paginaActual + 1);
149 if (paginaActual + 2 < $scope.lastPage) { 174 if (paginaActual + 2 < $scope.lastPage) {
150 paginas.push(paginaActual + 2); 175 paginas.push(paginaActual + 2);
151 } 176 }
152 } 177 }
153 178
154 if (paginaActual !== 1) { 179 if (paginaActual !== 1) {
155 paginas.unshift(1); 180 paginas.unshift(1);
156 } 181 }
157 182
158 if (paginaActual !== $scope.lastPage) { 183 if (paginaActual !== $scope.lastPage) {
159 paginas.push($scope.lastPage); 184 paginas.push($scope.lastPage);
160 } 185 }
161 186
162 return paginas; 187 return paginas;
163 } 188 }
164 189
165 function primera() { 190 function primera() {
166 $scope.selectedRemito = 0; 191 $scope.selectedRemito = 0;
167 } 192 }
168 193
169 function anterior() { 194 function anterior() {
170 if ($scope.selectedRemito === 0 && $scope.currentPage > 1) { 195 if ($scope.selectedRemito === 0 && $scope.currentPage > 1) {
171 retrocederPagina(); 196 retrocederPagina();
172 } else { 197 } else {
173 $scope.selectedRemito--; 198 $scope.selectedRemito--;
174 } 199 }
175 } 200 }
176 201
177 function siguiente() { 202 function siguiente() {
178 if ($scope.selectedRemito < $scope.currentPageRemitos.length - 1 ) { 203 if ($scope.selectedRemito < $scope.currentPageRemitos.length - 1) {
179 $scope.selectedRemito++; 204 $scope.selectedRemito++;
180 } else { 205 } else {
181 avanzarPagina(); 206 avanzarPagina();
182 } 207 }
183 } 208 }
184 209
185 function retrocederPagina() { 210 function retrocederPagina() {
186 if ($scope.currentPage > 1) { 211 if ($scope.currentPage > 1) {
187 $scope.selectPage($scope.currentPage - 1); 212 $scope.selectPage($scope.currentPage - 1);
188 $scope.selectedRemito = $scope.numPerPage - 1; 213 $scope.selectedRemito = $scope.numPerPage - 1;
189 } 214 }
190 } 215 }
191 216
192 function avanzarPagina() { 217 function avanzarPagina() {
193 if ($scope.currentPage < $scope.lastPage) { 218 if ($scope.currentPage < $scope.lastPage) {
194 $scope.selectPage($scope.currentPage + 1); 219 $scope.selectPage($scope.currentPage + 1);
195 $scope.selectedRemito = 0; 220 $scope.selectedRemito = 0;
196 } 221 }
197 } 222 }
198 } 223 }
199 ] 224 ]
200 ); 225 );
201 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">
8 <input
9 ladda="searchLoading"
10 type="text"
11 class="form-control form-control-sm"
12 placeholder="CLIENTE"
13 ng-model="filtersCliente"
14 ng-change="searchCliente()"
15 ng-keydown="busquedaDown($event.keyCode)"
16 ng-keypress="busquedaPress($event.keyCode)"
17 foca-focus="selectedRemito == -1"
18 ng-focus="selectedRemito = -1"
19 id="search"
20 teclado-virtual
21 >
22 <button
23 ng-show="filtersCliente.length >= 1"
24 type="button"
25 class="clear-input"
26 ng-click="filtersCliente = ''"
27 >
28 <i class="fa fa-times"></i>
29 </button>
30 </div>
7 <input 31 <input
8 ladda="searchLoading" 32 ladda="searchLoading"
9 type="text" 33 type="text"
10 class="form-control form-control-sm" 34 class="form-control form-control-sm"
11 placeholder="Razón social" 35 placeholder="REMITO"
12 ng-model="filters" 36 ng-model="filtersRemito"
13 ng-change="search()" 37 ng-change="searchRemito()"
14 ng-keydown="busquedaDown($event.keyCode)" 38 ng-keydown="busquedaDown($event.keyCode)"
15 ng-keypress="busquedaPress($event.keyCode)" 39 ng-keypress="busquedaPress($event.keyCode)"
16 foca-focus="selectedRemito == -1" 40 foca-focus="selectedRemito == -1"
17 ng-focus="selectedRemito = -1" 41 ng-focus="selectedRemito = -1"
18 id="search" 42 id="search"
19 teclado-virtual 43 teclado-virtual
20 > 44 >
21 <button 45 <button
22 ng-show="filters.length >= 1" 46 ng-show="filtersRemito.length >= 1"
23 type="button" 47 type="button"
24 class="clear-input" 48 class="clear-input"
25 ng-click="filters = ''" 49 ng-click="filtersRemito = ''"
26 > 50 >
27 <i class="fa fa-times"></i> 51 <i class="fa fa-times"></i>
28 </button> 52 </button>
29 <div class="input-group-append"> 53 <div class="input-group-append">
30 <button 54 <button
31 ladda="searchLoading" 55 ladda="searchLoading"
32 data-spinner-color="#FF0000" 56 data-spinner-color="#FF0000"
33 class="btn btn-outline-secondary" 57 class="btn btn-outline-secondary"
34 type="button" 58 type="button"
35 ng-click="busquedaPress(13)" 59 ng-click="busquedaPress(13)"
36 > 60 >
37 <i class="fa fa-search" aria-hidden="true"></i> 61 <i class="fa fa-search" aria-hidden="true"></i>
38 </button> 62 </button>
39 </div> 63 </div>
40 </div> 64 </div>
41 </div> 65 </div>
42
43 </div> 66 </div>
44 <div class="modal-body" id="modal-body"> 67 <div class="modal-body" id="modal-body">
45 <div class="input-group row"> 68 <div class="input-group row">
46 <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>
47 <div class="col-md-4 col-8 input-group mb-3"> 70 <div class="col-md-4 col-8 input-group mb-3">
48 <div class="input-group-prepend"> 71 <div class="input-group-prepend">
49 <button 72 <button
50 class="input-group-text" 73 class="input-group-text"
51 type="button" 74 type="button"
52 ng-click="datepickerOpen = true" 75 ng-click="datepickerOpen = true"
53 > 76 >
54 <i class="fa fa-calendar"></i> 77 <i class="fa fa-calendar"></i>
55 </button> 78 </button>
56 </div> 79 </div>
57 <input 80 <input
58 class="form-control form-control-sm" 81 class="form-control form-control-sm"
59 id="inlineFormInputGroup" 82 id="inlineFormInputGroup"
60 ladda="searchLoading" 83 ladda="searchLoading"
61 type="text" 84 type="text"
62 ng-model="fechaDesde" 85 ng-model="fechaDesde"
63 ng-required="true" 86 ng-required="true"
64 uib-datepicker-popup="dd/MM/yyyy" 87 uib-datepicker-popup="dd/MM/yyyy"
65 show-button-bar="false" 88 show-button-bar="false"
66 is-open="datepickerOpen" 89 is-open="datepickerOpen"
67 on-open-focus="false" 90 on-open-focus="false"
68 ng-focus="datepickerOpen = true" 91 ng-focus="datepickerOpen = true"
69 /> 92 />
70 </div> 93 </div>
71 <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>
72 <div class="col-md-4 col-8 input-group mb-3"> 95 <div class="col-md-4 col-8 input-group mb-3">
73 <div class="input-group-prepend"> 96 <div class="input-group-prepend">
74 <button 97 <button
75 class="input-group-text" 98 class="input-group-text"
76 type="button" 99 type="button"
77 ng-click="datepicker2Open = true" 100 ng-click="datepicker2Open = true"
78 > 101 >
79 <i class="fa fa-calendar"></i> 102 <i class="fa fa-calendar"></i>
80 </button> 103 </button>
81 </div> 104 </div>
82 <input 105 <input
83 class="form-control form-control-sm" 106 class="form-control form-control-sm"
84 id="inlineFormInputGroup" 107 id="inlineFormInputGroup"
85 ladda="searchLoading" 108 ladda="searchLoading"
86 type="text" 109 type="text"
87 ng-model="fechaHasta" 110 ng-model="fechaHasta"
88 ng-required="true" 111 ng-required="true"
89 uib-datepicker-popup="dd/MM/yyyy" 112 uib-datepicker-popup="dd/MM/yyyy"
90 show-button-bar="false" 113 show-button-bar="false"
91 is-open="datepicker2Open" 114 is-open="datepicker2Open"
92 on-open-focus="false" 115 on-open-focus="false"
93 ng-focus="datepicker2Open = true" 116 ng-focus="datepicker2Open = true"
94 /> 117 />
95 </div> 118 </div>
96 </div> 119 </div>
97 <table ng-show="primerBusqueda" class="table table-hover table-sm"> 120 <table ng-show="primerBusqueda" class="table table-hover table-sm">
98 <thead> 121 <thead>
99 <tr> 122 <tr>
100 <th>Fecha</th> 123 <th>Fecha</th>
101 <th>Cliente</th> 124 <th>Cliente</th>
102 <th>Comprobante</th> 125 <th>Comprobante</th>
103 <th>Importe</th> 126 <th>Importe</th>
104 <th></th> 127 <th></th>
105 <th></th> 128 <th></th>
106 </tr> 129 </tr>
107 </thead> 130 </thead>
108 <tbody> 131 <tbody>
109 <tr ng-show="currentPageRemitos.length == 0 && primerBusqueda"> 132 <tr ng-show="currentPageRemitos.length == 0 && primerBusqueda">
110 <td colspan="5"> 133 <td colspan="5">
111 No se encontraron resultados. 134 No se encontraron resultados.
112 </td> 135 </td>
113 </tr> 136 </tr>
114 <tr class="selectable" 137 <tr class="selectable"
115 ng-repeat-start="(key, remito) in currentPageRemitos" 138 ng-repeat-start="(key, remito) in currentPageRemitos"
116 > 139 >
117 <td ng-bind="remito.fechaRemito | date : 'dd/MM/yyyy'"></td> 140 <td ng-bind="remito.fechaRemito | date : 'dd/MM/yyyy'"></td>
118 <td ng-bind="remito.nombreCliente"></td> 141 <td ng-bind="remito.nombreCliente"></td>
119 <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td> 142 <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td>
120 <td ng-bind="remito.total | number: 2"></td> 143 <td ng-bind="remito.total | number: 2"></td>
121 <td> 144 <td>
122 <button 145 <button
123 type="button" 146 type="button"
124 class="btn btn-secondary btn-xs p-1" 147 class="btn btn-secondary btn-xs p-1"
125 ng-click="isCollapsed = !isCollapsed ; verProductos = remito.articulosRemito" 148 ng-click="isCollapsed = !isCollapsed ; verProductos = remito.articulosRemito"
126 ><i class="fa fa-eye"></i> 149 ><i class="fa fa-eye"></i>
127 </button> 150 </button>
128 </td> 151 </td>
129 <td> 152 <td>
130 <button ng-click="select(remito);" 153 <button ng-click="select(remito);"
131 type="button" 154 type="button"
132 class="btn btn-xs p-1 float-right" 155 class="btn btn-xs p-1 float-right"
133 ng-class="{ 156 ng-class="{
134 'btn-secondary': selectedRemito != key, 157 'btn-secondary': selectedRemito != key,
135 'btn-primary': selectedRemito == key 158 'btn-primary': selectedRemito == key
136 }" 159 }"
137 foca-focus="selectedRemito == {{key}}" 160 foca-focus="selectedRemito == {{key}}"
138 ng-keydown="itemRemito($event.keyCode)" 161 ng-keydown="itemRemito($event.keyCode)"
139 > 162 >
140 <i class="fa fa-circle-thin" aria-hidden="true"></i> 163 <i class="fa fa-circle-thin" aria-hidden="true"></i>
141 </button> 164 </button>
142 </td> 165 </td>
143 </tr> 166 </tr>
144 <tr ng-repeat-end uib-collapse="!isCollapsed"> 167 <tr ng-repeat-end uib-collapse="!isCollapsed">
145 <td colspan="6"> 168 <td colspan="6">
146 <table class="table table-sm"> 169 <table class="table table-sm">
147 <thead> 170 <thead>
148 <tr> 171 <tr>
149 <th>Código</th> 172 <th>Código</th>
150 <th>Descripción</th> 173 <th>Descripción</th>
151 <th>Cantidad</th> 174 <th>Cantidad</th>
152 </tr> 175 </tr>
153 </thead> 176 </thead>
154 <tbody> 177 <tbody>
155 <tr ng-repeat="(key, articulo) in verProductos"> 178 <tr ng-repeat="(key, articulo) in verProductos">
156 <td>{{articulo.codigo}}</td> 179 <td>{{articulo.codigo}}</td>
157 <td>{{articulo.descripcion}}</td> 180 <td>{{articulo.descripcion}}</td>
158 <td>{{articulo.cantidad}}</td> 181 <td>{{articulo.cantidad}}</td>
159 </tr> 182 </tr>
160 </tbody> 183 </tbody>
161 </table> 184 </table>
162 </td> 185 </td>
163 </tr> 186 </tr>
164 </tbody> 187 </tbody>
165 </table> 188 </table>
166 </div> 189 </div>
167 <div class="modal-footer py-1"> 190 <div class="modal-footer py-1">
168 <nav ng-show="currentPageRemitos.length > 0 && primerBusqueda" class="mr-auto"> 191 <nav ng-show="currentPageRemitos.length > 0 && primerBusqueda" class="mr-auto">
169 <ul class="pagination pagination-sm justify-content mb-0"> 192 <ul class="pagination pagination-sm justify-content mb-0">
170 <li class="page-item" ng-class="{'disabled': currentPage == 1}"> 193 <li class="page-item" ng-class="{'disabled': currentPage == 1}">
171 <a 194 <a
172 class="page-link" 195 class="page-link"
173 href="javascript:void();" 196 href="javascript:void();"
174 ng-click="selectPage(currentPage - 1)" 197 ng-click="selectPage(currentPage - 1)"
175 > 198 >
176 <span aria-hidden="true">&laquo;</span> 199 <span aria-hidden="true">&laquo;</span>
177 <span class="sr-only">Anterior</span> 200 <span class="sr-only">Anterior</span>
178 </a> 201 </a>
179 </li> 202 </li>
180 <li 203 <li
181 class="page-item" 204 class="page-item"
182 ng-repeat="pagina in paginas" 205 ng-repeat="pagina in paginas"
183 ng-class="{'active': pagina == currentPage}" 206 ng-class="{'active': pagina == currentPage}"
184 > 207 >
185 <a 208 <a
186 class="page-link" 209 class="page-link"
187 href="javascript:void();" 210 href="javascript:void();"
188 ng-click="selectPage(pagina)" 211 ng-click="selectPage(pagina)"
189 ng-bind="pagina" 212 ng-bind="pagina"
190 ></a> 213 ></a>
191 </li> 214 </li>
192 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> 215 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
193 <a 216 <a
194 class="page-link" 217 class="page-link"
195 href="javascript:void();" 218 href="javascript:void();"
196 ng-click="selectPage(currentPage + 1)" 219 ng-click="selectPage(currentPage + 1)"
197 > 220 >
198 <span aria-hidden="true">&raquo;</span> 221 <span aria-hidden="true">&raquo;</span>
199 <span class="sr-only">Siguiente</span> 222 <span class="sr-only">Siguiente</span>
200 </a> 223 </a>
201 </li> 224 </li>
202 </ul> 225 </ul>
203 </nav> 226 </nav>
204 <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>
205 </div> 228 </div>