Commit c1361c1982fc84fc3b1ed3778359071b63e06fb1
1 parent
ad8c39620c
Exists in
develop
Fix
Arreglo al seleccionar domicilio
Showing
1 changed file
with
12 additions
and
3 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -671,9 +671,18 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 671 | 671 | |
| 672 | 672 | }) |
| 673 | 673 | .catch(function (e) { |
| 674 | - console.info(e); | |
| 675 | - $scope.seleccionarCliente(true); | |
| 676 | - return; | |
| 674 | + if (!cliente) { | |
| 675 | + $scope.seleccionarCliente(true); | |
| 676 | + return; | |
| 677 | + } | |
| 678 | + $scope.remito.cliente = cliente; | |
| 679 | + $scope.$broadcast('addCabecera', { | |
| 680 | + label: 'Cliente:', | |
| 681 | + valor: $filter('rellenarDigitos')(cliente.COD, 5) + | |
| 682 | + ' - ' + cliente.NOM | |
| 683 | + }); | |
| 684 | + $filter('filter')($scope.botonera, | |
| 685 | + { label: 'Cliente' })[0].checked = true; | |
| 677 | 686 | }); |
| 678 | 687 | }; |
| 679 | 688 |