From 478c8edb644a98c5cd79133172c99b63438e9dbc Mon Sep 17 00:00:00 2001 From: Luigi Date: Thu, 21 Mar 2019 14:50:09 -0300 Subject: [PATCH] Guardar y busqueda arreglado --- src/js/controller.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 33725a6..a2d2efe 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -231,7 +231,6 @@ angular.module('focaBusquedaCliente') $scope.seleccionarIva = function(key) { if (key === 13) { var parametrosModal = { - searchText: $scope.cliente.iva.NOMBRE, query: '/iva', columnas: [ { @@ -333,28 +332,27 @@ angular.module('focaBusquedaCliente') if ($scope.cliente.iva.ID == 1) { datos = [ { - id: 'A', - nombre: 'Factura A' + ID: 'A', + NOMBRE: 'Factura A' }, { - id: 'M', - nombre: 'Factura M' + ID: 'M', + NOMBRE: 'Factura M' }, { - id: 'R', - nombre: 'Remito' + ID: 'R', + NOMBRE: 'Remito' } ]; - } else { datos = [ { - id: 'B', - nombre: 'Factura B' + ID: 'B', + NOMBRE: 'Factura B' }, { - id: 'R', - nombre: 'Remito' + ID: 'R', + NOMBRE: 'Remito' } ]; } @@ -364,16 +362,16 @@ angular.module('focaBusquedaCliente') size: 'md', columnas: [ { - propiedad: 'id', - nombre: 'Codigo' + propiedad: 'ID', + NOMBRE: 'Codigo' }, { - propiedad: 'nombre', - nombre: 'Factura' + propiedad: 'NOMBRE', + NOMBRE: 'Factura' } ], }).then(function(res) { - $scope.cliente.tipoFactura.NOMBRE = res.nombre; + $scope.cliente.tipoFactura = res; }); } }; @@ -464,6 +462,7 @@ angular.module('focaBusquedaCliente') }; $scope.pasarCampoCuit = function(numeroCuit) { + if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { $scope.cuitActivo = 2; } else if ( numeroCuit === 2 && $scope.cliente.cuit2.length === 8) { @@ -472,6 +471,8 @@ angular.module('focaBusquedaCliente') }; $scope.guardar = function() { + console.log('Cliente: ', $scope.cliente); + if (!$scope.cliente.NOM) { focaModalService.alert('Ingrese Nombre'); return; @@ -564,7 +565,7 @@ angular.module('focaBusquedaCliente') delete cliente.cuit1; delete cliente.cuit2; delete cliente.cuit3; - + console.log('Copia Cliente: ',cliente); return cliente; } -- 1.9.1