mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Stock-Journal: API, Summary, Done By (#989)
* Stockjournal: Add "Done by" * Add API for Stock-Journal * Add "Journal-Summary" * Use ALTER TABLE * Moved the "Jounral summary" button to the stock journal page * Changed icon & context menu position for new stock journal summary page Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
committed by
GitHub
parent
7498d8f13d
commit
0454c128f0
@@ -33,10 +33,8 @@ class StockController extends BaseController
|
||||
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'stockjournal', [
|
||||
'stockLog' => $this->getDatabase()->stock_log()->orderBy('row_created_timestamp', 'DESC'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name'),
|
||||
'stockLog' => $this->getDatabase()->uihelper_stock_journal()->orderBy('row_created_timestamp', 'DESC'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -442,4 +440,24 @@ class StockController extends BaseController
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
public function JournalSummary(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$entries = $this->getDatabase()->uihelper_stock_journal_summary();
|
||||
if (isset($request->getQueryParams()['product_id']))
|
||||
{
|
||||
$entries = $entries->where('product_id', $request->getQueryParams()['product_id']);
|
||||
}
|
||||
if (isset($request->getQueryParams()['user_id']))
|
||||
{
|
||||
$entries = $entries->where('user_id', $request->getQueryParams()['user_id']);
|
||||
}
|
||||
if (isset($request->getQueryParams()['transaction_type']))
|
||||
{
|
||||
$entries = $entries->where('transaction_type', $request->getQueryParams()['transaction_type']);
|
||||
}
|
||||
return $this->renderPage($response, 'stockjournalsummary', [
|
||||
'entries' => $entries
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user