Commit 750bf222048ba2a64543a9142e3568089f8e465e

Authored by Pablo Marco del Pont
1 parent c67cce973e
Exists in master

Cambios para usarse en nota pedido y remito.

... ... @@ -44,6 +44,7 @@
44 44 controller: 'focaModalNotaPedidoController',
45 45 size: 'lg',
46 46 resolve: {
  47 + usadoPor: 'remito',
47 48 parametroNotaPedido: {
48 49 idLista: -1,
49 50 cotizacion: 1,
src/js/controller.js
... ... @@ -5,8 +5,9 @@ angular.module('focaModalNotaPedido')
5 5 '$scope',
6 6 '$uibModalInstance',
7 7 'focaModalNotaPedidoService',
  8 + 'usadoPor',
8 9 function($filter, $scope, $uibModalInstance,
9   - focaModalNotaPedidoService
  10 + focaModalNotaPedidoService, usadoPor
10 11 ) {
11 12  
12 13 $scope.filters = '';
... ... @@ -24,7 +25,7 @@ angular.module('focaModalNotaPedido')
24 25 $scope.busquedaPress = function(key) {
25 26 if (key === 13) {
26 27 $scope.searchLoading = true;
27   - focaModalNotaPedidoService.getNotasPedido().then(llenarDatos);
  28 + focaModalNotaPedidoService.getNotasPedido(usadoPor).then(llenarDatos);
28 29 }
29 30 };
30 31 function llenarDatos(res) {
... ... @@ -4,8 +4,9 @@ angular.module('focaModalNotaPedido')
4 4 'API_ENDPOINT',
5 5 function($http, API_ENDPOINT) {
6 6 return {
7   - getNotasPedido: function() {
8   - return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar/sin-remito');
  7 + getNotasPedido: function(usadoPor) {
  8 + sinRemito = usadoPor === 'remito' ? '/sin-remito' : '';
  9 + return $http.get(API_ENDPOINT.URL + '/nota-pedido/listar' + sinRemito);
9 10 }
10 11 };
11 12 }