@aptos-scp/scp-component-store-selling-features-domain-model 2.10.3 → 2.10.5

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,6 +161,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
161
161
  private _prepaidTendersToApply?;
162
162
  private _transactionSubTotalExcludingPreviouslyCollected;
163
163
  private _transactionTotalSavingsExcludingPreviouslyCollected;
164
+ private _transactionSubTotalExcPrepaidAndExcTranDisc;
164
165
  private _transactionTotalTaxExcludingPreviouslyCollected;
165
166
  private _balanceDueExcludingPreviouslyCollected;
166
167
  private _transactionTotalExcludingPreviouslyCollected;
@@ -197,6 +198,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
197
198
  get transactionTotalTransactionDiscounts(): Money;
198
199
  get transactionTotalTendered(): Money;
199
200
  get transactionTotalTenderedPreviouslyCollected(): Money;
201
+ get transactionSubTotalExcPrepaidAndExcTranDisc(): Money;
200
202
  /**
201
203
  * Transaction SubTotal excluding previously collected tendered amount and excluding tax
202
204
  */
@@ -96,6 +96,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
96
96
  this._digestValue = digestValue;
97
97
  this._prepaidTendersToApply = prepaidTendersToApply;
98
98
  this._transactionSubTotalExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
99
+ this._transactionSubTotalExcPrepaidAndExcTranDisc = new scp_component_business_core_1.Money(0, accountingCurrency);
99
100
  this._transactionTotalSavingsExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
100
101
  this._transactionTotalTaxExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
101
102
  this._balanceDueExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
@@ -226,6 +227,8 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
226
227
  transaction._prepaidTendersToApply = this._prepaidTendersToApply;
227
228
  transaction._transactionSubTotalExcludingPreviouslyCollected =
228
229
  this._transactionSubTotalExcludingPreviouslyCollected;
230
+ transaction._transactionSubTotalExcPrepaidAndExcTranDisc =
231
+ this._transactionSubTotalExcPrepaidAndExcTranDisc;
229
232
  transaction._transactionTotalSavingsExcludingPreviouslyCollected =
230
233
  this._transactionTotalSavingsExcludingPreviouslyCollected;
231
234
  transaction._transactionTotalTaxExcludingPreviouslyCollected =
@@ -347,6 +350,9 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
347
350
  get transactionTotalTenderedPreviouslyCollected() {
348
351
  return this._transactionTotalTenderedPreviouslyCollected;
349
352
  }
353
+ get transactionSubTotalExcPrepaidAndExcTranDisc() {
354
+ return this._transactionSubTotalExcPrepaidAndExcTranDisc;
355
+ }
350
356
  /**
351
357
  * Transaction SubTotal excluding previously collected tendered amount and excluding tax
352
358
  */
@@ -862,6 +868,10 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
862
868
  "transaction.totalTenderedExcludingPreviouslyCollected",
863
869
  this.transactionTotalTenderedExcludingPreviouslyCollected,
864
870
  ],
871
+ [
872
+ "transaction.transactionSubTotalExcPrepaidAndExcTranDisc",
873
+ this._transactionSubTotalExcPrepaidAndExcTranDisc,
874
+ ],
865
875
  ["transaction.totalPreviouslyCollectedTenders", this.transactionTotalPreviouslyCollectedTenders],
866
876
  ["transaction.totalTenderedOnOrderCreate", this.transactionTotalTenderedOnOrderCreate],
867
877
  ["transaction.totalChangeTendered", this.transactionTotalChangeTendered],
@@ -1056,6 +1066,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
1056
1066
  _digestValue: this._digestValue,
1057
1067
  _prepaidTendersToApply: this.prepaidTendersToApply,
1058
1068
  _transactionSubTotalExcludingPreviouslyCollected: this.transactionSubTotalExcludingPreviouslyCollected,
1069
+ _transactionSubTotalExcPrepaidAndExcTranDisc: this.transactionSubTotalExcPrepaidAndExcTranDisc,
1059
1070
  _transactionTotalSavingsExcludingPreviouslyCollected: this.transactionTotalSavingsExcludingPreviouslyCollected,
1060
1071
  _transactionTotalTaxExcludingPreviouslyCollected: this.transactionTotalTaxExcludingPreviouslyCollected,
