update marketing
All checks were successful
All checks were successful
This commit is contained in:
28
Modules/Business/App/Exports/ExportGuestDue.php
Normal file
28
Modules/Business/App/Exports/ExportGuestDue.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Business\App\Exports;
|
||||
|
||||
use App\Models\Sale;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class ExportGuestDue implements FromView
|
||||
{
|
||||
public function view(): View
|
||||
{
|
||||
$walk_in_customers = Sale::where('business_id', auth()->user()->business_id)
|
||||
->with('dueCollect')
|
||||
->whereNull('party_id')
|
||||
->where('dueAmount', '>', 0)
|
||||
->when(request('search'), function ($query) {
|
||||
$query->where(function ($q) {
|
||||
$q->where('invoiceNumber', 'like', '%' . request('search') . '%')
|
||||
->orwhere('dueAmount', 'like', '%' . request('search') . '%');
|
||||
});
|
||||
})
|
||||
->latest()
|
||||
->limit(request('per_page') ?? 20)->get();
|
||||
|
||||
return view('business::walk-dues.excel-csv', compact('walk_in_customers'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user