Entity/OrderElement.php
public function setDiscountValue($discountValue, $fromRate = false)
    {
        $this->discountValue = $discountValue;

        if($this->getTotalPrice() > 0)
        {
            if($fromRate == false)
                $this->setDiscountRate(($this->discountValue/$this->getTotalPrice()), true);

            $this->setTotalPrice(($this->getUnitPrice()*$this->getQuantity()*$this->getLocationCoeff()) - $this->discountRate);
        }

        return $this;
    }
public function setDiscountValue($discountValue, $fromRate = false)
    {
        $this->discountValue = $discountValue;

        if($this->getTotalPrice() > 0)
        {
            if($fromRate == false)
                $this->setDiscountRate(($this->discountValue/$this->getTotalPrice()), true);

            $this->setTotalPrice(($this->getUnitPrice()*$this->getQuantity()*$this->getLocationCoeff()) - $this->discountRate);
        }

        return $this;
    }
Set discountValue

@param float $discountValue
@param boolean $fromRate
@return OrderElement