mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 03:04:36 +00:00
Add shopping location for price tracking (#658)
This commit is contained in:
@@ -38,6 +38,7 @@ class StockController extends BaseController
|
||||
'products' => $this->getDatabase()->products()->orderBy('name'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name'),
|
||||
'stockEntries' => $this->getDatabase()->stock()->orderBy('product_id'),
|
||||
'currentStockLocations' => $this->getStockService()->GetCurrentStockLocations(),
|
||||
'nextXDays' => $nextXDays,
|
||||
@@ -50,6 +51,7 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'purchase', [
|
||||
'products' => $this->getDatabase()->products()->orderBy('name'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
@@ -76,6 +78,7 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'inventory', [
|
||||
'products' => $this->getDatabase()->products()->orderBy('name'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
@@ -85,6 +88,7 @@ class StockController extends BaseController
|
||||
return $this->renderPage($response, 'stockentryform', [
|
||||
'stockEntry' => $this->getDatabase()->stock()->where('id', $args['entryId'])->fetch(),
|
||||
'products' => $this->getDatabase()->products()->orderBy('name'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
@@ -140,6 +144,15 @@ class StockController extends BaseController
|
||||
]);
|
||||
}
|
||||
|
||||
public function ShoppingLocationsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglocations', [
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('shopping_locations'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('shopping_locations')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ProductGroupsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'productgroups', [
|
||||
@@ -210,6 +223,25 @@ class StockController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function ShoppingLocationEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['shoppingLocationId'] == 'new')
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglocationform', [
|
||||
'mode' => 'create',
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('shopping_locations')
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglocationform', [
|
||||
'shoppinglocation' => $this->getDatabase()->shopping_locations($args['shoppingLocationId']),
|
||||
'mode' => 'edit',
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('shopping_locations')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductGroupEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['productGroupId'] == 'new')
|
||||
|
Reference in New Issue
Block a user