Commit c6a1e8597cecefded42bd27a7b3b2ecff7e4658a
Exists in
master
Merge branch 'master' into 'develop'
Master(benjamin) See merge request !83
Showing
1 changed file
Show diff stats
src/js/controller.js
... | ... | @@ -94,14 +94,16 @@ angular.module('focaCrearCobranza').controller('cobranzaController', |
94 | 94 | } |
95 | 95 | ); |
96 | 96 | } |
97 | - | |
98 | 97 | $scope.$watch('cobranza', function (newValue) { |
99 | 98 | focaBotoneraLateralService.setPausarData({ |
100 | 99 | label: 'cobranza', |
101 | 100 | val: newValue |
102 | 101 | }); |
103 | - }, true); | |
104 | - | |
102 | + focaBotoneraLateralService.setRutasPausadas({ | |
103 | + label: 'rutas', | |
104 | + val: 'cobranza/crear' | |
105 | + }); | |
106 | + }, true); | |
105 | 107 | $scope.crearCobranza = function () { |
106 | 108 | if (!$scope.cobranza.cliente.COD) { |
107 | 109 | focaModalService.alert('Ingrese Cliente'); |
... | ... | @@ -129,6 +131,9 @@ angular.module('focaCrearCobranza').controller('cobranzaController', |
129 | 131 | $scope.editando = false; |
130 | 132 | focaBotoneraLateralService.startGuardar(); |
131 | 133 | $scope.saveLoading = true; |
134 | + var rutaJson = JSON.parse($localStorage.rutas); | |
135 | + removeItemFromArr( rutaJson, 'cobranza/crear' ); | |
136 | + $localStorage.rutas = JSON.stringify(rutaJson); | |
132 | 137 | for (var i = 0; i < $scope.cobranza.facturas.length; i++) { |
133 | 138 | var cuerpoFactura = { |
134 | 139 | CYV: 'V', |
... | ... | @@ -815,6 +820,9 @@ angular.module('focaCrearCobranza').controller('cobranzaController', |
815 | 820 | ).then(function (data) { |
816 | 821 | if (data) { |
817 | 822 | $location.path('/'); |
823 | + var rutaJson = JSON.parse($localStorage.rutas); | |
824 | + removeItemFromArr(rutaJson, 'cobranza/crear'); | |
825 | + $localStorage.rutas = JSON.stringify(rutaJson); | |
818 | 826 | } |
819 | 827 | }); |
820 | 828 | } else { |
... | ... | @@ -822,6 +830,14 @@ angular.module('focaCrearCobranza').controller('cobranzaController', |
822 | 830 | } |
823 | 831 | } |
824 | 832 | |
833 | + function removeItemFromArr ( arr, item ) { | |
834 | + var i = arr.indexOf( item ); | |
835 | + | |
836 | + if ( i !== -1 ) { | |
837 | + arr.splice( i, 1 ); | |
838 | + } | |
839 | + } | |
840 | + | |
825 | 841 | function setearCobranza(cobranza) { |
826 | 842 | $scope.editando = true; |
827 | 843 | $scope.$broadcast('cleanCabecera'); |