Skip to content

Commit 9990dd4

Browse files
committed
MAGETWO-64832: "Order Total Excl. Tax" is not calculated(=0) on Shopping Cart and Checkout pages
1 parent c30a05a commit 9990dd4

File tree

5 files changed

+83
-10
lines changed

5 files changed

+83
-10
lines changed

app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/grand-total.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ define([
6262
return 0;
6363
}
6464

65-
return this.getFormattedPrice(totals['grand_total']);
65+
return this.getFormattedPrice(total['grand_total']);
6666
},
6767

6868
/**
@@ -75,7 +75,7 @@ define([
7575
return false;
7676
}
7777

78-
return totals['base_currency_code'] != totals['quote_currency_code']; //eslint-disable-line eqeqeq
78+
return total['base_currency_code'] != total['quote_currency_code']; //eslint-disable-line eqeqeq
7979
}
8080
});
8181
});

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/TaxCalculationTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Tax\Test\TestCase\TaxCalculationTest">
1010
<variation name="TaxCalculationTestConfigurableProduct" ticketId="MAGETWO-42708">
11-
<data name="tag" xsi:type="string">to_maintain:yes</data>
12-
<data name="issue" xsi:type="string">MAGETWO-64832: "Order Total Excl. Tax" is not calculated(=0) on Shopping Cart and Checkout pages</data>
1311
<data name="product" xsi:type="string">configurableProduct::two_options_by_one_dollar</data>
1412
<data name="taxRule" xsi:type="string">us_full_tax_rule</data>
1513
<data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/TaxCalculationTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Tax\Test\TestCase\TaxCalculationTest" summary="Apply Taxes for grouped products" ticketId="MAGETWO-60576">
1010
<variation name="TaxCalculationTestGroupedProduct">
11-
<data name="tag" xsi:type="string">to_maintain:yes</data>
12-
<data name="issue" xsi:type="string">MAGETWO-64832: "Order Total Excl. Tax" is not calculated(=0) on Shopping Cart and Checkout pages</data>
1311
<data name="product" xsi:type="string">groupedProduct::grouped_product_with_special_price</data>
1412
<data name="taxRule" xsi:type="string">us_full_tax_rule</data>
1513
<data name="shippingAddress/dataset" xsi:type="string">US_address_1</data>

dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@
117117
<constraint name="Magento\Weee\Test\Constraint\AssertFptApplied" />
118118
</variation>
119119
<variation name="CreateTaxWithFptTestVariation6" firstConstraint="Magento\Weee\Test\Constraint\AssertFptApplied" method="test">
120-
<data name="tag" xsi:type="string">to_maintain:yes</data>
121-
<data name="issue" xsi:type="string">MAGETWO-64832: "Order Total Excl. Tax" is not calculated(=0) on Shopping Cart and Checkout pages</data>
122120
<data name="description" xsi:type="string">Check taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax</data>
123121
<data name="configData" xsi:type="string">shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax</data>
124122
<data name="productData" xsi:type="string">with_custom_option_and_fpt</data>
@@ -137,8 +135,6 @@
137135
<constraint name="Magento\Weee\Test\Constraint\AssertFptApplied" />
138136
</variation>
139137
<variation name="CreateTaxWithFptTestVariation7" firstConstraint="Magento\Weee\Test\Constraint\AssertFptApplied" method="test">
140-
<data name="tag" xsi:type="string">to_maintain:yes</data>
141-
<data name="issue" xsi:type="string">MAGETWO-64832: "Order Total Excl. Tax" is not calculated(=0) on Shopping Cart and Checkout pages</data>
142138
<data name="description" xsi:type="string">Check taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax</data>
143139
<data name="configData" xsi:type="string">shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax</data>
144140
<data name="productData" xsi:type="string">with_special_price_and_fpt</data>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
/* eslint max-nested-callbacks: 0 */
7+
// jscs:disable jsDoc
8+
define(['squire', 'ko'], function (Squire, ko) {
9+
'use strict';
10+
11+
var injector = new Squire(),
12+
mocks = {
13+
'Magento_Checkout/js/model/totals': {
14+
totals: jasmine.createSpy()
15+
},
16+
'Magento_Catalog/js/price-utils': {
17+
formatPrice: function () {
18+
}
19+
}
20+
},
21+
obj;
22+
23+
beforeEach(function (done) {
24+
window.checkoutConfig = {
25+
quoteData: {}
26+
};
27+
injector.mock(mocks);
28+
injector.require(['Magento_Tax/js/view/checkout/summary/grand-total'], function (Constr) {
29+
obj = new Constr({
30+
provider: 'provName',
31+
name: '',
32+
index: ''
33+
});
34+
done();
35+
});
36+
});
37+
38+
describe('Magento_Tax/js/view/checkout/summary/grand-total', function () {
39+
describe('"getGrandTotalExclTax" method', function () {
40+
it('Check if totals object empty.', function () {
41+
expect(obj.getGrandTotalExclTax()).toBe(0);
42+
});
43+
it('Check if totals exists.', function () {
44+
var totalsData = {
45+
'grand_total': 10
46+
};
47+
48+
obj.totals = ko.observable(totalsData);
49+
spyOn(mocks['Magento_Catalog/js/price-utils'], 'formatPrice')
50+
.and.returnValue(10);
51+
expect(obj.getGrandTotalExclTax()).toBe(10);
52+
});
53+
});
54+
});
55+
describe('Magento_Tax/js/view/checkout/summary/grand-total', function () {
56+
describe('"isBaseGrandTotalDisplayNeeded" method', function () {
57+
it('Check if totals object empty.', function () {
58+
expect(obj.isBaseGrandTotalDisplayNeeded()).toBe(false);
59+
});
60+
it('Check if base currency not equal to quote currency.', function () {
61+
var totalsData = {
62+
'base_currency_code': 'USD',
63+
'quote_currency_code': 'EUR'
64+
};
65+
66+
obj.totals = ko.observable(totalsData);
67+
expect(obj.isBaseGrandTotalDisplayNeeded()).toBe(true);
68+
});
69+
it('Check if base currency equal to quote currency.', function () {
70+
var totalsData = {
71+
'base_currency_code': 'USD',
72+
'quote_currency_code': 'USD'
73+
};
74+
75+
obj.totals = ko.observable(totalsData);
76+
expect(obj.isBaseGrandTotalDisplayNeeded()).toBe(false);
77+
});
78+
});
79+
});
80+
81+
});

0 commit comments

Comments
 (0)