Commit d72cb9686c7f34a41144111954b4f360f0f7bdab

Authored by Benjamin Rodriguez
1 parent f5e26a9049
Exists in master

se elimina tarea pausada al guardar o salir

Showing 1 changed file with 28 additions and 3 deletions   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,17 @@ angular.module('focaCrearCobranza').controller('cobranzaController',
129 131 $scope.editando = false;
130 132 focaBotoneraLateralService.startGuardar();
131 133 $scope.saveLoading = true;
  134 + var ar = JSON.parse($localStorage.rutas);
  135 + function removeItemFromArr ( arr, item ) {
  136 + var i = arr.indexOf( item );
  137 +
  138 + if ( i !== -1 ) {
  139 + arr.splice( i, 1 );
  140 + }
  141 + }
  142 +
  143 + removeItemFromArr( ar, 'cobranza/crear' );
  144 + $localStorage.rutas = JSON.stringify(ar);
132 145 for (var i = 0; i < $scope.cobranza.facturas.length; i++) {
133 146 var cuerpoFactura = {
134 147 CYV: 'V',
... ... @@ -729,6 +742,17 @@ angular.module(&#39;focaCrearCobranza&#39;).controller(&#39;cobranzaController&#39;,
729 742  
730 743 $scope.salir = function () {
731 744 $location.path('/');
  745 + var ar = JSON.parse($localStorage.rutas);
  746 + function removeItemFromArr ( arr, item ) {
  747 + var i = arr.indexOf( item );
  748 +
  749 + if ( i !== -1 ) {
  750 + arr.splice( i, 1 );
  751 + }
  752 + }
  753 +
  754 + removeItemFromArr( ar, 'cobranza/crear' );
  755 + $localStorage.rutas = JSON.stringify(ar);
732 756 };
733 757  
734 758 $scope.parsearATexto = function (articulo) {
... ... @@ -815,6 +839,7 @@ angular.module(&#39;focaCrearCobranza&#39;).controller(&#39;cobranzaController&#39;,
815 839 ).then(function (data) {
816 840 if (data) {
817 841 $location.path('/');
  842 +
818 843 }
819 844 });
820 845 } else {