diff --git a/src/js/controller.js b/src/js/controller.js index 5492dd8..f6abd68 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -253,11 +253,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; $scope.seleccionarProductos = function() { + if ($scope.idLista === undefined) { focaModalService.alert( 'Primero seleccione una lista de precio y condicion'); return; + } else if (!validarNotaRemitada()) { + return; } + var modalInstance = $uibModal.open( { ariaLabelledBy: 'Busqueda de Productos', @@ -597,6 +601,11 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; $scope.seleccionarPreciosYCondiciones = function() { + + if (!validarNotaRemitada()) { + return; + } + if (!$scope.notaPedido.cliente.COD) { focaModalService.alert('Primero seleccione un cliente'); return; @@ -789,7 +798,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; $scope.quitarArticulo = function(key) { - $scope.notaPedido.articulosNotaPedido.splice(key, 1); + if (validarNotaRemitada()) { + $scope.notaPedido.articulosNotaPedido.splice(key, 1); + } }; $scope.editarArticulo = function(key, articulo, tmpCantidad, tmpPrecio) {