Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
Master

See merge request plugins/magento2!33
  • Loading branch information
Bob Kersten committed Aug 21, 2018
2 parents 0837851 + 5df79af commit 76d6077
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions Controller/Payment/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ public function execute () {
$item->getSku(),
$item->getName(),
$itemQty,
round( $item->getPriceInclTax() * 100, 0 ),
round( $item->getPrice() * 100, 0 ),
$url
);
);
$cartItem->setVat( round( $item->getTaxPercent(), 0 ) );
$cartItem->setVatIncluded( TRUE );
$cartItem->setVatIncluded( FALSE );
$cartItem->setVatAmount( round( ( $item->getTaxAmount() * 100 ) / $itemQty, 0 ) );

// Include stock in cart items will disable auto-capture on CardGate gateway if item
Expand All @@ -181,8 +181,7 @@ public function execute () {
$cartItem->setStock( $itemQty + $stockData['qty'] );
}
}

$calculatedGrandTotal += $item->getPriceInclTax() * $itemQty;
$calculatedGrandTotal += $item->getPrice() * $itemQty + round($item->getTaxAmount(),2);
$calculatedVatTotal += $item->getTaxAmount();
}

Expand All @@ -198,8 +197,7 @@ public function execute () {
$cartItem->setVat( ceil( ( ( $order->getShippingInclTax() / $shippingAmount ) - 1 ) * 1000 ) / 10 );
$cartItem->setVatIncluded( TRUE );
$cartItem->setVatAmount( round( $order->getShippingTaxAmount() * 100, 0 ) );

$calculatedGrandTotal += $order->getShippingInclTax();
$calculatedGrandTotal += $order->getShippingAmount();
$calculatedVatTotal += $order->getShippingTaxAmount();
}

Expand All @@ -215,7 +213,6 @@ public function execute () {
$cartItem->setVat( ceil( ( ( $discountAmount / ( $discountAmount - $order->getDiscountTaxCompensationAmount() ) ) - 1 ) * 1000 ) / 10 );
$cartItem->setVatIncluded( TRUE );
$cartItem->setVatAmount( round( $order->getDiscountTaxCompensationAmount() * 100, 0 ) );

$calculatedGrandTotal += $discountAmount;
$calculatedVatTotal -= $order->getDiscountTaxCompensationAmount();
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cardgate/magento2",
"description": "CardGate Module for Magento 2",
"homepage": "https://www.cardgate.com",
"version": "2.0.15",
"version": "2.0.16",
"keywords": [ "cardgate", "ideal", "bancontact", "creditcard", "magento" ],
"require": {
"php": "~5.6.0|~7.0.0|~7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
See LICENSE for license details.
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Cardgate_Payment" setup_version="2.0.15">
<module name="Cardgate_Payment" setup_version="2.0.16">
<sequence>
<module name="Magento_Quote" />
<module name="Magento_Sales" />
Expand Down

0 comments on commit 76d6077

Please sign in to comment.