Commit 5570c2fa3ec91516d4d74d8bac7e34b73b4e8799

Authored by Luigi
1 parent 7794aa6f38
Exists in master and in 1 other branch develop

Paginacion

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