Start changes for uncancel

This commit is contained in:
Mauricio Baeza 2019-07-11 13:34:59 -05:00
parent a67d174782
commit a87c78fc6b
2 changed files with 19 additions and 1 deletions

View File

@ -19,7 +19,7 @@ contratar: administracion ARROBA empresalibre.net
* Servidor web, recomendado Nginx * Servidor web, recomendado Nginx
* uwsgi * uwsgi
* python3 * python3.6+
* xsltproc * xsltproc
* openssl * openssl
* xmlsec * xmlsec

View File

@ -3663,6 +3663,8 @@ class Facturas(BaseModel):
@classmethod @classmethod
def validate_count_partners(cls, ids): def validate_count_partners(cls, ids):
"""Validate if invoices IDs are of unique client"""
filters = (Facturas.id.in_(tuple(ids.keys()))) filters = (Facturas.id.in_(tuple(ids.keys())))
partners = (Facturas.select(fn.COUNT(Socios.rfc)) partners = (Facturas.select(fn.COUNT(Socios.rfc))
.where(filters) .where(filters)
@ -5275,6 +5277,16 @@ class Facturas(BaseModel):
return {'ok': False} 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): class PreFacturas(BaseModel):
cliente = ForeignKeyField(Socios) cliente = ForeignKeyField(Socios)
@ -9974,6 +9986,8 @@ def _exportar_documentos():
if not month: if not month:
month = str(n.month) month = str(n.month)
without_stamp = []
filters = { filters = {
'year': year, 'year': year,
'month': month, 'month': month,
@ -9986,6 +10000,8 @@ def _exportar_documentos():
i+1, t, row['serie'], row['folio']) i+1, t, row['serie'], row['folio'])
log.info(msg) log.info(msg)
_, name = Facturas.get_xml(row['id']) _, name = Facturas.get_xml(row['id'])
if not row['uuid']:
without_stamp.append(f"{row['serie']}-{row['folio']}")
msg = '\tXML extraido...' msg = '\tXML extraido...'
log.info(msg) log.info(msg)
name = name[:-3] + 'pdf' name = name[:-3] + 'pdf'
@ -9998,6 +10014,8 @@ def _exportar_documentos():
log.info(msg) log.info(msg)
log.info('Documentos exportados...') log.info('Documentos exportados...')
for i in without_stamp:
log.info(i)
return return