mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:44:35 -04:00
Minor fixes for filter queries
This commit is contained in:
parent
27dbadadbc
commit
e46b186b08
@ -344,9 +344,9 @@ class TaxModel
|
|||||||
$this->regions->EU->subregions = new \stdClass();
|
$this->regions->EU->subregions = new \stdClass();
|
||||||
|
|
||||||
$this->regions->EU->subregions->AT = new \stdClass();
|
$this->regions->EU->subregions->AT = new \stdClass();
|
||||||
$this->regions->EU->subregions->AT->tax_rate = 21;
|
$this->regions->EU->subregions->AT->tax_rate = 20;
|
||||||
$this->regions->EU->subregions->AT->tax_name = 'USt';
|
$this->regions->EU->subregions->AT->tax_name = 'USt';
|
||||||
$this->regions->EU->subregions->AT->reduced_tax_rate = 11;
|
$this->regions->EU->subregions->AT->reduced_tax_rate = 10;
|
||||||
$this->regions->EU->subregions->AT->apply_tax = false;
|
$this->regions->EU->subregions->AT->apply_tax = false;
|
||||||
|
|
||||||
$this->regions->EU->subregions->BE = new \stdClass();
|
$this->regions->EU->subregions->BE = new \stdClass();
|
||||||
|
@ -138,6 +138,7 @@ abstract class QueryFilters
|
|||||||
*/
|
*/
|
||||||
public function status(string $filter = ''): Builder
|
public function status(string $filter = ''): Builder
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strlen($filter) == 0) {
|
if (strlen($filter) == 0) {
|
||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
@ -146,17 +147,17 @@ abstract class QueryFilters
|
|||||||
|
|
||||||
return $this->builder->where(function ($query) use ($filters) {
|
return $this->builder->where(function ($query) use ($filters) {
|
||||||
if (in_array(self::STATUS_ACTIVE, $filters)) {
|
if (in_array(self::STATUS_ACTIVE, $filters)) {
|
||||||
$query->orWhereNull('deleted_at');
|
$query = $query->orWhereNull('deleted_at');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array(self::STATUS_ARCHIVED, $filters)) {
|
if (in_array(self::STATUS_ARCHIVED, $filters)) {
|
||||||
$query->orWhere(function ($query) {
|
$query = $query->orWhere(function ($q) {
|
||||||
$query->whereNotNull('deleted_at')->where('is_deleted', 0);
|
$q->whereNotNull('deleted_at')->where('is_deleted', 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array(self::STATUS_DELETED, $filters)) {
|
if (in_array(self::STATUS_DELETED, $filters)) {
|
||||||
$query->orWhere('is_deleted', 1);
|
$query = $query->orWhere('is_deleted', 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,7 @@ class CompanyUser extends Pivot
|
|||||||
'settings' => 'object',
|
'settings' => 'object',
|
||||||
'notifications' => 'object',
|
'notifications' => 'object',
|
||||||
'permissions' => 'string',
|
'permissions' => 'string',
|
||||||
|
'react_settings' => 'object',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
@ -44,7 +44,7 @@ class CompanyUserTransformer extends EntityTransformer
|
|||||||
'permissions' => $company_user->permissions ?: '',
|
'permissions' => $company_user->permissions ?: '',
|
||||||
'notifications' => $company_user->notifications ? (object) $company_user->notifications : $blank_obj,
|
'notifications' => $company_user->notifications ? (object) $company_user->notifications : $blank_obj,
|
||||||
'settings' => $company_user->settings ? (object) $company_user->settings : $blank_obj,
|
'settings' => $company_user->settings ? (object) $company_user->settings : $blank_obj,
|
||||||
'react_settings' => $company_user->react_settings ? $company_user->react_settings : [],
|
'react_settings' => $company_user->react_settings ? (object) $company_user->react_settings : [],
|
||||||
'is_owner' => (bool) $company_user->is_owner,
|
'is_owner' => (bool) $company_user->is_owner,
|
||||||
'is_admin' => (bool) $company_user->is_admin,
|
'is_admin' => (bool) $company_user->is_admin,
|
||||||
'is_locked' => (bool) $company_user->is_locked,
|
'is_locked' => (bool) $company_user->is_locked,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user