diff --git a/CHANGELOG.md b/CHANGELOG.md index 60adc6b..eeebccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v 1.9.1 [25-jun-2018] +--------------------- + - Fix: Al mostrar el título de la aplicación + - Se agrega el registro de acción al borrar una factura + + v 1.9.0 [18-jun-2018] --------------------- - Se agrega la vista del detalle de facturas diff --git a/VERSION b/VERSION index f8e233b..9ab8337 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.0 +1.9.1 diff --git a/source/app/conf.py.example b/source/app/conf.py.example index 1dc4598..36133c0 100644 --- a/source/app/conf.py.example +++ b/source/app/conf.py.example @@ -8,6 +8,7 @@ MV = True # ~ una nueva base de datos, personaliza por la que quieras. DEFAULT_PASSWORD = 'salgueiro3.3' +TITLE_APP = 'Empresa Libre' #~ Establece una ruta accesible para el servidor web LOG_PATH = '/home/empresa/.opt/empresa-libre.log' diff --git a/source/app/controllers/main.py b/source/app/controllers/main.py index ec81ac5..1003d85 100644 --- a/source/app/controllers/main.py +++ b/source/app/controllers/main.py @@ -110,8 +110,7 @@ class AppValues(object): def on_get(self, req, resp, table): values = req.params session = req.env['beaker.session'] - - if req.path in ('values/titlelogin', '/values/empresas'): + if req.path in ('/values/titlelogin', '/values/empresas'): req.context['result'] = self._db.get_values(table, values, session) resp.status = falcon.HTTP_200 return @@ -313,7 +312,8 @@ class AppInvoices(object): def on_delete(self, req, resp): values = req.params - if self._db.delete('invoice', values['id']): + session = req.env['beaker.session'] + if self._db.delete('invoice', values['id'], session['userobj']): resp.status = falcon.HTTP_200 else: resp.status = falcon.HTTP_204 diff --git a/source/app/controllers/pac.py b/source/app/controllers/pac.py index 33f3a08..a0a4f36 100644 --- a/source/app/controllers/pac.py +++ b/source/app/controllers/pac.py @@ -19,6 +19,8 @@ from zeep.plugins import HistoryPlugin from zeep.cache import SqliteCache from zeep.transports import Transport from zeep.exceptions import Fault, TransportError +from requests.exceptions import ConnectionError + if __name__ == '__main__': from configpac import DEBUG, TIMEOUT, AUTH, URL @@ -268,6 +270,10 @@ class Finkok(object): else: self.error = str(e) return + except ConnectionError as e: + msg = '502 - Error de conexión' + self.error = msg + return return self._check_result(method, result) diff --git a/source/app/models/db.py b/source/app/models/db.py index c788120..18ac62a 100644 --- a/source/app/models/db.py +++ b/source/app/models/db.py @@ -256,13 +256,13 @@ class StorageEngine(object): def _get_ebancomov(self, values): return main.MovimientosBanco.con(values['id']) - def delete(self, table, id): + def delete(self, table, id, user=None): if table == 'partner': return main.Socios.remove(id) if table == 'product': return main.Productos.remove(id) if table == 'invoice': - return main.Facturas.remove(id) + return main.Facturas.remove(id, user) if table == 'folios': return main.Folios.remove(id) if table == 'preinvoice': diff --git a/source/app/models/main.py b/source/app/models/main.py index b6ab4ca..94c23fb 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -3666,7 +3666,7 @@ class Facturas(BaseModel): return {'ok': True, 'rows': rows} @classmethod - def remove(cls, id): + def remove(cls, id, user): obj = Facturas.get(Facturas.id==id) if obj.uuid: return False @@ -3678,6 +3678,10 @@ class Facturas(BaseModel): q = FacturasRelacionadas.delete().where(FacturasRelacionadas.factura==obj) q.execute() Tickets.uncancel(obj) + + m = 'B {}'.format(obj.id) + _save_log(user.usuario, m, 'F') + return bool(obj.delete_instance()) def _get_folio(self, serie): diff --git a/source/app/settings.py b/source/app/settings.py index b680e1b..04f3edb 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -31,7 +31,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.9.0' +VERSION = '1.9.1' EMAIL_SUPPORT = ('soporte@empresalibre.net',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION) @@ -62,7 +62,6 @@ template_lookup = TemplateLookup(directories=[PATH_TEMPLATES], input_encoding='utf-8', output_encoding='utf-8') -LOG_PATH = 'empresalibre.log' LOG_NAME = 'API' LOG_LEVEL = 'INFO'