@aptos-scp/scp-component-store-selling-features-domain-model 1.46.2 → 1.46.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.
@@ -206,7 +206,8 @@ function originalTenderNeeded(tenderLine, tenderAuthCategory, currentOriginalTen
206
206
  var _a;
207
207
  if (tenderAuthCategory === Constants_1.TenderAuthCategory.TapToPayOnPOS ||
208
208
  tenderAuthCategory === Constants_1.TenderAuthCategory.PaymentDevice ||
209
- tenderAuthCategory === Constants_1.TenderAuthCategory.Wallet) {
209
+ tenderAuthCategory === Constants_1.TenderAuthCategory.Wallet ||
210
+ tenderAuthCategory === Constants_1.TenderAuthCategory.PayByLink) {
210
211
  return true;
211
212
  }
212
213
  else {
@@ -217,7 +218,8 @@ function getOriginalTenderFromLine(tenderLine, tenderAuthCategory, additionalLin
217
218
  var _a, _b, _c, _d, _e, _f, _g;
218
219
  const showReference = (tenderAuthCategory === Constants_1.TenderAuthCategory.TapToPayOnPOS ||
219
220
  tenderAuthCategory === Constants_1.TenderAuthCategory.PaymentDevice ||
220
- tenderAuthCategory === Constants_1.TenderAuthCategory.Wallet) &&
221
+ tenderAuthCategory === Constants_1.TenderAuthCategory.Wallet ||
222
+ tenderAuthCategory === Constants_1.TenderAuthCategory.PayByLink) &&
221
223
  tenderLine.tenderDetails &&
222
224
  tenderLine.tenderDetails.paymentProvider !== scp_types_commerce_devices_1.PaymentProvider.NonIntegrated;
223
225
  const originalTenderAmount = tenderLine.tenderAmount && scp_component_business_core_1.Money.fromIMoney(tenderLine.tenderAmount);
@@ -141,13 +141,15 @@ class TenderType {
141
141
  var _a, _b, _c, _d;
142
142
  let total = new scp_component_business_core_1.Money(0, accountingCurrency);
143
143
  (_b = (_a = displayInfo) === null || _a === void 0 ? void 0 : _a.shippingFeeDisplayLines) === null || _b === void 0 ? void 0 : _b.forEach((shippingFeeDisplayLine) => {
144
+ var _a;
144
145
  if (shippingFeeDisplayLine.lineType === scp_types_commerce_transaction_1.LineType.TransactionFeeRefund) {
145
- total = total.plus(shippingFeeDisplayLine.extendedAmountIncludingTax.abs());
146
+ total = total.plus((_a = shippingFeeDisplayLine.extendedAmountIncludingTax) === null || _a === void 0 ? void 0 : _a.abs());
146
147
  }
147
148
  });
148
149
  (_d = (_c = displayInfo) === null || _c === void 0 ? void 0 : _c.itemFeeDisplayLines) === null || _d === void 0 ? void 0 : _d.forEach((itemFeeDisplayLine) => {
150
+ var _a;
149
151
  if (itemFeeDisplayLine.lineType === scp_types_commerce_transaction_1.LineType.ItemFeeRefund) {
150
- total = total.plus(itemFeeDisplayLine.extendedAmount.abs());
152
+ total = total.plus((_a = itemFeeDisplayLine.extendedAmountIncludingTax) === null || _a === void 0 ? void 0 : _a.abs());
151
153
  }
152
154
  });
153
155
  return total;
@@ -236,8 +238,7 @@ class TenderType {
236
238
  withoutTransactionTotal = withoutTransactionTotal.plus(withoutTransactionItemAmount);
237
239
  const withoutTransactionTenderedAmount = TenderType.getTenderedAmountsWithoutTransaction((_b = displayInfo) === null || _b === void 0 ? void 0 : _b.tenderDisplayLines, accountingCurrency, configurationManager);
238
240
  withoutTransactionTotal = withoutTransactionTotal.minus(withoutTransactionTenderedAmount);
239
- const feesTotal = TenderType.getFeesTotal(displayInfo, accountingCurrency);
240
- withoutTransactionTotal = withoutTransactionTotal.plus(feesTotal);
241
+ // shipping and item fee are not returned on RWOR
241
242
  return withoutTransactionTotal;
242
243
  }
243
244
  static getWithTransactionTotal(displayInfo, accountingCurrency, configurationManager) {
@@ -258,8 +259,7 @@ class TenderType {
258
259
  withOfflineTransactionTotal = withOfflineTransactionTotal.plus(withOfflineTransactionItemAmount);
259
260
  const withOfflineTransactionTenderedAmount = TenderType.getTenderedAmountsWithOfflineTransaction((_b = displayInfo) === null || _b === void 0 ? void 0 : _b.tenderDisplayLines, accountingCurrency, configurationManager);
260
261
  withOfflineTransactionTotal = withOfflineTransactionTotal.minus(withOfflineTransactionTenderedAmount);
261
- const feesTotal = TenderType.getFeesTotal(displayInfo, accountingCurrency);
262
- withOfflineTransactionTotal = withOfflineTransactionTotal.plus(feesTotal);
262
+ // shipping and item fee are not returned on offline returns
263
263
  return withOfflineTransactionTotal;
264
264
  }
265
265
  static getOriginalRefundableTenders(container, accountingCurrency, originalTransactionsDetails, balanceDue, itemTypes, orderTypes, isRefund, productAttributeTypes, displayInfo) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "1.46.2",
3
+ "version": "1.46.4",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",