FIX: Cuotas hoy y pendientes.
This commit is contained in:
@ -83,9 +83,7 @@ class Cuota extends Ideal\Repository
|
||||
->joined('JOIN venta ON venta.pie = a.pie')
|
||||
->joined('JOIN (SELECT ev1.* FROM estado_venta ev1 JOIN (SELECT MAX(id) AS id, venta FROM estado_venta GROUP BY venta) ev0 ON ev0.id = ev1.id) ev ON ev.venta = venta.id')
|
||||
->joined('JOIN tipo_estado_venta tev ON tev.id = ev.estado')
|
||||
->where('tep.descripcion = ?')
|
||||
->where('pago.fecha = CURDATE()')
|
||||
->where('tev.descripcion IN (?, ?, ?)');
|
||||
->where('tep.descripcion = ? AND pago.fecha = CURDATE() AND tev.descripcion IN (?, ?, ?)');
|
||||
return $this->fetchMany($query, ['no pagado', 'vigente', 'escriturando', 'firmado por inmobiliaria']);
|
||||
}
|
||||
public function fetchPendientes(): array
|
||||
@ -108,9 +106,7 @@ class Cuota extends Ideal\Repository
|
||||
->joined('JOIN proyecto_tipo_unidad ptu ON ptu.id = unidad.pt')
|
||||
->joined('JOIN proyecto ON proyecto.id = ptu.proyecto')
|
||||
->joined('JOIN banco ON banco.id = pago.banco')
|
||||
->where('tep.descripcion = ?')
|
||||
->where('pago.fecha < CURDATE()')
|
||||
->where('tev.descripcion IN (?, ?, ?)')
|
||||
->where('tep.descripcion = ? AND pago.fecha < CURDATE() AND tev.descripcion IN (?, ?, ?)')
|
||||
->order('pago.fecha DESC');
|
||||
return $this->fetchAsArray($query, ['no pagado', 'vigente', 'escriturando', 'firmado por inmobiliaria']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user