service.js
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
angular.module('focaCrearRemito')
.service('crearRemitoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
var route = API_ENDPOINT.URL;
return {
crearRemito: function(remito) {
// TODO: Cambiar para usar el servicio /remito
return $http.post(route + '/remito', remito);
},
obtenerRemito: function() {
return $http.get(route +'/nota-pedido');
},
setRemito: function(remito) {
this.remito = remito;
},
clearRemito: function() {
this.remito = undefined;
},
getRemito: function() {
return this.remito;
},
getArticulosByIdRemito: function(id) {
return $http.get(route+'/articulos/nota-pedido/'+id);
},
crearArticulosParaRemito: function(articuloRemito) {
return $http.post(route + '/articulos/remito',
{articuloRemito: articuloRemito});
},
getDomiciliosByIdRemito: function(id) {
return $http.get(route +'/nota-pedido/'+id+'/domicilios');
},
getDomiciliosByIdCliente: function(id) {
var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega)
return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id );
},
getPrecioCondicion: function() {
return $http.get(route + '/precio-condicion');
},
getPrecioCondicionById: function(id) {
return $http.get(route + '/precio-condicion/' + id);
},
getPlazoPagoByPrecioCondicion: function(id) {
return $http.get(route + '/plazo-pago/precio-condicion/'+ id);
},
crearFlete: function(flete) {
return $http.post(route + '/flete', {flete : flete});
},
crearPlazosParaRemito: function(plazos) {
return $http.post(route + '/plazo-pago/remito', plazos);
},
getCotizacionByIdMoneda: function(id) {
return $http.get(route + '/moneda/' + id);
},
crearEstadoParaRemito: function(estado) {
return $http.post(route + '/estado', {estado: estado});
},
getNumeroRemito: function() {
return $http.get(route + '/remito/numero-siguiente');
},
getBotonera: function() {
return [
{
label: 'Nota pedido',
image: 'notaDePedido.png'
},
{
label: 'Vendedor',
image: 'vendedor.png'
},
{
label: 'Cliente',
image: 'cliente.png'
},
{
label: 'Proveedor',
image: 'proveedor.png'
},
{
label: 'Moneda',
image: 'moneda.png'
},
{
label: 'Precios y condiciones',
image: 'precios-condiciones.png'
},
{
label: 'Flete',
image: 'flete.png'
},
{
label: 'Productos',
image: 'productos.png'
}
];
}
};
}]);