Print stock entry labels also on inventory when adding products (closes #1713)

This commit is contained in:
Bernd Bestel
2021-12-09 18:32:59 +01:00
parent 3e20c2cc3d
commit a711bbd8f6
6 changed files with 94 additions and 5 deletions

View File

@@ -855,7 +855,7 @@ class StockService extends BaseService
return $this->getDatabase()->stock()->where('id', $entryId)->fetch();
}
public function InventoryProduct(int $productId, float $newAmount, $bestBeforeDate, $locationId = null, $price = null, $shoppingLocationId = null, $purchasedDate = null)
public function InventoryProduct(int $productId, float $newAmount, $bestBeforeDate, $locationId = null, $price = null, $shoppingLocationId = null, $purchasedDate = null, $stockLabelType = 0)
{
if (!$this->ProductExists($productId))
{
@@ -902,7 +902,7 @@ class StockService extends BaseService
$bookingAmount = $newAmount;
}
return $this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, $purchasedDate, $price, $locationId, $shoppingLocationId);
return $this->AddProduct($productId, $bookingAmount, $bestBeforeDate, self::TRANSACTION_TYPE_INVENTORY_CORRECTION, $purchasedDate, $price, $locationId, $shoppingLocationId, $unusedTransactionId, $stockLabelType);
}
elseif ($newAmount < $productDetails->stock_amount + $containerWeight)
{