Skip to content

Commit c871076

Browse files
committed
AC-13075: FPT value in cart page and product page are different for same configurations for a dynamic product
1 parent e116b30 commit c871076

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

‎app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Tax\Model\Calculation;
77

@@ -115,8 +115,20 @@ protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $
115115
$taxId = $appliedRate['id'];
116116
$taxRate = $appliedRate['percent'];
117117
$rowTaxPerRate = $this->calculationTool->calcTaxAmount($rowTotalForTaxCalculation, $taxRate, false, false);
118-
$rowTaxPerRate = $this->calculationTool->round($rowTaxPerRate);
118+
119+
$deltaRoundingType = self::KEY_REGULAR_DELTA_ROUNDING;
120+
if ($applyTaxAfterDiscount) {
121+
$deltaRoundingType = self::KEY_TAX_BEFORE_DISCOUNT_DELTA_ROUNDING;
122+
}
123+
124+
if ($round) {
125+
$rowTaxPerRate = $this->calculationTool->round($rowTaxPerRate);
126+
} else {
127+
$rowTaxPerRate = $this->roundAmount($rowTaxPerRate, $taxId, false, $deltaRoundingType, $round, $item);
128+
}
129+
119130
$rowTaxAfterDiscount = $rowTaxPerRate;
131+
120132
//Handle discount
121133
if ($applyTaxAfterDiscount) {
122134
//TODO: handle originalDiscountAmount

‎app/code/Magento/Weee/Model/Tax.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@ public function getProductWeeeAttributes(
367367
$taxAmount = $value * $currentPercent / 100;
368368
}
369369
}
370-
if ($round) {
371-
$taxAmount = $this->priceCurrency->round($taxAmount);
372-
}
373370
}
374371
}
375372

0 commit comments

Comments
 (0)