use Shopware\Core\Checkout\Cart\Tax\Struct\CalculatedTax;
use Shopware\Core\Checkout\Cart\Tax\Struct\CalculatedTaxCollection;
use Shopware\Core\Checkout\Cart\Tax\Struct\TaxRule;
use Shopware\Core\Checkout\Cart\Tax\Struct\TaxRuleCollection;
use Shopware\Core\Framework\Log\Package;
#[Package('checkout')]
class TaxCalculator{ public function calculateGross(float
$netPrice, TaxRuleCollection
$rules): float
{ $taxes =
$this->
calculateNetTaxes($netPrice,
$rules);
return $netPrice +
$taxes->
getAmount();
} public function calculateGrossTaxes(float
$price, TaxRuleCollection
$rules): CalculatedTaxCollection
{ $taxes =
[];
foreach ($rules as $rule) { $taxes[] =
$this->
calculateTaxFromGrossPrice($price,
$rule);
}