rerobe-js-orm 3.6.2 → 3.6.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.
@@ -70,6 +70,10 @@ export default class OrderHelpers {
70
70
  amount: string;
71
71
  currencyCode: string;
72
72
  };
73
+ presentmentTaxPrice: {
74
+ amount: string;
75
+ currencyCode: string;
76
+ };
73
77
  brand?: string | null | undefined;
74
78
  productId?: string | null | undefined;
75
79
  shopifyProductId?: string | number | null | undefined;
@@ -80,7 +84,6 @@ export default class OrderHelpers {
80
84
  status?: string | undefined;
81
85
  isOnSale?: string | undefined;
82
86
  salePrice?: string | undefined;
83
- presentmentTaxPrice?: Money | undefined;
84
87
  isTaxable?: boolean | undefined;
85
88
  taxRate?: number | undefined;
86
89
  fromCountry?: string | undefined;
@@ -140,6 +143,10 @@ export default class OrderHelpers {
140
143
  amount: string;
141
144
  currencyCode: string;
142
145
  };
146
+ presentmentTaxPrice: {
147
+ amount: string;
148
+ currencyCode: string;
149
+ };
143
150
  brand?: string | null | undefined;
144
151
  productId?: string | null | undefined;
145
152
  shopifyProductId?: string | number | null | undefined;
@@ -150,7 +157,6 @@ export default class OrderHelpers {
150
157
  status?: string | undefined;
151
158
  isOnSale?: string | undefined;
152
159
  salePrice?: string | undefined;
153
- presentmentTaxPrice?: Money | undefined;
154
160
  isTaxable?: boolean | undefined;
155
161
  taxRate?: number | undefined;
156
162
  fromCountry?: string | undefined;
@@ -380,7 +380,7 @@ class OrderHelpers {
380
380
  let subtotalOriginalPresentment = 0;
381
381
  const totalTax = Number(itemsTax || 0) + Number(shippingFeeTax || 0);
382
382
  const lineItems = productsFullInfoWithQuantity.map((item) => {
383
- var _a;
383
+ var _a, _b;
384
384
  const lineItem = this.buildLineItemFromProduct(item.product, merchantCurrency, item.quantity, {
385
385
  price: item.price,
386
386
  isTaxable: item.isTaxable,
@@ -395,8 +395,9 @@ class OrderHelpers {
395
395
  const presentmentSalePrice = convertAndFixPrice(lineItem.salePrice, 5);
396
396
  const presentmentItemPrice = lineItem.isOnSale === 'yes' ? presentmentSalePrice : presentmentUnitPrice;
397
397
  const presentmentTotalPrice = this.toFixedPointPrice(Number(presentmentItemPrice) * Number(item.quantity));
398
+ const presentmentTaxPrice = convertAndFixPrice((_b = lineItem.taxAmountWithDiscount) === null || _b === void 0 ? void 0 : _b.amount, 5);
398
399
  subtotalOriginalPresentment += Number(this.toFixedPointPrice(Number(presentmentUnitPrice) * Number(item.quantity)));
399
- return Object.assign(Object.assign({}, lineItem), { presentmentTotalPrice: prepareMoneyObj(presentmentTotalPrice), presentmentUnitPrice: prepareMoneyObj(presentmentUnitPrice), presentmentSalePrice: prepareMoneyObj(presentmentSalePrice) });
400
+ return Object.assign(Object.assign({}, lineItem), { presentmentTotalPrice: prepareMoneyObj(presentmentTotalPrice), presentmentUnitPrice: prepareMoneyObj(presentmentUnitPrice), presentmentSalePrice: prepareMoneyObj(presentmentSalePrice), presentmentTaxPrice: prepareMoneyObj(presentmentTaxPrice) });
400
401
  });
401
402
  if (!presentmentCurrencyCode || presentmentCurrencyCode === merchantCurrency) {
402
403
  return {
@@ -161,6 +161,7 @@ class Order extends Base_1.default {
161
161
  totalRefunded: this.totalRefunded,
162
162
  totalShippingPrice: this.totalShippingPrice,
163
163
  totalTax: this.totalTax,
164
+ taxTitle: this.taxTitle,
164
165
  originalTotalPrice: this.originalTotalPrice,
165
166
  lineItems: this.lineItems,
166
167
  cancelReason: this.cancelReason,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",