migrate to gtea from bistbucket
This commit is contained in:
22
Modules/Business/App/Exports/ExportCurrentStockReport.php
Normal file
22
Modules/Business/App/Exports/ExportCurrentStockReport.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Business\App\Exports;
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class ExportCurrentStockReport implements FromView
|
||||
{
|
||||
public function view(): View
|
||||
{
|
||||
return view('business::reports.stocks.excel-csv', [
|
||||
'stock_reports' => Product::with('stocks')
|
||||
->where('business_id', auth()->user()->business_id)
|
||||
->where('product_type', '!=', 'combo')
|
||||
->withSum('stocks', 'productStock')
|
||||
->latest()
|
||||
->get()
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user