@aptos-scp/scp-component-store-selling-features-domain-model 2.8.1 → 2.9.0-patch.2
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.
- package/lib/domain/model/MerchandiseTransaction.d.ts +2 -0
- package/lib/domain/model/MerchandiseTransaction.js +14 -0
- package/lib/domain/model/TenderType.d.ts +2 -1
- package/lib/domain/model/TenderType.js +13 -8
- package/lib/domain/model/configuration/IDonationBehaviorsConfig.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -196,6 +197,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
|
|
|
196
197
|
get transactionTotalTransactionDiscounts(): Money;
|
|
197
198
|
get transactionTotalTendered(): Money;
|
|
198
199
|
get transactionTotalTenderedPreviouslyCollected(): Money;
|
|
200
|
+
get transactionSubTotalExcPrepaidAndExcTranDisc(): Money;
|
|
199
201
|
/**
|
|
200
202
|
* Transaction SubTotal excluding previously collected tendered amount and excluding tax
|
|
201
203
|
*/
|
|
@@ -95,6 +95,7 @@ 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);
|
|
98
99
|
this._transactionTotalSavingsExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
|
|
99
100
|
this._transactionTotalTaxExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
|
|
100
101
|
this._balanceDueExcludingPreviouslyCollected = new scp_component_business_core_1.Money(0, accountingCurrency);
|
|
@@ -224,6 +225,8 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
224
225
|
transaction._prepaidTendersToApply = this._prepaidTendersToApply;
|
|
225
226
|
transaction._transactionSubTotalExcludingPreviouslyCollected =
|
|
226
227
|
this._transactionSubTotalExcludingPreviouslyCollected;
|
|
228
|
+
transaction._transactionSubTotalExcPrepaidAndExcTranDisc =
|
|
229
|
+
this._transactionSubTotalExcPrepaidAndExcTranDisc;
|
|
227
230
|
transaction._transactionTotalSavingsExcludingPreviouslyCollected =
|
|
228
231
|
this._transactionTotalSavingsExcludingPreviouslyCollected;
|
|
229
232
|
transaction._transactionTotalTaxExcludingPreviouslyCollected =
|
|
@@ -345,6 +348,9 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
345
348
|
get transactionTotalTenderedPreviouslyCollected() {
|
|
346
349
|
return this._transactionTotalTenderedPreviouslyCollected;
|
|
347
350
|
}
|
|
351
|
+
get transactionSubTotalExcPrepaidAndExcTranDisc() {
|
|
352
|
+
return this._transactionSubTotalExcPrepaidAndExcTranDisc;
|
|
353
|
+
}
|
|
348
354
|
/**
|
|
349
355
|
* Transaction SubTotal excluding previously collected tendered amount and excluding tax
|
|
350
356
|
*/
|
|
@@ -852,6 +858,10 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
852
858
|
"transaction.totalTenderedExcludingPreviouslyCollected",
|
|
853
859
|
this.transactionTotalTenderedExcludingPreviouslyCollected,
|
|
854
860
|
],
|
|
861
|
+
[
|
|
862
|
+
"transaction.transactionSubTotalExcPrepaidAndExcTranDisc",
|
|
863
|
+
this._transactionSubTotalExcPrepaidAndExcTranDisc,
|
|
864
|
+
],
|
|
855
865
|
["transaction.totalPreviouslyCollectedTenders", this.transactionTotalPreviouslyCollectedTenders],
|
|
856
866
|
["transaction.totalTenderedOnOrderCreate", this.transactionTotalTenderedOnOrderCreate],
|
|
857
867
|
["transaction.totalChangeTendered", this.transactionTotalChangeTendered],
|
|
@@ -1044,6 +1054,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
1044
1054
|
_digestValue: this._digestValue,
|
|
1045
1055
|
_prepaidTendersToApply: this.prepaidTendersToApply,
|
|
1046
1056
|
_transactionSubTotalExcludingPreviouslyCollected: this.transactionSubTotalExcludingPreviouslyCollected,
|
|
1057
|
+
_transactionSubTotalExcPrepaidAndExcTranDisc: this.transactionSubTotalExcPrepaidAndExcTranDisc,
|
|
1047
1058
|
_transactionTotalSavingsExcludingPreviouslyCollected: this.transactionTotalSavingsExcludingPreviouslyCollected,
|
|
1048
1059
|
_transactionTotalTaxExcludingPreviouslyCollected: this.transactionTotalTaxExcludingPreviouslyCollected,
|
|
1049
1060
|
_balanceDueExcludingPreviouslyCollected: this.transactionBalanceDueExcludingPreviouslyCollected,
|
|
@@ -1199,6 +1210,9 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
1199
1210
|
this._transactionSubTotalExcludingPreviouslyCollected =
|
|
1200
1211
|
transactionJsonObj._transactionSubTotalExcludingPreviouslyCollected &&
|
|
1201
1212
|
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);
|
|
1202
1216
|
this._transactionTotalSavingsExcludingPreviouslyCollected =
|
|
1203
1217
|
transactionJsonObj._transactionTotalSavingsExcludingPreviouslyCollected &&
|
|
1204
1218
|
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 (
|
|
131
|
-
refundableAmount = refundableAmount
|
|
130
|
+
if (group.refundableAmount && useGroupRefundableAmount) {
|
|
131
|
+
refundableAmount = group.refundableAmount;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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.
|
|
3
|
+
"version": "2.9.0-patch.2",
|
|
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",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@aptos-scp/scp-component-taxation": "^5.28.0",
|
|
84
84
|
"@aptos-scp/scp-component-user": "^1.4.0",
|
|
85
85
|
"@aptos-scp/scp-types-client-registration": "^1.4.0",
|
|
86
|
-
"@aptos-scp/scp-types-commerce-devices": "^6.
|
|
86
|
+
"@aptos-scp/scp-types-commerce-devices": "^6.3.0",
|
|
87
87
|
"@aptos-scp/scp-types-commerce-transaction": "^1.79.0",
|
|
88
88
|
"@aptos-scp/scp-types-core": "^1.0.5",
|
|
89
89
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|