@medipass/utils 11.58.2 → 11.58.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +2 -2
- package/service-items.js +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.58.3](https://github.com/medipass/web/compare/@medipass/utils@11.58.2...@medipass/utils@11.58.3) (2021-12-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* item totals section ([#605](https://github.com/medipass/web/issues/605)) ([1b12e67](https://github.com/medipass/web/commit/1b12e67))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [11.58.2](https://github.com/medipass/web/compare/@medipass/utils@11.58.1...@medipass/utils@11.58.2) (2021-12-17)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipass/utils",
|
|
3
|
-
"version": "11.58.
|
|
3
|
+
"version": "11.58.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"redux-thunk": "^2.2.0",
|
|
48
48
|
"rimraf": "^2.6.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "f524d6cfe9e2383b8a1bc07b85efc3057504cbc5"
|
|
51
51
|
}
|
package/service-items.js
CHANGED
|
@@ -35,7 +35,7 @@ var calculateTotalAmount = function calculateTotalAmount(serviceItems, opts) {
|
|
|
35
35
|
|
|
36
36
|
var prices = calculateAmounts({
|
|
37
37
|
isTaxable: Boolean(opts.includeGST && item.isTaxable),
|
|
38
|
-
|
|
38
|
+
initialGrossAmount: parseFloat((item == null ? void 0 : item.grossAmount) || 0),
|
|
39
39
|
quantity: includeQuantity ? item.quantity : 1
|
|
40
40
|
});
|
|
41
41
|
var itemTotal = undefined;
|
|
@@ -74,7 +74,7 @@ var calculateTotalGSTAmount = function calculateTotalGSTAmount(serviceItems, opt
|
|
|
74
74
|
|
|
75
75
|
var prices = calculateAmounts({
|
|
76
76
|
isTaxable: item.isTaxable,
|
|
77
|
-
|
|
77
|
+
initialGrossAmount: parseFloat((item == null ? void 0 : item.grossAmount) || 0),
|
|
78
78
|
quantity: includeQuantity ? item.quantity : 1
|
|
79
79
|
});
|
|
80
80
|
var gstAmount = prices == null ? void 0 : prices.taxAmount;
|
|
@@ -194,10 +194,9 @@ function mapItemsToClaimItems(transaction) {
|
|
|
194
194
|
}
|
|
195
195
|
var calculateAmounts = function calculateAmounts(_ref3) {
|
|
196
196
|
var isTaxable = _ref3.isTaxable,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
var
|
|
200
|
-
var feeAmount = parseFloat(initialFeeAmount || 0);
|
|
197
|
+
initialGrossAmount = _ref3.initialGrossAmount;
|
|
198
|
+
var grossAmount = parseFloat(initialGrossAmount || 0);
|
|
199
|
+
var feeAmount = parseFloat(initialGrossAmount || 0);
|
|
201
200
|
var taxAmount = 0;
|
|
202
201
|
|
|
203
202
|
if (!isTaxable) {
|
|
@@ -208,8 +207,8 @@ var calculateAmounts = function calculateAmounts(_ref3) {
|
|
|
208
207
|
};
|
|
209
208
|
}
|
|
210
209
|
|
|
210
|
+
feeAmount = feeAmount - feeAmount / 11;
|
|
211
211
|
taxAmount = parseFloat((feeAmount * 1.1).toFixed(6)) - feeAmount;
|
|
212
|
-
grossAmount = feeAmount + taxAmount;
|
|
213
212
|
return {
|
|
214
213
|
taxAmount: taxAmount,
|
|
215
214
|
feeAmount: feeAmount,
|