@aptos-scp/scp-component-store-selling-features-domain-model 2.9.0-patch.2 → 2.9.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.
@@ -161,7 +161,6 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
161
161
  private _prepaidTendersToApply?;
162
162
  private _transactionSubTotalExcludingPreviouslyCollected;
163
163
  private _transactionTotalSavingsExcludingPreviouslyCollected;
164
- private _transactionSubTotalExcPrepaidAndExcTranDisc;
165
164
  private _transactionTotalTaxExcludingPreviouslyCollected;
166
165
  private _balanceDueExcludingPreviouslyCollected;
167
166
  private _transactionTotalExcludingPreviouslyCollected;
@@ -197,7 +196,6 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
197
196
  get transactionTotalTransactionDiscounts(): Money;
198
197
  get transactionTotalTendered(): Money;
199
198
  get transactionTotalTenderedPreviouslyCollected(): Money;
200
- get transactionSubTotalExcPrepaidAndExcTranDisc(): Money;
201
199
  /**
202
200
  * Transaction SubTotal excluding previously collected tendered amount and excluding tax
203
201
  */
@@ -95,7 +95,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
95
95
  this._digestValue = digestValue;
96
96
  this._prepaidTendersToApply = prepaidTendersToApply;
97
97
  this._transactionSubTotalExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
98
- this._transactionSubTotalExcPrepaidAndExcTranDisc = new scp_component_business_core_1.Money(0, accountingCurrency);
99
98
  this._transactionTotalSavingsExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
100
99
  this._transactionTotalTaxExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
101
100
  this._balanceDueExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
@@ -225,8 +224,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
225
224
  transaction._prepaidTendersToApply = this._prepaidTendersToApply;
226
225
  transaction._transactionSubTotalExcludingPreviouslyCollected =
227
226
  this._transactionSubTotalExcludingPreviouslyCollected;
228
- transaction._transactionSubTotalExcPrepaidAndExcTranDisc =
229
- this._transactionSubTotalExcPrepaidAndExcTranDisc;
230
227
  transaction._transactionTotalSavingsExcludingPreviouslyCollected =
231
228
  this._transactionTotalSavingsExcludingPreviouslyCollected;
232
229
  transaction._transactionTotalTaxExcludingPreviouslyCollected =
@@ -348,9 +345,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
348
345
  get transactionTotalTenderedPreviouslyCollected() {
349
346
  return this._transactionTotalTenderedPreviouslyCollected;
350
347
  }
351
- get transactionSubTotalExcPrepaidAndExcTranDisc() {
352
- return this._transactionSubTotalExcPrepaidAndExcTranDisc;
353
- }
354
348
  /**
355
349
  * Transaction SubTotal excluding previously collected tendered amount and excluding tax
356
350
  */
@@ -858,10 +852,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
858
852
  "transaction.totalTenderedExcludingPreviouslyCollected",
859
853
  this.transactionTotalTenderedExcludingPreviouslyCollected,
860
854
  ],
861
- [
862
- "transaction.transactionSubTotalExcPrepaidAndExcTranDisc",
863
- this._transactionSubTotalExcPrepaidAndExcTranDisc,
864
- ],
865
855
  ["transaction.totalPreviouslyCollectedTenders", this.transactionTotalPreviouslyCollectedTenders],
866
856
  ["transaction.totalTenderedOnOrderCreate", this.transactionTotalTenderedOnOrderCreate],
867
857
  ["transaction.totalChangeTendered", this.transactionTotalChangeTendered],
@@ -1054,7 +1044,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
1054
1044
  _digestValue: this._digestValue,
1055
1045
  _prepaidTendersToApply: this.prepaidTendersToApply,
1056
1046
  _transactionSubTotalExcludingPreviouslyCollected: this.transactionSubTotalExcludingPreviouslyCollected,
1057
- _transactionSubTotalExcPrepaidAndExcTranDisc: this.transactionSubTotalExcPrepaidAndExcTranDisc,
1058
1047
  _transactionTotalSavingsExcludingPreviouslyCollected: this.transactionTotalSavingsExcludingPreviouslyCollected,
1059
1048
  _transactionTotalTaxExcludingPreviouslyCollected: this.transactionTotalTaxExcludingPreviouslyCollected,
1060
1049
  _balanceDueExcludingPreviouslyCollected: this.transactionBalanceDueExcludingPreviouslyCollected,
@@ -1210,9 +1199,6 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
1210
1199
  this._transactionSubTotalExcludingPreviouslyCollected =
1211
1200
  transactionJsonObj._transactionSubTotalExcludingPreviouslyCollected &&
1212
1201
  new scp_component_business_core_1.Money(transactionJsonObj._transactionSubTotalExcludingPreviouslyCollected);
