From c12697a1af98c2d27a87713a85102f0f81b6d091 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 30 Jan 2026 17:39:08 +0530 Subject: [PATCH] Refactor invoice record query to include scanned status filter and adjust pagination --- app/Livewire/InvoiceDataTable.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/Livewire/InvoiceDataTable.php b/app/Livewire/InvoiceDataTable.php index dd12ee7..048206f 100644 --- a/app/Livewire/InvoiceDataTable.php +++ b/app/Livewire/InvoiceDataTable.php @@ -474,11 +474,18 @@ class InvoiceDataTable extends Component public function getInvoiceRecordsProperty() { return InvoiceValidation::with('stickerMasterRelation.item') - ->when($this->hasSearched, function ($query) { - $query->where('invoice_number', $this->invoiceNumber) - ->where('plant_id', $this->plantId); + ->where('invoice_number', $this->invoiceNumber) + ->where('plant_id', $this->plantId) + ->where(function ($query) { + $query->whereNull('scanned_status') + ->orWhere('scanned_status', ''); }) - ->paginate(7); + // ->when($this->hasSearched, function ($query) { + // $query->where('invoice_number', $this->invoiceNumber) + // ->where('plant_id', $this->plantId) + // ->where('scanned_status', '=', ''); + // }) + ->paginate(6); }