@medipass/utils 11.55.1-fix-comcare-verify.0 → 11.55.2

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,28 @@
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.55.2](https://github.com/medipass/web/compare/@medipass/utils@11.55.1...@medipass/utils@11.55.2) (2021-11-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * service items quantity totals ([#581](https://github.com/medipass/web/issues/581)) ([b27ccae](https://github.com/medipass/web/commit/b27ccae))
12
+
13
+
14
+
15
+
16
+
17
+ ## [11.55.1](https://github.com/medipass/web/compare/@medipass/utils@11.55.0...@medipass/utils@11.55.1) (2021-10-29)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * comcare verify endpoint ([#577](https://github.com/medipass/web/issues/577)) ([e9aab21](https://github.com/medipass/web/commit/e9aab21))
23
+
24
+
25
+
26
+
27
+
6
28
  # [11.55.0](https://github.com/medipass/web/compare/@medipass/utils@11.54.5...@medipass/utils@11.55.0) (2021-10-22)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipass/utils",
3
- "version": "11.55.1-fix-comcare-verify.0",
3
+ "version": "11.55.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -44,10 +44,10 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@babel/plugin-transform-runtime": "7.8.3",
47
- "@medipass/web-sdk": "^11.18.7-fix-comcare-verify.0",
47
+ "@medipass/web-sdk": "^11.18.8",
48
48
  "redux-mock-store": "^1.3.0",
49
49
  "redux-thunk": "^2.2.0",
50
50
  "rimraf": "^2.6.2"
51
51
  },
52
- "gitHead": "70caac05636eff1b5bd2b1faad93074b4e98423b"
52
+ "gitHead": "e97112fbd2bc789ef84c0a0d202572ee620343a3"
53
53
  }
package/service-items.js CHANGED
@@ -207,16 +207,33 @@ var calculatePrices = function calculatePrices(_ref3) {
207
207
  initialFeeAmount = _ref3.initialFeeAmount,
208
208
  isExtendedPrice = _ref3.isExtendedPrice,
209
209
  quantity = _ref3.quantity;
210
+
211
+ function getTotalsWithQuantity(_ref4) {
212
+ var taxAmount = _ref4.taxAmount,
213
+ feeAmount = _ref4.feeAmount,
214
+ grossAmount = _ref4.grossAmount;
215
+ if (isExtendedPrice) return {
216
+ taxAmount: taxAmount,
217
+ feeAmount: feeAmount,
218
+ grossAmount: grossAmount
219
+ };
220
+ return {
221
+ grossAmount: grossAmount * quantity,
222
+ feeAmount: feeAmount * quantity,
223
+ taxAmount: taxAmount * quantity
224
+ };
225
+ }
226
+
210
227
  var grossAmount = parseFloat(initialFeeAmount || 0);
211
228
  var feeAmount = parseFloat(initialFeeAmount || 0);
212
229
  var taxAmount = 0;
213
230
 
214
231
  if (!isTaxable) {
215
- return {
232
+ return getTotalsWithQuantity({
216
233
  grossAmount: grossAmount,
217
234
  feeAmount: feeAmount,
218
235
  taxAmount: taxAmount
219
- };
236
+ });
220
237
  }
221
238
 
222
239
  if (isGross) {
@@ -227,17 +244,11 @@ var calculatePrices = function calculatePrices(_ref3) {
227
244
  grossAmount = feeAmount + taxAmount;
228
245
  }
229
246
 
230
- if (!isExtendedPrice) {
231
- taxAmount = taxAmount * quantity;
232
- feeAmount = feeAmount * quantity;
233
- grossAmount = grossAmount * quantity;
234
- }
235
-
236
- return {
247
+ return getTotalsWithQuantity({
237
248
  grossAmount: grossAmount,
238
249
  feeAmount: feeAmount,
239
250
  taxAmount: taxAmount
240
- };
251
+ });
241
252
  };
242
253
 
243
254
  exports.applyDiscountToServiceItems = applyDiscountToServiceItems;