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 = (
|
||||
(Facturas.cancelada==False) &
|
||||
(Facturas.uuid.is_null(False)) &
|
||||
(Facturas.tipo_comprobante=='I') &
|
||||
(Facturas.tipo_comprobante.in_(('I', 'ingreso'))) &
|
||||
(Facturas.saldo>0)
|
||||
)
|
||||
if ids:
|
||||
filtros &= (Facturas.id.not_in(ids))
|
||||
|
||||
currency = case(Facturas.moneda, (
|
||||
('peso', 'MXN'),
|
||||
), Facturas.moneda)
|
||||
|
||||
rows = tuple(Facturas
|
||||
.select(
|
||||
Facturas.id,
|
||||
|
@ -3676,7 +3680,7 @@ class Facturas(BaseModel):
|
|||
Facturas.estatus,
|
||||
Socios.nombre.alias('cliente'),
|
||||
Facturas.total,
|
||||
Facturas.moneda.alias('currency'),
|
||||
currency.alias('currency'),
|
||||
Facturas.total_mn,
|
||||
Facturas.saldo,
|
||||
)
|
||||
|
@ -5357,7 +5361,7 @@ class FacturasPagos(BaseModel):
|
|||
else:
|
||||
nuevo['saldo_anterior'] = float(mov_ant.saldo)
|
||||
|
||||
if(fac.moneda=='MXN'):
|
||||
if(fac.moneda in ('MXN', 'peso')):
|
||||
nuevo['saldo'] = nuevo['saldo_anterior'] - importe
|
||||
else:
|
||||
nuevo['importe'] = this_pay
|
||||
|
|
Loading…
Reference in New Issue