23 lines
669 B
PHP
23 lines
669 B
PHP
<?php
|
|
|
|
namespace Modules\Portal\Http\Controllers\Supplier;
|
|
|
|
use App\Transaction;
|
|
use Modules\Portal\Http\Controllers\BasePortalController;
|
|
|
|
class DocumentController extends BasePortalController
|
|
{
|
|
public function index()
|
|
{
|
|
$this->ensureCrmSubscription();
|
|
$transactions = Transaction::where('business_id', $this->businessId())
|
|
->where('contact_id', $this->contactId())
|
|
->whereIn('type', ['purchase', 'purchase_order'])
|
|
->whereNotNull('document')
|
|
->orderByDesc('transaction_date')
|
|
->paginate(20);
|
|
|
|
return view('portal::supplier.documents.index', compact('transactions'));
|
|
}
|
|
}
|