Commit e2acb06d7a88c1e0cdc53ed6dddefa6d7b8b99fe

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Agregada cruz para limpiar inputs en crear cliente.

See merge request !33
src/js/controller.js
1 angular.module('focaBusquedaCliente') 1 angular.module('focaBusquedaCliente')
2 .controller('focaBusquedaClienteModalController', [ 2 .controller('focaBusquedaClienteModalController', [
3 '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter', 3 '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter',
4 '$uibModal', 'focaModalService', '$timeout', 'vendedor', 'cobrador', 4 '$uibModal', 'focaModalService', '$timeout', 'vendedor', 'cobrador',
5 function($uibModalInstance, focaBusquedaClienteService, $scope, $filter, 5 function($uibModalInstance, focaBusquedaClienteService, $scope, $filter,
6 $uibModal, focaModalService, $timeout, vendedor, cobrador) { 6 $uibModal, focaModalService, $timeout, vendedor, cobrador) {
7 7
8 $scope.cobrador = cobrador ? cobrador : {}; 8 $scope.cobrador = cobrador ? cobrador : {};
9 $scope.vendedor = vendedor ? vendedor : {}; 9 $scope.vendedor = vendedor ? vendedor : {};
10 $scope.filters = ''; 10 $scope.filters = '';
11 $scope.primerBusqueda = false; 11 $scope.primerBusqueda = false;
12 // pagination 12 // pagination
13 $scope.numPerPage = 10; 13 $scope.numPerPage = 10;
14 $scope.currentPage = 1; 14 $scope.currentPage = 1;
15 $scope.filteredClientes = []; 15 $scope.filteredClientes = [];
16 $scope.currentPageClientes = []; 16 $scope.currentPageClientes = [];
17 $scope.selectedClientes = -1; 17 $scope.selectedClientes = -1;
18 $scope.ingreso = false; 18 $scope.ingreso = false;
19 $scope.regexCuit = new RegExp(/\b(20|23|24|27|30|33|34)(\D)?[0-9]{8}(\D)?[0-9]/); 19 $scope.regexCuit = new RegExp(/\b(20|23|24|27|30|33|34)(\D)?[0-9]{8}(\D)?[0-9]/);
20 $scope.focused = 1; 20 $scope.focused = 1;
21 21
22 $scope.cliente = { 22 $scope.cliente = {
23 COD: 0, 23 COD: 0,
24 ES_MAY: true, 24 ES_MAY: true,
25 cuit1: '', 25 cuit1: '',
26 cuit2: '', 26 cuit2: '',
27 cuit3: '', 27 cuit3: '',
28 provincia: { 28 provincia: {
29 NOMBRE: '' 29 NOMBRE: ''
30 }, 30 },
31 localidad: { 31 localidad: {
32 NOMBRE: '' 32 NOMBRE: ''
33 }, 33 },
34 iva: { 34 iva: {
35 NOMBRE: '' 35 NOMBRE: ''
36 }, 36 },
37 actividad: { 37 actividad: {
38 NOM: '' 38 NOM: ''
39 }, 39 },
40 zona: { 40 zona: {
41 NOM: '' 41 NOM: ''
42 }, 42 },
43 tipoFactura: { 43 tipoFactura: {
44 NOMBRE: '' 44 NOMBRE: ''
45 }, 45 },
46 tipoComprobante: { 46 tipoComprobante: {
47 NOMBRE: '' 47 NOMBRE: ''
48 }, 48 },
49 formaPago: { 49 formaPago: {
50 NOMBRE: '' 50 NOMBRE: ''
51 }, 51 },
52 cobrador: { 52 cobrador: {
53 NomVen: '' 53 NomVen: ''
54 } 54 }
55 }; 55 };
56 56
57 $scope.busquedaPress = function(key) { 57 $scope.busquedaPress = function(key) {
58 if (key === 13) { 58 if (key === 13) {
59 var funcion; 59 var funcion;
60 if ($scope.vendedor.id) { 60 if ($scope.vendedor.id) {
61 funcion = 'obtenerClientesPorNombreOCuitByVendedor'; 61 funcion = 'obtenerClientesPorNombreOCuitByVendedor';
62 } else if ($scope.cobrador.id) { 62 } else if ($scope.cobrador.id) {
63 funcion = 'obtenerClientesPorNombreOCuitByCobrador'; 63 funcion = 'obtenerClientesPorNombreOCuitByCobrador';
64 } else { 64 } else {
65 funcion = 'obtenerClientesPorNombreOCuit'; 65 funcion = 'obtenerClientesPorNombreOCuit';
66 } 66 }
67 67
68 $scope.searchLoading = true; 68 $scope.searchLoading = true;
69 focaBusquedaClienteService 69 focaBusquedaClienteService
70 [funcion]($scope.filters, $scope.vendedor.id || $scope.cobrador.id) 70 [funcion]($scope.filters, $scope.vendedor.id || $scope.cobrador.id)
71 .then( 71 .then(
72 function(res) { 72 function(res) {
73 $scope.primerBusqueda = true; 73 $scope.primerBusqueda = true;
74 $scope.clientes = res.data; 74 $scope.clientes = res.data;
75 $scope.search(true); 75 $scope.search(true);
76 primera(); 76 primera();
77 $scope.searchLoading = false; 77 $scope.searchLoading = false;
78 }); 78 });
79 } 79 }
80 }; 80 };
81 81
82 $scope.search = function (pressed) { 82 $scope.search = function (pressed) {
83 if ($scope.primerBusqueda) { 83 if ($scope.primerBusqueda) {
84 $scope.filteredClientes = $filter('filter')( 84 $scope.filteredClientes = $filter('filter')(
85 $scope.clientes, {$: $scope.filters} 85 $scope.clientes, {$: $scope.filters}
86 ); 86 );
87 87
88 if (pressed && $scope.filteredClientes.length === 0) { 88 if (pressed && $scope.filteredClientes.length === 0) {
89 $timeout(function() { 89 $timeout(function() {
90 angular.element('#search')[0].focus(); 90 angular.element('#search')[0].focus();
91 $scope.filters = ''; 91 $scope.filters = '';
92 }); 92 });
93 } 93 }
94 94
95 $scope.lastPage = Math.ceil( 95 $scope.lastPage = Math.ceil(
96 $scope.filteredClientes.length / $scope.numPerPage 96 $scope.filteredClientes.length / $scope.numPerPage
97 ); 97 );
98 98
99 $scope.resetPage(); 99 $scope.resetPage();
100 } 100 }
101 }; 101 };
102 102
103 $scope.resetPage = function () { 103 $scope.resetPage = function () {
104 $scope.currentPage = 1; 104 $scope.currentPage = 1;
105 $scope.selectPage(1); 105 $scope.selectPage(1);
106 }; 106 };
107 107
108 $scope.selectPage = function (page) { 108 $scope.selectPage = function (page) {
109 var start = (page - 1) * $scope.numPerPage; 109 var start = (page - 1) * $scope.numPerPage;
110 var end = start + $scope.numPerPage; 110 var end = start + $scope.numPerPage;
111 $scope.paginas = []; 111 $scope.paginas = [];
112 $scope.paginas = calcularPages(page); 112 $scope.paginas = calcularPages(page);
113 $scope.currentPageClientes = $scope.filteredClientes.slice(start, end); 113 $scope.currentPageClientes = $scope.filteredClientes.slice(start, end);
114 $scope.currentPage = page; 114 $scope.currentPage = page;
115 }; 115 };
116 116
117 $scope.select = function(cliente, esNuevo = false) { 117 $scope.select = function(cliente, esNuevo = false) {
118 cliente.esNuevo = esNuevo; 118 cliente.esNuevo = esNuevo;
119 $uibModalInstance.close(cliente); 119 $uibModalInstance.close(cliente);
120 }; 120 };
121 121
122 $scope.cancel = function() { 122 $scope.cancel = function() {
123 if ($scope.ingreso) { 123 if ($scope.ingreso) {
124 $scope.ingreso = false; 124 $scope.ingreso = false;
125 } else { 125 } else {
126 $uibModalInstance.dismiss('cancel'); 126 $uibModalInstance.dismiss('cancel');
127 } 127 }
128 }; 128 };
129 129
130 $scope.busquedaDown = function(key) { 130 $scope.busquedaDown = function(key) {
131 if (key === 40) { 131 if (key === 40) {
132 primera(key); 132 primera(key);
133 } 133 }
134 }; 134 };
135 135
136 $scope.itemCliente = function(key) { 136 $scope.itemCliente = function(key) {
137 if (key === 38) { 137 if (key === 38) {
138 anterior(key); 138 anterior(key);
139 } 139 }
140 140
141 if (key === 40) { 141 if (key === 40) {
142 siguiente(key); 142 siguiente(key);
143 } 143 }
144 144
145 if (key === 37) { 145 if (key === 37) {
146 retrocederPagina(); 146 retrocederPagina();
147 } 147 }
148 148
149 if (key === 39) { 149 if (key === 39) {
150 avanzarPagina(); 150 avanzarPagina();
151 } 151 }
152 }; 152 };
153 153
154 $scope.focus = function(val) { 154 $scope.focus = function(val) {
155 $scope.focused = val; 155 $scope.focused = val;
156 }; 156 };
157 157
158 $scope.next = function(key) { 158 $scope.next = function(key) {
159 if (key === 13) $scope.focused++; 159 if (key === 13) $scope.focused++;
160 }; 160 };
161 161
162 $scope.seleccionarProvincia = function(key) { 162 $scope.seleccionarProvincia = function(key) {
163 if (key === 13) { 163 if (key === 13) {
164 var parametrosModal = { 164 var parametrosModal = {
165 searchText: $scope.cliente.provincia.NOMBRE, 165 searchText: $scope.cliente.provincia.NOMBRE,
166 query: '/provincia', 166 query: '/provincia',
167 columnas: [ 167 columnas: [
168 { 168 {
169 propiedad: 'ID', 169 propiedad: 'ID',
170 nombre: 'Codigo', 170 nombre: 'Codigo',
171 filtro: { 171 filtro: {
172 nombre: 'rellenarDigitos', 172 nombre: 'rellenarDigitos',
173 parametro: 3 173 parametro: 3
174 } 174 }
175 }, 175 },
176 { 176 {
177 propiedad: 'NOMBRE', 177 propiedad: 'NOMBRE',
178 nombre: 'Nombre' 178 nombre: 'Nombre'
179 } 179 }
180 ], 180 ],
181 titulo:'Búsqueda de provincias', 181 titulo:'Búsqueda de provincias',
182 size: 'md' 182 size: 'md'
183 }; 183 };
184 focaModalService.modal(parametrosModal).then(function(provincia) { 184 focaModalService.modal(parametrosModal).then(function(provincia) {
185 $scope.cliente.provincia = provincia; 185 $scope.cliente.provincia = provincia;
186 $timeout(function() { 186 $timeout(function() {
187 $scope.focused = 4; 187 $scope.focused = 4;
188 }); 188 });
189 }, function() { 189 }, function() {
190 //TODO: función llamada cuando cancela el modal 190 //TODO: función llamada cuando cancela el modal
191 }); 191 });
192 } 192 }
193 }; 193 };
194 $scope.seleccionarLocalidad = function(key) { 194 $scope.seleccionarLocalidad = function(key) {
195 if ($scope.cliente.provincia.ID === undefined) { 195 if ($scope.cliente.provincia.ID === undefined) {
196 focaModalService.alert('Seleccione una provincia'); 196 focaModalService.alert('Seleccione una provincia');
197 return; 197 return;
198 } 198 }
199 if (key === 13) { 199 if (key === 13) {
200 var parametrosModal = { 200 var parametrosModal = {
201 searchText: $scope.cliente.localidad.NOMBRE, 201 searchText: $scope.cliente.localidad.NOMBRE,
202 query: '/localidad/' + $scope.cliente.provincia.ID, 202 query: '/localidad/' + $scope.cliente.provincia.ID,
203 columnas: [ 203 columnas: [
204 { 204 {
205 propiedad: 'ID', 205 propiedad: 'ID',
206 nombre: 'Código', 206 nombre: 'Código',
207 filtro: { 207 filtro: {
208 nombre: 'rellenarDigitos', 208 nombre: 'rellenarDigitos',
209 parametro: 3 209 parametro: 3
210 } 210 }
211 }, 211 },
212 { 212 {
213 propiedad: 'NOMBRE', 213 propiedad: 'NOMBRE',
214 nombre: 'Nombre' 214 nombre: 'Nombre'
215 } 215 }
216 ], 216 ],
217 titulo:'Búsqueda de localidades', 217 titulo:'Búsqueda de localidades',
218 size: 'md' 218 size: 'md'
219 }; 219 };
220 focaModalService.modal(parametrosModal).then(function(localidad) { 220 focaModalService.modal(parametrosModal).then(function(localidad) {
221 $scope.cliente.localidad = localidad; 221 $scope.cliente.localidad = localidad;
222 $timeout(function() { 222 $timeout(function() {
223 $scope.focused = 5; 223 $scope.focused = 5;
224 }); 224 });
225 }, function() { 225 }, function() {
226 //TODO: función llamada cuando cancela el modal 226 //TODO: función llamada cuando cancela el modal
227 }); 227 });
228 } 228 }
229 }; 229 };
230 $scope.seleccionarIva = function(key) { 230 $scope.seleccionarIva = function(key) {
231 if (key === 13) { 231 if (key === 13) {
232 var parametrosModal = { 232 var parametrosModal = {
233 query: '/iva', 233 query: '/iva',
234 searchText: $scope.cliente.iva.NOMBRE, 234 searchText: $scope.cliente.iva.NOMBRE,
235 columnas: [ 235 columnas: [
236 { 236 {
237 propiedad: 'ID', 237 propiedad: 'ID',
238 nombre: 'Código', 238 nombre: 'Código',
239 filtro: { 239 filtro: {
240 nombre: 'rellenarDigitos', 240 nombre: 'rellenarDigitos',
241 parametro: 3 241 parametro: 3
242 } 242 }
243 }, 243 },
244 { 244 {
245 propiedad: 'NOMBRE', 245 propiedad: 'NOMBRE',
246 nombre: 'Nombre' 246 nombre: 'Nombre'
247 } 247 }
248 ], 248 ],
249 titulo:'Búsqueda de responsabilidad ante el IVA', 249 titulo:'Búsqueda de responsabilidad ante el IVA',
250 size: 'md' 250 size: 'md'
251 }; 251 };
252 focaModalService.modal(parametrosModal).then( 252 focaModalService.modal(parametrosModal).then(
253 function(iva) { 253 function(iva) {
254 if (iva) { 254 if (iva) {
255 delete $scope.cliente.tipoFactura.NOMBRE; 255 delete $scope.cliente.tipoFactura.NOMBRE;
256 } 256 }
257 $scope.cliente.iva = iva; 257 $scope.cliente.iva = iva;
258 $timeout(function() { 258 $timeout(function() {
259 $scope.focused = 12; 259 $scope.focused = 12;
260 }); 260 });
261 }, function() { 261 }, function() {
262 // funcion ejecutada cuando se cancela el modal 262 // funcion ejecutada cuando se cancela el modal
263 }); 263 });
264 } 264 }
265 }; 265 };
266 $scope.seleccionarActividad = function(key) { 266 $scope.seleccionarActividad = function(key) {
267 if (key === 13) { 267 if (key === 13) {
268 var parametrosModal = { 268 var parametrosModal = {
269 searchText: $scope.cliente.actividad.NOM, 269 searchText: $scope.cliente.actividad.NOM,
270 query: '/actividad', 270 query: '/actividad',
271 columnas: [ 271 columnas: [
272 { 272 {
273 propiedad: 'ID', 273 propiedad: 'ID',
274 nombre: 'Código', 274 nombre: 'Código',
275 filtro: { 275 filtro: {
276 nombre: 'rellenarDigitos', 276 nombre: 'rellenarDigitos',
277 parametro: 3 277 parametro: 3
278 } 278 }
279 }, 279 },
280 { 280 {
281 propiedad: 'NOM', 281 propiedad: 'NOM',
282 nombre: 'Nombre' 282 nombre: 'Nombre'
283 } 283 }
284 ], 284 ],
285 titulo: 'Búsqueda de actividades', 285 titulo: 'Búsqueda de actividades',
286 size: 'md' 286 size: 'md'
287 }; 287 };
288 focaModalService.modal(parametrosModal).then( 288 focaModalService.modal(parametrosModal).then(
289 function(actividad) { 289 function(actividad) {
290 $scope.cliente.actividad = actividad; 290 $scope.cliente.actividad = actividad;
291 $timeout(function() { 291 $timeout(function() {
292 $scope.focused = 7; 292 $scope.focused = 7;
293 }); 293 });
294 }, function() { 294 }, function() {
295 // funcion ejecutada cuando se cancela el modal 295 // funcion ejecutada cuando se cancela el modal
296 }); 296 });
297 } 297 }
298 }; 298 };
299 $scope.seleccionarZona = function(key) { 299 $scope.seleccionarZona = function(key) {
300 if (key === 13) { 300 if (key === 13) {
301 var parametrosModal = { 301 var parametrosModal = {
302 searchText: $scope.cliente.zona.NOM, 302 searchText: $scope.cliente.zona.NOM,
303 query: '/zona', 303 query: '/zona',
304 columnas: [ 304 columnas: [
305 { 305 {
306 propiedad: 'ID', 306 propiedad: 'ID',
307 nombre: 'Código', 307 nombre: 'Código',
308 filtro: { 308 filtro: {
309 nombre: 'rellenarDigitos', 309 nombre: 'rellenarDigitos',
310 parametro: 3 310 parametro: 3
311 } 311 }
312 }, 312 },
313 { 313 {
314 propiedad: 'NOM', 314 propiedad: 'NOM',
315 nombre: 'Nombre' 315 nombre: 'Nombre'
316 } 316 }
317 ], 317 ],
318 titulo: 'Búsqueda de zonas', 318 titulo: 'Búsqueda de zonas',
319 size: 'md' 319 size: 'md'
320 }; 320 };
321 focaModalService.modal(parametrosModal).then( 321 focaModalService.modal(parametrosModal).then(
322 function(zona) { 322 function(zona) {
323 $scope.cliente.zona = zona; 323 $scope.cliente.zona = zona;
324 $timeout(function() { 324 $timeout(function() {
325 $scope.focused = 6; 325 $scope.focused = 6;
326 }); 326 });
327 }, function() { 327 }, function() {
328 // funcion ejecutada cuando se cancela el modal 328 // funcion ejecutada cuando se cancela el modal
329 }); 329 });
330 } 330 }
331 }; 331 };
332 $scope.seleccionarTipoFactura = function(key) { 332 $scope.seleccionarTipoFactura = function(key) {
333 333
334 if ($scope.cliente.iva.NOMBRE == '') { 334 if ($scope.cliente.iva.NOMBRE == '') {
335 focaModalService.alert('Seleccione una responsabilidad ante el IVA'); 335 focaModalService.alert('Seleccione una responsabilidad ante el IVA');
336 return; 336 return;
337 } 337 }
338 338
339 if (key === 13) { 339 if (key === 13) {
340 var datos; 340 var datos;
341 if ($scope.cliente.iva.ID == 1) { 341 if ($scope.cliente.iva.ID == 1) {
342 datos = [ 342 datos = [
343 { 343 {
344 ID: 'A', 344 ID: 'A',
345 NOMBRE: 'Factura A' 345 NOMBRE: 'Factura A'
346 }, 346 },
347 { 347 {
348 ID: 'M', 348 ID: 'M',
349 NOMBRE: 'Factura M' 349 NOMBRE: 'Factura M'
350 }, 350 },
351 { 351 {
352 ID: 'R', 352 ID: 'R',
353 NOMBRE: 'Remito' 353 NOMBRE: 'Remito'
354 } 354 }
355 ]; 355 ];
356 } else { 356 } else {
357 datos = [ 357 datos = [
358 { 358 {
359 ID: 'B', 359 ID: 'B',
360 NOMBRE: 'Factura B' 360 NOMBRE: 'Factura B'
361 }, 361 },
362 { 362 {
363 ID: 'R', 363 ID: 'R',
364 NOMBRE: 'Remito' 364 NOMBRE: 'Remito'
365 } 365 }
366 ]; 366 ];
367 } 367 }
368 focaModalService.modal({ 368 focaModalService.modal({
369 titulo: 'Seleccionar Factura', 369 titulo: 'Seleccionar Factura',
370 data: datos, 370 data: datos,
371 size: 'md', 371 size: 'md',
372 columnas: [ 372 columnas: [
373 { 373 {
374 propiedad: 'ID', 374 propiedad: 'ID',
375 NOMBRE: 'Codigo' 375 NOMBRE: 'Codigo'
376 }, 376 },
377 { 377 {
378 propiedad: 'NOMBRE', 378 propiedad: 'NOMBRE',
379 NOMBRE: 'Factura' 379 NOMBRE: 'Factura'
380 } 380 }
381 ], 381 ],
382 }).then(function(res) { 382 }).then(function(res) {
383 $scope.cliente.tipoFactura = res; 383 $scope.cliente.tipoFactura = res;
384 }); 384 });
385 } 385 }
386 }; 386 };
387 $scope.seleccionarTipoComprobante = function(key) { 387 $scope.seleccionarTipoComprobante = function(key) {
388 if (key === 13) { 388 if (key === 13) {
389 var parametrosModal = { 389 var parametrosModal = {
390 searchText: $scope.cliente.tipoComprobante.NOMBRE, 390 searchText: $scope.cliente.tipoComprobante.NOMBRE,
391 query: '/tipo-comprobante', 391 query: '/tipo-comprobante',
392 columnas: [ 392 columnas: [
393 { 393 {
394 propiedad: 'ID', 394 propiedad: 'ID',
395 nombre: 'Código' 395 nombre: 'Código'
396 }, 396 },
397 { 397 {
398 propiedad: 'NOMBRE', 398 propiedad: 'NOMBRE',
399 nombre: 'Nombre' 399 nombre: 'Nombre'
400 } 400 }
401 ], 401 ],
402 titulo: 'Búsqueda de tipos de comprobante', 402 titulo: 'Búsqueda de tipos de comprobante',
403 size: 'md' 403 size: 'md'
404 }; 404 };
405 focaModalService.modal(parametrosModal).then( 405 focaModalService.modal(parametrosModal).then(
406 function(tipoComprobante) { 406 function(tipoComprobante) {
407 $scope.cliente.tipoComprobante = tipoComprobante; 407 $scope.cliente.tipoComprobante = tipoComprobante;
408 $timeout(function() { 408 $timeout(function() {
409 $scope.focused = 17; 409 $scope.focused = 17;
410 }); 410 });
411 }, function() { 411 }, function() {
412 // funcion ejecutada cuando se cancela el modal 412 // funcion ejecutada cuando se cancela el modal
413 }); 413 });
414 } 414 }
415 }; 415 };
416 $scope.seleccionarFormaPago = function(key) { 416 $scope.seleccionarFormaPago = function(key) {
417 if (key === 13) { 417 if (key === 13) {
418 var parametrosModal = { 418 var parametrosModal = {
419 searchText: $scope.cliente.formaPago.NOMBRE, 419 searchText: $scope.cliente.formaPago.NOMBRE,
420 query: '/forma-pago', 420 query: '/forma-pago',
421 columnas: [ 421 columnas: [
422 { 422 {
423 propiedad: 'ID', 423 propiedad: 'ID',
424 nombre: 'Código', 424 nombre: 'Código',
425 filtro: { 425 filtro: {
426 nombre: 'rellenarDigitos', 426 nombre: 'rellenarDigitos',
427 parametro: 3 427 parametro: 3
428 } 428 }
429 }, 429 },
430 { 430 {
431 propiedad: 'NOMBRE', 431 propiedad: 'NOMBRE',
432 nombre: 'Nombre' 432 nombre: 'Nombre'
433 } 433 }
434 ], 434 ],
435 titulo: 'Búsqueda de formas de pago', 435 titulo: 'Búsqueda de formas de pago',
436 size: 'md' 436 size: 'md'
437 }; 437 };
438 focaModalService.modal(parametrosModal).then( 438 focaModalService.modal(parametrosModal).then(
439 function(formaPago) { 439 function(formaPago) {
440 $scope.cliente.formaPago = formaPago; 440 $scope.cliente.formaPago = formaPago;
441 }, function() { 441 }, function() {
442 // funcion ejecutada cuando se cancela el modal 442 // funcion ejecutada cuando se cancela el modal
443 }); 443 });
444 } 444 }
445 }; 445 };
446 $scope.seleccionarCobrador = function(key) { 446 $scope.seleccionarCobrador = function(key) {
447 if (key === 13) { 447 if (key === 13) {
448 var parametrosModal = { 448 var parametrosModal = {
449 searchText: $scope.cliente.cobrador.NOM, 449 searchText: $scope.cliente.cobrador.NOM,
450 query: '/cobrador', 450 query: '/cobrador',
451 columnas: [ 451 columnas: [
452 { 452 {
453 propiedad: 'NUM', 453 propiedad: 'NUM',
454 nombre: 'Código' 454 nombre: 'Código'
455 }, 455 },
456 { 456 {
457 propiedad: 'NOM', 457 propiedad: 'NOM',
458 nombre: 'Nombre' 458 nombre: 'Nombre'
459 } 459 }
460 ], 460 ],
461 titulo: 'Búsqueda de cobradores', 461 titulo: 'Búsqueda de cobradores',
462 size: 'md' 462 size: 'md'
463 }; 463 };
464 focaModalService.modal(parametrosModal).then( 464 focaModalService.modal(parametrosModal).then(
465 function(cobrador) { 465 function(cobrador) {
466 $scope.cliente.cobrador = cobrador; 466 $scope.cliente.cobrador = cobrador;
467 }, function() { 467 }, function() {
468 // funcion ejecutada cuando se cancela el modal 468 // funcion ejecutada cuando se cancela el modal
469 }); 469 });
470 } 470 }
471 }; 471 };
472 472
473 $scope.pasarCampoCuit = function(numeroCuit) { 473 $scope.pasarCampoCuit = function(numeroCuit) {
474 if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { 474 if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) {
475 $scope.cuitActivo = 2; 475 $scope.cuitActivo = 2;
476 } else if ( numeroCuit === 2 && $scope.cliente.cuit2.length === 8) { 476 } else if ( numeroCuit === 2 && $scope.cliente.cuit2.length === 8) {
477 $scope.cuitActivo = 3; 477 $scope.cuitActivo = 3;
478 } 478 }
479 }; 479 };
480 480
481 $scope.guardar = function() { 481 $scope.guardar = function() {
482 if (!$scope.cliente.NOM) { 482 if (!$scope.cliente.NOM) {
483 focaModalService.alert('Ingrese Nombre'); 483 focaModalService.alert('Ingrese Nombre');
484 return; 484 return;
485 } else if (!$scope.cliente.CPO) { 485 } else if (!$scope.cliente.CPO) {
486 focaModalService.alert('Ingrese Codigo Postal'); 486 focaModalService.alert('Ingrese Codigo Postal');
487 return; 487 return;
488 } else if (!$scope.cliente.provincia.NOMBRE) { 488 } else if (!$scope.cliente.provincia.NOMBRE) {
489 focaModalService.alert('Seleccione una provincia'); 489 focaModalService.alert('Seleccione una provincia');
490 return; 490 return;
491 } else if (!$scope.cliente.DOM) { 491 } else if (!$scope.cliente.DOM) {
492 focaModalService.alert('Ingrese Domicilio'); 492 focaModalService.alert('Ingrese Domicilio');
493 return; 493 return;
494 } else if (!$scope.cliente.localidad.NOMBRE) { 494 } else if (!$scope.cliente.localidad.NOMBRE) {
495 focaModalService.alert('Seleccione una localidad'); 495 focaModalService.alert('Seleccione una localidad');
496 return; 496 return;
497 } else if (!$scope.cliente.zona.NOM) { 497 } else if (!$scope.cliente.zona.NOM) {
498 focaModalService.alert('Seleccione una zona'); 498 focaModalService.alert('Seleccione una zona');
499 return; 499 return;
500 } else if (!$scope.cliente.actividad.NOM) { 500 } else if (!$scope.cliente.actividad.NOM) {
501 focaModalService.alert('Seleccione actividad'); 501 focaModalService.alert('Seleccione actividad');
502 return; 502 return;
503 } else if (!$scope.cliente.cobrador.NUM) { 503 } else if (!$scope.cliente.cobrador.NUM) {
504 focaModalService.alert('Seleccione un cobrador'); 504 focaModalService.alert('Seleccione un cobrador');
505 return; 505 return;
506 } else if ($scope.cliente.MAIL && !validateEmails($scope.cliente.MAIL)) { 506 } else if ($scope.cliente.MAIL && !validateEmails($scope.cliente.MAIL)) {
507 focaModalService.alert('Ingrese un formato de email válido'); 507 focaModalService.alert('Ingrese un formato de email válido');
508 return; 508 return;
509 } else if (!$scope.cliente.TEL) { 509 } else if (!$scope.cliente.TEL) {
510 focaModalService.alert('Ingrese un numero de telefono'); 510 focaModalService.alert('Ingrese un numero de telefono');
511 return; 511 return;
512 } else if (!$scope.cliente.iva.NOMBRE) { 512 } else if (!$scope.cliente.iva.NOMBRE) {
513 focaModalService.alert('Seleccione responsabilidad ante el IVA'); 513 focaModalService.alert('Seleccione responsabilidad ante el IVA');
514 return; 514 return;
515 } else if (!$scope.cliente.tipoFactura.NOMBRE) { 515 } else if (!$scope.cliente.tipoFactura.NOMBRE) {
516 focaModalService.alert('Seleccione tipo de Factura'); 516 focaModalService.alert('Seleccione tipo de Factura');
517 return; 517 return;
518 } else if (!$scope.cliente.cuit1 && !$scope.cliente.cuit2 && !$scope.cliente.cuit3) { 518 } else if (!$scope.cliente.cuit1 && !$scope.cliente.cuit2 && !$scope.cliente.cuit3) {
519 focaModalService.alert('Ingrese CUIT'); 519 focaModalService.alert('Ingrese CUIT');
520 return; 520 return;
521 } else if (!$scope.cliente.cuit1 || !$scope.cliente.cuit2 || !$scope.cliente.cuit3){ 521 } else if (!$scope.cliente.cuit1 || !$scope.cliente.cuit2 || !$scope.cliente.cuit3){
522 focaModalService.alert('Ingrese CUIT válido'); 522 focaModalService.alert('Ingrese CUIT válido');
523 return; 523 return;
524 } else if (!$scope.regexCuit.test($scope.cliente.cuit1 + $scope.cliente.cuit2 + $scope.cliente.cuit3) ) { 524 } else if (!$scope.regexCuit.test($scope.cliente.cuit1 + $scope.cliente.cuit2 + $scope.cliente.cuit3) ) {
525 focaModalService.alert('Ingrese CUIT con formato: XX-XXXXXXXX-X'); 525 focaModalService.alert('Ingrese CUIT con formato: XX-XXXXXXXX-X');
526 return; 526 return;
527 } else if (!$scope.cliente.tipoComprobante.NOMBRE) { 527 } else if (!$scope.cliente.tipoComprobante.NOMBRE) {
528 focaModalService.alert('Seleccione un Comprobante'); 528 focaModalService.alert('Seleccione un Comprobante');
529 return; 529 return;
530 } else if (!$scope.cliente.formaPago.NOMBRE) { 530 } else if (!$scope.cliente.formaPago.NOMBRE) {
531 focaModalService.alert('Seleccione una forma de pago'); 531 focaModalService.alert('Seleccione una forma de pago');
532 return; 532 return;
533 } 533 }
534 534
535 var cliente = crearCopia(); 535 var cliente = crearCopia();
536 536
537 focaBusquedaClienteService 537 focaBusquedaClienteService
538 .guardarCliente(cliente) 538 .guardarCliente(cliente)
539 .then(function(res) { 539 .then(function(res) {
540 var cliente = { 540 var cliente = {
541 cod: res.data.COD, 541 cod: res.data.COD,
542 cuit: res.data.CUIT, 542 cuit: res.data.CUIT,
543 esNuevo: res.data.esNuevo, 543 esNuevo: res.data.esNuevo,
544 nom: res.data.NOM 544 nom: res.data.NOM
545 }; 545 };
546 $scope.select(cliente, true); 546 $scope.select(cliente, true);
547 }); 547 });
548 }; 548 };
549 549
550 function crearCopia(){ 550 function crearCopia(){
551 var cliente = angular.copy($scope.cliente); 551 var cliente = angular.copy($scope.cliente);
552 552
553 cliente.PCX = cliente.provincia.ID; 553 cliente.PCX = cliente.provincia.ID;
554 cliente.LOX = cliente.localidad.ID; 554 cliente.LOX = cliente.localidad.ID;
555 cliente.IVA = cliente.iva.ID; 555 cliente.IVA = cliente.iva.ID;
556 cliente.ACT = cliente.actividad.ID; 556 cliente.ACT = cliente.actividad.ID;
557 cliente.ZON = cliente.zona.ID; 557 cliente.ZON = cliente.zona.ID;
558 cliente.TIP = cliente.tipoFactura.ID; 558 cliente.TIP = cliente.tipoFactura.ID;
559 cliente.TCO = cliente.tipoComprobante.ID; 559 cliente.TCO = cliente.tipoComprobante.ID;
560 cliente.FPA = cliente.formaPago.ID; 560 cliente.FPA = cliente.formaPago.ID;
561 cliente.VEN = vendedor.ID; 561 cliente.VEN = vendedor.ID;
562 cliente.CUIT = cliente.cuit1 + cliente.cuit2 + cliente.cuit3; 562 cliente.CUIT = cliente.cuit1 + cliente.cuit2 + cliente.cuit3;
563 cliente.idCobrador = cliente.cobrador.ID; 563 cliente.idCobrador = cliente.cobrador.ID;
564 564
565 delete cliente.provincia; 565 delete cliente.provincia;
566 delete cliente.localidad; 566 delete cliente.localidad;
567 delete cliente.iva; 567 delete cliente.iva;
568 delete cliente.actividad; 568 delete cliente.actividad;
569 delete cliente.zona; 569 delete cliente.zona;
570 delete cliente.tipoFactura; 570 delete cliente.tipoFactura;
571 delete cliente.tipoComprobante; 571 delete cliente.tipoComprobante;
572 delete cliente.formaPago; 572 delete cliente.formaPago;
573 delete cliente.cobrador; 573 delete cliente.cobrador;
574 delete cliente.cuit1; 574 delete cliente.cuit1;
575 delete cliente.cuit2; 575 delete cliente.cuit2;
576 delete cliente.cuit3; 576 delete cliente.cuit3;
577 577
578 return cliente; 578 return cliente;
579 } 579 }
580 580
581 function calcularPages(paginaActual) { 581 function calcularPages(paginaActual) {
582 var paginas = []; 582 var paginas = [];
583 paginas.push(paginaActual); 583 paginas.push(paginaActual);
584 584
585 if (paginaActual - 1 > 1) { 585 if (paginaActual - 1 > 1) {
586 586
587 paginas.unshift(paginaActual - 1); 587 paginas.unshift(paginaActual - 1);
588 if (paginaActual - 2 > 1) { 588 if (paginaActual - 2 > 1) {
589 paginas.unshift(paginaActual - 2); 589 paginas.unshift(paginaActual - 2);
590 } 590 }
591 } 591 }
592 592
593 if (paginaActual + 1 < $scope.lastPage) { 593 if (paginaActual + 1 < $scope.lastPage) {
594 paginas.push(paginaActual + 1); 594 paginas.push(paginaActual + 1);
595 if (paginaActual + 2 < $scope.lastPage) { 595 if (paginaActual + 2 < $scope.lastPage) {
596 paginas.push(paginaActual + 2); 596 paginas.push(paginaActual + 2);
597 } 597 }
598 } 598 }
599 599
600 if (paginaActual !== 1) { 600 if (paginaActual !== 1) {
601 paginas.unshift(1); 601 paginas.unshift(1);
602 } 602 }
603 603
604 if (paginaActual !== $scope.lastPage) { 604 if (paginaActual !== $scope.lastPage) {
605 paginas.push($scope.lastPage); 605 paginas.push($scope.lastPage);
606 } 606 }
607 607
608 return paginas; 608 return paginas;
609 } 609 }
610 610
611 function primera() { 611 function primera() {
612 $scope.selectedClientes = 0; 612 $scope.selectedClientes = 0;
613 } 613 }
614 614
615 function anterior() { 615 function anterior() {
616 if ($scope.selectedClientes === 0 && $scope.currentPage > 1) { 616 if ($scope.selectedClientes === 0 && $scope.currentPage > 1) {
617 retrocederPagina(); 617 retrocederPagina();
618 } else { 618 } else {
619 $scope.selectedClientes--; 619 $scope.selectedClientes--;
620 } 620 }
621 } 621 }
622 622
623 function siguiente() { 623 function siguiente() {
624 if ($scope.selectedClientes < $scope.currentPageClientes.length - 1 ) { 624 if ($scope.selectedClientes < $scope.currentPageClientes.length - 1 ) {
625 $scope.selectedClientes++; 625 $scope.selectedClientes++;
626 } else { 626 } else {
627 avanzarPagina(); 627 avanzarPagina();
628 } 628 }
629 } 629 }
630 630
631 function retrocederPagina() { 631 function retrocederPagina() {
632 if ($scope.currentPage > 1) { 632 if ($scope.currentPage > 1) {
633 $scope.selectPage($scope.currentPage - 1); 633 $scope.selectPage($scope.currentPage - 1);
634 $scope.selectedClientes = $scope.numPerPage - 1; 634 $scope.selectedClientes = $scope.numPerPage - 1;
635 } 635 }
636 } 636 }
637 637
638 function avanzarPagina() { 638 function avanzarPagina() {
639 if ($scope.currentPage < $scope.lastPage) { 639 if ($scope.currentPage < $scope.lastPage) {
640 $scope.selectPage($scope.currentPage + 1); 640 $scope.selectPage($scope.currentPage + 1);
641 $scope.selectedClientes = 0; 641 $scope.selectedClientes = 0;
642 } 642 }
643 } 643 }
644 function validateEmails(emails) { 644 function validateEmails(emails) {
645 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 645 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
646 var arr = emails.split(','); 646 var arr = emails.split(',');
647 var result = true; 647 var result = true;
648 arr.forEach(function(email) { 648 arr.forEach(function(email) {
649 var val = String(email).trim().toLowerCase(); 649 var val = String(email).trim().toLowerCase();
650 if (!re.test(val)) result = false; 650 if (!re.test(val)) result = false;
651 }); 651 });
652 return result; 652 return result;
653 } 653 }
654 $scope.clearInput = function(){
655 $scope.filters = '';
656 }
657 } 654 }
658 ]); 655 ]);
659 656
src/views/foca-busqueda-cliente-modal.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-4 col-7"> 3 <div class="col-lg-4 col-7">
4 <h5 class="modal-title my-1" ng-hide="ingreso">Búsqueda de Cliente</h5> 4 <h5 class="modal-title my-1" ng-hide="ingreso">Búsqueda de Cliente</h5>
5 <h5 class="modal-title my-1" ng-show="ingreso">Crear Cliente</h5> 5 <h5 class="modal-title my-1" ng-show="ingreso">Crear Cliente</h5>
6 </div> 6 </div>
7 <div ng-show="ingreso" class="col-lg-6 col-5 front-index"> 7 <div ng-show="ingreso" class="col-lg-6 col-5 front-index">
8 <div class="custom-control custom-checkbox mt-2"> 8 <div class="custom-control custom-checkbox mt-2">
9 <input 9 <input
10 type="checkbox" 10 type="checkbox"
11 class="custom-control-input" 11 class="custom-control-input"
12 id="checkProspecto" 12 id="checkProspecto"
13 ng-model="cliente.ES_PROS"> 13 ng-model="cliente.ES_PROS">
14 <label class="custom-control-label" for="checkProspecto">¿Es prospecto?</label> 14 <label class="custom-control-label" for="checkProspecto">¿Es prospecto?</label>
15 </div> 15 </div>
16 </div> 16 </div>
17 <div class="input-group col-lg-6 offset-lg-2 pr-0 my-2"> 17 <div class="input-group col-lg-6 offset-lg-2 pr-0 my-2">
18 <button 18 <button
19 class="btn btn-outline-debo mr-2" 19 class="btn btn-outline-debo mr-2"
20 ng-click="ingreso = true" 20 ng-click="ingreso = true"
21 ng-show="!ingreso && vendedor.NUM" 21 ng-show="!ingreso && vendedor.NUM"
22 title="Nuevo"> 22 title="Nuevo">
23 <i class="fa fa-plus" aria-hidden="true"></i> 23 <i class="fa fa-plus" aria-hidden="true"></i>
24 </button> 24 </button>
25 <input 25 <input
26 ladda="searchLoading" 26 ladda="searchLoading"
27 type="text" 27 type="text"
28 class="form-control form-control-sm" 28 class="form-control form-control-sm"
29 id="search" 29 id="search"
30 placeholder="Busqueda" 30 placeholder="Busqueda"
31 ng-model="filters" 31 ng-model="filters"
32 ng-change="search()" 32 ng-change="search()"
33 ng-keydown="busquedaDown($event.keyCode)" 33 ng-keydown="busquedaDown($event.keyCode)"
34 ng-keypress="busquedaPress($event.keyCode)" 34 ng-keypress="busquedaPress($event.keyCode)"
35 foca-focus="selectedClientes == -1" 35 foca-focus="selectedClientes == -1"
36 ng-focus="selectedClientes = -1" 36 ng-focus="selectedClientes = -1"
37 teclado-virtual 37 teclado-virtual
38 ng-hide="ingreso" 38 ng-hide="ingreso"
39 > 39 >
40 <button 40 <button
41 ng-show="filters.length >= 1" 41 ng-show="filters.length >= 1"
42 type="button" 42 type="button"
43 class="clear-input" 43 class="clear-input"
44 ng-click="clearInput()" 44 ng-click="filters = ''"
45 > 45 >
46 <i class="fa fa-times"></i> 46 <i class="fa fa-times"></i>
47 </button> 47 </button>
48 <div class="input-group-append" ng-hide="ingreso"> 48 <div class="input-group-append" ng-hide="ingreso">
49 <button 49 <button
50 ladda="searchLoading" 50 ladda="searchLoading"
51 data-spinner-color="#FF0000" 51 data-spinner-color="#FF0000"
52 class="btn btn-outline-secondary" 52 class="btn btn-outline-secondary"
53 type="button" 53 type="button"
54 ng-click="busquedaPress(13)"> 54 ng-click="busquedaPress(13)">
55 <i class="fa fa-search" aria-hidden="true"></i> 55 <i class="fa fa-search" aria-hidden="true"></i>
56 </button> 56 </button>
57 </div> 57 </div>
58 </div> 58 </div>
59 </div> 59 </div>
60 </div> 60 </div>
61 <div class="modal-body" id="modal-body"> 61 <div class="modal-body" id="modal-body">
62 62
63 <div ng-show="!primerBusqueda && !ingreso"> 63 <div ng-show="!primerBusqueda && !ingreso">
64 Debe realizar una primer búsqueda. 64 Debe realizar una primer búsqueda.
65 </div> 65 </div>
66 66
67 <table ng-show="primerBusqueda && !ingreso" class="table table-striped table-sm"> 67 <table ng-show="primerBusqueda && !ingreso" class="table table-striped table-sm">
68 <thead> 68 <thead>
69 <tr> 69 <tr>
70 <th>Código</th> 70 <th>Código</th>
71 <th>Nombre</th> 71 <th>Nombre</th>
72 <th>CUIT</th> 72 <th>CUIT</th>
73 <th></th> 73 <th></th>
74 </tr> 74 </tr>
75 </thead> 75 </thead>
76 <tbody> 76 <tbody>
77 <tr ng-show="currentPageClientes.length == 0 && primerBusqueda"> 77 <tr ng-show="currentPageClientes.length == 0 && primerBusqueda">
78 <td colspan="4"> 78 <td colspan="4">
79 No se encontraron resultados. 79 No se encontraron resultados.
80 </td> 80 </td>
81 </tr> 81 </tr>
82 <tr 82 <tr
83 class="selectable" 83 class="selectable"
84 ng-repeat="(key, cliente) in currentPageClientes" 84 ng-repeat="(key, cliente) in currentPageClientes"
85 ng-click="select(cliente)"> 85 ng-click="select(cliente)">
86 <td ng-bind="('00000'+cliente.cod).slice(-5)"></td> 86 <td ng-bind="('00000'+cliente.cod).slice(-5)"></td>
87 <td ng-bind="cliente.nom"></td> 87 <td ng-bind="cliente.nom"></td>
88 <td ng-bind="cliente.cuit"></td> 88 <td ng-bind="cliente.cuit"></td>
89 <td> 89 <td>
90 <button 90 <button
91 type="button" 91 type="button"
92 class="btn btn-xs p-1 float-right" 92 class="btn btn-xs p-1 float-right"
93 ng-class="{ 93 ng-class="{
94 'btn-secondary': selectedClientes != key, 94 'btn-secondary': selectedClientes != key,
95 'btn-primary': selectedClientes == key 95 'btn-primary': selectedClientes == key
96 }" 96 }"
97 ng-click="select(cliente)" 97 ng-click="select(cliente)"
98 foca-focus="selectedClientes == {{key}}" 98 foca-focus="selectedClientes == {{key}}"
99 ng-keydown="itemCliente($event.keyCode)" 99 ng-keydown="itemCliente($event.keyCode)"
100 > 100 >
101 <i class="fa fa-circle-thin" aria-hidden="true"></i> 101 <i class="fa fa-circle-thin" aria-hidden="true"></i>
102 </button> 102 </button>
103 </td> 103 </td>
104 </tr> 104 </tr>
105 </tbody> 105 </tbody>
106 </table> 106 </table>
107 107
108 <form name="formCliente"> 108 <form name="formCliente">
109 <uib-tabset class="tabs-right" ng-show="ingreso"> 109 <uib-tabset class="tabs-right" ng-show="ingreso">
110 <uib-tab heading="Datos cliente"> 110 <uib-tab heading="Datos cliente">
111 <div class="row"> 111 <div class="row">
112 <div class="col-3"> 112 <div class="col-3">
113 <label>Código</label> 113 <label>Código</label>
114 <input 114 <input
115 type="text" 115 type="text"
116 class="form-control form-control-sm" 116 class="form-control form-control-sm"
117 ng-model="cliente.codigo" 117 ng-model="cliente.codigo"
118 readonly 118 readonly
119 /> 119 />
120 </div> 120 </div>
121 <div class="col-9"> 121 <div class="col-9">
122 <label>Nombre</label> 122 <label>Nombre</label>
123 <input 123 <input
124 type="text" 124 type="text"
125 class="form-control form-control-sm" 125 class="form-control form-control-sm"
126 ng-model="cliente.NOM" 126 ng-model="cliente.NOM"
127 teclado-virtual 127 teclado-virtual
128 placeholder="Ingrese nombre" 128 placeholder="Ingrese nombre"
129 ng-required="true" 129 ng-required="true"
130 foca-focus="focused == 1 || ingreso" 130 foca-focus="focused == 1 || ingreso"
131 ng-focus="focus(1)" 131 ng-focus="focus(1)"
132 ng-keypress="next($event.keyCode)" 132 ng-keypress="next($event.keyCode)"
133 /> 133 />
134 </div> 134 </div>
135 </div> 135 </div>
136 <div class="row"> 136 <div class="row">
137 <div class="col-md-9 col-12"> 137 <div class="col-md-9 col-12">
138 <label>Domicilio</label> 138 <label>Domicilio</label>
139 <input 139 <input
140 type="text" 140 type="text"
141 class="form-control form-control-sm" 141 class="form-control form-control-sm"
142 ng-model="cliente.DOM" 142 ng-model="cliente.DOM"
143 teclado-virtual 143 teclado-virtual
144 placeholder="Ingrese domicilio" 144 placeholder="Ingrese domicilio"
145 ng-required="true" 145 ng-required="true"
146 ng-focus="focus(2)" 146 ng-focus="focus(2)"
147 foca-focus="focused == 2" 147 foca-focus="focused == 2"
148 ng-keypress="next($event.keyCode)" 148 ng-keypress="next($event.keyCode)"
149 /> 149 />
150 </div> 150 </div>
151 <div class="col-md-3 col-12"> 151 <div class="col-md-3 col-12">
152 <label>Código postal</label> 152 <label>Código postal</label>
153 <input 153 <input
154 type="text" 154 type="text"
155 class="form-control form-control-sm" 155 class="form-control form-control-sm"
156 ng-model="cliente.CPO" 156 ng-model="cliente.CPO"
157 placeholder="Ingrese CP" 157 placeholder="Ingrese CP"
158 ng-required="true" 158 ng-required="true"
159 ng-focus="focus(3)" 159 ng-focus="focus(3)"
160 foca-focus="focused == 3" 160 foca-focus="focused == 3"
161 ng-keypress="next($event.keyCode)" 161 ng-keypress="next($event.keyCode)"
162 teclado-virtual 162 teclado-virtual
163 /> 163 />
164 </div> 164 </div>
165 </div> 165 </div>
166 <div class="row"> 166 <div class="row">
167 <div class="col-md-6 col-12"> 167 <div class="col-md-6 col-12">
168 <label>Provincia</label> 168 <label>Provincia</label>
169 <div class="input-group"> 169 <div class="input-group">
170 <input 170 <input
171 type="text" 171 type="text"
172 class="form-control form-control-sm" 172 class="form-control form-control-sm"
173 ng-model="cliente.provincia.NOMBRE" 173 ng-model="cliente.provincia.NOMBRE"
174 ng-keypress="seleccionarProvincia($event.keyCode)" 174 ng-keypress="seleccionarProvincia($event.keyCode)"
175 placeholder="Seleccione provincia" 175 placeholder="Seleccione provincia"
176 ng-required="true" 176 ng-required="true"
177 ng-focus="focus(4)" 177 ng-focus="focus(4)"
178 foca-focus="focused == 4" 178 foca-focus="focused == 4"
179 teclado-virtual 179 teclado-virtual
180 /> 180 />
181 <button
182 ng-show="cliente.provincia.NOMBRE.length >= 1"
183 type="button"
184 class="clear-input"
185 ng-click="cliente.provincia.NOMBRE = ''"
186 >
187 <i class="fa fa-times"></i>
188 </button>
181 <div class="input-group-append"> 189 <div class="input-group-append">
182 <button 190 <button
183 ladda="searchLoading" 191 ladda="searchLoading"
184 class="btn btn-outline-secondary" 192 class="btn btn-outline-secondary"
185 type="button" 193 type="button"
186 ng-click="seleccionarProvincia(13)" 194 ng-click="seleccionarProvincia(13)"
187 > 195 >
188 <i class="fa fa-search" aria-hidden="true"></i> 196 <i class="fa fa-search" aria-hidden="true"></i>
189 </button> 197 </button>
190 </div> 198 </div>
191 </div> 199 </div>
192 </div> 200 </div>
193 <div class="col-md-6 col-12"> 201 <div class="col-md-6 col-12">
194 <label>Localidad</label> 202 <label>Localidad</label>
195 <div class="input-group"> 203 <div class="input-group">
196 <input 204 <input
197 type="text" 205 type="text"
198 class="form-control form-control-sm" 206 class="form-control form-control-sm"
199 ng-model="cliente.localidad.NOMBRE" 207 ng-model="cliente.localidad.NOMBRE"
200 ng-keypress="seleccionarLocalidad($event.keyCode)" 208 ng-keypress="seleccionarLocalidad($event.keyCode)"
201 placeholder="Seleccione localidad" 209 placeholder="Seleccione localidad"
202 ng-required="true" 210 ng-required="true"
203 foca-focus="focused == 5" 211 foca-focus="focused == 5"
204 ng-focus="focus(5)" 212 ng-focus="focus(5)"
205 teclado-virtual 213 teclado-virtual
206 /> 214 />
215 <button
216 ng-show="cliente.localidad.NOMBRE.length >= 1"
217 type="button"
218 class="clear-input"
219 ng-click="cliente.localidad.NOMBRE = ''"
220 >
221 <i class="fa fa-times"></i>
222 </button>
207 <div class="input-group-append"> 223 <div class="input-group-append">
208 <button 224 <button
209 ladda="searchLoading" 225 ladda="searchLoading"
210 class="btn btn-outline-secondary" 226 class="btn btn-outline-secondary"
211 type="button" 227 type="button"
212 ng-click="seleccionarLocalidad(13)" 228 ng-click="seleccionarLocalidad(13)"
213 > 229 >
214 <i class="fa fa-search" aria-hidden="true"></i> 230 <i class="fa fa-search" aria-hidden="true"></i>
215 </button> 231 </button>
216 </div> 232 </div>
217 </div> 233 </div>
218 </div> 234 </div>
219 </div> 235 </div>
220 <div class="row"> 236 <div class="row">
221 <div class="col-md-6 col-12"> 237 <div class="col-md-6 col-12">
222 <label>Zona</label> 238 <label>Zona</label>
223 <div class="input-group"> 239 <div class="input-group">
224 <input 240 <input
225 type="text" 241 type="text"
226 class="form-control form-control-sm" 242 class="form-control form-control-sm"
227 ng-model="cliente.zona.NOM" 243 ng-model="cliente.zona.NOM"
228 ng-keypress="seleccionarZona($event.keyCode)" 244 ng-keypress="seleccionarZona($event.keyCode)"
229 placeholder="Seleccione zona" 245 placeholder="Seleccione zona"
230 ng-required="true" 246 ng-required="true"
231 ng-focus="focus(6)" 247 ng-focus="focus(6)"
232 foca-focus="focused == 6" 248 foca-focus="focused == 6"
233 teclado-virtual 249 teclado-virtual
234 /> 250 />
251 <button
252 ng-show="cliente.zona.NOM.length >= 1"
253 type="button"
254 class="clear-input"
255 ng-click="cliente.zona.NOM = ''"
256 >
257 <i class="fa fa-times"></i>
258 </button>
235 <div class="input-group-append"> 259 <div class="input-group-append">
236 <button 260 <button
237 ladda="searchLoading" 261 ladda="searchLoading"
238 class="btn btn-outline-secondary" 262 class="btn btn-outline-secondary"
239 type="button" 263 type="button"
240 ng-click="seleccionarZona(13)" 264 ng-click="seleccionarZona(13)"
241 > 265 >
242 <i class="fa fa-search" aria-hidden="true"></i> 266 <i class="fa fa-search" aria-hidden="true"></i>
243 </button> 267 </button>
244 </div> 268 </div>
245 </div> 269 </div>
246 </div> 270 </div>
247 <div class="col-md-6 col-12"> 271 <div class="col-md-6 col-12">
248 <label> Actividad </label> 272 <label> Actividad </label>
249 <div class="input-group"> 273 <div class="input-group">
250 <input 274 <input
251 type="text" 275 type="text"
252 class="form-control form-control-sm" 276 class="form-control form-control-sm"
253 ng-model="cliente.actividad.NOM" 277 ng-model="cliente.actividad.NOM"
254 ng-keypress="seleccionarActividad($event.keyCode)" 278 ng-keypress="seleccionarActividad($event.keyCode)"
255 placeholder="Seleccione actividad" 279 placeholder="Seleccione actividad"
256 ng-required="true" 280 ng-required="true"
257 ng-focus="focus(7)" 281 ng-focus="focus(7)"
258 foca-focus="focused == 7" 282 foca-focus="focused == 7"
259 teclado-virtual 283 teclado-virtual
260 /> 284 />
285 <button
286 ng-show="cliente.actividad.NOM.length >= 1"
287 type="button"
288 class="clear-input"
289 ng-click="cliente.actividad.NOM = ''"
290 >
291 <i class="fa fa-times"></i>
292 </button>
261 <div class="input-group-append"> 293 <div class="input-group-append">
262 <button 294 <button
263 ladda="searchLoading" 295 ladda="searchLoading"
264 class="btn btn-outline-secondary" 296 class="btn btn-outline-secondary"
265 type="button" 297 type="button"
266 ng-click="seleccionarActividad(13)" 298 ng-click="seleccionarActividad(13)"
267 > 299 >
268 <i class="fa fa-search" aria-hidden="true"></i> 300 <i class="fa fa-search" aria-hidden="true"></i>
269 </button> 301 </button>
270 </div> 302 </div>
271 </div> 303 </div>
272 </div> 304 </div>
273 </div> 305 </div>
274 <div class="row"> 306 <div class="row">
275 <div class="col-md-6 col-12"> 307 <div class="col-md-6 col-12">
276 <label>Cobrador</label> 308 <label>Cobrador</label>
277 <div class="input-group"> 309 <div class="input-group">
278 <input 310 <input
279 type="text" 311 type="text"
280 class="form-control form-control-sm" 312 class="form-control form-control-sm"
281 ng-model="cliente.cobrador.NOM" 313 ng-model="cliente.cobrador.NOM"
282 ng-keypress="seleccionarCobrador($event.keyCode)" 314 ng-keypress="seleccionarCobrador($event.keyCode)"
283 placeholder="Seleccione cobrador" 315 placeholder="Seleccione cobrador"
284 ng-focus="focus(8)" 316 ng-focus="focus(8)"
285 foca-focus="focused == 8" 317 foca-focus="focused == 8"
286 teclado-virtual 318 teclado-virtual
287 /> 319 />
320 <button
321 ng-show="cliente.cobrador.NOM.length >= 1"
322 type="button"
323 class="clear-input"
324 ng-click="cliente.cobrador.NOM = ''"
325 >
326 <i class="fa fa-times"></i>
327 </button>
288 <div class="input-group-append"> 328 <div class="input-group-append">
289 <button 329 <button
290 ladda="searchLoading" 330 ladda="searchLoading"
291 class="btn btn-outline-secondary" 331 class="btn btn-outline-secondary"
292 type="button" 332 type="button"
293 ng-click="seleccionarCobrador(13)" 333 ng-click="seleccionarCobrador(13)"
294 > 334 >
295 <i class="fa fa-search" aria-hidden="true"></i> 335 <i class="fa fa-search" aria-hidden="true"></i>
296 </button> 336 </button>
297 </div> 337 </div>
298 </div> 338 </div>
299 </div> 339 </div>
300 <div class="col-md-6 col-12"> 340 <div class="col-md-6 col-12">
301 <label>Vendedor</label> 341 <label>Vendedor</label>
302 <div class="input-group"> 342 <div class="input-group">
303 <input 343 <input
304 type="text" 344 type="text"
305 class="form-control form-control-sm" 345 class="form-control form-control-sm"
306 ng-model="vendedor.NOM" 346 ng-model="vendedor.NOM"
307 disabled="true" 347 disabled="true"
308 /> 348 />
309 </div> 349 </div>
310 </div> 350 </div>
311 <div class="col-md-6 col-12"> 351 <div class="col-md-6 col-12">
312 <label>Email</label> 352 <label>Email</label>
313 <div class="input-group"> 353 <div class="input-group">
314 <input 354 <input
315 type="text" 355 type="text"
316 class="form-control form-control-sm" 356 class="form-control form-control-sm"
317 placeholder="Ingrese Email" 357 placeholder="Ingrese Email"
318 ng-model="cliente.MAIL" 358 ng-model="cliente.MAIL"
319 ng-required="true" 359 ng-required="true"
320 ng-keypress="next($event.keyCode)" 360 ng-keypress="next($event.keyCode)"
321 ng-focus="focus(10)" 361 ng-focus="focus(10)"
322 foca-focus="focused == 10" 362 foca-focus="focused == 10"
323 teclado-virtual> 363 teclado-virtual>
324 </div> 364 </div>
325 </div> 365 </div>
326 <div class="col-md-6 col-12"> 366 <div class="col-md-6 col-12">
327 <label>Telefono</label> 367 <label>Telefono</label>
328 <div class="input-group"> 368 <div class="input-group">
329 <input 369 <input
330 foca-tipo-input 370 foca-tipo-input
331 limite-numeros-max="20" 371 limite-numeros-max="20"
332 class="form-control form-control-sm" 372 class="form-control form-control-sm"
333 placeholder="Ingrese Telefono" 373 placeholder="Ingrese Telefono"
334 ng-model="cliente.TEL" 374 ng-model="cliente.TEL"
335 ng-required="true" 375 ng-required="true"
336 ng-keypress="next($event.keyCode)" 376 ng-keypress="next($event.keyCode)"
337 ng-focus="focus(11)" 377 ng-focus="focus(11)"
338 foca-focus="focused == 11" 378 foca-focus="focused == 11"
339 teclado-virtual> 379 teclado-virtual>
340 </div> 380 </div>
341 </div> 381 </div>
342 </div> 382 </div>
343 <div class="row"> 383 <div class="row">
344 <div class="col-6 d-flex"> 384 <div class="col-6 d-flex">
345 <div class="custom-control custom-checkbox mt-auto"> 385 <div class="custom-control custom-checkbox mt-auto">
346 <input 386 <input
347 type="checkbox" 387 type="checkbox"
348 class="custom-control-input" 388 class="custom-control-input"
349 id="checkDistribuidor" 389 id="checkDistribuidor"
350 ng-model="cliente.ES_MAY" 390 ng-model="cliente.ES_MAY"
351 checked 391 checked
352 disabled="disabled"> 392 disabled="disabled">
353 <label class="custom-control-label" for="checkDistribuidor">¿Este cliente es distribuidor?</label> 393 <label class="custom-control-label" for="checkDistribuidor">¿Este cliente es distribuidor?</label>
354 </div> 394 </div>
355 </div> 395 </div>
356 </div> 396 </div>
357 </uib-tab> 397 </uib-tab>
358 <uib-tab heading="Datos impositivos"> 398 <uib-tab heading="Datos impositivos">
359 <div class="row"> 399 <div class="row">
360 <div class="col-md-7 col-12"> 400 <div class="col-md-7 col-12">
361 <label>Responsabilidad ante el IVA</label> 401 <label>Responsabilidad ante el IVA</label>
362 <div class="input-group"> 402 <div class="input-group">
363 <input 403 <input
364 type="text" 404 type="text"
365 class="form-control form-control-sm" 405 class="form-control form-control-sm"
366 placeholder="Seleccione responsabilidad ante el IVA" 406 placeholder="Seleccione responsabilidad ante el IVA"
367 ng-model="cliente.iva.NOMBRE" 407 ng-model="cliente.iva.NOMBRE"
368 ng-keypress="seleccionarIva($event.keyCode)" 408 ng-keypress="seleccionarIva($event.keyCode)"
369 ng-required="true" 409 ng-required="true"
370 ng-focus="focus(12)" 410 ng-focus="focus(12)"
371 foca-focus="focused == 12" 411 foca-focus="focused == 12"
372 teclado-virtual 412 teclado-virtual
373 /> 413 />
414 <button
415 ng-show="cliente.iva.NOMBRE.length >= 1"
416 type="button"
417 class="clear-input"
418 ng-click="cliente.iva.NOMBRE = ''"
419 >
420 <i class="fa fa-times"></i>
421 </button>
374 <div class="input-group-append"> 422 <div class="input-group-append">
375 <button 423 <button
376 ladda="searchLoading" 424 ladda="searchLoading"
377 class="btn btn-outline-secondary" 425 class="btn btn-outline-secondary"
378 type="button" 426 type="button"
379 ng-click="seleccionarIva(13)" 427 ng-click="seleccionarIva(13)"
380 > 428 >
381 <i class="fa fa-search" aria-hidden="true"></i> 429 <i class="fa fa-search" aria-hidden="true"></i>
382 </button> 430 </button>
383 </div> 431 </div>
384 </div> 432 </div>
385 </div> 433 </div>
386 <div class="col-md-5 col-12"> 434 <div class="col-md-5 col-12">
387 <label>Factura que emite</label> 435 <label>Factura que emite</label>
388 <div class="input-group"> 436 <div class="input-group">
389 <input 437 <input
390 type="text" 438 type="text"
391 class="form-control form-control-sm" 439 class="form-control form-control-sm"
392 placeholder="Seleccione factura que emite" 440 placeholder="Seleccione factura que emite"
393 ng-model="cliente.tipoFactura.NOMBRE" 441 ng-model="cliente.tipoFactura.NOMBRE"
394 ng-required="true" 442 ng-required="true"
395 ng-keypress="seleccionarTipoFactura(13)" 443 ng-keypress="seleccionarTipoFactura(13)"
396 ng-focus="focus(13)" 444 ng-focus="focus(13)"
397 foca-focus="focused == 13" 445 foca-focus="focused == 13"
398 teclado-virtual> 446 teclado-virtual>
447 <button
448 ng-show="cliente.tipoFactura.NOMBRE.length >= 1"
449 type="button"
450 class="clear-input"
451 ng-click="cliente.tipoFactura.NOMBRE = ''"
452 >
453 <i class="fa fa-times"></i>
454 </button>
399 <div class="input-group-append"> 455 <div class="input-group-append">
400 <button 456 <button
401 ladda="searchLoading" 457 ladda="searchLoading"
402 class="btn btn-outline-secondary" 458 class="btn btn-outline-secondary"
403 type="button" 459 type="button"
404 ng-click="seleccionarTipoFactura(13)" 460 ng-click="seleccionarTipoFactura(13)"
405 > 461 >
406 <i class="fa fa-search" aria-hidden="true"></i> 462 <i class="fa fa-search" aria-hidden="true"></i>
407 </button> 463 </button>
408 </div> 464 </div>
409 </div> 465 </div>
410 </div> 466 </div>
411 </div> 467 </div>
412 468
413 <div class="row"> 469 <div class="row">
414 <div class= "col-md-4 col-12"> 470 <div class= "col-md-4 col-12">
415 <label>CUIT</label> 471 <label>CUIT</label>
416 <div class="d-flex"> 472 <div class="d-flex">
417 <input 473 <input
418 type="text" 474 type="text"
419 class="form-control form-control-sm col-2" 475 class="form-control form-control-sm col-2"
420 limite-numeros-max="2" 476 limite-numeros-max="2"
421 ng-model="cliente.cuit1" 477 ng-model="cliente.cuit1"
422 ng-required="true" 478 ng-required="true"
423 ng-keypress="pasarCampoCuit(1)" 479 ng-keypress="pasarCampoCuit(1)"
424 ng-focus="focus(14)" 480 ng-focus="focus(14)"
425 foca-focus="focused == 14" 481 foca-focus="focused == 14"
426 teclado-virtual 482 teclado-virtual
427 > 483 >
428 <span class="m-1"> - </span> 484 <span class="m-1"> - </span>
429 <input 485 <input
430 type="text" 486 type="text"
431 class="form-control form-control-sm col-5" 487 class="form-control form-control-sm col-5"
432 maxlength="8" 488 maxlength="8"
433 limite-numeros-max="8" 489 limite-numeros-max="8"
434 ng-keypress="pasarCampoCuit(2)" 490 ng-keypress="pasarCampoCuit(2)"
435 ng-model="cliente.cuit2" 491 ng-model="cliente.cuit2"
436 ng-required="true" 492 ng-required="true"
437 ng-focus="focus(15)" 493 ng-focus="focus(15)"
438 foca-focus="cuitActivo == 2 || focused == 15" 494 foca-focus="cuitActivo == 2 || focused == 15"
439 teclado-virtual 495 teclado-virtual
440 > 496 >
441 <span class="m-1"> - </span> 497 <span class="m-1"> - </span>
442 <input 498 <input
443 type="text" 499 type="text"
444 class="form-control form-control-sm col-2" 500 class="form-control form-control-sm col-2"
445 maxlength="1" 501 maxlength="1"
446 limite-numeros-max="1" 502 limite-numeros-max="1"
447 ng-keypress="pasarCampoCuit(3)" 503 ng-keypress="pasarCampoCuit(3)"
448 ng-model="cliente.cuit3" 504 ng-model="cliente.cuit3"
449 ng-required="true" 505 ng-required="true"
450 ng-focus="focus(16)" 506 ng-focus="focus(16)"
451 foca-focus="cuitActivo == 3 || focused == 16" 507 foca-focus="cuitActivo == 3 || focused == 16"
452 teclado-virtual 508 teclado-virtual
453 > 509 >
454 </div> 510 </div>
455 </div> 511 </div>
456 <div class="col-md-4 col-12"> 512 <div class="col-md-4 col-12">
457 <label>Clase de comprobante</label> 513 <label>Clase de comprobante</label>
458 <div class="input-group"> 514 <div class="input-group">
459 <input 515 <input
460 type="text" 516 type="text"
461 class="form-control form-control-sm" 517 class="form-control form-control-sm"
462 placeholder="Seleccione clase de comprobante" 518 placeholder="Seleccione clase de comprobante"
463 ng-keypress="seleccionarTipoComprobante($event.keyCode)" 519 ng-keypress="seleccionarTipoComprobante($event.keyCode)"
464 ng-model="cliente.tipoComprobante.NOMBRE" 520 ng-model="cliente.tipoComprobante.NOMBRE"
465 ng-required="true" 521 ng-required="true"
466 ng-focus="focus(17)" 522 ng-focus="focus(17)"
467 foca-focus="focused == 17" 523 foca-focus="focused == 17"
468 teclado-virtual> 524 teclado-virtual>
525 <button
526 ng-show="cliente.tipoComprobante.NOMBRE.length >= 1"
527 type="button"
528 class="clear-input"
529 ng-click="cliente.tipoComprobante.NOMBRE = ''"
530 >
531 <i class="fa fa-times"></i>
532 </button>
469 <div class="input-group-append"> 533 <div class="input-group-append">
470 <button 534 <button
471 ladda="searchLoading" 535 ladda="searchLoading"
472 class="btn btn-outline-secondary" 536 class="btn btn-outline-secondary"
473 type="button" 537 type="button"
474 ng-click="seleccionarTipoComprobante(13)" 538 ng-click="seleccionarTipoComprobante(13)"
475 > 539 >
476 <i class="fa fa-search" aria-hidden="true"></i> 540 <i class="fa fa-search" aria-hidden="true"></i>
477 </button> 541 </button>
478 </div> 542 </div>
479 </div> 543 </div>
480 </div> 544 </div>
481 <div class="col-md-4 col-12"> 545 <div class="col-md-4 col-12">
482 <label>Forma de pago</label> 546 <label>Forma de pago</label>
483 <div class="input-group"> 547 <div class="input-group">
484 <input 548 <input
485 type="text" 549 type="text"
486 class="form-control form-control-sm" 550 class="form-control form-control-sm"
487 placeholder="Seleccione forma de pago" 551 placeholder="Seleccione forma de pago"
488 ng-model="cliente.formaPago.NOMBRE" 552 ng-model="cliente.formaPago.NOMBRE"
489 ng-required="true" 553 ng-required="true"
490 ng-keypress="seleccionarFormaPago($event.keyCode)" 554 ng-keypress="seleccionarFormaPago($event.keyCode)"
491 ng-focus="focus(18)" 555 ng-focus="focus(18)"
492 foca-focus="focused == 18" 556 foca-focus="focused == 18"
493 teclado-virtual> 557 teclado-virtual>
558 <button
559 ng-show="cliente.formaPago.NOMBRE.length >= 1"
560 type="button"
561 class="clear-input"
562 ng-click="cliente.formaPago.NOMBRE = ''"
563 >
564 <i class="fa fa-times"></i>
565 </button>
494 <div class="input-group-append"> 566 <div class="input-group-append">
495 <button 567 <button
496 ladda="searchLoading" 568 ladda="searchLoading"
497 class="btn btn-outline-secondary" 569 class="btn btn-outline-secondary"
498 type="button" 570 type="button"
499 ng-click="seleccionarFormaPago(13)" 571 ng-click="seleccionarFormaPago(13)"
500 > 572 >
501 <i class="fa fa-search" aria-hidden="true"></i> 573 <i class="fa fa-search" aria-hidden="true"></i>
502 </button> 574 </button>
503 </div> 575 </div>
504 </div> 576 </div>
505 </div> 577 </div>
506 </div> 578 </div>
507 </uib-tab> 579 </uib-tab>
508 </uib-tabset> 580 </uib-tabset>
509 </form> 581 </form>
510 </div> 582 </div>
511 <div class="modal-footer py-1"> 583 <div class="modal-footer py-1">
512 <nav ng-show="currentPageClientes.length > 0 && primerBusqueda && !ingreso" class="mr-auto"> 584 <nav ng-show="currentPageClientes.length > 0 && primerBusqueda && !ingreso" class="mr-auto">
513 <ul class="pagination pagination-sm mb-0"> 585 <ul class="pagination pagination-sm mb-0">
514 <li class="page-item" ng-class="{'disabled': currentPage == 1}"> 586 <li class="page-item" ng-class="{'disabled': currentPage == 1}">
515 <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> 587 <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)">
516 <span aria-hidden="true">&laquo;</span> 588 <span aria-hidden="true">&laquo;</span>
517 <span class="sr-only">Anterior</span> 589 <span class="sr-only">Anterior</span>
518 </a> 590 </a>
519 </li> 591 </li>
520 <li 592 <li
521 class="page-item" 593 class="page-item"
522 ng-repeat="pagina in paginas" 594 ng-repeat="pagina in paginas"
523 ng-class="{'active': pagina == currentPage}" 595 ng-class="{'active': pagina == currentPage}"
524 > 596 >
525 <a 597 <a
526 class="page-link" 598 class="page-link"
527 href="javascript:void()" 599 href="javascript:void()"
528 ng-click="selectPage(pagina)" 600 ng-click="selectPage(pagina)"
529 ng-bind="pagina" 601 ng-bind="pagina"
530 ></a> 602 ></a>
531 </li> 603 </li>
532 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> 604 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
533 <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> 605 <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)">
534 <span aria-hidden="true">&raquo;</span> 606 <span aria-hidden="true">&raquo;</span>
535 <span class="sr-only">Siguiente</span> 607 <span class="sr-only">Siguiente</span>
536 </a> 608 </a>
537 </li> 609 </li>
538 </ul> 610 </ul>
539 </nav> 611 </nav>
540 <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> 612 <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button>
541 <button 613 <button
542 class="btn btn-sm btn-primary" 614 class="btn btn-sm btn-primary"
543 type="button" 615 type="button"
544 ng-show="ingreso" 616 ng-show="ingreso"
545 ng-click="guardar()" 617 ng-click="guardar()"
546 >Guardar</button> 618 >Guardar</button>
547 </div> 619 </div>
548 620