migrate to gtea from bistbucket
This commit is contained in:
34
Modules/Business/App/Exports/ExportDayBookReport.php
Normal file
34
Modules/Business/App/Exports/ExportDayBookReport.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Business\App\Exports;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class ExportDayBookReport implements FromView
|
||||
{
|
||||
public function view(): View
|
||||
{
|
||||
$day_books = Transaction::with([
|
||||
'paymentType:id,name',
|
||||
'sale:id,user_id,party_id,totalAmount',
|
||||
'sale.party:id,name',
|
||||
'sale.user:id,name',
|
||||
'saleReturn:id,sale_id',
|
||||
'purchase:id,user_id,party_id,totalAmount',
|
||||
'purchase.party:id,name',
|
||||
'purchase.user:id,name',
|
||||
'purchaseReturn:id,purchase_id',
|
||||
'dueCollect:id,user_id,party_id,totalDue',
|
||||
'dueCollect.party:id,name',
|
||||
'dueCollect.user:id,name',
|
||||
])
|
||||
->where('business_id', auth()->user()->business_id)
|
||||
->whereIn('type', ['debit', 'credit'])
|
||||
->latest()
|
||||
->get();
|
||||
|
||||
return view('business::day-book.excel-csv', compact('day_books'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user