Commit 750bf222048ba2a64543a9142e3568089f8e465e
1 parent
c67cce973e
Exists in
master
Cambios para usarse en nota pedido y remito.
Showing
3 changed files
with
7 additions
and
4 deletions
Show diff stats
index.html
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) { |
src/js/service.js
... | ... | @@ -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 | } |