Commit 9296c6d3f362d2ae250e677cc582508f20222cce
1 parent
bf6bf47fcd
Exists in
master
Validacion de cliente
Showing
2 changed files
with
45 additions
and
3 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -414,6 +414,7 @@ angular.module('focaBusquedaCliente') |
| 414 | 414 | }; |
| 415 | 415 | focaModalService.modal(parametrosModal).then( |
| 416 | 416 | function(cobrador) { |
| 417 | + console.log(cobrador); | |
| 417 | 418 | $scope.cliente.cobrador = cobrador; |
| 418 | 419 | }, function() { |
| 419 | 420 | // funcion ejecutada cuando se cancela el modal |
| ... | ... | @@ -421,7 +422,48 @@ angular.module('focaBusquedaCliente') |
| 421 | 422 | } |
| 422 | 423 | }; |
| 423 | 424 | |
| 424 | - $scope.guardar = function() { | |
| 425 | + $scope.guardar = function() { | |
| 426 | + | |
| 427 | + if (!$scope.cliente.NOM) { | |
| 428 | + focaModalService.alert('Ingrese Nombre'); | |
| 429 | + return; | |
| 430 | + } else if (!$scope.cliente.CPO) { | |
| 431 | + focaModalService.alert('Ingrese Codigo Postal'); | |
| 432 | + return; | |
| 433 | + } else if (!$scope.cliente.provincia.NOMBRE) { | |
| 434 | + focaModalService.alert('Seleccione una provincia'); | |
| 435 | + return; | |
| 436 | + } else if (!$scope.cliente.DOM) { | |
| 437 | + focaModalService.alert('Ingrese Domicilio'); | |
| 438 | + return; | |
| 439 | + } else if (!$scope.cliente.localidad.NOMBRE) { | |
| 440 | + focaModalService.alert('Seleccione una localidad'); | |
| 441 | + return; | |
| 442 | + } else if (!$scope.cliente.zona.NOM) { | |
| 443 | + focaModalService.alert('Seleccione una zona'); | |
| 444 | + return; | |
| 445 | + } else if (!$scope.cliente.actividad.NOM) { | |
| 446 | + focaModalService.alert('Seleccione actividad'); | |
| 447 | + return; | |
| 448 | + } else if (!$scope.cliente.cobrador.NUM) { | |
| 449 | + focaModalService.alert('Seleccione un cobrador'); | |
| 450 | + return; | |
| 451 | + } else if (!$scope.cliente.iva.NOMBRE) { | |
| 452 | + focaModalService.alert('Seleccione responsabilidad ante el IVA'); | |
| 453 | + return; | |
| 454 | + } else if (!$scope.cliente.tipoFactura.NOMBRE) { | |
| 455 | + focaModalService.alert('Seleccione tipo de Factura'); | |
| 456 | + return; | |
| 457 | + } else if (!$scope.cliente.CUIT) { | |
| 458 | + focaModalService.alert('Ingresar CUIT'); | |
| 459 | + return; | |
| 460 | + } else if (!$scope.cliente.tipoComprobante.NOMBRE) { | |
| 461 | + focaModalService.alert('Seleccione un Comprobante'); | |
| 462 | + return; | |
| 463 | + } else if (!$scope.cliente.formaPago.NOMBRE) { | |
| 464 | + focaModalService.alert('Seleccione una forma de pago'); | |
| 465 | + return; | |
| 466 | + } | |
| 425 | 467 | |
| 426 | 468 | $scope.cliente.PCX = $scope.cliente.provincia.ID; |
| 427 | 469 | $scope.cliente.LOX = $scope.cliente.localidad.ID; |
src/views/foca-busqueda-cliente-modal.html
| ... | ... | @@ -270,7 +270,7 @@ |
| 270 | 270 | <input |
| 271 | 271 | type="text" |
| 272 | 272 | class="form-control form-control-sm" |
| 273 | - ng-model="cliente.cobrador.NomVen" | |
| 273 | + ng-model="cliente.cobrador.NOM" | |
| 274 | 274 | ng-keypress="seleccionarCobrador($event.keyCode)" |
| 275 | 275 | placeholder="Ingrese cobrador" |
| 276 | 276 | ng-focus="focus(8)" |
| ... | ... | @@ -478,5 +478,5 @@ |
| 478 | 478 | type="button" |
| 479 | 479 | ng-show="ingreso" |
| 480 | 480 | ng-click="guardar()" |
| 481 | - ng-disabled="!formCliente.$valid">Guardar</button> | |
| 481 | + >Guardar</button> | |
| 482 | 482 | </div> |