Entity/OrderElement.php
public function setDiscountRate($discountRate, $fromValue = false)
    {
        $this->discountRate = $discountRate;

        if($this->getTotalPrice() > 0 && $fromValue == false && $discountRate > 0)
        {
            $this->setDiscountValue(($this->getTotalPrice()/$this->discountRate), true);
        }

        return $this;
    }
public function setDiscountRate($discountRate, $fromValue = false)
    {
        $this->discountRate = $discountRate;

        if($this->getTotalPrice() > 0 && $fromValue == false && $discountRate > 0)
        {
            $this->setDiscountValue(($this->getTotalPrice()/$this->discountRate), true);
        }

        return $this;
    }
Set discountRate

@param float $discountRate
@param boolean $fromValue
@return OrderElement