This commit is contained in:
Lizandro Guarnizo
2026-06-18 13:04:07 -05:00
parent ebd72870be
commit a56a69dccb
2 changed files with 14 additions and 5 deletions
+4 -2
View File
@@ -18,15 +18,17 @@ class ReversarCompra extends Component
use WithPagination;
public $buscar;
public $fecha_desde;
public $fecha_hasta;
public $confirmando_id = null;
protected $listeners = ['confirmarReversar'];
public function render()
{
$consulta = Historiale::with('vendedor', 'cliente', 'tarifa.servicio', 'promocion', 'cuentas')
->where('estado', 'activo')
->orderBy('id', 'DESC')
->when(!empty($this->fecha_desde), fn($q) => $q->whereDate('created_at', '>=', $this->fecha_desde))
->when(!empty($this->fecha_hasta), fn($q) => $q->whereDate('created_at', '<=', $this->fecha_hasta))
->when(!empty($this->buscar), function ($query) {
$query->where(function ($q) {
$q->where('id', 'ILIKE', '%' . $this->buscar . '%')