Commit 8f25127247e77e8019507cfe6fde9b88a4a75a42

Authored by Nicolás Guarnieri
1 parent aff6290492
Exists in master

fix nota de pedido

Showing 1 changed file with 12 additions and 1 deletions   Show diff stats
src/js/controller.js
... ... @@ -88,7 +88,11 @@ angular.module('focaCrearRemito') .controller('remitoController',
88 88 templateUrl: 'foca-modal-nota-pedido.html',
89 89 controller: 'focaModalNotaPedidoController',
90 90 size: 'lg',
91   - resolve: {usadoPor: function() {return 'remito';}}
  91 + resolve: {
  92 + usadoPor: function() {
  93 + return 'remito';
  94 + }
  95 + }
92 96 }
93 97 );
94 98 modalInstance.result.then(
... ... @@ -164,14 +168,21 @@ angular.module('focaCrearRemito') .controller('remitoController',
164 168 }
165 169 cabeceras.push(cabeceraBomba);
166 170 }
  171 +
  172 + for (var i = notaPedido.articulosNotaPedido.length - 1; i >= 0; i--) {
  173 + notaPedido.articulosNotaPedido[i].id = 0;
  174 + }
  175 +
167 176 $scope.articulosTabla = notaPedido.articulosNotaPedido;
168 177 remitoBusinessService.calcularArticulos($scope.articulosTabla,
169 178 notaPedido.cotizacion[0].VENDEDOR);
  179 +
170 180 if(notaPedido.precioCondicion.length > 0) {
171 181 $scope.idLista = notaPedido.precioCondicion[0].idListaPrecio;
172 182 } else {
173 183 $scope.idLista = -1;
174 184 }
  185 +
175 186 delete notaPedido.id;
176 187 $scope.remito = notaPedido;
177 188 $scope.remito.vendedor = notaPedido.vendedor[0];