Commit 9521c95d037e77838096152ca82686df58dcd22b
1 parent
fdc60f1cc4
Exists in
master
Primera versión estable.
Showing
3 changed files
with
11 additions
and
9 deletions
Show diff stats
README.md
| 1 | foca-crear-remito | ||
| 1 | # foca-crear-remito | ||
| 2 |
src/js/route.js
| 1 | angular.module('focaCrearRemito') | 1 | angular.module('focaCrearRemito') |
| 2 | .config(['$routeProvider', function($routeProvider) { | 2 | .config(['$routeProvider', function($routeProvider) { |
| 3 | $routeProvider.when('/venta-nota-remito/crear', { | 3 | $routeProvider.when('/venta-remito/crear', { |
| 4 | controller: 'remitoController', | 4 | controller: 'remitoController', |
| 5 | templateUrl: 'src/views/nota-remito.html' | 5 | templateUrl: 'src/views/remito.html' |
| 6 | }); | 6 | }); |
| 7 | }]); | 7 | }]); |
| 8 | 8 |
src/js/service.js
| 1 | angular.module('focaCrearRemito') | 1 | angular.module('focaCrearRemito') |
| 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
| 3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
| 4 | return { | 4 | return { |
| 5 | crearRemito: function(remito) { | 5 | crearRemito: function(remito) { |
| 6 | return $http.post(route + '/nota-remito', {remito: remito}); | 6 | return $http.post(route + '/nota-pedido', {remito: remito}); |
| 7 | }, | 7 | }, |
| 8 | obtenerRemito: function() { | 8 | obtenerRemito: function() { |
| 9 | return $http.get(route +'/nota-remito'); | 9 | return $http.get(route +'/nota-pedido'); |
| 10 | }, | 10 | }, |
| 11 | setRemito: function(remito) { | 11 | setRemito: function(remito) { |
| 12 | this.remito = remito; | 12 | this.remito = remito; |
| 13 | }, | 13 | }, |
| 14 | clearRemito: function() { | 14 | clearRemito: function() { |
| 15 | this.remito = undefined; | 15 | this.remito = undefined; |
| 16 | }, | 16 | }, |
| 17 | getRemito: function() { | 17 | getRemito: function() { |
| 18 | return this.remito; | 18 | return this.remito; |
| 19 | }, | 19 | }, |
| 20 | getArticulosByIdRemito: function(id) { | 20 | getArticulosByIdRemito: function(id) { |
| 21 | return $http.get(route+'/articulos/nota-remito/'+id); | 21 | return $http.get(route+'/articulos/nota-pedido/'+id); |
| 22 | }, | 22 | }, |
| 23 | crearArticulosParaRemito: function(articuloRemito) { | 23 | crearArticulosParaRemito: function(articuloRemito) { |
| 24 | return $http.post(route + '/articulos/nota-remito', | 24 | return $http.post(route + '/articulos/nota-pedido', |
| 25 | {articuloRemito: articuloRemito}); | 25 | {articuloRemito: articuloRemito}); |
| 26 | }, | 26 | }, |
| 27 | getDomiciliosByIdRemito: function(id) { | 27 | getDomiciliosByIdRemito: function(id) { |
| 28 | return $http.get(route +'/nota-remito/'+id+'/domicilios'); | 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
| 29 | }, | 29 | }, |
| 30 | getDomiciliosByIdCliente: function(id) { | 30 | getDomiciliosByIdCliente: function(id) { |
| 31 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) | 31 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) |
| 32 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); | 32 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); |
| 33 | }, | 33 | }, |
| 34 | getPrecioCondicion: function() { | 34 | getPrecioCondicion: function() { |
| 35 | return $http.get(route + '/precio-condicion'); | 35 | return $http.get(route + '/precio-condicion'); |
| 36 | }, | 36 | }, |
| 37 | getPrecioCondicionById: function(id) { | 37 | getPrecioCondicionById: function(id) { |
| 38 | return $http.get(route + '/precio-condicion/' + id); | 38 | return $http.get(route + '/precio-condicion/' + id); |
| 39 | }, | 39 | }, |
| 40 | getPlazoPagoByPrecioCondicion: function(id) { | 40 | getPlazoPagoByPrecioCondicion: function(id) { |
| 41 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 41 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
| 42 | }, | 42 | }, |
| 43 | crearFlete: function(flete) { | 43 | crearFlete: function(flete) { |
| 44 | return $http.post(route + '/flete', {flete : flete}); | 44 | return $http.post(route + '/flete', {flete : flete}); |
| 45 | }, | 45 | }, |
| 46 | crearPlazosParaRemito: function(plazos) { | 46 | crearPlazosParaRemito: function(plazos) { |
| 47 | return $http.post(route + '/plazo-pago/nota-remito', plazos); | 47 | return $http.post(route + '/plazo-pago/nota-pedido', plazos); |
| 48 | }, | 48 | }, |
| 49 | getCotizacionByIdMoneda: function(id) { | 49 | getCotizacionByIdMoneda: function(id) { |
| 50 | return $http.get(route + '/moneda/' + id); | 50 | return $http.get(route + '/moneda/' + id); |
| 51 | }, | 51 | }, |
| 52 | crearEstadoParaRemito: function(estado) { | 52 | crearEstadoParaRemito: function(estado) { |
| 53 | return $http.post(route + '/estado', {estado: estado}); | 53 | return $http.post(route + '/estado', {estado: estado}); |
| 54 | } | 54 | } |
| 55 | }; | 55 | }; |
| 56 | }]); | 56 | }]); |
| 57 | 57 |