Commit de278bfbe6257da86e2c7e50926afbb0b7f78537

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Master(mpuebla)

See merge request !7
src/js/controller.js
... ... @@ -34,9 +34,11 @@ angular.module('focaBusquedaProductos')
34 34 if (parametroProducto.idLista > 0) {
35 35 focaBusquedaProductosService
36 36 .getProductosByIdLista(parametroProducto.idLista, $scope.filters)
37   - .then(llenarDatos);
38   - focaBusquedaProductosService.getProductos()
39   - .then(fillAllProductos);
  37 + .then(function (data) {
  38 + llenarDatos(data);
  39 + focaBusquedaProductosService.getProductos()
  40 + .then(fillAllProductos);
  41 + });
40 42 }
41 43 }
42 44 };
... ... @@ -52,7 +54,13 @@ angular.module('focaBusquedaProductos')
52 54 };
53 55 function fillAllProductos(res) {
54 56 for (var i = 0; i < res.data.length; i++) {
55   - res.data[i].precio = res.data[i].precio / parametroProducto.cotizacion;
  57 + var producto = $scope.listaProductos.filter(function(producto) {
  58 + return producto.id == res.data[i].id;
  59 + })[0];
  60 +
  61 + if (producto) {
  62 + res.data[i].precio = producto.precio;
  63 + }
56 64 }
57 65 $scope.searchLoading = false;
58 66 $scope.primerBusqueda = true;
... ... @@ -97,8 +105,6 @@ angular.module(&#39;focaBusquedaProductos&#39;)
97 105 $scope.currentPage = page;
98 106 };
99 107 $scope.select = function (producto) {
100   - // if ($scope.useAllProducts)
101   - // producto.precio = producto.precioBase;
102 108 $uibModalInstance.close(producto);
103 109 };
104 110 $scope.cancel = function () {
src/views/modal-busqueda-productos.html
... ... @@ -36,7 +36,9 @@
36 36 <div class="col my-1 d-flex justify-content-end">
37 37 <div class="custom-control custom-checkbox mt-auto">
38 38 <input type="checkbox" class="custom-control-input" id="check" ng-click="changeProductsData()">
39   - <label class="custom-control-label" for="check">Buscar en todos los artículos disponibles</label>
  39 + <label class="custom-control-label disable-selection" for="check">
  40 + Buscar en todos los artículos disponibles
  41 + </label>
40 42 </div>
41 43 </div>
42 44 </div>
... ... @@ -69,7 +71,7 @@
69 71 <td ng-bind="producto.sector + '-' + producto.codigo"
70 72 ng-hide="soloMostrar"></td>
71 73 <td ng-bind="producto.descripcion"></td>
72   - <td class="text-right" ng-bind="producto.precio | number: 2"></td>
  74 + <td class="text-right">{{producto.precioBase == producto.precio ? '' : producto.precio}}</td>
73 75 <td class="text-right" ng-bind="producto.precioBase | number: 2" ng-show="useAllProducts"></td>
74 76 <td class="d-md-none text-primary">
75 77 <i class="fa fa-circle-thin" aria-hidden="true"></i>