forked from elmau/empresa-libre
Obtener solo por pagar
This commit is contained in:
parent
b59f62e4f1
commit
0a575afaa9
|
@ -1973,13 +1973,16 @@ class Facturas(BaseModel):
|
|||
|
||||
return (Facturas.folio.between(folio1, folio2))
|
||||
|
||||
def _get_por_pagar(self):
|
||||
def _get_por_pagar(self, ids):
|
||||
filtros = (
|
||||
(Facturas.cancelada==False) &
|
||||
(Facturas.uuid.is_null(False)) &
|
||||
(Facturas.tipo_comprobante=='I') &
|
||||
(Facturas.saldo>0)
|
||||
)
|
||||
if ids:
|
||||
filtros &= (Facturas.id.not_in(ids))
|
||||
|
||||
rows = tuple(Facturas
|
||||
.select(
|
||||
Facturas.id,
|
||||
|
@ -2004,7 +2007,7 @@ class Facturas(BaseModel):
|
|||
|
||||
def _get_opt(self, values):
|
||||
if values['opt'] == 'porpagar':
|
||||
return self._get_por_pagar(self)
|
||||
return self._get_por_pagar(self, util.loads(values['ids']))
|
||||
|
||||
cfdis = util.loads(values['cfdis'])
|
||||
|
||||
|
|
|
@ -112,18 +112,24 @@ function get_bancos_forma_pago(retiro){
|
|||
|
||||
|
||||
function get_facturas_por_pagar(){
|
||||
var grid = $$('grid_cfdi_por_pagar')
|
||||
var grid1 = $$('grid_cfdi_este_deposito')
|
||||
var grid2 = $$('grid_cfdi_por_pagar')
|
||||
|
||||
webix.ajax().get('/invoices', {'opt': 'porpagar'}, {
|
||||
var ids = []
|
||||
grid1.data.each(function(obj){
|
||||
ids.push(obj.id)
|
||||
})
|
||||
|
||||
webix.ajax().get('/invoices', {'opt': 'porpagar', 'ids': ids}, {
|
||||
error:function(text, data, XmlHttpRequest){
|
||||
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||
msg_error(msg)
|
||||
},
|
||||
success:function(text, data, XmlHttpRequest){
|
||||
var values = data.json()
|
||||
grid.clearAll()
|
||||
grid2.clearAll()
|
||||
if (values.ok){
|
||||
grid.parse(values.rows, 'json')
|
||||
grid2.parse(values.rows, 'json')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -276,6 +282,7 @@ function actualizar_deposito(grid){
|
|||
})
|
||||
$$('txt_deposito_importe').setValue(suma)
|
||||
$$('deposito_descripcion').setValue(descripcion)
|
||||
grid.refresh()
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue