Skip to content

Commit

Permalink
[MP2-12] Fix tax in discounts
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed May 14, 2019
1 parent 0193c9f commit 8954ef6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.history
.vscode
10 changes: 4 additions & 6 deletions Model/Api/AbstractBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,14 @@ public function extraItems($order)
{
$items = [];
$discount_with_tax = 0;
//@todo

foreach ($order->getAllItems() as $item) {
$dto = $item->getDiscountAmount();
$dto = $item->getDiscountAmount() * ( 1 + $item->getTaxPercent() / 100 );
$discount_with_tax += $dto * 100;
}

//order discounts
if ($discount_with_tax > 0) {
//$discountExclTax=$discount*1.21; //What kind of tax?
$item = [];
$item["type"] = "discount";
$item["reference"] = self::notNull($order->getCouponCode());
Expand Down Expand Up @@ -307,9 +305,9 @@ public static function isMobile()
return true;
}

if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),
'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))
) {
if (strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') > 0 or
isset($_SERVER['HTTP_X_WAP_PROFILE']) or
isset($_SERVER['HTTP_PROFILE'])) {
return true;
}

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 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Sequra_Core" setup_version="2.3.1">
<module name="Sequra_Core" setup_version="2.3.1.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down

0 comments on commit 8954ef6

Please sign in to comment.