rerobe-js-orm 3.1.9 → 3.2.0

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.
@@ -99,8 +99,9 @@ class OrderHelpers {
99
99
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
100
100
  const orderRefunds = order.refunds ? [...order.refunds] : [];
101
101
  const orderFulfillment = order.fulfillments ? [...order.fulfillments] : [];
102
- const subtotalPrice = Object.assign(Object.assign({}, order.subtotalPrice), { amount: this.getSubtotalPrice(order.lineItems) });
103
- const subtotalPricePresentment = Object.assign(Object.assign({}, order.subtotalPricePresentment), { amount: this.getAmountSumByField(order.lineItems, 'presentmentTotalPrice') });
102
+ const orderLineItems = order.lineItems && Array.isArray(order.lineItems) ? [...order.lineItems] : [];
103
+ const subtotalPrice = Object.assign(Object.assign({}, order.subtotalPrice), { amount: this.getSubtotalPrice(orderLineItems) });
104
+ const subtotalPricePresentment = Object.assign(Object.assign({}, order.subtotalPricePresentment), { amount: this.getAmountSumByField(orderLineItems, 'presentmentTotalPrice') });
104
105
  const preparedOrder = {
105
106
  documentId: order.documentId || '',
106
107
  name: order.name || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.1.9",
3
+ "version": "3.2.0",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",