BUG oxorderarticles->setNewAmount

You can change article amout in oxid backend in order_article, even if the stock ‘would’ get negative -> prevent ‘set amount’ and ‘save’ for oxorderarticle, if negative stock is not allowed

/**
 * Ordered article stock setter. Before setting new stock value additionally checks for
 * original article stock value. Is stock values <= preferred, adjusts order stock according
 * to it
 *
 * @param int $iNewAmount new ordered items amount
 *
 * @return null
 */
public function setNewAmount( $iNewAmount )
{
    if ( $iNewAmount >= 0 ) {
        // to update stock we must first check if it is possible - article exists?
        $oArticle = oxNew( "oxarticle" );
        if ( $oArticle->load( $this->oxorderarticles__oxartid->value ) ) {

            // updating stock info
            $iStockChange = $iNewAmount - $this->oxorderarticles__oxamount->value;
            $iOnStock = $oArticle->checkForStock( $iStockChange );
            if ( $iStockChange > 0 && $iOnStock !== false ) {
                if ( $iOnStock !== true ) {
                    $iStockChange = $iOnStock;
                    $iNewAmount   = $this->oxorderarticles__oxamount->value + $iStockChange;
                }
            }

            $this->updateArticleStock( $iStockChange * -1, $this->getConfig()->getConfigParam( 'blAllowNegativeStock' ) );

            if ($this->getConfig()->getConfigParam( 'blAllowNegativeStock' ) || $iOnStock !== false) {
                // updating self
                $this->oxorderarticles__oxamount = new oxField ($iNewAmount, oxField::T_RAW);
                $this->save();
            }
        }
    }
}