Commit c524383b8ba5ee55892db3e4a36e530f28f2bc59
1 parent
2aeb5fc11d
Exists in
master
Alerta en el campo CUIT - Cambio en Seleccionar TipoFactura
Showing
1 changed file
with
25 additions
and
38 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -324,8 +324,9 @@ angular.module('focaBusquedaCliente') |
| 324 | 324 | }; |
| 325 | 325 | $scope.seleccionarTipoFactura = function(key) { |
| 326 | 326 | if (key === 13) { |
| 327 | + var datos; | |
| 327 | 328 | if ($scope.cliente.iva.ID == 1) { |
| 328 | - var datos = [ | |
| 329 | + datos = [ | |
| 329 | 330 | { |
| 330 | 331 | id: 'A', |
| 331 | 332 | nombre: 'Factura A' |
| ... | ... | @@ -339,25 +340,9 @@ angular.module('focaBusquedaCliente') |
| 339 | 340 | nombre: 'Remito' |
| 340 | 341 | } |
| 341 | 342 | ]; |
| 342 | - focaModalService.modal({ | |
| 343 | - titulo: 'Seleccionar Factura', | |
| 344 | - data: datos, | |
| 345 | - size: 'md', | |
| 346 | - columnas: [ | |
| 347 | - { | |
| 348 | - propiedad: 'id', | |
| 349 | - nombre: 'Codigo' | |
| 350 | - }, | |
| 351 | - { | |
| 352 | - propiedad: 'nombre', | |
| 353 | - nombre: 'Factura' | |
| 354 | - } | |
| 355 | - ], | |
| 356 | - }).then(function(res) { | |
| 357 | - $scope.cliente.tipoFactura.NOMBRE = res.nombre; | |
| 358 | - }); | |
| 359 | - } else if ($scope.cliente.iva.ID == 3 || $scope.cliente.iva.ID == 4 || $scope.cliente.iva.ID == 5) { | |
| 360 | - var datos2 = [ | |
| 343 | + | |
| 344 | + } else { | |
| 345 | + datos = [ | |
| 361 | 346 | { |
| 362 | 347 | id: 'B', |
| 363 | 348 | nombre: 'Factura B' |
| ... | ... | @@ -367,24 +352,24 @@ angular.module('focaBusquedaCliente') |
| 367 | 352 | nombre: 'Remito' |
| 368 | 353 | } |
| 369 | 354 | ]; |
| 370 | - focaModalService.modal({ | |
| 371 | - titulo: 'Seleccionar Factura', | |
| 372 | - data: datos2, | |
| 373 | - size: 'md', | |
| 374 | - columnas: [ | |
| 375 | - { | |
| 376 | - propiedad: 'id', | |
| 377 | - nombre: 'Codigo' | |
| 378 | - }, | |
| 379 | - { | |
| 380 | - propiedad: 'nombre', | |
| 381 | - nombre: 'Factura' | |
| 382 | - } | |
| 383 | - ], | |
| 384 | - }).then(function(res) { | |
| 385 | - $scope.cliente.tipoFactura.NOMBRE = res.nombre; | |
| 386 | - }); | |
| 387 | 355 | } |
| 356 | + focaModalService.modal({ | |
| 357 | + titulo: 'Seleccionar Factura', | |
| 358 | + data: datos, | |
| 359 | + size: 'md', | |
| 360 | + columnas: [ | |
| 361 | + { | |
| 362 | + propiedad: 'id', | |
| 363 | + nombre: 'Codigo' | |
| 364 | + }, | |
| 365 | + { | |
| 366 | + propiedad: 'nombre', | |
| 367 | + nombre: 'Factura' | |
| 368 | + } | |
| 369 | + ], | |
| 370 | + }).then(function(res) { | |
| 371 | + $scope.cliente.tipoFactura.NOMBRE = res.nombre; | |
| 372 | + }); | |
| 388 | 373 | } |
| 389 | 374 | }; |
| 390 | 375 | $scope.seleccionarTipoComprobante = function(key) { |
| ... | ... | @@ -515,6 +500,9 @@ angular.module('focaBusquedaCliente') |
| 515 | 500 | } else if (!$scope.cliente.cuit1 && !$scope.cliente.cuit2 && !$scope.cliente.cuit3) { |
| 516 | 501 | focaModalService.alert('Ingresar CUIT'); |
| 517 | 502 | return; |
| 503 | + } else if (!$scope.cliente.cuit1 || !$scope.cliente.cuit2 || !$scope.cliente.cuit3){ | |
| 504 | + focaModalService.alert('Cuit Incompleto'); | |
| 505 | + return; | |
| 518 | 506 | } else if (!$scope.regexCuit.test($scope.cliente.cuit1 + $scope.cliente.cuit2 + $scope.cliente.cuit3) ) { |
| 519 | 507 | focaModalService.alert('Debe ingresar CUIT con formato: XX-XXXXXXXX-X'); |
| 520 | 508 | return; |
| ... | ... | @@ -526,7 +514,6 @@ angular.module('focaBusquedaCliente') |
| 526 | 514 | return; |
| 527 | 515 | } |
| 528 | 516 | |
| 529 | - | |
| 530 | 517 | var cliente = crearCopia(); |
| 531 | 518 | |
| 532 | 519 | focaBusquedaClienteService |