Commit 08537266a8bb22af44237cfc5a5cbee77c685b0f
1 parent
ad224acdad
Exists in
master
puntos descarga fix
Showing
2 changed files
with
13 additions
and
13 deletions
Show diff stats
src/js/businessService.js
src/js/controller.js
| ... | ... | @@ -335,7 +335,14 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 335 | 335 | ); |
| 336 | 336 | modalInstance.result.then( |
| 337 | 337 | function(puntoDescarga) { |
| 338 | - $scope.notaPedido.notaPedidoPuntoDescarga = puntoDescarga; | |
| 338 | + | |
| 339 | + puntoDescarga.forEach(function(punto) { | |
| 340 | + $scope.notaPedido.notaPedidoPuntoDescarga.push( | |
| 341 | + { | |
| 342 | + puntoDescarga: punto | |
| 343 | + } | |
| 344 | + ) | |
| 345 | + }); | |
| 339 | 346 | |
| 340 | 347 | $scope.$broadcast('addCabecera', { |
| 341 | 348 | label: 'Puntos de descarga:', |
| ... | ... | @@ -547,8 +554,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 547 | 554 | domicilio.Localidad + ', ' + domicilio.Provincia; |
| 548 | 555 | $scope.notaPedido.domicilioStamp = domicilioStamp; |
| 549 | 556 | |
| 550 | - $scope.notaPedido.notaPedidoPuntoDescarga = domicilio.puntoDescarga; | |
| 551 | - | |
| 552 | 557 | $scope.$broadcast('addCabecera', { |
| 553 | 558 | label: 'Cliente:', |
| 554 | 559 | valor: $filter('rellenarDigitos')(cliente.cod, 5) + ' - ' + cliente.nom |
| ... | ... | @@ -562,12 +567,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 562 | 567 | if (domicilio.verPuntos) { |
| 563 | 568 | delete $scope.notaPedido.domicilio.verPuntos; |
| 564 | 569 | $scope.seleccionarPuntosDeDescarga(); |
| 565 | - } else { | |
| 566 | - crearNotaPedidoService | |
| 567 | - .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) | |
| 568 | - .then(function(res) { | |
| 569 | - if (res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
| 570 | - }); | |
| 571 | 570 | } |
| 572 | 571 | |
| 573 | 572 | // Seteo checked en botonera |
| ... | ... | @@ -990,7 +989,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 990 | 989 | if (notaPedido.notaPedidoPuntoDescarga.length) { |
| 991 | 990 | var puntos = []; |
| 992 | 991 | notaPedido.notaPedidoPuntoDescarga.forEach(function(notaPedidoPuntoDescarga) { |
| 993 | - puntos.push(notaPedidoPuntoDescarga); | |
| 992 | + puntos.push(notaPedidoPuntoDescarga.puntoDescarga); | |
| 994 | 993 | }); |
| 995 | 994 | cabeceras.push({ |
| 996 | 995 | label: 'Puntos de descarga: ', |
| ... | ... | @@ -1064,13 +1063,14 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 1064 | 1063 | } |
| 1065 | 1064 | |
| 1066 | 1065 | function deleteCliente() { |
| 1067 | - delete $scope.notaPedido.domicilioStamp; | |
| 1068 | - delete $scope.notaPedido.notaPedidoPuntoDescarga; | |
| 1066 | + $scope.notaPedido.domicilioStamp = ''; | |
| 1067 | + $scope.notaPedido.notaPedidoPuntoDescarga = []; | |
| 1069 | 1068 | $scope.notaPedido.domicilio = {dom: ''}; |
| 1070 | 1069 | $scope.notaPedido.cliente = {}; |
| 1071 | 1070 | $scope.$broadcast('removeCabecera', 'Cliente:'); |
| 1072 | 1071 | $scope.$broadcast('removeCabecera', 'Domicilio:'); |
| 1073 | 1072 | $scope.$broadcast('removeCabecera', 'Puntos de descarga:'); |
| 1073 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = false; | |
| 1074 | 1074 | } |
| 1075 | 1075 | } |
| 1076 | 1076 | ]); |