Make it possible to hide locations/stores/QUs/product_groups/task_categories (closes #2222)

This commit is contained in:
Bernd Bestel
2023-05-13 14:24:52 +02:00
parent b5d3e68d68
commit 9cdb0908d6
22 changed files with 323 additions and 58 deletions

View File

@@ -1772,7 +1772,7 @@ class StockService extends BaseService
if (file_exists($path))
{
require_once $path;
return new $pluginName($this->getDatabase()->locations()->fetchAll(), $this->getDatabase()->quantity_units()->fetchAll());
return new $pluginName($this->getDatabase()->locations()->where('active = 1')->fetchAll(), $this->getDatabase()->quantity_units()->fetchAll());
}
else
{
@@ -1782,7 +1782,7 @@ class StockService extends BaseService
private function LocationExists($locationId)
{
$locationRow = $this->getDatabase()->locations()->where('id = :1', $locationId)->fetch();
$locationRow = $this->getDatabase()->locations()->where('id = :1', $locationId)->where('active = 1')->fetch();
return $locationRow !== null;
}

View File

@@ -7,7 +7,7 @@ class TasksService extends BaseService
public function GetCurrent(): \LessQL\Result
{
$users = $this->getUsersService()->GetUsersAsDto();
$categories = $this->getDatabase()->task_categories();
$categories = $this->getDatabase()->task_categories()->where('active = 1');
$tasks = $this->getDatabase()->tasks_current();
foreach ($tasks as $task)