Skip to content

Commit

Permalink
Release 1.0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Mar 5, 2024
1 parent 3039266 commit ae63c8e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ account dashboard.

## Documentation

[Documentation](https://plugin-documentation.wallee.com/wallee-payment/jtl-5/1.0.22/docs/en/documentation.html)
[Documentation](https://plugin-documentation.wallee.com/wallee-payment/jtl-5/1.0.23/docs/en/documentation.html)

## License

Expand Down
36 changes: 13 additions & 23 deletions Services/WalleeTransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,31 +481,27 @@ private function createLineItemProductItem(CartItem $productData, $isDiscount =
$uniqueName = $productData->cArtNr ?: $slug;
if ($isDiscount || $productData->nPosTyp === \C_WARENKORBPOS_TYP_GUTSCHEIN) {
$uniqueName = $uniqueName . '_' . rand(1, 99999);
} else {
$taxRate = CartItem::getTaxRate($productData);
$tax = (new TaxCreate())
->setRate($taxRate)
->setTitle('Tax: ' . $taxRate . '%');
$taxes[] = $tax;
$lineItem->setTaxes($taxes);
}

$lineItem->setUniqueId($uniqueName);
$lineItem->setSku($productData->cArtNr);
$lineItem->setQuantity($productData->nAnzahl);

$currencyFactor = Frontend::getCurrency()->getConversionFactor();
// fPreis is price, nAnzahl is quantity
$priceDecimal = Tax::getGross(
$productData->fPreis * $productData->nAnzahl,
CartItem::getTaxRate($productData)
);
$priceDecimal *= $currencyFactor;
$priceDecimal = (float)number_format($priceDecimal, 2, '.', '');

$type = LineItemType::PRODUCT;
if ($isDiscount === false) {
$currencyFactor = Frontend::getCurrency()->getConversionFactor();
$priceDecimal = Tax::getGross(
$productData->fPreis * $productData->nAnzahl,
CartItem::getTaxRate($productData)
);
$priceDecimal *= $currencyFactor;
$priceDecimal = (float)number_format($priceDecimal, 2, '.', '');
} else {
if ($isDiscount === true) {
$type = LineItemType::DISCOUNT;
$priceDecimal = -1 * (float)number_format($productData->fPreis, 2, '.', '');
if ($priceDecimal > 0) {
$priceDecimal = -1 * $priceDecimal;
}
}
$lineItem->setAmountIncludingTax($priceDecimal);
$lineItem->setType($type);
Expand Down Expand Up @@ -534,12 +530,6 @@ private function createLineItemShippingItem(CartItem $productData): LineItemCrea
$priceDecimal = (float)number_format($priceDecimal, 2, '.', '');

$lineItem->setAmountIncludingTax($priceDecimal);
$taxRate = CartItem::getTaxRate($productData);
$tax = (new TaxCreate())
->setRate($taxRate)
->setTitle('Tax: ' . $taxRate . '%');
$taxes[] = $tax;
$lineItem->setTaxes($taxes);
$lineItem->setType(LineItemType::SHIPPING);

return $lineItem;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/jtl-5/releases/tag/1.0.22/">
<a href="https://github.com/wallee-payment/jtl-5/releases/tag/1.0.23/">
Source
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Icon>logo.jpg</Icon>
<PluginID>jtl_wallee</PluginID>
<CreateDate>2023-05-29</CreateDate>
<Version>1.0.22</Version>
<Version>1.0.23</Version>
<Install>
<Locales>
<Variable>
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit85027cb17e825355259778975f39a81c::getLoader();
return ComposerAutoloaderInit7f05ae93e8e5ad8b515abde483eefd87::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit85027cb17e825355259778975f39a81c
class ComposerAutoloaderInit7f05ae93e8e5ad8b515abde483eefd87
{
private static $loader;

Expand All @@ -24,12 +24,12 @@ public static function getLoader()

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit85027cb17e825355259778975f39a81c', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit7f05ae93e8e5ad8b515abde483eefd87', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit85027cb17e825355259778975f39a81c', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit7f05ae93e8e5ad8b515abde483eefd87', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit85027cb17e825355259778975f39a81c::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit7f05ae93e8e5ad8b515abde483eefd87::getInitializer($loader));

$loader->register(true);

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit85027cb17e825355259778975f39a81c
class ComposerStaticInit7f05ae93e8e5ad8b515abde483eefd87
{
public static $prefixLengthsPsr4 = array (
'W' =>
Expand Down Expand Up @@ -32,9 +32,9 @@ class ComposerStaticInit85027cb17e825355259778975f39a81c
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit85027cb17e825355259778975f39a81c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit85027cb17e825355259778975f39a81c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit85027cb17e825355259778975f39a81c::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit7f05ae93e8e5ad8b515abde483eefd87::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7f05ae93e8e5ad8b515abde483eefd87::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7f05ae93e8e5ad8b515abde483eefd87::$classMap;

}, null, ClassLoader::class);
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '6146672aa2a11432e18570add9f8d9f441b740e0',
'reference' => '3286400047d17b4246302360800009e77c13b983',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '6146672aa2a11432e18570add9f8d9f441b740e0',
'reference' => '3286400047d17b4246302360800009e77c13b983',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down

0 comments on commit ae63c8e

Please sign in to comment.