Commit d73a6e985af34a8de66224d08419f9887643e1f0

Authored by Luigi
Exists in master

Merge remote-tracking branch 'upstream/develop'

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