Commit e693f0eff56e72e4e2e901655548a70196050c99
1 parent
c5dd54f9e4
Exists in
master
and in
1 other branch
cambio posicionamiento botonera
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/js/service.js
| 1 | angular.module('focaCrearRemito') | 1 | angular.module('focaCrearRemito') |
| 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', | 2 | .service('crearRemitoService', ['$http', 'API_ENDPOINT', |
| 3 | function($http, API_ENDPOINT) { | 3 | function($http, API_ENDPOINT) { |
| 4 | var route = API_ENDPOINT.URL; | 4 | var route = API_ENDPOINT.URL; |
| 5 | return { | 5 | return { |
| 6 | getVendedorById: function (idVendedor) { | 6 | getVendedorById: function (idVendedor) { |
| 7 | return $http.get(route + '/vendedor-cobrador/' + idVendedor); | 7 | return $http.get(route + '/vendedor-cobrador/' + idVendedor); |
| 8 | }, | 8 | }, |
| 9 | crearRemito: function(remito) { | 9 | crearRemito: function(remito) { |
| 10 | // TODO: Cambiar para usar el servicio /remito | 10 | // TODO: Cambiar para usar el servicio /remito |
| 11 | return $http.post(route + '/remito/guardar', remito); | 11 | return $http.post(route + '/remito/guardar', remito); |
| 12 | }, | 12 | }, |
| 13 | getRemitoById: function(id) { | 13 | getRemitoById: function(id) { |
| 14 | return $http.get(route + '/remito/obtener/' + id); | 14 | return $http.get(route + '/remito/obtener/' + id); |
| 15 | }, | 15 | }, |
| 16 | obtenerRemito: function() { | 16 | obtenerRemito: function() { |
| 17 | return $http.get(route +'/nota-pedido'); | 17 | return $http.get(route +'/nota-pedido'); |
| 18 | }, | 18 | }, |
| 19 | setRemito: function(remito) { | 19 | setRemito: function(remito) { |
| 20 | this.remito = remito; | 20 | this.remito = remito; |
| 21 | }, | 21 | }, |
| 22 | clearRemito: function() { | 22 | clearRemito: function() { |
| 23 | this.remito = undefined; | 23 | this.remito = undefined; |
| 24 | }, | 24 | }, |
| 25 | getRemito: function() { | 25 | getRemito: function() { |
| 26 | return this.remito; | 26 | return this.remito; |
| 27 | }, | 27 | }, |
| 28 | getArticulosByIdRemito: function(id) { | 28 | getArticulosByIdRemito: function(id) { |
| 29 | return $http.get(route+'/articulos/nota-pedido/'+id); | 29 | return $http.get(route+'/articulos/nota-pedido/'+id); |
| 30 | }, | 30 | }, |
| 31 | crearArticulosParaRemito: function(articuloRemito) { | 31 | crearArticulosParaRemito: function(articuloRemito) { |
| 32 | return $http.post(route + '/articulos/remito', | 32 | return $http.post(route + '/articulos/remito', |
| 33 | {articuloRemito: articuloRemito}); | 33 | {articuloRemito: articuloRemito}); |
| 34 | }, | 34 | }, |
| 35 | getProveedorById: function(id) { | 35 | getProveedorById: function(id) { |
| 36 | return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); | 36 | return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); |
| 37 | }, | 37 | }, |
| 38 | getDomiciliosByIdRemito: function(id) { | 38 | getDomiciliosByIdRemito: function(id) { |
| 39 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 39 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
| 40 | }, | 40 | }, |
| 41 | getDomiciliosByIdCliente: function(id) { | 41 | getDomiciliosByIdCliente: function(id) { |
| 42 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) | 42 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) |
| 43 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); | 43 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); |
| 44 | }, | 44 | }, |
| 45 | getPrecioCondicion: function() { | 45 | getPrecioCondicion: function() { |
| 46 | return $http.get(route + '/precio-condicion'); | 46 | return $http.get(route + '/precio-condicion'); |
| 47 | }, | 47 | }, |
| 48 | getPrecioCondicionById: function(id) { | 48 | getPrecioCondicionById: function(id) { |
| 49 | return $http.get(route + '/precio-condicion/' + id); | 49 | return $http.get(route + '/precio-condicion/' + id); |
| 50 | }, | 50 | }, |
| 51 | getListaPrecioById: function (id) { | 51 | getListaPrecioById: function (id) { |
| 52 | return $http.get(route + '/lista-precio/' + id); | 52 | return $http.get(route + '/lista-precio/' + id); |
| 53 | }, | 53 | }, |
| 54 | getPlazoPagoByPrecioCondicion: function(id) { | 54 | getPlazoPagoByPrecioCondicion: function(id) { |
| 55 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 55 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
| 56 | }, | 56 | }, |
| 57 | crearFlete: function(flete) { | 57 | crearFlete: function(flete) { |
| 58 | return $http.post(route + '/flete', {flete : flete}); | 58 | return $http.post(route + '/flete', {flete : flete}); |
| 59 | }, | 59 | }, |
| 60 | crearPlazosParaRemito: function(plazos) { | 60 | crearPlazosParaRemito: function(plazos) { |
| 61 | return $http.post(route + '/plazo-pago/remito', plazos); | 61 | return $http.post(route + '/plazo-pago/remito', plazos); |
| 62 | }, | 62 | }, |
| 63 | getCotizacionByIdMoneda: function(id) { | 63 | getCotizacionByIdMoneda: function(id) { |
| 64 | return $http.get(route + '/moneda/' + id); | 64 | return $http.get(route + '/moneda/' + id); |
| 65 | }, | 65 | }, |
| 66 | crearEstadoParaRemito: function(estado) { | 66 | crearEstadoParaRemito: function(estado) { |
| 67 | return $http.post(route + '/estado', {estado: estado}); | 67 | return $http.post(route + '/estado', {estado: estado}); |
| 68 | }, | 68 | }, |
| 69 | getNumeroRemito: function(tipoComprobante) { | 69 | getNumeroRemito: function(tipoComprobante) { |
| 70 | 70 | ||
| 71 | var tipo = tipoComprobante ? '/' + tipoComprobante : ''; | 71 | var tipo = tipoComprobante ? '/' + tipoComprobante : ''; |
| 72 | 72 | ||
| 73 | return $http.get(route + '/remito/numero-siguiente' + tipo); | 73 | return $http.get(route + '/remito/numero-siguiente' + tipo); |
| 74 | }, | 74 | }, |
| 75 | imprimirRemitoByIdRemito: function(idRemito) { | 75 | imprimirRemitoByIdRemito: function(idRemito) { |
| 76 | return $http.get(route + '/remito/comprobante/' + idRemito , { | 76 | return $http.get(route + '/remito/comprobante/' + idRemito , { |
| 77 | responseType: 'arraybuffer' | 77 | responseType: 'arraybuffer' |
| 78 | }); | 78 | }); |
| 79 | }, | 79 | }, |
| 80 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { | 80 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { |
| 81 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + | 81 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + |
| 82 | idDomicilio + '/' + idCliente); | 82 | idDomicilio + '/' + idCliente); |
| 83 | }, | 83 | }, |
| 84 | enviarCorreo: function(options) { | 84 | enviarCorreo: function(options) { |
| 85 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); | 85 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); |
| 86 | }, | 86 | }, |
| 87 | getParametros: function() { | 87 | getParametros: function() { |
| 88 | return $http.get(API_ENDPOINT.URL + '/parametros/remito'); | 88 | return $http.get(API_ENDPOINT.URL + '/parametros/remito'); |
| 89 | }, | 89 | }, |
| 90 | crearPuntosDescarga: function(puntosDescarga) { | 90 | crearPuntosDescarga: function(puntosDescarga) { |
| 91 | return $http.post(route + '/puntos-descarga/remito', | 91 | return $http.post(route + '/puntos-descarga/remito', |
| 92 | {puntosDescarga: puntosDescarga}); | 92 | {puntosDescarga: puntosDescarga}); |
| 93 | }, | 93 | }, |
| 94 | getBotonera: function() { | 94 | getBotonera: function() { |
| 95 | return [ | 95 | return [ |
| 96 | { | 96 | { |
| 97 | label: 'Nota pedido', | 97 | label: 'Nota pedido', |
| 98 | image: 'notaDePedido.png' | 98 | image: 'notaDePedido.png' |
| 99 | }, | 99 | }, |
| 100 | { | 100 | { |
| 101 | label: 'Cliente', | 101 | label: 'Cliente', |
| 102 | image: 'cliente.png' | 102 | image: 'cliente.png' |
| 103 | }, | 103 | }, |
| 104 | { | 104 | { |
| 105 | label: 'Domicilio de Entrega', | ||
| 106 | image: 'domicilioDeEntrega.png' | ||
| 107 | }, | ||
| 108 | { | ||
| 105 | label: 'Proveedor', | 109 | label: 'Proveedor', |
| 106 | image: 'proveedor.png' | 110 | image: 'proveedor.png' |
| 107 | }, | 111 | }, |
| 108 | { | 112 | { |
| 109 | label: 'Moneda', | 113 | label: 'Moneda', |
| 110 | image: 'moneda.png' | 114 | image: 'moneda.png' |
| 111 | }, | 115 | }, |
| 112 | { | 116 | { |
| 113 | label: 'Precios y condiciones', | 117 | label: 'Precios y condiciones', |
| 114 | image: 'precios-condiciones.png' | 118 | image: 'precios-condiciones.png' |
| 115 | }, | 119 | }, |
| 116 | { | 120 | { |
| 117 | label: 'Productos', | 121 | label: 'Productos', |
| 118 | image: 'productos.png' | 122 | image: 'productos.png' |
| 119 | }, | 123 | }, |
| 120 | { | 124 | { |
| 121 | label: 'Domicilio de Entrega', | ||
| 122 | image: 'domicilioDeEntrega.png' | ||
| 123 | }, | ||
| 124 | { | ||
| 125 | label: 'Observaciones', | 125 | label: 'Observaciones', |
| 126 | image: 'botonObservaciones.png', | 126 | image: 'botonObservaciones.png', |
| 127 | disable: true | 127 | disable: true |
| 128 | }, | 128 | }, |
| 129 | { | 129 | { |
| 130 | label: 'Eliminar Remito', | 130 | label: 'Eliminar Remito', |
| 131 | image: 'eliminarRemito.png', | 131 | image: 'eliminarRemito.png', |
| 132 | disable: true | 132 | disable: true |
| 133 | } | 133 | } |
| 134 | ]; | 134 | ]; |
| 135 | }, | 135 | }, |
| 136 | eliminarRemito: function (remito) { | 136 | eliminarRemito: function (remito) { |
| 137 | return $http.delete(API_ENDPOINT.URL + '/remito/anular/' + remito.id); | 137 | return $http.delete(API_ENDPOINT.URL + '/remito/anular/' + remito.id); |