mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Updated vendors to new datatable class
This commit is contained in:
parent
541b19cd5f
commit
b2beb8fb73
@ -74,6 +74,6 @@ class VendorDatatable extends EntityDatatable
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ use App\Ninja\Datatables\EntityDatatable;
|
||||
|
||||
class DatatableService
|
||||
{
|
||||
//public function createDatatable($entityType, $query, $columns, $actions = null, $showCheckbox = true, $orderColumns = [])
|
||||
public function createDatatable(EntityDatatable $datatable, $query)
|
||||
{
|
||||
$table = Datatable::query($query);
|
||||
|
@ -8,6 +8,7 @@ use App\Models\Expense;
|
||||
use App\Services\BaseService;
|
||||
use App\Ninja\Repositories\VendorRepository;
|
||||
use App\Ninja\Repositories\NinjaRepository;
|
||||
use App\Ninja\Datatables\VendorDatatable;
|
||||
|
||||
class VendorService extends BaseService
|
||||
{
|
||||
@ -37,13 +38,14 @@ class VendorService extends BaseService
|
||||
|
||||
public function getDatatable($search)
|
||||
{
|
||||
$datatable = new VendorDatatable();
|
||||
$query = $this->vendorRepo->find($search);
|
||||
|
||||
if(!Utils::hasPermission('view_all')){
|
||||
$query->where('vendors.user_id', '=', Auth::user()->id);
|
||||
}
|
||||
|
||||
return $this->datatableService->createDatatable(ENTITY_VENDOR, $query);
|
||||
return $this->datatableService->createDatatable($datatable, $query);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user