Commit ea64bb1fd125f95a7de7fd7c25301f9ee4fbb430
1 parent
2f9276f19b
Exists in
master
nota de pedido remitada
Showing
1 changed file
with
12 additions
and
1 deletions
Show diff stats
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) { |