Commit e712e1149b935fa53d2b885dfec634b9e52194a3
1 parent
2adebe2d11
Exists in
master
and in
1 other branch
Limite de números CUIT
Showing
2 changed files
with
5 additions
and
7 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -538,7 +538,7 @@ angular.module('focaBusquedaCliente') |
538 | 538 | $scope.select(cliente, true); |
539 | 539 | }); |
540 | 540 | }; |
541 | - | |
541 | + | |
542 | 542 | function crearCopia(){ |
543 | 543 | var cliente = angular.copy($scope.cliente); |
544 | 544 | |
... | ... | @@ -633,20 +633,15 @@ angular.module('focaBusquedaCliente') |
633 | 633 | $scope.selectedClientes = 0; |
634 | 634 | } |
635 | 635 | } |
636 | - // | |
637 | 636 | function validateEmails(emails) { |
638 | 637 | 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,}))$/; |
639 | 638 | var arr = emails.split(','); |
640 | 639 | var result = true; |
641 | - | |
642 | 640 | arr.forEach(function(email) { |
643 | 641 | var val = String(email).trim().toLowerCase(); |
644 | - | |
645 | 642 | if (!re.test(val)) result = false; |
646 | 643 | }); |
647 | - | |
648 | 644 | return result; |
649 | 645 | } |
650 | - | |
651 | 646 | } |
652 | 647 | ]); |
src/views/foca-busqueda-cliente-modal.html
... | ... | @@ -408,7 +408,8 @@ |
408 | 408 | <input |
409 | 409 | type="text" |
410 | 410 | class="form-control form-control-sm col-2" |
411 | - maxlength="2" | |
411 | + max="2" | |
412 | + limite-numeros-max="2" | |
412 | 413 | ng-model="cliente.cuit1" |
413 | 414 | ng-required="true" |
414 | 415 | ng-keypress="pasarCampoCuit(1)" |
... | ... | @@ -421,6 +422,7 @@ |
421 | 422 | type="text" |
422 | 423 | class="form-control form-control-sm col-5" |
423 | 424 | maxlength="8" |
425 | + limite-numeros-max="8" | |
424 | 426 | ng-keypress="pasarCampoCuit(2)" |
425 | 427 | ng-model="cliente.cuit2" |
426 | 428 | ng-required="true" |
... | ... | @@ -433,6 +435,7 @@ |
433 | 435 | type="text" |
434 | 436 | class="form-control form-control-sm col-2" |
435 | 437 | maxlength="1" |
438 | + limite-numeros-max="1" | |
436 | 439 | ng-keypress="pasarCampoCuit(3)" |
437 | 440 | ng-model="cliente.cuit3" |
438 | 441 | ng-required="true" |