calculateRegulationPrice example

$reference = $this->calculateReferencePrice($unitPrice$definition->getReferencePriceDefinition()$config);

        return new CalculatedPrice(
            $unitPrice,
            $price,
            $unitTaxes,
            $definition->getTaxRules(),
            $definition->getQuantity(),
            $reference,
            $this->calculateListPrice($unitPrice$definition$config),
            $this->calculateRegulationPrice($definition$config)
        );
    }

    private function getUnitPrice(QuantityPriceDefinition $definition, CashRoundingConfig $config): float
    {
        // item price already calculated?         if ($definition->isCalculated()) {
            return $this->priceRounding->cashRound($definition->getPrice()$config);
        }

        $price = $this->taxCalculator->calculateGross(
            
$reference = $this->calculateReferencePrice($unitPrice$definition->getReferencePriceDefinition()$config);

        return new CalculatedPrice(
            $unitPrice,
            $price,
            $calculatedTaxes,
            $taxRules,
            $definition->getQuantity(),
            $reference,
            $this->calculateListPrice($unitPrice$definition$config),
            $this->calculateRegulationPrice($definition$config)
        );
    }

    private function calculateListPrice(float $unitPrice, QuantityPriceDefinition $definition, CashRoundingConfig $config): ?ListPrice
    {
        $listPrice = $definition->getListPrice();
        if (!$listPrice) {
            return null;
        }

        if (!$definition->isCalculated()) {
            
Home | Imprint | This part of the site doesn't use cookies.