Fix get years in preinvoices
This commit is contained in:
parent
e547ce0113
commit
ace4ef21a7
|
@ -3931,25 +3931,6 @@ class Facturas(BaseModel):
|
||||||
query.execute()
|
query.execute()
|
||||||
return
|
return
|
||||||
|
|
||||||
# ~ def _cancel_signature(self, id):
|
|
||||||
# ~ msg = 'Factura cancelada correctamente'
|
|
||||||
# ~ auth = Emisor.get_auth()
|
|
||||||
# ~ certificado = Certificado.select()[0]
|
|
||||||
# ~ obj = Facturas.get(Facturas.id==id)
|
|
||||||
# ~ data, result = util.cancel_signature(
|
|
||||||
# ~ obj.uuid, certificado.p12, certificado.rfc, auth)
|
|
||||||
# ~ if data['ok']:
|
|
||||||
# ~ obj.estatus = 'Cancelada'
|
|
||||||
# ~ obj.error = ''
|
|
||||||
# ~ obj.cancelada = True
|
|
||||||
# ~ obj.fecha_cancelacion = result['Fecha']
|
|
||||||
# ~ obj.acuse = result['Acuse']
|
|
||||||
# ~ self._actualizar_saldo_cliente(self, obj, True)
|
|
||||||
# ~ else:
|
|
||||||
# ~ obj.error = data['msg']
|
|
||||||
# ~ obj.save()
|
|
||||||
# ~ return data
|
|
||||||
|
|
||||||
def _get_filters(self, values):
|
def _get_filters(self, values):
|
||||||
if 'start' in values and 'end' in values:
|
if 'start' in values and 'end' in values:
|
||||||
filters = Facturas.fecha.between(
|
filters = Facturas.fecha.between(
|
||||||
|
@ -5855,13 +5836,12 @@ class PreFacturas(BaseModel):
|
||||||
def filter_years(cls):
|
def filter_years(cls):
|
||||||
data = [{'id': -1, 'value': 'Todos'}]
|
data = [{'id': -1, 'value': 'Todos'}]
|
||||||
rows = (PreFacturas
|
rows = (PreFacturas
|
||||||
.select(PreFacturas.fecha.year)
|
.select(PreFacturas.fecha.year.alias('year'))
|
||||||
.group_by(PreFacturas.fecha.year)
|
.group_by(PreFacturas.fecha.year)
|
||||||
.order_by(PreFacturas.fecha.year)
|
.order_by(PreFacturas.fecha.year)
|
||||||
.scalar(as_tuple=True)
|
|
||||||
)
|
)
|
||||||
if not rows is None:
|
if not rows is None:
|
||||||
data += [{'id': int(row), 'value': int(row)} for row in rows]
|
data += [{'id': int(r.year), 'value': int(r.year)} for r in rows]
|
||||||
return tuple(data)
|
return tuple(data)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in New Issue