1061
1072
  _balanceDueExcludingPreviouslyCollected: this.transactionBalanceDueExcludingPreviouslyCollected,
@@ -1212,6 +1223,9 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
1212
1223
  this._transactionSubTotalExcludingPreviouslyCollected =
1213
1224
  transactionJsonObj._transactionSubTotalExcludingPreviouslyCollected &&
1214
1225
  new scp_component_business_core_1.Money(transactionJsonObj._transactionSubTotalExcludingPreviouslyCollected);
1226
+ this._transactionSubTotalExcPrepaidAndExcTranDisc =
1227
+ transactionJsonObj._transactionSubTotalExcPrepaidAndExcTranDisc &&
1228
+ new scp_component_business_core_1.Money(transactionJsonObj._transactionSubTotalExcPrepaidAndExcTranDisc);
1215
1229
  this._transactionTotalSavingsExcludingPreviouslyCollected =
1216
1230
  transactionJsonObj._transactionTotalSavingsExcludingPreviouslyCollected &&
1217
1231
  new scp_component_business_core_1.Money(transactionJsonObj._transactionTotalSavingsExcludingPreviouslyCollected);
@@ -40,6 +40,7 @@ export interface ITenderGroup {
40
40
  tenderType?: string;
41
41
  groupLabel?: ILabel;
42
42
  subType?: TenderSubType;
43
+ refundableAmount?: Money;
43
44
  }
44
45
  export interface IChangeBehaviorDefinition {
45
46
  forfeitChange?: boolean;
@@ -98,7 +99,7 @@ export declare class TenderType {
98
99
  static getActiveConfiguredTenderGroups(container: Container, accountingCurrency: string, activeTenders: TenderType[]): ITenderGroup[];
99
100
  static getActiveRefundConfiguredTenderGroups(container: Container, accountingCurrency: string, withTransaction: boolean, activeTenders: TenderType[], originalTransactionsDetails: IOriginalTransactionDetails[], withOfflineTransaction: boolean): ITenderGroup[];
100
101
  static tenderIsCreditOrDebit(tenderType: any): boolean;
101
- static getRefundableAmountByGroup(group: ITenderGroup, displayInfo: any, currency: string, configuration: IConfigurationManager, refundDue?: Money): Money;
102
+ static getRefundableAmountByGroup(group: ITenderGroup, displayInfo: any, currency: string, configuration: IConfigurationManager, refundDue?: Money, useGroupRefundableAmount?: boolean): Money;
102
103
  static getFeesTotal(displayInfo: any, accountingCurrency: string): Money;
103
104
  static getTenderedAmountsWithoutTransaction(tenderDisplayLines: any[], accountingCurrency: string, configurationManager: IConfigurationManager): Money;
104
105
  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) {
91
+ static getRefundableAmountByGroup(group, displayInfo, currency, configuration, refundDue, useGroupRefundableAmount = false) {
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,14 +127,19 @@ class TenderType {
127
127
  }
128
128
  });
129
129
  let refundableAmount = new scp_component_business_core_1.Money(0, currency);
130
- if (tenderAllowRefund.includes(ITendersConfig_1.AllowRefund.WithTransaction)) {
131
- refundableAmount = refundableAmount.plus(withTransactionTotal);
130
+ if (group.refundableAmount && useGroupRefundableAmount) {
131
+ refundableAmount = group.refundableAmount;
132
132
  }
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);
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
+ }
138
143
  }
139
144
  return getLowestRefundDue(refundDue, undefined, refundableAmount);
140
145
  }
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.10.3",
3
+ "version": "2.10.5",
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",
@@ -202,13 +202,5 @@
202
202
  "extends": [
203
203
  "@aptos-scp/scp-component-commit-configs/.commitlintrc.js"
204
204
  ]
205
- },
206
- "release": {
207
- "repositoryUrl": "https://auth@bitbucket.org/aptosretail/scp-component-store-selling-features-domain-model.git",
208
- "tagFormat": "@aptos-scp/scp-component-store-selling-features-domain-model@${version}",
209
- "extends": [
210
- "@aptos-scp/scp-component-commit-configs/releaserc.config.js"
211
- ],
212
- "npmPublish": true
213
205
  }
214
206
  }