Commit e1f45452b5ea561ee55ff1391ab034ce8f633a3f

Authored by Marcelo Puebla
1 parent 76b43cb972
Exists in master and in 1 other branch develop

Cambio input de vendedor por un buscador de vendedores.

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