Commit eaf6dfa1fa80ffdd60fbba4e692bceb53885eb43
Exists in
master
Merge branch 'master' into 'develop'
Master(efernandez) See merge request !110
Showing
1 changed file
Show diff stats
src/js/controller.js
| ... | ... | @@ -247,7 +247,15 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | ); |
| 250 | - modalInstance.result.then(setearNotaPedido); | |
| 250 | + modalInstance.result.then(function(notaPedido) { | |
| 251 | + | |
| 252 | + notaPedido.articulosNotaPedido.forEach(function (articulo) { | |
| 253 | + articulo.precio = | |
| 254 | + (articulo.precio / notaPedido.cotizacion.VENDEDOR).toFixed(4); | |
| 255 | + }); | |
| 256 | + | |
| 257 | + setearNotaPedido(notaPedido); | |
| 258 | + }); | |
| 251 | 259 | }; |
| 252 | 260 | |
| 253 | 261 | $scope.seleccionarProductos = function () { |
| ... | ... | @@ -1028,13 +1036,6 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
| 1028 | 1036 | }); |
| 1029 | 1037 | } |
| 1030 | 1038 | |
| 1031 | - if ($scope.notaPedido.articulosNotaPedido.length) { | |
| 1032 | - $scope.notaPedido.articulosNotaPedido.forEach(function (articulo) { | |
| 1033 | - articulo.precio = | |
| 1034 | - (articulo.precio / $scope.notaPedido.cotizacion.VENDEDOR).toFixed(4); | |
| 1035 | - }); | |
| 1036 | - } | |
| 1037 | - | |
| 1038 | 1039 | addArrayCabecera(cabeceras); |
| 1039 | 1040 | } |
| 1040 | 1041 |