public function setNewAmount($iNewAmount)
    {
        if ($iNewAmount >= 0) {
            // to update stock we must first check if it is possible - article exists?
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            if ($oArticle->load($this->oxorderarticles__oxartid->value)) {
                // updating stock info
                $iStockChange = $iNewAmount - $this->oxorderarticles__oxamount->value;
                if ($iStockChange > 0 && ($iOnStock = $oArticle->checkForStock($iStockChange)) !== false) {
                    if ($iOnStock !== true) {
                        $iStockChange = $iOnStock;
                        $iNewAmount = $this->oxorderarticles__oxamount->value + $iStockChange;
                    }
                }

                $this->updateArticleStock($iStockChange * -1, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowNegativeStock'));

                // updating self
                $this->oxorderarticles__oxamount = new \OxidEsales\Eshop\Core\Field($iNewAmount, \OxidEsales\Eshop\Core\Field::T_RAW);
                $this->save();
            }
        }
    }