mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for chart queries
This commit is contained in:
parent
22d6d31399
commit
9872dab2ab
@ -35,6 +35,9 @@ class ChartService
|
|||||||
$currencies = Client::withTrashed()
|
$currencies = Client::withTrashed()
|
||||||
->where('company_id', $this->company->id)
|
->where('company_id', $this->company->id)
|
||||||
->where('is_deleted', 0)
|
->where('is_deleted', 0)
|
||||||
|
->when(!$this->is_admin, function ($query) {
|
||||||
|
$query->where('user_id', $this->user->id);
|
||||||
|
})
|
||||||
->distinct()
|
->distinct()
|
||||||
->pluck('settings->currency_id as id');
|
->pluck('settings->currency_id as id');
|
||||||
|
|
||||||
@ -45,6 +48,9 @@ class ChartService
|
|||||||
$expense_currencies = Expense::withTrashed()
|
$expense_currencies = Expense::withTrashed()
|
||||||
->where('company_id', $this->company->id)
|
->where('company_id', $this->company->id)
|
||||||
->where('is_deleted', 0)
|
->where('is_deleted', 0)
|
||||||
|
->when(!$this->is_admin, function ($query) {
|
||||||
|
$query->where('user_id', $this->user->id);
|
||||||
|
})
|
||||||
->distinct()
|
->distinct()
|
||||||
->pluck('currency_id as id');
|
->pluck('currency_id as id');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user