From 9296c6d3f362d2ae250e677cc582508f20222cce Mon Sep 17 00:00:00 2001 From: Luigi Date: Thu, 7 Mar 2019 11:08:18 -0300 Subject: [PATCH] Validacion de cliente --- src/js/controller.js | 44 +++++++++++++++++++++++++++++- src/views/foca-busqueda-cliente-modal.html | 4 +-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 6a35c6a..911bcef 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -414,6 +414,7 @@ angular.module('focaBusquedaCliente') }; focaModalService.modal(parametrosModal).then( function(cobrador) { + console.log(cobrador); $scope.cliente.cobrador = cobrador; }, function() { // funcion ejecutada cuando se cancela el modal @@ -421,7 +422,48 @@ angular.module('focaBusquedaCliente') } }; - $scope.guardar = function() { + $scope.guardar = function() { + + if (!$scope.cliente.NOM) { + focaModalService.alert('Ingrese Nombre'); + return; + } else if (!$scope.cliente.CPO) { + focaModalService.alert('Ingrese Codigo Postal'); + return; + } else if (!$scope.cliente.provincia.NOMBRE) { + focaModalService.alert('Seleccione una provincia'); + return; + } else if (!$scope.cliente.DOM) { + focaModalService.alert('Ingrese Domicilio'); + return; + } else if (!$scope.cliente.localidad.NOMBRE) { + focaModalService.alert('Seleccione una localidad'); + return; + } else if (!$scope.cliente.zona.NOM) { + focaModalService.alert('Seleccione una zona'); + return; + } else if (!$scope.cliente.actividad.NOM) { + focaModalService.alert('Seleccione actividad'); + return; + } else if (!$scope.cliente.cobrador.NUM) { + focaModalService.alert('Seleccione un cobrador'); + return; + } else if (!$scope.cliente.iva.NOMBRE) { + focaModalService.alert('Seleccione responsabilidad ante el IVA'); + return; + } else if (!$scope.cliente.tipoFactura.NOMBRE) { + focaModalService.alert('Seleccione tipo de Factura'); + return; + } else if (!$scope.cliente.CUIT) { + focaModalService.alert('Ingresar CUIT'); + return; + } else if (!$scope.cliente.tipoComprobante.NOMBRE) { + focaModalService.alert('Seleccione un Comprobante'); + return; + } else if (!$scope.cliente.formaPago.NOMBRE) { + focaModalService.alert('Seleccione una forma de pago'); + return; + } $scope.cliente.PCX = $scope.cliente.provincia.ID; $scope.cliente.LOX = $scope.cliente.localidad.ID; diff --git a/src/views/foca-busqueda-cliente-modal.html b/src/views/foca-busqueda-cliente-modal.html index 103ff6c..76600ed 100644 --- a/src/views/foca-busqueda-cliente-modal.html +++ b/src/views/foca-busqueda-cliente-modal.html @@ -270,7 +270,7 @@ Guardar + >Guardar -- 1.9.1