Commit 7c0585b502c185490e2c5578ef40883778e75661
1 parent
1720fd1224
Exists in
master
and in
1 other branch
servicio obtener próximo número de comprobante
Showing
1 changed file
with
5 additions
and
2 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() { | 69 | getNumeroRemito: function(tipoComprobante) { | 
| 70 | return $http.get(route + '/remito/numero-siguiente'); | 70 | |
| 71 | var tipo = tipoComprobante ? '/' + tipoComprobante : ''; | ||
| 72 | |||
| 73 | return $http.get(route + '/remito/numero-siguiente' + tipo); | ||
| 71 | }, | 74 | }, | 
| 72 | imprimirRemitoByIdRemito: function(idRemito) { | 75 | imprimirRemitoByIdRemito: function(idRemito) { | 
| 73 | return $http.get(route + '/remito/comprobante/' + idRemito , { | 76 | return $http.get(route + '/remito/comprobante/' + idRemito , { | 
| 74 | responseType: 'arraybuffer' | 77 | responseType: 'arraybuffer' | 
| 75 | }); | 78 | }); | 
| 76 | }, | 79 | }, | 
| 77 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { | 80 | getPuntosDescargaByClienDom: function(idDomicilio, idCliente) { | 
| 78 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + | 81 | return $http.get(API_ENDPOINT.URL + '/punto-descarga/' + | 
| 79 | idDomicilio + '/' + idCliente); | 82 | idDomicilio + '/' + idCliente); | 
| 80 | }, | 83 | }, | 
| 81 | enviarCorreo: function(options) { | 84 | enviarCorreo: function(options) { | 
| 82 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); | 85 | return $http.post(API_ENDPOINT.URL + '/remito/mail', options); | 
| 83 | }, | 86 | }, | 
| 84 | getParametros: function() { | 87 | getParametros: function() { | 
| 85 | return $http.get(API_ENDPOINT.URL + '/parametros/remito'); | 88 | return $http.get(API_ENDPOINT.URL + '/parametros/remito'); | 
| 86 | }, | 89 | }, | 
| 87 | crearPuntosDescarga: function(puntosDescarga) { | 90 | crearPuntosDescarga: function(puntosDescarga) { | 
| 88 | return $http.post(route + '/puntos-descarga/remito', | 91 | return $http.post(route + '/puntos-descarga/remito', | 
| 89 | {puntosDescarga: puntosDescarga}); | 92 | {puntosDescarga: puntosDescarga}); | 
| 90 | }, | 93 | }, | 
| 91 | getBotonera: function() { | 94 | getBotonera: function() { | 
| 92 | return [ | 95 | return [ | 
| 93 | { | 96 | { | 
| 94 | label: 'Nota pedido', | 97 | label: 'Nota pedido', | 
| 95 | image: 'notaDePedido.png' | 98 | image: 'notaDePedido.png' | 
| 96 | }, | 99 | }, | 
| 97 | { | 100 | { | 
| 98 | label: 'Cliente', | 101 | label: 'Cliente', | 
| 99 | image: 'cliente.png' | 102 | image: 'cliente.png' | 
| 100 | }, | 103 | }, | 
| 101 | { | 104 | { | 
| 102 | label: 'Proveedor', | 105 | label: 'Proveedor', | 
| 103 | image: 'proveedor.png' | 106 | image: 'proveedor.png' | 
| 104 | }, | 107 | }, | 
| 105 | { | 108 | { | 
| 106 | label: 'Moneda', | 109 | label: 'Moneda', | 
| 107 | image: 'moneda.png' | 110 | image: 'moneda.png' | 
| 108 | }, | 111 | }, | 
| 109 | { | 112 | { | 
| 110 | label: 'Precios y condiciones', | 113 | label: 'Precios y condiciones', | 
| 111 | image: 'precios-condiciones.png' | 114 | image: 'precios-condiciones.png' | 
| 112 | }, | 115 | }, | 
| 113 | { | 116 | { | 
| 114 | label: 'Productos', | 117 | label: 'Productos', | 
| 115 | image: 'productos.png' | 118 | image: 'productos.png' | 
| 116 | }, | 119 | }, | 
| 117 | { | 120 | { | 
| 118 | label: 'Domicilio de Entrega', | 121 | label: 'Domicilio de Entrega', | 
| 119 | image: 'domicilioDeEntrega.png' | 122 | image: 'domicilioDeEntrega.png' | 
| 120 | }, | 123 | }, | 
| 121 | { | 124 | { | 
| 122 | label: 'Observaciones', | 125 | label: 'Observaciones', | 
| 123 | image: 'botonObservaciones.png', | 126 | image: 'botonObservaciones.png', | 
| 124 | disable: true | 127 | disable: true | 
| 125 | }, | 128 | }, | 
| 126 | { | 129 | { | 
| 127 | label: 'Eliminar Remito', | 130 | label: 'Eliminar Remito', | 
| 128 | image: 'eliminarRemito.png', | 131 | image: 'eliminarRemito.png', | 
| 129 | disable: true | 132 | disable: true | 
| 130 | } | 133 | } | 
| 131 | ]; | 134 | ]; | 
| 132 | }, | 135 | }, | 
| 133 | eliminarRemito: function (remito) { | 136 | eliminarRemito: function (remito) { | 
| 134 | return $http.delete(API_ENDPOINT.URL + '/remito/anular/' + remito.id); | 137 | return $http.delete(API_ENDPOINT.URL + '/remito/anular/' + remito.id); | 
| 135 | } | 138 | } | 
| 136 | }; | 139 | }; | 
| 137 | }]); | 140 | }]); | 
| 138 | 141 |