Skip to content

Commit

Permalink
MC-4316: Tax calculation process does not follow "Apply Tax On" setting
Browse files Browse the repository at this point in the history
- Fix for integration and functional tests.
  • Loading branch information
YuliyaLabudova committed Feb 4, 2019
1 parent 27d3626 commit 4ec8dfb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@
<waitForPageLoad stepKey="waitForConfigSaved"/>
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
</actionGroup>
<actionGroup name="DisableTaxApplyOnOriginalPrice">
<arguments>
<argument name="userInput" type="string"/>
</arguments>
<amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/>
<scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="goToCheckbox"/>
<selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOff"/>
<checkOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="disableApplyTaxOnSetting"/>
<click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
<waitForPageLoad stepKey="waitForConfigSaved"/>
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $
if ($applyTaxAfterDiscount) {
//TODO: handle originalDiscountAmount
$taxableAmount = max($rowTotalForTaxCalculation - $discountAmount, 0);
if ($taxableAmount) {
if ($taxableAmount && !$applyTaxAfterDiscount) {
$taxableAmount = $rowTotalForTaxCalculation;
}
$rowTaxAfterDiscount = $this->calculationTool->calcTaxAmount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/>
<deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" />
<actionGroup ref="DisableTaxApplyOnOriginalPrice" stepKey="setApplyTaxOffSetting">
<argument name="userInput" value="Custom price if available"/>
</actionGroup>
<actionGroup ref="ResetTaxClassForShipping" stepKey="resetTaxClassForShipping"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

Expand Down

0 comments on commit 4ec8dfb

Please sign in to comment.