@aptos-scp/scp-component-store-selling-features-domain-model 2.10.4 → 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.
|
@@ -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.10.
|
|
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
|
}
|