forked from elmau/empresa-libre
Fix in get year for preinvoices
This commit is contained in:
commit
0084197906
|
@ -3931,25 +3931,6 @@ class Facturas(BaseModel):
|
|||
query.execute()
|
||||
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):
|
||||
if 'start' in values and 'end' in values:
|
||||
filters = Facturas.fecha.between(
|
||||
|
@ -5855,13 +5836,12 @@ class PreFacturas(BaseModel):
|
|||
def filter_years(cls):
|
||||
data = [{'id': -1, 'value': 'Todos'}]
|
||||
rows = (PreFacturas
|
||||
.select(PreFacturas.fecha.year)
|
||||
.select(PreFacturas.fecha.year.alias('year'))
|
||||
.group_by(PreFacturas.fecha.year)
|
||||
.order_by(PreFacturas.fecha.year)
|
||||
.scalar(as_tuple=True)
|
||||
)
|
||||
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)
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue