Commit 46d3aa36a08f45cced1462fd7b98021b3c2bd3ee

Authored by Nicolás Guarnieri
Exists in master and in 1 other branch develop

Merge branch 'master' into 'master'

Master

See merge request !7
src/js/controller.js
... ... @@ -8,8 +8,9 @@ angular.module('focaModalNotaPedido')
8 8 'focaModalNotaPedidoService',
9 9 'usadoPor',
10 10 'focaModalService',
  11 + 'idVendedor',
11 12 function($timeout, $filter, $scope, $uibModalInstance,
12   - focaModalNotaPedidoService, usadoPor, focaModalService
  13 + focaModalNotaPedidoService, usadoPor, focaModalService, idVendedor
13 14 ) {
14 15 var fecha = new Date();
15 16 $scope.fechaHasta = new Date();
... ... @@ -45,10 +46,22 @@ angular.module('focaModalNotaPedido')
45 46 }
46 47 $scope.searchLoading = true;
47 48 //TODO hacer filtro de fecha
48   - focaModalNotaPedidoService
49   - .getNotasPedido(usadoPor, $scope.fechaDesde.toISOString().split('.')[0],
50   - $scope.fechaHasta.toISOString().split('.')[0])
51   - .then(llenarDatos);
  49 +
  50 + if(idVendedor) {
  51 + focaModalNotaPedidoService
  52 + .getNotasPedidoByIdVendedor(
  53 + usadoPor,
  54 + $scope.fechaDesde.toISOString().split('.')[0],
  55 + $scope.fechaHasta.toISOString().split('.')[0],
  56 + idVendedor)
  57 + .then(llenarDatos);
  58 + }else {
  59 + focaModalNotaPedidoService
  60 + .getNotasPedido(usadoPor,
  61 + $scope.fechaDesde.toISOString().split('.')[0],
  62 + $scope.fechaHasta.toISOString().split('.')[0])
  63 + .then(llenarDatos);
  64 + }
52 65 }
53 66 };
54 67 function llenarDatos(res) {
... ... @@ -8,6 +8,11 @@ angular.module('focaModalNotaPedido')
8 8 var sinRemito = (usadoPor === 'remito' ? '/sin-remito' : '');
9 9 return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar/' + fechaDesde + '/' +
10 10 fechaHasta + sinRemito);
  11 + },
  12 + getNotasPedidoByIdVendedor: function(usadoPor, fechaDesde, fechaHasta, idVendedor) {
  13 + var sinRemito = (usadoPor === 'remito' ? '/sin-remito' : '');
  14 + return $http.get(API_ENDPOINT.URL + '/nota-pedido/vendedor/listar/' +
  15 + idVendedor + '/' + fechaDesde + '/' + fechaHasta + sinRemito);
11 16 }
12 17 };
13 18 }
src/views/foca-modal-nota-pedido.html
... ... @@ -9,7 +9,7 @@
9 9 type="text"
10 10 class="form-control form-control-sm"
11 11 id="search"
12   - placeholder="Razón social"
  12 + placeholder="Cliente"
13 13 ng-model="filters"
14 14 ng-change="search()"
15 15 ng-keydown="busquedaDown($event.keyCode)"