Pricing/Model/Price.php
private function calculateAdjustment(AdjustmentDataInterface $adjustment, $base)
    {
        if ($adjustment->getMode() === AdjustmentModes::MODE_PERCENT) {
            return Money::round($base * $adjustment->getAmount() / 100, $this->currency);
        }

        if ($adjustment->getMode() === AdjustmentModes::MODE_FLAT) {
            return $adjustment->getAmount();
        }

        throw new InvalidArgumentException("Unexpected adjustment mode.");
    }
private function calculateAdjustment(AdjustmentDataInterface $adjustment, $base)
    {
        if ($adjustment->getMode() === AdjustmentModes::MODE_PERCENT) {
            return Money::round($base * $adjustment->getAmount() / 100, $this->currency);
        }

        if ($adjustment->getMode() === AdjustmentModes::MODE_FLAT) {
            return $adjustment->getAmount();
        }

        throw new InvalidArgumentException("Unexpected adjustment mode.");
    }
private function calculateAdjustment ( AdjustmentDataInterface $ adjustment , $ base ) { if ( $ adjustment -> getMode ( ) === AdjustmentModes :: MODE_PERCENT ) { return Money :: round ( $ base * $ adjustment -> getAmount ( ) / 100 , $ this -> currency ) ; } if ( $ adjustment -> getMode ( ) === AdjustmentModes :: MODE_FLAT ) { return $ adjustment -> getAmount ( ) ; } throw new InvalidArgumentException ( "Unexpected adjustment mode." ) ; }
Calculates the adjustment amount.

@param AdjustmentDataInterface $adjustment
@param                         $base

@return float
Calculates the adjustment amount .