mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
fix: add variable definition and reorder args used in ConsumeProduct
This commit is contained in:
parent
25255287a7
commit
ea2b7996d1
|
|
@ -278,14 +278,14 @@ class StockApiController extends BaseApiController
|
||||||
}
|
}
|
||||||
|
|
||||||
$specificStockEntryId = 'default';
|
$specificStockEntryId = 'default';
|
||||||
if (array_key_exists('stock_entry_id', $requestBody) && !empty($requestBody['stock_entry_id']))
|
if (array_key_exists('stock_id', $args) && !empty($args['stock_id']))
|
||||||
{
|
|
||||||
$specificStockEntryId = $requestBody['stock_entry_id'];
|
|
||||||
}
|
|
||||||
elseif (array_key_exists('stock_id', $args) && !empty($args['stock_id']))
|
|
||||||
{
|
{
|
||||||
$specificStockEntryId = $args['stock_id'];
|
$specificStockEntryId = $args['stock_id'];
|
||||||
}
|
}
|
||||||
|
elseif (array_key_exists('stock_entry_id', $requestBody) && !empty($requestBody['stock_entry_id']))
|
||||||
|
{
|
||||||
|
$specificStockEntryId = $requestBody['stock_entry_id'];
|
||||||
|
}
|
||||||
|
|
||||||
$locationId = null;
|
$locationId = null;
|
||||||
if (array_key_exists('location_id', $requestBody) && !empty($requestBody['location_id']) && is_numeric($requestBody['location_id']))
|
if (array_key_exists('location_id', $requestBody) && !empty($requestBody['location_id']) && is_numeric($requestBody['location_id']))
|
||||||
|
|
@ -326,6 +326,7 @@ class StockApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
$barcode = $args['barcode'];
|
||||||
if (Grocycode::Validate($barcode))
|
if (Grocycode::Validate($barcode))
|
||||||
{
|
{
|
||||||
$gc = new Grocycode($barcode);
|
$gc = new Grocycode($barcode);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user