Refactor invoice record query to include scanned status filter and adjust pagination
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled

This commit is contained in:
dhanabalan
2026-01-30 17:39:08 +05:30
parent c0929b4153
commit c12697a1af

View File

@@ -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);
}