diff --git a/src/js/controller.js b/src/js/controller.js index 859b264..966961a 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -62,12 +62,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', focaBotoneraLateralService.addCustomButton('Salir', salir); }); - crearNotaPedidoService.getPrecioCondicion().then( - function(res) { - $scope.precioCondiciones = res.data; - } - ); - crearNotaPedidoService.getNumeroNotaPedido().then( function(res) { $scope.puntoVenta = rellenar(res.data.sucursal, 4); @@ -476,9 +470,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', modalInstance.result.then( function(cliente) { $scope.abrirModalDomicilios(cliente); - }, function() { - - } + }, function() {} ); } }; @@ -524,6 +516,11 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', label: 'Domicilio:', valor: domicilioStamp }); + crearNotaPedidoService + .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) + .then(function(res) { + if(res.data.length) $scope.seleccionarPuntosDeDescarga(); + }); }, function() { $scope.seleccionarCliente(); return; diff --git a/src/js/service.js b/src/js/service.js index 850fc61..9a643cb 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -84,16 +84,16 @@ angular.module('focaCrearNotaPedido') { label: 'Productos', image: 'productos.png' - }, - { - label: 'Puntos de descarga', - image: 'puntosDeDescarga.png' } ]; }, crearPuntosDescarga: function(puntosDescarga) { return $http.post(route + '/puntos-descarga/nota-pedido', {puntosDescarga: puntosDescarga}); + }, + getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { + return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + + idDomicilio + '/' + idCliente); } }; }]); diff --git a/src/views/nota-pedido.html b/src/views/nota-pedido.html index e4c21da..13dfdc6 100644 --- a/src/views/nota-pedido.html +++ b/src/views/nota-pedido.html @@ -11,7 +11,7 @@