diff --git a/composer.json b/composer.json index 5f2c6d8..6bcc3ff 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php": ">=7.4", "ext-json": "*", "contao/core-bundle": "^4.9", - "doctrine/dbal": "^2.0", + "doctrine/dbal": "^2.0 || ^3.0", "isotope/isotope-core": "^2.6", "symfony/dependency-injection": "^4.4 || ^5.0", "symfony/http-client": "^4.4 || ^5.0", diff --git a/src/Dto/ShippingOption.php b/src/Dto/ShippingOption.php index d04da5a..2c23739 100644 --- a/src/Dto/ShippingOption.php +++ b/src/Dto/ShippingOption.php @@ -74,6 +74,6 @@ private function addTaxData(IsotopeShipping $shipping) $rate = StringUtil::deserialize($includes->rate, true); $this->tax_rate = (int) round($rate['value'] * 100); - $this->tax_amount = (int) round($includes->calculateAmountIncludedInPrice($this->price) * 100); + $this->tax_amount = (int) round($includes->calculateAmountIncludedInPrice($this->price)); } } diff --git a/src/Dto/Surcharge.php b/src/Dto/Surcharge.php index 5b78922..80f06b2 100644 --- a/src/Dto/Surcharge.php +++ b/src/Dto/Surcharge.php @@ -34,7 +34,7 @@ public function __construct(ProductCollectionSurcharge $surcharge) if ($surcharge->hasTax()) { $this->total_tax_amount = (int) round(($surcharge->total_price - $surcharge->tax_free_total_price) * 100); - $this->tax_rate = (int) round(($this->total_tax_amount / $this->total_amount) * 1000); + $this->tax_rate = (int) round(($surcharge->total_price / $surcharge->tax_free_total_price - 1 ) * 10000); } else { $this->tax_rate = 0; $this->total_tax_amount = 0; diff --git a/src/Resources/contao/dca/tl_iso_config.php b/src/Resources/contao/dca/tl_iso_config.php index 2569268..023ed1e 100644 --- a/src/Resources/contao/dca/tl_iso_config.php +++ b/src/Resources/contao/dca/tl_iso_config.php @@ -49,7 +49,7 @@ 'mandatory' => true, 'tl_class' => 'w50', ], - 'sql' => "varchar(64) NOT NULL default ''", + 'sql' => "varchar(255) NOT NULL default ''", ]; $GLOBALS['TL_DCA']['tl_iso_config']['fields']['klarna_api_test'] = [