Commit dbbb1b199ca7a4e4f60307d815f989ba66eff7a5
Exists in
master
Merge branch 'develop' into 'master'
Develop See merge request !114
Showing
2 changed files
 
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 () { | 
| ... | ... | @@ -641,6 +649,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', | 
| 641 | 649 | abrirModal(); | 
| 642 | 650 | } | 
| 643 | 651 | function abrirModal() { | 
| 652 | + var parametros = { idCliente: $scope.notaPedido.cliente.COD, idListaPrecio : $scope.notaPedido.cliente.MOD}; | |
| 644 | 653 | var modalInstance = $uibModal.open( | 
| 645 | 654 | { | 
| 646 | 655 | ariaLabelledBy: 'Busqueda de Precio Condición', | 
| ... | ... | @@ -648,8 +657,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', | 
| 648 | 657 | controller: 'focaModalPrecioCondicionController', | 
| 649 | 658 | size: 'lg', | 
| 650 | 659 | resolve: { | 
| 651 | - idListaPrecio: function () { return $scope.notaPedido.cliente.MOD || null; }, | |
| 652 | - idCliente: function () { return $scope.notaPedido.cliente.COD } | |
| 660 | + parametros: function () { return parametros; }, | |
| 653 | 661 | } | 
| 654 | 662 | } | 
| 655 | 663 | ); | 
| ... | ... | @@ -662,6 +670,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', | 
| 662 | 670 | $scope.notaPedido.notaPedidoPlazo = precioCondicion.plazoPago; | 
| 663 | 671 | $scope.notaPedido.precioCondicion = precioCondicion; | 
| 664 | 672 | $scope.notaPedido.idPrecioCondicion = precioCondicion.listaPrecio.ID; | 
| 673 | + $scope.notaPedido.cliente.MOD = precioCondicion.listaPrecio.ID; | |
| 665 | 674 | $scope.idLista = parseInt(precioCondicion.listaPrecio.ID) ? | 
| 666 | 675 | parseInt(precioCondicion.listaPrecio.ID) : -1; | 
| 667 | 676 | for (var i = 0; i < precioCondicion.plazoPago.length; i++) { | 
| ... | ... | @@ -1028,13 +1037,6 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', | 
| 1028 | 1037 | }); | 
| 1029 | 1038 | } | 
| 1030 | 1039 | |
| 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 | 1040 | addArrayCabecera(cabeceras); | 
| 1039 | 1041 | } | 
| 1040 | 1042 | 
src/views/nota-pedido.html
| ... | ... | @@ -64,7 +64,7 @@ | 
| 64 | 64 | ></td> | 
| 65 | 65 | <td | 
| 66 | 66 | class="col-4" | 
| 67 | - ng-bind="articulo.nombre" | |
| 67 | + ng-bind="articulo.descripcion" | |
| 68 | 68 | ></td> | 
| 69 | 69 | <td class="col text-right"> | 
| 70 | 70 | <input | 
| ... | ... | @@ -150,7 +150,7 @@ | 
| 150 | 150 | <td class="col-4 tabla-articulo-descripcion"> | 
| 151 | 151 | <input | 
| 152 | 152 | class="form-control" | 
| 153 | - ng-model="articuloACargar.nombre" | |
| 153 | + ng-model="articuloACargar.descripcion" | |
| 154 | 154 | readonly | 
| 155 | 155 | > | 
| 156 | 156 | </td> | 
| ... | ... | @@ -263,7 +263,7 @@ | 
| 263 | 263 | ></span> | 
| 264 | 264 | </div> | 
| 265 | 265 | <div class="col-8 px-1"> | 
| 266 | - <span ng-bind="articulo.nombre"></span> | |
| 266 | + <span ng-bind="articulo.descripcion"></span> | |
| 267 | 267 | </div> | 
| 268 | 268 | </div> | 
| 269 | 269 | <div class="d-flex"> | 
| ... | ... | @@ -330,7 +330,7 @@ | 
| 330 | 330 | ></span> | 
| 331 | 331 | </div> | 
| 332 | 332 | <div class="col-8 px-1"> | 
| 333 | - <span ng-bind="articuloACargar.nombre"></span> | |
| 333 | + <span ng-bind="articuloACargar.descripcion"></span> | |
| 334 | 334 | </div> | 
| 335 | 335 | </div> | 
| 336 | 336 | <div class="d-flex"> |