@medipass/utils 11.58.2-react-core-0.114.1.0 → 11.58.4

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 CHANGED
@@ -3,6 +3,39 @@
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.4](https://github.com/medipass/web/compare/@medipass/utils@11.58.3...@medipass/utils@11.58.4) (2021-12-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * calculate totals ([#606](https://github.com/medipass/web/issues/606)) ([214c51b](https://github.com/medipass/web/commit/214c51b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [11.58.3](https://github.com/medipass/web/compare/@medipass/utils@11.58.2...@medipass/utils@11.58.3) (2021-12-22)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * item totals section ([#605](https://github.com/medipass/web/issues/605)) ([1b12e67](https://github.com/medipass/web/commit/1b12e67))
23
+
24
+
25
+
26
+
27
+
28
+ ## [11.58.2](https://github.com/medipass/web/compare/@medipass/utils@11.58.1...@medipass/utils@11.58.2) (2021-12-17)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * calculate item totals in services section ([#602](https://github.com/medipass/web/issues/602)) ([e6267fe](https://github.com/medipass/web/commit/e6267fe))
34
+
35
+
36
+
37
+
38
+
6
39
  ## [11.58.1](https://github.com/medipass/web/compare/@medipass/utils@11.58.0...@medipass/utils@11.58.1) (2021-12-15)
7
40
 
8
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipass/utils",
3
- "version": "11.58.2-react-core-0.114.1.0",
3
+ "version": "11.58.4",
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": "8a05fc61ef0047fbe76cc506e06f10401c8bfde2"
50
+ "gitHead": "a7686b733dba3197e88fd0b7bac30637a8f5334c"
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
- initialFeeAmount: (item == null ? void 0 : item.feeAmount) ? parseFloat((item == null ? void 0 : item.feeAmount) || 0) : parseFloat((item == null ? void 0 : item.initialFeeAmount) || 0),
38
+ initialGrossAmount: (item == null ? void 0 : item.grossAmount) ? parseFloat((item == null ? void 0 : item.grossAmount) || 0) : parseFloat((item == null ? void 0 : item.feeAmount) || 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
- initialFeeAmount: (item == null ? void 0 : item.feeAmount) ? parseFloat((item == null ? void 0 : item.feeAmount) || 0) : parseFloat((item == null ? void 0 : item.initialFeeAmount) || 0),
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,11 +194,9 @@ function mapItemsToClaimItems(transaction) {
194
194
  }
195
195
  var calculateAmounts = function calculateAmounts(_ref3) {
196
196
  var isTaxable = _ref3.isTaxable,
197
- initialFeeAmount = _ref3.initialFeeAmount,
198
- isExtendedPrice = _ref3.isExtendedPrice,
199
- _ref3$quantity = _ref3.quantity;
200
- var grossAmount = parseFloat(initialFeeAmount || 0);
201
- var feeAmount = parseFloat(initialFeeAmount || 0);
197
+ initialGrossAmount = _ref3.initialGrossAmount;
198
+ var grossAmount = parseFloat(initialGrossAmount || 0);
199
+ var feeAmount = parseFloat(initialGrossAmount || 0);
202
200
  var taxAmount = 0;
203
201
 
204
202
  if (!isTaxable) {
@@ -209,8 +207,8 @@ var calculateAmounts = function calculateAmounts(_ref3) {
209
207
  };
210
208
  }
211
209
 
210
+ feeAmount = feeAmount - feeAmount / 11;
212
211
  taxAmount = parseFloat((feeAmount * 1.1).toFixed(6)) - feeAmount;
213
- grossAmount = feeAmount + taxAmount;
214
212
  return {
215
213
  taxAmount: taxAmount,
216
214
  feeAmount: feeAmount,