Commit 9d4ac61c3484363e2c7abd79382910b1a3129036

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Master(efernandez)

See merge request !90
src/js/controller.js
... ... @@ -253,11 +253,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
253 253 };
254 254  
255 255 $scope.seleccionarProductos = function() {
  256 +
256 257 if ($scope.idLista === undefined) {
257 258 focaModalService.alert(
258 259 'Primero seleccione una lista de precio y condicion');
259 260 return;
  261 + } else if (!validarNotaRemitada()) {
  262 + return;
260 263 }
  264 +
261 265 var modalInstance = $uibModal.open(
262 266 {
263 267 ariaLabelledBy: 'Busqueda de Productos',
... ... @@ -597,6 +601,11 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
597 601 };
598 602  
599 603 $scope.seleccionarPreciosYCondiciones = function() {
  604 +
  605 + if (!validarNotaRemitada()) {
  606 + return;
  607 + }
  608 +
600 609 if (!$scope.notaPedido.cliente.COD) {
601 610 focaModalService.alert('Primero seleccione un cliente');
602 611 return;
... ... @@ -789,7 +798,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
789 798 };
790 799  
791 800 $scope.quitarArticulo = function(key) {
792   - $scope.notaPedido.articulosNotaPedido.splice(key, 1);
  801 + if (validarNotaRemitada()) {
  802 + $scope.notaPedido.articulosNotaPedido.splice(key, 1);
  803 + }
793 804 };
794 805  
795 806 $scope.editarArticulo = function(key, articulo, tmpCantidad, tmpPrecio) {