Added price field on inventory page (for added products) (references #225)

This commit is contained in:
Bernd Bestel
2019-05-03 22:11:20 +02:00
parent 8138dd43ac
commit bcae9f9292
5 changed files with 40 additions and 3 deletions

View File

@@ -177,7 +177,13 @@ class StockApiController extends BaseApiController
$locationId = $requestBody['location_id'];
}
$bookingId = $this->StockService->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId);
$price = null;
if (array_key_exists('price', $requestBody) && is_numeric($requestBody['price']))
{
$price = $requestBody['price'];
}
$bookingId = $this->StockService->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price);
return $this->ApiResponse($this->Database->stock_log($bookingId));
}
catch (\Exception $ex)