Commit 77e826975b0ac6d7325a653439f96e69976674be
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master(benjamin) See merge request !126
Showing
1 changed file
Show diff stats
src/js/controller.js
| ... | ... | @@ -83,6 +83,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 83 | 83 | articulosNotaPedido: [], |
| 84 | 84 | notaPedidoPlazo: [], |
| 85 | 85 | notaPedidoPuntoDescarga: [] |
| 86 | + | |
| 86 | 87 | }; |
| 87 | 88 | $scope.idLista = undefined; |
| 88 | 89 | |
| ... | ... | @@ -217,6 +218,11 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 217 | 218 | $scope.notaPedido.notaPedidoPuntoDescarga); |
| 218 | 219 | } |
| 219 | 220 | |
| 221 | + var rutaJson = JSON.parse($localStorage.rutas); | |
| 222 | + | |
| 223 | + removeItemFromArr( rutaJson, 'venta-nota-pedido/crear' ); | |
| 224 | + $localStorage.rutas = JSON.stringify(rutaJson); | |
| 225 | + | |
| 220 | 226 | var plazos = $scope.notaPedido.notaPedidoPlazo; |
| 221 | 227 | var plazosACrear = []; |
| 222 | 228 | plazos.forEach(function (plazo) { |
| ... | ... | @@ -1105,6 +1111,14 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 1105 | 1111 | } |
| 1106 | 1112 | } |
| 1107 | 1113 | |
| 1114 | + function removeItemFromArr ( arr, item ) { | |
| 1115 | + var i = arr.indexOf( item ); | |
| 1116 | + | |
| 1117 | + if ( i !== -1 ) { | |
| 1118 | + arr.splice( i, 1 ); | |
| 1119 | + } | |
| 1120 | + } | |
| 1121 | + | |
| 1108 | 1122 | function salir() { |
| 1109 | 1123 | var confirmacion = false; |
| 1110 | 1124 | |
| ... | ... | @@ -1118,6 +1132,9 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 1118 | 1132 | ).then(function (data) { |
| 1119 | 1133 | if (data) { |
| 1120 | 1134 | $location.path('/'); |
| 1135 | + var rutaJson = JSON.parse($localStorage.rutas); | |
| 1136 | + removeItemFromArr( rutaJson, 'venta-nota-pedido/crear' ); | |
| 1137 | + $localStorage.rutas = JSON.stringify(rutaJson); | |
| 1121 | 1138 | } |
| 1122 | 1139 | }); |
| 1123 | 1140 | } else { |