diff --git a/README.md b/README.md index 9935ff6..44f0eed 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ contratar: administracion ARROBA empresalibre.net * Servidor web, recomendado Nginx * uwsgi -* python3 +* python3.6+ * xsltproc * openssl * xmlsec diff --git a/source/app/models/main.py b/source/app/models/main.py index c90c18e..59fcd25 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -3663,6 +3663,8 @@ class Facturas(BaseModel): @classmethod def validate_count_partners(cls, ids): + """Validate if invoices IDs are of unique client""" + filters = (Facturas.id.in_(tuple(ids.keys()))) partners = (Facturas.select(fn.COUNT(Socios.rfc)) .where(filters) @@ -5275,6 +5277,16 @@ class Facturas(BaseModel): return {'ok': False} + # ~ v2 + @classmethod + def uncancel(cls, id): + obj = Facturas.get(Facturas.id==id) + if obj.uuid is None: + msg = 'La factura no esta timbrada' + return {'ok': False, 'msg': msg} + + return + class PreFacturas(BaseModel): cliente = ForeignKeyField(Socios) @@ -9974,6 +9986,8 @@ def _exportar_documentos(): if not month: month = str(n.month) + without_stamp = [] + filters = { 'year': year, 'month': month, @@ -9986,6 +10000,8 @@ def _exportar_documentos(): i+1, t, row['serie'], row['folio']) log.info(msg) _, name = Facturas.get_xml(row['id']) + if not row['uuid']: + without_stamp.append(f"{row['serie']}-{row['folio']}") msg = '\tXML extraido...' log.info(msg) name = name[:-3] + 'pdf' @@ -9998,6 +10014,8 @@ def _exportar_documentos(): log.info(msg) log.info('Documentos exportados...') + for i in without_stamp: + log.info(i) return