forked from elmau/empresa-libre
Filtrar por pagar facturas v3.2
This commit is contained in:
parent
aee9a83dd2
commit
db435a9b3d
|
@ -3659,12 +3659,16 @@ class Facturas(BaseModel):
|
||||||
filtros = (
|
filtros = (
|
||||||
(Facturas.cancelada==False) &
|
(Facturas.cancelada==False) &
|
||||||
(Facturas.uuid.is_null(False)) &
|
(Facturas.uuid.is_null(False)) &
|
||||||
(Facturas.tipo_comprobante=='I') &
|
(Facturas.tipo_comprobante.in_(('I', 'ingreso'))) &
|
||||||
(Facturas.saldo>0)
|
(Facturas.saldo>0)
|
||||||
)
|
)
|
||||||
if ids:
|
if ids:
|
||||||
filtros &= (Facturas.id.not_in(ids))
|
filtros &= (Facturas.id.not_in(ids))
|
||||||
|
|
||||||
|
currency = case(Facturas.moneda, (
|
||||||
|
('peso', 'MXN'),
|
||||||
|
), Facturas.moneda)
|
||||||
|
|
||||||
rows = tuple(Facturas
|
rows = tuple(Facturas
|
||||||
.select(
|
.select(
|
||||||
Facturas.id,
|
Facturas.id,
|
||||||
|
@ -3676,7 +3680,7 @@ class Facturas(BaseModel):
|
||||||
Facturas.estatus,
|
Facturas.estatus,
|
||||||
Socios.nombre.alias('cliente'),
|
Socios.nombre.alias('cliente'),
|
||||||
Facturas.total,
|
Facturas.total,
|
||||||
Facturas.moneda.alias('currency'),
|
currency.alias('currency'),
|
||||||
Facturas.total_mn,
|
Facturas.total_mn,
|
||||||
Facturas.saldo,
|
Facturas.saldo,
|
||||||
)
|
)
|
||||||
|
@ -5357,7 +5361,7 @@ class FacturasPagos(BaseModel):
|
||||||
else:
|
else:
|
||||||
nuevo['saldo_anterior'] = float(mov_ant.saldo)
|
nuevo['saldo_anterior'] = float(mov_ant.saldo)
|
||||||
|
|
||||||
if(fac.moneda=='MXN'):
|
if(fac.moneda in ('MXN', 'peso')):
|
||||||
nuevo['saldo'] = nuevo['saldo_anterior'] - importe
|
nuevo['saldo'] = nuevo['saldo_anterior'] - importe
|
||||||
else:
|
else:
|
||||||
nuevo['importe'] = this_pay
|
nuevo['importe'] = this_pay
|
||||||
|
|
Loading…
Reference in New Issue