Commit c405d6b1ea044a8d1917dd7eaa8b9ba95486ced8
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-crear-remito!22
Showing
1 changed file
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]; |