@zeniai/client-epic-state 4.11.37 → 4.11.38
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/entity/company/companyPayload.js +1 -1
- package/lib/entity/company/companyReducer.js +6 -2
- package/lib/entity/user/userSelector.js +7 -2
- package/lib/view/companyView/selector/companyManagementViewSelector.js +47 -27
- package/lib/view/people/peopleSelector.js +2 -2
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +126 -67
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/fetchZeniAccountListPageEpic.js +4 -2
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ const toCompanyInfo = (payload, companyIdTenantIdMapping, companyInStore) => {
|
|
|
17
17
|
? (0, zeniDayJS_1.date)(payload.book_close_date)
|
|
18
18
|
: undefined,
|
|
19
19
|
companyId: payload.company_id,
|
|
20
|
-
tenantId: companyIdTenantIdMapping != null
|
|
20
|
+
tenantId: (companyIdTenantIdMapping === null || companyIdTenantIdMapping === void 0 ? void 0 : companyIdTenantIdMapping[payload.company_id]) != null
|
|
21
21
|
? companyIdTenantIdMapping[payload.company_id]
|
|
22
22
|
: companyInStore === null || companyInStore === void 0 ? void 0 : companyInStore.companyInfo.tenantId,
|
|
23
23
|
createTime: (0, zeniDayJS_1.date)(payload.create_time),
|
|
@@ -36,8 +36,12 @@ const company = (0, toolkit_1.createSlice)({
|
|
|
36
36
|
}
|
|
37
37
|
else if (companyInStore != null &&
|
|
38
38
|
(newCompany.companyInfo.updateTime.isAfter(companyInStore.companyInfo.updateTime) ||
|
|
39
|
-
!(0, isEqual_1.default)(newCompany.parentSubsidiaryInfo, companyInStore.parentSubsidiaryInfo)
|
|
40
|
-
|
|
39
|
+
!(0, isEqual_1.default)(newCompany.parentSubsidiaryInfo, companyInStore.parentSubsidiaryInfo) ||
|
|
40
|
+
newCompany.companyInfo.tenantId !==
|
|
41
|
+
companyInStore.companyInfo.tenantId)) {
|
|
42
|
+
// Note: If company data already exists, save it if the new data is the latest one
|
|
43
|
+
// or parent subsidiary relationship has changed
|
|
44
|
+
// or tenant id has changed
|
|
41
45
|
draft.companiesById[companyPayload.company_id] = newCompany;
|
|
42
46
|
}
|
|
43
47
|
});
|
|
@@ -31,8 +31,13 @@ const getAllZeniUsersFromState = (state) => {
|
|
|
31
31
|
exports.getAllZeniUsersFromState = getAllZeniUsersFromState;
|
|
32
32
|
const getUserName = (user) => {
|
|
33
33
|
if (user != null) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const firstName = user.firstName;
|
|
35
|
+
const lastName = user.lastName;
|
|
36
|
+
if (Boolean(firstName) && Boolean(lastName)) {
|
|
37
|
+
return `${firstName} ${lastName}`;
|
|
38
|
+
}
|
|
39
|
+
else if (Boolean(firstName) || Boolean(lastName)) {
|
|
40
|
+
return firstName || lastName;
|
|
36
41
|
}
|
|
37
42
|
else {
|
|
38
43
|
return user.email;
|
|
@@ -14,6 +14,7 @@ const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
|
14
14
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
15
15
|
const customerSatisfactionState_1 = require("../../../entity/customerSatisfaction/customerSatisfactionState");
|
|
16
16
|
const cockpitHelpers_1 = require("../helpers/cockpitHelpers");
|
|
17
|
+
const sortOrderPayload_1 = require("../../../commonPayloadTypes/sortOrderPayload");
|
|
17
18
|
const getManagementViewFromCompanyIds = (rootState, companyIds, fetchState) => {
|
|
18
19
|
const uiState = rootState.companyViewState.managementView.uiState;
|
|
19
20
|
const { sortKey, sortOrder, filterText, filters } = uiState;
|
|
@@ -334,12 +335,27 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
334
335
|
break;
|
|
335
336
|
}
|
|
336
337
|
});
|
|
338
|
+
const sortOrderKey = (0, sortOrderPayload_1.getSortOrder)(sortOrder);
|
|
339
|
+
const sortOrderKeys = [];
|
|
340
|
+
if (sortKey === 'plans') {
|
|
341
|
+
let maxPlansCount = 0;
|
|
342
|
+
companiesWithSortKeyValue.forEach((company) => {
|
|
343
|
+
var _a;
|
|
344
|
+
maxPlansCount = Math.max(maxPlansCount, (_a = (0, exports.getPlanList)(company)) === null || _a === void 0 ? void 0 : _a.length);
|
|
345
|
+
});
|
|
346
|
+
for (let i = 0; i < maxPlansCount; i++) {
|
|
347
|
+
sortOrderKeys.push(sortOrderKey);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (sortOrderKeys.length === 0) {
|
|
351
|
+
sortOrderKeys.push(sortOrderKey, sortOrderKey);
|
|
352
|
+
}
|
|
337
353
|
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValue, [
|
|
338
354
|
(company) => {
|
|
339
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
355
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
340
356
|
let primarySortValue;
|
|
341
|
-
let
|
|
342
|
-
let
|
|
357
|
+
let multiSortValues = [];
|
|
358
|
+
let isMultiSortApplicable = false;
|
|
343
359
|
const managegmentInfo = company.company.company.managegmentInfo;
|
|
344
360
|
switch (sortKey) {
|
|
345
361
|
case 'companyName':
|
|
@@ -350,10 +366,11 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
350
366
|
primarySortValue = (_a = managegmentInfo.companyGroupId) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
351
367
|
break;
|
|
352
368
|
case 'plans':
|
|
353
|
-
|
|
369
|
+
isMultiSortApplicable = true;
|
|
370
|
+
multiSortValues = (0, exports.getPlanList)(company).map((plan) => plan === null || plan === void 0 ? void 0 : plan.zeniSku);
|
|
354
371
|
break;
|
|
355
372
|
case 'task':
|
|
356
|
-
primarySortValue = (
|
|
373
|
+
primarySortValue = (_b = company.taskSummary) === null || _b === void 0 ? void 0 : _b.count;
|
|
357
374
|
break;
|
|
358
375
|
case 'controller':
|
|
359
376
|
primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.controllerUserIds[0]).toLowerCase();
|
|
@@ -371,50 +388,53 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
371
388
|
primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.apAnalystUserIds[0]).toLowerCase();
|
|
372
389
|
break;
|
|
373
390
|
case 'reportSent':
|
|
374
|
-
primarySortValue = ((
|
|
391
|
+
primarySortValue = ((_c = managegmentInfo.lastReportSentDate) !== null && _c !== void 0 ? _c : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
|
|
375
392
|
break;
|
|
376
393
|
case 'taxStatus':
|
|
377
|
-
primarySortValue = (
|
|
394
|
+
primarySortValue = (_d = managegmentInfo.taxStatusCode) === null || _d === void 0 ? void 0 : _d.toLowerCase();
|
|
378
395
|
break;
|
|
379
396
|
case 'taxLead':
|
|
380
397
|
primarySortValue = (0, userSelector_1.getUserNameById)(userState, managegmentInfo.taxLeadUserIds[0]).toLowerCase();
|
|
381
398
|
break;
|
|
382
399
|
case 'monthlyRecurringRevenue':
|
|
383
400
|
primarySortValue =
|
|
384
|
-
(
|
|
401
|
+
(_g = (_f = (_e = company.primarySubscription) === null || _e === void 0 ? void 0 : _e.summary) === null || _f === void 0 ? void 0 : _f.summary.monthlyRecurringRevenue.amount) !== null && _g !== void 0 ? _g : 0;
|
|
385
402
|
break;
|
|
386
403
|
case 'annualRecurringRevenue':
|
|
387
404
|
primarySortValue =
|
|
388
|
-
(
|
|
405
|
+
(_k = (_j = (_h = company.primarySubscription) === null || _h === void 0 ? void 0 : _h.summary) === null || _j === void 0 ? void 0 : _j.summary.annualRecurringRevenue.amount) !== null && _k !== void 0 ? _k : 0;
|
|
389
406
|
break;
|
|
390
407
|
case 'notes':
|
|
391
|
-
primarySortValue = (
|
|
408
|
+
primarySortValue = (_l = managegmentInfo.note) === null || _l === void 0 ? void 0 : _l.length;
|
|
392
409
|
break;
|
|
393
410
|
case 'satisfaction':
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
? customerSatisfactionState_1.teamRatingValues[managegmentInfo.customerSatisfaction.teamRating]
|
|
402
|
-
: 0;
|
|
411
|
+
isMultiSortApplicable = true;
|
|
412
|
+
multiSortValues.push(((_m = managegmentInfo.customerSatisfaction) === null || _m === void 0 ? void 0 : _m.customerRating) != null
|
|
413
|
+
? customerSatisfactionState_1.customerRatingValues[managegmentInfo.customerSatisfaction.customerRating]
|
|
414
|
+
: 0);
|
|
415
|
+
multiSortValues.push(((_o = managegmentInfo.customerSatisfaction) === null || _o === void 0 ? void 0 : _o.teamRating) != null
|
|
416
|
+
? customerSatisfactionState_1.teamRatingValues[managegmentInfo.customerSatisfaction.teamRating]
|
|
417
|
+
: 0);
|
|
403
418
|
break;
|
|
404
419
|
case 'bookCloseDate':
|
|
405
|
-
primarySortValue = ((
|
|
420
|
+
primarySortValue = ((_p = company.company.company.companyInfo.bookCloseDate) !== null && _p !== void 0 ? _p : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
|
|
406
421
|
break;
|
|
407
422
|
case 'status':
|
|
408
|
-
default:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
423
|
+
default: {
|
|
424
|
+
isMultiSortApplicable = true;
|
|
425
|
+
let statusCode = '';
|
|
426
|
+
if (managegmentInfo.statusCode) {
|
|
427
|
+
statusCode = (0, cockpitTypes_1.toManagementStatusCodeType)(managegmentInfo.statusCode.toLowerCase());
|
|
428
|
+
}
|
|
429
|
+
multiSortValues.push(cockpitTypes_1.MANAGEMENT_STATUS_CODES.indexOf(statusCode));
|
|
430
|
+
multiSortValues.push((_q = managegmentInfo.companyGroupId) === null || _q === void 0 ? void 0 : _q.toLowerCase());
|
|
431
|
+
}
|
|
412
432
|
}
|
|
413
|
-
return
|
|
414
|
-
?
|
|
433
|
+
return isMultiSortApplicable === true
|
|
434
|
+
? multiSortValues
|
|
415
435
|
: primarySortValue;
|
|
416
436
|
},
|
|
417
|
-
],
|
|
437
|
+
], sortOrderKeys);
|
|
418
438
|
return [...sortedCompaniesWithSortKeyValue, ...companiesWithNoSortKeyValue];
|
|
419
439
|
};
|
|
420
440
|
const getTotalRecurringRevenue = (companies) => companies.reduce((prev, curr) => {
|
|
@@ -142,8 +142,8 @@ const sortPeopleBySortKey = (person, sortKey, userState, classState) => {
|
|
|
142
142
|
default:
|
|
143
143
|
return person.user != null
|
|
144
144
|
? person.user.firstName
|
|
145
|
-
? (_b = person.user) === null || _b === void 0 ? void 0 : _b.firstName.toLowerCase()
|
|
146
|
-
: (_c = person.user) === null || _c === void 0 ? void 0 : _c.email.toLowerCase()
|
|
145
|
+
? (_b = person.user) === null || _b === void 0 ? void 0 : _b.firstName.toLowerCase().trim()
|
|
146
|
+
: (_c = person.user) === null || _c === void 0 ? void 0 : _c.email.toLowerCase().trim()
|
|
147
147
|
: undefined;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
@@ -13,6 +13,7 @@ import { RecurringBillConfig } from '../../../../entity/billPay/recurringBills/r
|
|
|
13
13
|
import { BulkOperationType, BulkSelectExceptionInfoType } from '../billsBulkActionView/billsBulkActionViewState';
|
|
14
14
|
export interface BillBulkSelectInfo {
|
|
15
15
|
isSelectableForBulkAction: boolean;
|
|
16
|
+
isSelectableForBulkActionSelectAll: boolean;
|
|
16
17
|
bulkSelectExceptionInfo?: BulkSelectExceptionInfoType;
|
|
17
18
|
}
|
|
18
19
|
export interface BillListBulkActionInfo {
|
|
@@ -49,4 +50,4 @@ export declare const getBillList: (state: RootState, currentTimePeriod: TimePeri
|
|
|
49
50
|
export declare const getApproversOrRejectors: (billTransaction: BillTransaction, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
50
51
|
export declare const getBillListOnSort: (sortKey: BillPayViewSortKey, sortOrder: SortOrder, currentTab: BillTab, transactions: BillTransactionView[]) => BillTransactionView[];
|
|
51
52
|
export declare const checkIfBulkActionAllowed: (selectedTab: BillTab, selectedSubTab: BillsSubTabType) => boolean;
|
|
52
|
-
export declare const getAllowedBulkActions: (selectedTab: BillTab, selectedSubTab: BillsSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean) => BulkOperationType[];
|
|
53
|
+
export declare const getAllowedBulkActions: (selectedTab: BillTab, selectedSubTab: BillsSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean, isBookClosedForAnySelectedBill: boolean, isRecurringBillInBulkActionList: boolean) => BulkOperationType[];
|
|
@@ -100,21 +100,7 @@ const getBillList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
100
100
|
}
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
|
-
const bulkSubmissionFetchState = billsBulkActionViewState.bulkSubmissionFetchState.fetchState;
|
|
104
|
-
let isRecurringBillInBulkActionList = false;
|
|
105
|
-
let billListBulkActionInfo = {
|
|
106
|
-
isBulkActionAllowed: false,
|
|
107
|
-
billsSelectedForBulkAction: [],
|
|
108
|
-
allowedBulkActions: [],
|
|
109
|
-
bulkSubmissionFetchState,
|
|
110
|
-
isRecurringBillInBulkActionList,
|
|
111
|
-
};
|
|
112
|
-
let firstBillInBulkList = undefined;
|
|
113
|
-
const isBulkActionAllowed = isBulkActionFeatureEnabled
|
|
114
|
-
? (0, exports.checkIfBulkActionAllowed)(billListState.currentTab, billListState.currentSubTab)
|
|
115
|
-
: false;
|
|
116
103
|
let transactionsView = transactions.map((transaction) => {
|
|
117
|
-
var _a, _b;
|
|
118
104
|
let approvers = {
|
|
119
105
|
users: [],
|
|
120
106
|
attributes: [],
|
|
@@ -128,51 +114,10 @@ const getBillList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
128
114
|
recurringBillDetail = (0, get_1.default)(recurringBillState.recurringBillDetailByConfigId, transaction.recurringBillConfigId, undefined);
|
|
129
115
|
}
|
|
130
116
|
const recurringBillConfig = recurringBillDetail === null || recurringBillDetail === void 0 ? void 0 : recurringBillDetail.recurringBillConfig;
|
|
131
|
-
let billBulkSelectInfo;
|
|
132
|
-
if (isBulkActionAllowed) {
|
|
133
|
-
const isProcessing = (0, helpers_1.isBillProcessing)((_a = transaction.bulkProcessingDetail) === null || _a === void 0 ? void 0 : _a.type);
|
|
134
|
-
const isError = ((_b = transaction.bulkProcessingDetail) === null || _b === void 0 ? void 0 : _b.type) === 'error';
|
|
135
|
-
const isBookClosedForBill = transaction.bookCloseDate != null &&
|
|
136
|
-
transaction.date.isBefore(transaction.bookCloseDate);
|
|
137
|
-
const { isSelectableForBulkAction, bulkSelectExceptionInfo } = isProcessing || isError
|
|
138
|
-
? {
|
|
139
|
-
isSelectableForBulkAction: false,
|
|
140
|
-
bulkSelectExceptionInfo: undefined,
|
|
141
|
-
}
|
|
142
|
-
: isBillSelectableForBulkAction(transaction, billListState.currentTab, isBookClosedForBill, firstBillInBulkList);
|
|
143
|
-
if (isBulkActionAllowed &&
|
|
144
|
-
billsBulkActionViewState.billsSelectedForBulkAction.includes(transaction.id)) {
|
|
145
|
-
if (isRecurring) {
|
|
146
|
-
isRecurringBillInBulkActionList = true;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
billBulkSelectInfo = {
|
|
150
|
-
isSelectableForBulkAction,
|
|
151
|
-
bulkSelectExceptionInfo,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
117
|
return Object.assign(Object.assign({}, transaction), { approvers,
|
|
155
118
|
isRecurring,
|
|
156
|
-
billBulkSelectInfo,
|
|
157
119
|
recurringBillConfig });
|
|
158
120
|
});
|
|
159
|
-
if (isBulkActionAllowed) {
|
|
160
|
-
const billsSelectedForBulkAction = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
161
|
-
firstBillInBulkList = (0, get_1.default)(billTransactionState.transactionById, billsSelectedForBulkAction[0], undefined);
|
|
162
|
-
const allBulkBillsAwaitingMyApproval = (0, difference_1.default)(billsSelectedForBulkAction, pendingApprovalTransactionIDs)
|
|
163
|
-
.length === 0;
|
|
164
|
-
const allowedBulkActions = isBulkActionAllowed
|
|
165
|
-
? (0, exports.getAllowedBulkActions)(billListState.currentTab, billListState.currentSubTab, allBulkBillsAwaitingMyApproval, (firstBillInBulkList === null || firstBillInBulkList === void 0 ? void 0 : firstBillInBulkList.billPayInfo.billPaymentStatus.code) ===
|
|
166
|
-
'processing')
|
|
167
|
-
: [];
|
|
168
|
-
billListBulkActionInfo = {
|
|
169
|
-
isBulkActionAllowed,
|
|
170
|
-
billsSelectedForBulkAction,
|
|
171
|
-
allowedBulkActions,
|
|
172
|
-
bulkSubmissionFetchState,
|
|
173
|
-
isRecurringBillInBulkActionList,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
121
|
transactionsView = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('bill_pay', transactionsView, billListState.filters);
|
|
177
122
|
const TransactionsPendingForMyApprovalLength = pendingApprovalTransactionIDs.length;
|
|
178
123
|
const fetchState = (_f = (_e = billListState.byBillListKey[key]) === null || _e === void 0 ? void 0 : _e.fetchState) !== null && _f !== void 0 ? _f : 'Not-Started';
|
|
@@ -195,6 +140,73 @@ const getBillList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
195
140
|
((_c = transaction.documentId) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes(loweredSearchText)) ===
|
|
196
141
|
true);
|
|
197
142
|
}));
|
|
143
|
+
//BulkActions
|
|
144
|
+
const bulkSubmissionFetchState = billsBulkActionViewState.bulkSubmissionFetchState.fetchState;
|
|
145
|
+
let isRecurringBillInBulkActionList = false;
|
|
146
|
+
let isBookClosedForAnySelectedBill = false;
|
|
147
|
+
let billListBulkActionInfo = {
|
|
148
|
+
isBulkActionAllowed: false,
|
|
149
|
+
billsSelectedForBulkAction: [],
|
|
150
|
+
allowedBulkActions: [],
|
|
151
|
+
bulkSubmissionFetchState,
|
|
152
|
+
isRecurringBillInBulkActionList,
|
|
153
|
+
};
|
|
154
|
+
const billsSelectedForBulkAction = billsBulkActionViewState.billsSelectedForBulkAction;
|
|
155
|
+
const firstBillInBulkList = (0, get_1.default)(billTransactionState.transactionById, billsSelectedForBulkAction[0], undefined);
|
|
156
|
+
const isBulkActionAllowed = isBulkActionFeatureEnabled
|
|
157
|
+
? (0, exports.checkIfBulkActionAllowed)(billListState.currentTab, billListState.currentSubTab)
|
|
158
|
+
: false;
|
|
159
|
+
let firstSelectableBill = undefined;
|
|
160
|
+
if (isBulkActionAllowed) {
|
|
161
|
+
transactionsView = transactionsView.map((transaction) => {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
let billBulkSelectInfo;
|
|
164
|
+
if (isBulkActionAllowed) {
|
|
165
|
+
const isProcessing = (0, helpers_1.isBillProcessing)((_a = transaction.bulkProcessingDetail) === null || _a === void 0 ? void 0 : _a.type);
|
|
166
|
+
const isError = ((_b = transaction.bulkProcessingDetail) === null || _b === void 0 ? void 0 : _b.type) === 'error';
|
|
167
|
+
const isBookClosedForBill = transaction.bookCloseDate != null &&
|
|
168
|
+
transaction.date.isBefore(transaction.bookCloseDate);
|
|
169
|
+
const { isSelectableForBulkAction, isSelectableForBulkActionSelectAll, bulkSelectExceptionInfo, } = isProcessing || isError
|
|
170
|
+
? {
|
|
171
|
+
isSelectableForBulkAction: false,
|
|
172
|
+
isSelectableForBulkActionSelectAll: false,
|
|
173
|
+
bulkSelectExceptionInfo: undefined,
|
|
174
|
+
}
|
|
175
|
+
: isBillSelectableForBulkAction(transaction, billListState.currentTab, isBookClosedForBill, pendingApprovalTransactionIDs.includes(transaction.id), firstSelectableBill, firstBillInBulkList);
|
|
176
|
+
if (isBulkActionAllowed &&
|
|
177
|
+
billsBulkActionViewState.billsSelectedForBulkAction.includes(transaction.id)) {
|
|
178
|
+
if (transaction.isRecurring) {
|
|
179
|
+
isRecurringBillInBulkActionList = true;
|
|
180
|
+
}
|
|
181
|
+
if (isBookClosedForBill) {
|
|
182
|
+
isBookClosedForAnySelectedBill = true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (firstSelectableBill == null && isSelectableForBulkAction) {
|
|
186
|
+
firstSelectableBill = transaction;
|
|
187
|
+
}
|
|
188
|
+
billBulkSelectInfo = {
|
|
189
|
+
isSelectableForBulkAction,
|
|
190
|
+
isSelectableForBulkActionSelectAll,
|
|
191
|
+
bulkSelectExceptionInfo,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return Object.assign(Object.assign({}, transaction), { billBulkSelectInfo });
|
|
195
|
+
});
|
|
196
|
+
const allBulkBillsAwaitingMyApproval = (0, difference_1.default)(billsSelectedForBulkAction, pendingApprovalTransactionIDs)
|
|
197
|
+
.length === 0;
|
|
198
|
+
const allowedBulkActions = isBulkActionAllowed
|
|
199
|
+
? (0, exports.getAllowedBulkActions)(billListState.currentTab, billListState.currentSubTab, allBulkBillsAwaitingMyApproval, (firstBillInBulkList === null || firstBillInBulkList === void 0 ? void 0 : firstBillInBulkList.billPayInfo.billPaymentStatus.code) ===
|
|
200
|
+
'processing', isBookClosedForAnySelectedBill, isRecurringBillInBulkActionList)
|
|
201
|
+
: [];
|
|
202
|
+
billListBulkActionInfo = {
|
|
203
|
+
isBulkActionAllowed,
|
|
204
|
+
billsSelectedForBulkAction,
|
|
205
|
+
allowedBulkActions,
|
|
206
|
+
bulkSubmissionFetchState,
|
|
207
|
+
isRecurringBillInBulkActionList,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
198
210
|
const isDownloadEnabled = (0, spendManagementFilterHelpers_1.isBillListDownloadable)(state, currentTimePeriod);
|
|
199
211
|
const billBulkSubmissionLimit = billPayConfigState.billBulkSubmissionLimit;
|
|
200
212
|
return {
|
|
@@ -506,28 +518,66 @@ const checkIfBulkActionAllowed = (selectedTab, selectedSubTab) => {
|
|
|
506
518
|
return true;
|
|
507
519
|
};
|
|
508
520
|
exports.checkIfBulkActionAllowed = checkIfBulkActionAllowed;
|
|
509
|
-
const isBillSelectableForBulkAction = (bill, selectedTab, isBookClosedForBill, firstBillSelected) => {
|
|
521
|
+
const isBillSelectableForBulkAction = (bill, selectedTab, isBookClosedForBill, isAwaitingMyApproval, firstSelectableBill, firstBillSelected) => {
|
|
510
522
|
const result = {
|
|
511
523
|
isSelectableForBulkAction: true,
|
|
524
|
+
isSelectableForBulkActionSelectAll: true,
|
|
512
525
|
bulkSelectExceptionInfo: undefined,
|
|
513
526
|
};
|
|
514
|
-
if (isBookClosedForBill
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
527
|
+
if (isBookClosedForBill) {
|
|
528
|
+
if (selectedTab === 'scheduled' ||
|
|
529
|
+
(selectedTab === 'pending_approval' && !isAwaitingMyApproval)) {
|
|
530
|
+
return {
|
|
531
|
+
isSelectableForBulkAction: false,
|
|
532
|
+
isSelectableForBulkActionSelectAll: false,
|
|
533
|
+
bulkSelectExceptionInfo: 'bookCloseDateProcessing',
|
|
534
|
+
};
|
|
535
|
+
}
|
|
519
536
|
}
|
|
520
537
|
if (selectedTab === 'scheduled') {
|
|
538
|
+
//for cases where user attempts select all on scheduled tab
|
|
539
|
+
if (firstBillSelected == null && firstSelectableBill != null) {
|
|
540
|
+
if (firstSelectableBill.billPayInfo.billPaymentStatus.code === 'processing') {
|
|
541
|
+
if (bill.isRecurring &&
|
|
542
|
+
Boolean(firstSelectableBill.isRecurring) === false) {
|
|
543
|
+
return {
|
|
544
|
+
isSelectableForBulkAction: true,
|
|
545
|
+
isSelectableForBulkActionSelectAll: false,
|
|
546
|
+
bulkSelectExceptionInfo: undefined,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
if (bill.billPayInfo.billPaymentStatus.code !== 'processing') {
|
|
550
|
+
return {
|
|
551
|
+
isSelectableForBulkAction: true,
|
|
552
|
+
isSelectableForBulkActionSelectAll: false,
|
|
553
|
+
bulkSelectExceptionInfo: undefined,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (bill.billPayInfo.billPaymentStatus.code === 'processing') {
|
|
558
|
+
if (firstSelectableBill.billPayInfo.billPaymentStatus.code !==
|
|
559
|
+
'processing') {
|
|
560
|
+
return {
|
|
561
|
+
isSelectableForBulkAction: true,
|
|
562
|
+
isSelectableForBulkActionSelectAll: false,
|
|
563
|
+
bulkSelectExceptionInfo: undefined,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
521
568
|
if ((firstBillSelected === null || firstBillSelected === void 0 ? void 0 : firstBillSelected.billPayInfo.billPaymentStatus.code) === 'processing') {
|
|
522
|
-
if (bill.isRecurring
|
|
569
|
+
if (bill.isRecurring &&
|
|
570
|
+
Boolean(firstBillSelected === null || firstBillSelected === void 0 ? void 0 : firstBillSelected.isRecurring) === false) {
|
|
523
571
|
return {
|
|
524
572
|
isSelectableForBulkAction: false,
|
|
573
|
+
isSelectableForBulkActionSelectAll: true,
|
|
525
574
|
bulkSelectExceptionInfo: 'cancelRecurring',
|
|
526
575
|
};
|
|
527
576
|
}
|
|
528
577
|
if (bill.billPayInfo.billPaymentStatus.code !== 'processing') {
|
|
529
578
|
return {
|
|
530
579
|
isSelectableForBulkAction: false,
|
|
580
|
+
isSelectableForBulkActionSelectAll: true,
|
|
531
581
|
bulkSelectExceptionInfo: 'processingSelectTogether',
|
|
532
582
|
};
|
|
533
583
|
}
|
|
@@ -537,6 +587,7 @@ const isBillSelectableForBulkAction = (bill, selectedTab, isBookClosedForBill, f
|
|
|
537
587
|
if (firstBillSelected.billPayInfo.billPaymentStatus.code !== 'processing') {
|
|
538
588
|
return {
|
|
539
589
|
isSelectableForBulkAction: false,
|
|
590
|
+
isSelectableForBulkActionSelectAll: true,
|
|
540
591
|
bulkSelectExceptionInfo: 'processingWithOthers',
|
|
541
592
|
};
|
|
542
593
|
}
|
|
@@ -544,7 +595,7 @@ const isBillSelectableForBulkAction = (bill, selectedTab, isBookClosedForBill, f
|
|
|
544
595
|
}
|
|
545
596
|
return result;
|
|
546
597
|
};
|
|
547
|
-
const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing) => {
|
|
598
|
+
const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing, isBookClosedForAnySelectedBill, isRecurringBillInBulkActionList) => {
|
|
548
599
|
switch (selectedTab) {
|
|
549
600
|
case 'draft':
|
|
550
601
|
return ['send_for_approval', 'delete'];
|
|
@@ -553,11 +604,16 @@ const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyAppro
|
|
|
553
604
|
case 'all':
|
|
554
605
|
case 'awaiting_approval':
|
|
555
606
|
case 'overdue':
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
607
|
+
if (isAllAwaitingMyApproval) {
|
|
608
|
+
return isBookClosedForAnySelectedBill
|
|
609
|
+
? ['approve', 'reject']
|
|
610
|
+
: ['approve', 'reject', 'delete'];
|
|
611
|
+
}
|
|
612
|
+
return isBookClosedForAnySelectedBill ? [] : ['delete'];
|
|
559
613
|
case 'awaiting_my_approval':
|
|
560
|
-
return
|
|
614
|
+
return isBookClosedForAnySelectedBill
|
|
615
|
+
? ['approve', 'reject']
|
|
616
|
+
: ['approve', 'reject', 'delete'];
|
|
561
617
|
case 'rejected':
|
|
562
618
|
return ['delete'];
|
|
563
619
|
default:
|
|
@@ -567,6 +623,9 @@ const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyAppro
|
|
|
567
623
|
case 'scheduled': {
|
|
568
624
|
switch (selectedSubTab) {
|
|
569
625
|
case 'all':
|
|
626
|
+
if (isRecurringBillInBulkActionList) {
|
|
627
|
+
return ['delete'];
|
|
628
|
+
}
|
|
570
629
|
return isFirstBillProcessing ? ['cancel'] : ['delete'];
|
|
571
630
|
case 'failed':
|
|
572
631
|
case 'cancelled':
|
|
@@ -43,7 +43,7 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
43
43
|
var _a, _b, _c, _d, _e;
|
|
44
44
|
switch (sortKey) {
|
|
45
45
|
case 'owner':
|
|
46
|
-
return ((_c = `${(_a = card.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName.toLowerCase()} ${(_b = card.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName.toLowerCase()}`) !== null && _c !== void 0 ? _c : '');
|
|
46
|
+
return ((_c = `${(_a = card.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName.toLowerCase().trim()} ${(_b = card.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName.toLowerCase().trim()}`) !== null && _c !== void 0 ? _c : '');
|
|
47
47
|
case 'cardName':
|
|
48
48
|
return card.cardName.toLowerCase();
|
|
49
49
|
case 'department':
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountList/fetchZeniAccountListPageEpic.js
CHANGED
|
@@ -18,8 +18,10 @@ const fetchZeniAccountListEpic = (actions$, state$) => actions$.pipe((0, operato
|
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
const depositAccountList = state.depositAccountListState;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const zeniAccountList = state.zeniAccountListState;
|
|
22
|
+
if ((depositAccountList.hasValidState() === false &&
|
|
23
|
+
depositAccountList.fetchState !== 'In-Progress') ||
|
|
24
|
+
zeniAccountList.summary.zeniAccounts == null) {
|
|
23
25
|
zeniAccountActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
24
26
|
}
|
|
25
27
|
const paymentAccountList = state.paymentAccountListState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.38",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@reduxjs/toolkit": "^1.6.2",
|
|
51
|
-
"@stripe/stripe-js": "4.
|
|
51
|
+
"@stripe/stripe-js": "^4.1.0",
|
|
52
52
|
"cross-fetch": "^3.1.2",
|
|
53
53
|
"date-holidays": "^3.23.8",
|
|
54
54
|
"dayjs": "^1.10.7",
|