Commit 7f6b31e47bd66894a03505c1db4614150e4cc35e

Authored by Luigi
Exists in master

Merge remote-tracking branch 'upstream/develop'

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