From e90b8e9ec8a41d4fca638856857d591b83bf7e5f Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Fri, 25 Jan 2019 16:28:21 -0300 Subject: [PATCH] fuera bug abre dos veces modal puntos descarga --- src/js/controller.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index dfa4baf..6c6450a 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -420,7 +420,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', function(puntosDescarga) { $scope.notaPedido.puntosDescarga = puntosDescarga; }, function() { - + $scope.abrirModalDomicilios($scope.cliente); } ); } @@ -499,6 +499,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', modalInstance.result.then( function(cliente) { $scope.abrirModalDomicilios(cliente); + $scope.cliente = cliente; }, function() {} ); } @@ -512,8 +513,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', controller: 'focaModalDomicilioController', resolve: { idCliente: function() { return cliente.cod; }, - esNuevo: function() { return cliente.esNuevo; }, - articulos: function() { return $scope.articulosTabla; }, + esNuevo: function() { return cliente.esNuevo; } }, size: 'lg', } @@ -541,11 +541,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', label: 'Domicilio:', valor: domicilioStamp }); - crearNotaPedidoService - .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) - .then(function(res) { - if(res.data.length) $scope.seleccionarPuntosDeDescarga(); - }); + if(domicilio.verPuntos) { + $scope.seleccionarPuntosDeDescarga(); + }else { + crearNotaPedidoService + .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) + .then(function(res) { + if(res.data.length) $scope.seleccionarPuntosDeDescarga(); + }); + } }, function() { $scope.seleccionarCliente(); return; -- 1.9.1