source/Application/Model/Basket.php
protected function _applyDiscounts()
    {
        //apply discounts for brutto price
        $dDiscountedSum = $this->_getDiscountedProductsSum();

        $oUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
        $dVatSum = 0;
        foreach ($this->_aDiscountedVats as $dVat) {
            $dVatSum += $oUtils->fRound($dVat, $this->_oCurrency);
        }

        $oNotDiscounted = $this->getNotDiscountProductsPrice();

        if ($this->isCalculationModeNetto()) {
            // netto view mode
            $this->setNettoSum($this->getProductsPrice()->getSum());
            $this->setBruttoSum($oNotDiscounted->getSum(false) + $dDiscountedSum + $dVatSum);
        } else {
            // brutto view mode
            $this->setNettoSum($oNotDiscounted->getSum() + $dDiscountedSum - $dVatSum);
            $this->setBruttoSum($this->getProductsPrice()->getSum(false));
        }
    }
protected function _applyDiscounts()
    {
        //apply discounts for brutto price
        $dDiscountedSum = $this->_getDiscountedProductsSum();

        $oUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
        $dVatSum = 0;
        foreach ($this->_aDiscountedVats as $dVat) {
            $dVatSum += $oUtils->fRound($dVat, $this->_oCurrency);
        }

        $oNotDiscounted = $this->getNotDiscountProductsPrice();

        if ($this->isCalculationModeNetto()) {
            // netto view mode
            $this->setNettoSum($this->getProductsPrice()->getSum());
            $this->setBruttoSum($oNotDiscounted->getSum(false) + $dDiscountedSum + $dVatSum);
        } else {
            // brutto view mode
            $this->setNettoSum($oNotDiscounted->getSum() + $dDiscountedSum - $dVatSum);
            $this->setBruttoSum($this->getProductsPrice()->getSum(false));
        }
    }
protected function _applyDiscounts ( ) { //apply discounts for brutto price $ dDiscountedSum = $ this -> _getDiscountedProductsSum ( ) ; $ oUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ dVatSum = 0 ; foreach ( $ this -> _aDiscountedVats as $ dVat ) { $ dVatSum += $ oUtils -> fRound ( $ dVat , $ this -> _oCurrency ) ; } $ oNotDiscounted = $ this -> getNotDiscountProductsPrice ( ) ; if ( $ this -> isCalculationModeNetto ( ) ) { // netto view mode $ this -> setNettoSum ( $ this -> getProductsPrice ( ) -> getSum ( ) ) ; $ this -> setBruttoSum ( $ oNotDiscounted -> getSum ( false ) + $ dDiscountedSum + $ dVatSum ) ; } else { // brutto view mode $ this -> setNettoSum ( $ oNotDiscounted -> getSum ( ) + $ dDiscountedSum - $ dVatSum ) ; $ this -> setBruttoSum ( $ this -> getProductsPrice ( ) -> getSum ( false ) ) ; } }
Performs netto price and VATs calculations including discounts and vouchers.
Performs netto price and VATs calculations including discounts and vouchers .