Handle edited stock entries in GetProductPriceHistory (fixes #913)

This commit is contained in:
Bernd Bestel
2020-08-25 19:09:47 +02:00
parent 0b98504371
commit 4058925f40
3 changed files with 24 additions and 1 deletions

View File

@@ -182,7 +182,7 @@ class StockService extends BaseService
$returnData = array();
$shoppingLocations = $this->getDatabase()->shopping_locations();
$rows = $this->getDatabase()->stock_log()->where('product_id = :1 AND transaction_type IN (:2, :3) AND undone = 0', $productId, self::TRANSACTION_TYPE_PURCHASE, self::TRANSACTION_TYPE_INVENTORY_CORRECTION)->whereNOT('price', null)->orderBy('purchased_date', 'DESC');
$rows = $this->getDatabase()->product_price_history()->where('product_id = :1', $productId)->orderBy('purchased_date', 'DESC');
foreach ($rows as $row)
{
$returnData[] = array(