1213
- this._transactionSubTotalExcPrepaidAndExcTranDisc =
1214
- transactionJsonObj._transactionSubTotalExcPrepaidAndExcTranDisc &&
1215
- new scp_component_business_core_1.Money(transactionJsonObj._transactionSubTotalExcPrepaidAndExcTranDisc);
1216
1202
  this._transactionTotalSavingsExcludingPreviouslyCollected =
1217
1203
  transactionJsonObj._transactionTotalSavingsExcludingPreviouslyCollected &&
1218
1204
  new scp_component_business_core_1.Money(transactionJsonObj._transactionTotalSavingsExcludingPreviouslyCollected);
@@ -40,7 +40,6 @@ export interface ITenderGroup {
40
40
  tenderType?: string;
41
41
  groupLabel?: ILabel;
42
42
  subType?: TenderSubType;
43
- refundableAmount?: Money;
44
43
  }
45
44
  export interface IChangeBehaviorDefinition {
46
45
  forfeitChange?: boolean;
@@ -99,7 +98,7 @@ export declare class TenderType {
99
98
  static getActiveConfiguredTenderGroups(container: Container, accountingCurrency: string, activeTenders: TenderType[]): ITenderGroup[];
100
99
  static getActiveRefundConfiguredTenderGroups(container: Container, accountingCurrency: string, withTransaction: boolean, activeTenders: TenderType[], originalTransactionsDetails: IOriginalTransactionDetails[], withOfflineTransaction: boolean): ITenderGroup[];
101
100
  static tenderIsCreditOrDebit(tenderType: any): boolean;
102
- static getRefundableAmountByGroup(group: ITenderGroup, displayInfo: any, currency: string, configuration: IConfigurationManager, refundDue?: Money, useGroupRefundableAmount?: boolean): Money;
101
+ static getRefundableAmountByGroup(group: ITenderGroup, displayInfo: any, currency: string, configuration: IConfigurationManager, refundDue?: Money): Money;
103
102
  static getFeesTotal(displayInfo: any, accountingCurrency: string): Money;
104
103
  static getTenderedAmountsWithoutTransaction(tenderDisplayLines: any[], accountingCurrency: string, configurationManager: IConfigurationManager): Money;
105
104
  static getTenderedAmountsWithTransaction(tenderDisplayLines: any[], accountingCurrency: string, configurationManager: IConfigurationManager): Money;
@@ -88,7 +88,7 @@ class TenderType {
88
88
  var _a, _b;
89
89
  return (((_a = tenderType) === null || _a === void 0 ? void 0 : _a.tenderType) === scp_types_commerce_devices_1.TenderType.Credit || ((_b = tenderType) === null || _b === void 0 ? void 0 : _b.tenderTyp) === scp_types_commerce_devices_1.TenderType.Debit);
90
90
  }
91
- static getRefundableAmountByGroup(group, displayInfo, currency, configuration, refundDue, useGroupRefundableAmount = false) {
91
+ static getRefundableAmountByGroup(group, displayInfo, currency, configuration, refundDue) {
92
92
  var _a, _b, _c, _d;
93
93
  const withoutTransactionTotal = TenderType.getWithoutTransactionTotal(displayInfo, currency, configuration);
94
94
  const withTransactionTotal = TenderType.getWithTransactionTotal(displayInfo, currency, configuration);
@@ -127,19 +127,14 @@ class TenderType {
127
127
  }
128
128
  });
129
129
  let refundableAmount = new scp_component_business_core_1.Money(0, currency);
130
- if (group.refundableAmount && useGroupRefundableAmount) {
131
- refundableAmount = group.refundableAmount;
130
+ if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithTransaction)) {
131
+ refundableAmount = refundableAmount.plus(withTransactionTotal);
132
132
  }
133
- else {
134
- if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithTransaction)) {
135
- refundableAmount = refundableAmount.plus(withTransactionTotal);
136
- }
137
- if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithoutTransaction)) {
138
- refundableAmount = refundableAmount.plus(withoutTransactionTotal);
139
- }
140
- if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithOfflineTransaction)) {
141
- refundableAmount = refundableAmount.plus(withOfflineTransactionTotal);
142
- }
133
+ if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithoutTransaction)) {
134
+ refundableAmount = refundableAmount.plus(withoutTransactionTotal);
135
+ }
136
+ if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithOfflineTransaction)) {
137
+ refundableAmount = refundableAmount.plus(withOfflineTransactionTotal);
143
138
  }
144
139
  return getLowestRefundDue(refundDue, undefined, refundableAmount);
145
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.9.0-patch.2",
3
+ "version": "2.9.0",
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",