/**
  * @param $clientPublicId
  * @param $search
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($search)
 {
     // we don't support bulk edit and hide the client on the individual client page
     $datatable = new ExpenseCategoryDatatable();
     $query = $this->categoryRepo->find($search);
     return $this->datatableService->createDatatable($datatable, $query);
 }
 /**
  * @param $search
  * @return \Illuminate\Http\JsonResponse
  */
 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($datatable, $query);
 }
 /**
  * @param $vendorPublicId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatableVendor($vendorPublicId)
 {
     $datatable = new ExpenseDatatable(false, true);
     $query = $this->expenseRepo->findVendor($vendorPublicId);
     if (!Utils::hasPermission('view_all')) {
         $query->where('expenses.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }
 /**
  * @param $accountId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($accountId, $search)
 {
     $datatable = new ProductDatatable(true);
     $query = $this->productRepo->find($accountId, $search);
     if (!Utils::hasPermission('view_all')) {
         $query->where('products.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }
 /**
  * @param $clientPublicId
  * @param $search
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($clientPublicId, $search)
 {
     // we don't support bulk edit and hide the client on the individual client page
     $datatable = new CreditDatatable(!$clientPublicId, $clientPublicId);
     $query = $this->creditRepo->find($clientPublicId, $search);
     if (!Utils::hasPermission('view_all')) {
         $query->where('credits.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }
 public function getDatatable($accountId, $clientPublicId = null, $entityType, $search)
 {
     $datatable = new InvoiceDatatable(!$clientPublicId, $clientPublicId);
     $datatable->entityType = $entityType;
     $query = $this->invoiceRepo->getInvoices($accountId, $clientPublicId, $entityType, $search)->where('invoices.invoice_type_id', '=', $entityType == ENTITY_QUOTE ? INVOICE_TYPE_QUOTE : INVOICE_TYPE_STANDARD);
     if (!Utils::hasPermission('view_all')) {
         $query->where('invoices.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }
示例#7
0
 /**
  * @param $accountId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($accountId)
 {
     $datatable = new UserDatatable(false);
     $query = $this->userRepo->find($accountId);
     return $this->datatableService->createDatatable($datatable, $query);
 }
 public function getDatatable($accountId)
 {
     $query = $this->bankAccountRepo->find($accountId);
     return $this->datatableService->createDatatable(new BankAccountDatatable(false), $query);
 }
 /**
  * @param $userId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($userId)
 {
     $datatable = new TokenDatatable(false);
     $query = $this->tokenRepo->find($userId);
     return $this->datatableService->createDatatable($datatable, $query);
 }
示例#10
0
 /**
  * @param $search
  * @param $userId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($search, $userId)
 {
     $datatable = new ClientDatatable();
     $query = $this->clientRepo->find($search, $userId);
     return $this->datatableService->createDatatable($datatable, $query);
 }
 /**
  * @param null $clientPublicId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($clientPublicId = null)
 {
     $clientId = Client::getPrivateId($clientPublicId);
     $query = $this->activityRepo->findByClientId($clientId);
     return $this->datatableService->createDatatable(new ActivityDatatable(false), $query);
 }