Refactor invoice record query to include scanned status filter and adjust pagination #286
@@ -474,11 +474,18 @@ class InvoiceDataTable extends Component
|
|||||||
public function getInvoiceRecordsProperty()
|
public function getInvoiceRecordsProperty()
|
||||||
{
|
{
|
||||||
return InvoiceValidation::with('stickerMasterRelation.item')
|
return InvoiceValidation::with('stickerMasterRelation.item')
|
||||||
->when($this->hasSearched, function ($query) {
|
->where('invoice_number', $this->invoiceNumber)
|
||||||
$query->where('invoice_number', $this->invoiceNumber)
|
->where('plant_id', $this->plantId)
|
||||||
->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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user