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 . '%')
@@ -1,8 +1,15 @@
<div class="bg-[#f5f5f5] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-4">
<div class="flex justify-between items-center mb-4">
<div class="flex flex-wrap justify-between items-center gap-2 mb-4">
<h1 class="text-lg font-bold">Reversar Compras</h1>
<input type="text" placeholder="Buscar por ID, vendedor, cliente o cuenta..." wire:model.lazy="buscar"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow px-4 py-2 w-72 focus:outline-none focus:border-neutral-400">
<div class="flex flex-wrap items-center gap-2">
<input type="date" wire:model="fecha_desde"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow px-3 py-2 focus:outline-none focus:border-neutral-400 text-sm">
<span class="text-gray-400">a</span>
<input type="date" wire:model="fecha_hasta"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow px-3 py-2 focus:outline-none focus:border-neutral-400 text-sm">
<input type="text" placeholder="Buscar por ID, vendedor, cliente o cuenta..." wire:model.lazy="buscar"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow px-4 py-2 w-64 focus:outline-none focus:border-neutral-400">
</div>
</div>
<div class="overflow-x-auto">