Commit 5d63fe04fd188634756fe9ec5a6166eb5405cdaf
1 parent
9d5a67b2bf
Exists in
master
servicio para insercion de flete
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
src/js/service.js
| 1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') |
| 2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
| 3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
| 4 | return { | 4 | return { |
| 5 | crearNotaPedido: function(notaPedido) { | 5 | crearNotaPedido: function(notaPedido) { |
| 6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); | 6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); |
| 7 | }, | 7 | }, |
| 8 | obtenerNotaPedido: function() { | 8 | obtenerNotaPedido: function() { |
| 9 | return $http.get(route +'/nota-pedido'); | 9 | return $http.get(route +'/nota-pedido'); |
| 10 | }, | 10 | }, |
| 11 | setNotaPedido: function(notaPedido) { | 11 | setNotaPedido: function(notaPedido) { |
| 12 | this.notaPedido = notaPedido; | 12 | this.notaPedido = notaPedido; |
| 13 | }, | 13 | }, |
| 14 | clearNotaPedido: function() { | 14 | clearNotaPedido: function() { |
| 15 | this.notaPedido = undefined; | 15 | this.notaPedido = undefined; |
| 16 | }, | 16 | }, |
| 17 | getNotaPedido: function() { | 17 | getNotaPedido: function() { |
| 18 | return this.notaPedido; | 18 | return this.notaPedido; |
| 19 | }, | 19 | }, |
| 20 | getArticulosByIdNotaPedido: function(id) { | 20 | getArticulosByIdNotaPedido: function(id) { |
| 21 | return $http.get(route+'/articulos/nota-pedido/'+id); | 21 | return $http.get(route+'/articulos/nota-pedido/'+id); |
| 22 | }, | 22 | }, |
| 23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { | 23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { |
| 24 | return $http.post(route + '/articulos/nota-pedido', | 24 | return $http.post(route + '/articulos/nota-pedido', |
| 25 | {articuloNotaPedido: articuloNotaPedido}); | 25 | {articuloNotaPedido: articuloNotaPedido}); |
| 26 | }, | 26 | }, |
| 27 | getDomiciliosByIdNotaPedido: function(id) { | 27 | getDomiciliosByIdNotaPedido: function(id) { |
| 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
| 29 | }, | 29 | }, |
| 30 | //EN DESARROLLO | 30 | //EN DESARROLLO |
| 31 | getDomicilios: function(id) { | 31 | getDomicilios: function(id) { |
| 32 | // return $http.get(route + '/'+id) | 32 | // return $http.get(route + '/'+id) |
| 33 | id='le asigno un valor para pasar pre commit'; | 33 | id='le asigno un valor para pasar pre commit'; |
| 34 | var domicilio = [ | 34 | var domicilio = [ |
| 35 | { | 35 | { |
| 36 | id: 1, | 36 | id: 1, |
| 37 | dom: 'RISSO PATRON 781' | 37 | dom: 'RISSO PATRON 781' |
| 38 | }, | 38 | }, |
| 39 | { | 39 | { |
| 40 | id: 2, | 40 | id: 2, |
| 41 | dom: 'MARIANO MORENO 533' | 41 | dom: 'MARIANO MORENO 533' |
| 42 | }, | 42 | }, |
| 43 | { | 43 | { |
| 44 | id: 3, | 44 | id: 3, |
| 45 | dom: 'SALTA 796' | 45 | dom: 'SALTA 796' |
| 46 | } | 46 | } |
| 47 | ]; | 47 | ]; |
| 48 | return domicilio; | 48 | return domicilio; |
| 49 | }, | 49 | }, |
| 50 | getPrecioCondicion: function() { | 50 | getPrecioCondicion: function() { |
| 51 | return $http.get(route + '/precio-condicion'); | 51 | return $http.get(route + '/precio-condicion'); |
| 52 | }, | 52 | }, |
| 53 | getPrecioCondicionById: function(id) { | 53 | getPrecioCondicionById: function(id) { |
| 54 | return $http.get(route + '/precio-condicion/' + id); | 54 | return $http.get(route + '/precio-condicion/' + id); |
| 55 | }, | 55 | }, |
| 56 | getPlazoPagoByPrecioCondicion: function(id) { | 56 | getPlazoPagoByPrecioCondicion: function(id) { |
| 57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
| 58 | }, | ||
| 59 | crearFlete: function(flete) { | ||
| 60 | return $http.post(route + '/flete', {flete : flete}); | ||
| 58 | } | 61 | } |
| 59 | }; | 62 | }; |
| 60 | }]); | 63 | }]); |
| 61 | 64 |