@@ -20,9 +20,8 @@ define([
20
20
var isTaxDisplayedInGrandTotal = window . checkoutConfig . includeTaxInGrandTotal ,
21
21
isFullTaxSummaryDisplayed = window . checkoutConfig . isFullTaxSummaryDisplayed ,
22
22
isZeroTaxDisplayed = window . checkoutConfig . isZeroTaxDisplayed ,
23
- totalPercentage = 0 ,
24
- amount = '' ,
25
- rates = '' ;
23
+ taxAmount = 0 ,
24
+ rates = 0 ;
26
25
27
26
return Component . extend ( {
28
27
defaults : {
@@ -108,24 +107,24 @@ define([
108
107
* @return {*|String }
109
108
*/
110
109
getTaxAmount : function ( parent , percentage ) {
111
- amount = parent . amount ;
110
+ var totalPercentage = 0 ;
111
+ taxAmount = parent . amount ;
112
112
rates = parent . rates ;
113
- totalPercentage = 0 ;
114
113
_ . each ( rates , function ( rate ) {
115
114
totalPercentage += parseFloat ( rate . percent ) ;
116
115
} ) ;
117
116
118
- return this . getFormattedPrice ( this . getPercentAmount ( amount , totalPercentage , percentage ) ) ;
117
+ return this . getFormattedPrice ( this . getPercentAmount ( taxAmount , totalPercentage , percentage ) ) ;
119
118
} ,
120
119
121
120
/**
122
- * @param {* } amount
121
+ * @param {* } taxAmount
123
122
* @param {* } totalPercentage
124
123
* @param {* } percentage
125
124
* @return {*|String }
126
125
*/
127
- getPercentAmount : function ( amount , totalPercentage , percentage ) {
128
- return parseFloat ( ( amount * percentage ) / totalPercentage ) ;
126
+ getPercentAmount : function ( taxAmount , totalPercentage , percentage ) {
127
+ return parseFloat ( ( taxAmount * percentage ) / totalPercentage ) ;
129
128
} ,
130
129
131
130
/**
0 commit comments