@zeniai/client-epic-state 4.19.96-betaJK20 → 4.19.96-betaJK21
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/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/entity/account/accountPayload.d.ts +0 -2
- package/lib/entity/account/accountReducer.d.ts +2 -5
- package/lib/entity/account/accountReducer.js +2 -7
- package/lib/entity/account/accountSelector.d.ts +0 -1
- package/lib/entity/account/accountSelector.js +1 -8
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconState.js +1 -0
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +0 -35
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -44
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +1 -2
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +1 -2
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +0 -13
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/tenant/tenantSelector.d.ts +0 -1
- package/lib/entity/tenant/tenantSelector.js +1 -9
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -3
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -12
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +1 -4
- package/lib/epic.js +1 -4
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/esm/entity/account/accountReducer.js +1 -6
- package/lib/esm/entity/account/accountSelector.js +0 -6
- package/lib/esm/entity/accountRecon/accountReconState.js +1 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +0 -44
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +1 -2
- package/lib/esm/entity/tenant/tenantReducer.js +0 -1
- package/lib/esm/entity/tenant/tenantSelector.js +0 -7
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -12
- package/lib/esm/epic.js +1 -4
- package/lib/esm/index.js +9 -10
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -82
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
- package/lib/esm/view/classList/fetchClassListEpic.js +2 -9
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +5 -15
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +13 -6
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +1 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +29 -2
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +2 -1
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +1 -17
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +3 -148
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -50
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +1 -68
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -17
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -7
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/lib/index.d.ts +13 -16
- package/lib/index.js +32 -44
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -7
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
- package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -83
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
- package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +1 -18
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +1 -8
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +5 -15
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +2 -6
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +13 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +1 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +29 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/accountRecon/uploadAccountStatementDocumentAIHelper.js +2 -1
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -33
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -18
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +3 -14
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +4 -149
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +1 -11
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +3 -50
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -1
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -67
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +0 -19
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +4 -13
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -7
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +2 -7
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +3 -6
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +14 -16
- package/package.json +1 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -29
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -44
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -44
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -33
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +0 -48
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +0 -48
|
@@ -37,15 +37,7 @@ export const initialReconciliationTabsState = {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
export const initialActionFetchState = {
|
|
40
|
-
excludeAccountFetch: {
|
|
41
|
-
fetchState: 'Not-Started',
|
|
42
|
-
error: undefined,
|
|
43
|
-
},
|
|
44
40
|
excludeFetchById: {},
|
|
45
|
-
includeAccountFetch: {
|
|
46
|
-
fetchState: 'Not-Started',
|
|
47
|
-
error: undefined,
|
|
48
|
-
},
|
|
49
41
|
reconcileFetch: {
|
|
50
42
|
fetchState: 'Not-Started',
|
|
51
43
|
error: undefined,
|
|
@@ -59,7 +51,6 @@ export const initialActionFetchState = {
|
|
|
59
51
|
export const initialState = {
|
|
60
52
|
accountReconciliationRecordsBySelectedPeriod: {},
|
|
61
53
|
accountConnectionStatusByAccountID: {},
|
|
62
|
-
excludedAccountExclusionInfo: {},
|
|
63
54
|
fetchState: 'Not-Started',
|
|
64
55
|
error: undefined,
|
|
65
56
|
selectedTab: 'review',
|
|
@@ -73,7 +64,6 @@ export const initialState = {
|
|
|
73
64
|
scrollTop: 0,
|
|
74
65
|
},
|
|
75
66
|
},
|
|
76
|
-
excludedAccountIDs: [],
|
|
77
67
|
};
|
|
78
68
|
// Create slice with reducers
|
|
79
69
|
const expenseAutomationReconciliationView = createSlice({
|
|
@@ -142,7 +132,7 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
142
132
|
fetchReconciliationSuccess: {
|
|
143
133
|
reducer(draft, action) {
|
|
144
134
|
if (action.payload.accountId == null) {
|
|
145
|
-
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground
|
|
135
|
+
updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground);
|
|
146
136
|
}
|
|
147
137
|
else if (action.payload.reconciliation.reconciliation.length > 0 &&
|
|
148
138
|
action.payload.reconciliation.accounts.length > 0) {
|
|
@@ -431,113 +421,6 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
431
421
|
...localData,
|
|
432
422
|
};
|
|
433
423
|
},
|
|
434
|
-
excludeAccountFromReconciliation: {
|
|
435
|
-
reducer(draft) {
|
|
436
|
-
draft.actionFetchState.excludeAccountFetch = {
|
|
437
|
-
fetchState: 'In-Progress',
|
|
438
|
-
error: undefined,
|
|
439
|
-
};
|
|
440
|
-
},
|
|
441
|
-
prepare(payload) {
|
|
442
|
-
return { payload };
|
|
443
|
-
},
|
|
444
|
-
},
|
|
445
|
-
excludeAccountFromReconciliationSuccess: (draft, action) => {
|
|
446
|
-
draft.actionFetchState.excludeAccountFetch = {
|
|
447
|
-
fetchState: 'Completed',
|
|
448
|
-
error: undefined,
|
|
449
|
-
};
|
|
450
|
-
const { account, selectedPeriod } = action.payload;
|
|
451
|
-
if (account != null) {
|
|
452
|
-
if (!draft.excludedAccountIDs.includes(account.account_id)) {
|
|
453
|
-
draft.excludedAccountIDs.push(account.account_id);
|
|
454
|
-
}
|
|
455
|
-
draft.excludedAccountExclusionInfo[account.account_id] = {
|
|
456
|
-
bankBalance: account.bank_balance != null
|
|
457
|
-
? {
|
|
458
|
-
amount: account.bank_balance,
|
|
459
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
460
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
461
|
-
}
|
|
462
|
-
: undefined,
|
|
463
|
-
clearedBalance: account.cleared_balance != null
|
|
464
|
-
? {
|
|
465
|
-
amount: account.cleared_balance,
|
|
466
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
467
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
468
|
-
}
|
|
469
|
-
: undefined,
|
|
470
|
-
variance: account.variance != null
|
|
471
|
-
? {
|
|
472
|
-
amount: account.variance,
|
|
473
|
-
currencyCode: account.currency_code ?? 'USD',
|
|
474
|
-
currencySymbol: account.currency_symbol ?? '$',
|
|
475
|
-
}
|
|
476
|
-
: undefined,
|
|
477
|
-
};
|
|
478
|
-
const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
|
|
479
|
-
draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId].accountIDs.filter((id) => id !== account.account_id);
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
excludeAccountFromReconciliationFailure: (draft, action) => {
|
|
483
|
-
draft.actionFetchState.excludeAccountFetch = {
|
|
484
|
-
fetchState: 'Error',
|
|
485
|
-
error: action.payload.error,
|
|
486
|
-
};
|
|
487
|
-
},
|
|
488
|
-
includeAccountInReconciliation: {
|
|
489
|
-
reducer(draft) {
|
|
490
|
-
draft.actionFetchState.includeAccountFetch = {
|
|
491
|
-
fetchState: 'In-Progress',
|
|
492
|
-
error: undefined,
|
|
493
|
-
};
|
|
494
|
-
},
|
|
495
|
-
prepare(payload) {
|
|
496
|
-
return { payload };
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
includeAccountInReconciliationSuccess: (draft, action) => {
|
|
500
|
-
draft.actionFetchState.includeAccountFetch = {
|
|
501
|
-
fetchState: 'Completed',
|
|
502
|
-
error: undefined,
|
|
503
|
-
};
|
|
504
|
-
const { reconciliation, selectedPeriod } = action.payload;
|
|
505
|
-
if (reconciliation == null) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
const accountId = reconciliation.account_id;
|
|
509
|
-
draft.excludedAccountIDs = draft.excludedAccountIDs.filter((id) => id !== accountId);
|
|
510
|
-
delete draft.excludedAccountExclusionInfo[accountId];
|
|
511
|
-
const monthYearPeriodId = toMonthYearPeriodId(selectedPeriod);
|
|
512
|
-
const accountReconciliationRecords = draft.accountReconciliationRecordsBySelectedPeriod[monthYearPeriodId];
|
|
513
|
-
if (accountReconciliationRecords != null) {
|
|
514
|
-
if (!accountReconciliationRecords.accountIDs.includes(accountId)) {
|
|
515
|
-
accountReconciliationRecords.accountIDs.push(accountId);
|
|
516
|
-
}
|
|
517
|
-
accountReconciliationRecords.reconciliationByAccountID[accountId] = {
|
|
518
|
-
accountId,
|
|
519
|
-
reconciliationId: reconciliation.reconciliation_id ?? undefined,
|
|
520
|
-
transactionFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
521
|
-
refreshStatus: { fetchState: 'Not-Started', error: undefined },
|
|
522
|
-
statementDeleteStatus: { fetchState: 'Not-Started', error: undefined },
|
|
523
|
-
statementUploadStatus: { fetchState: 'Not-Started', error: undefined },
|
|
524
|
-
statementUpdateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
525
|
-
statementParseInProgress: reconciliation.bank_status.code === 'parsing',
|
|
526
|
-
localData: {},
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
draft.accountConnectionStatusByAccountID[accountId] = {
|
|
530
|
-
status: toBankStatusCodeType(reconciliation.bank_status.code),
|
|
531
|
-
connectionInProgress: false,
|
|
532
|
-
paymentAccountId: undefined,
|
|
533
|
-
};
|
|
534
|
-
},
|
|
535
|
-
includeAccountInReconciliationFailure: (draft, action) => {
|
|
536
|
-
draft.actionFetchState.includeAccountFetch = {
|
|
537
|
-
fetchState: 'Error',
|
|
538
|
-
error: action.payload.error,
|
|
539
|
-
};
|
|
540
|
-
},
|
|
541
424
|
updateStatementUploadChosen: (draft, action) => {
|
|
542
425
|
draft.statementUploadChosen = action.payload.statementUploadChosen;
|
|
543
426
|
},
|
|
@@ -547,38 +430,10 @@ const expenseAutomationReconciliationView = createSlice({
|
|
|
547
430
|
},
|
|
548
431
|
});
|
|
549
432
|
// Export actions
|
|
550
|
-
export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure,
|
|
433
|
+
export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, } = expenseAutomationReconciliationView.actions;
|
|
551
434
|
// Export reducer
|
|
552
435
|
export default expenseAutomationReconciliationView.reducer;
|
|
553
|
-
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground
|
|
554
|
-
draft.excludedAccountIDs = excludedAccounts.map((ea) => ea.account_id);
|
|
555
|
-
draft.excludedAccountExclusionInfo = {};
|
|
556
|
-
excludedAccounts.forEach((ea) => {
|
|
557
|
-
const { exclusion_info } = ea;
|
|
558
|
-
draft.excludedAccountExclusionInfo[ea.account_id] = {
|
|
559
|
-
bankBalance: exclusion_info.bank_balance != null
|
|
560
|
-
? {
|
|
561
|
-
amount: exclusion_info.bank_balance,
|
|
562
|
-
currencyCode: ea.currency_code ?? 'USD',
|
|
563
|
-
currencySymbol: ea.currency_symbol ?? '$',
|
|
564
|
-
}
|
|
565
|
-
: undefined,
|
|
566
|
-
clearedBalance: exclusion_info.cleared_balance != null
|
|
567
|
-
? {
|
|
568
|
-
amount: exclusion_info.cleared_balance,
|
|
569
|
-
currencyCode: ea.currency_code ?? 'USD',
|
|
570
|
-
currencySymbol: ea.currency_symbol ?? '$',
|
|
571
|
-
}
|
|
572
|
-
: undefined,
|
|
573
|
-
variance: exclusion_info.variance != null
|
|
574
|
-
? {
|
|
575
|
-
amount: exclusion_info.variance,
|
|
576
|
-
currencyCode: ea.currency_code ?? 'USD',
|
|
577
|
-
currencySymbol: ea.currency_symbol ?? '$',
|
|
578
|
-
}
|
|
579
|
-
: undefined,
|
|
580
|
-
};
|
|
581
|
-
});
|
|
436
|
+
function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground) {
|
|
582
437
|
draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)] = {
|
|
583
438
|
accountIDs: [],
|
|
584
439
|
reconciliationByAccountID: {},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import omit from 'lodash/omit';
|
|
2
|
-
import orderBy from 'lodash/orderBy';
|
|
3
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
4
3
|
import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
|
|
5
4
|
import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
@@ -11,42 +10,6 @@ import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDet
|
|
|
11
10
|
import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
|
|
12
11
|
import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
|
|
13
12
|
import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
|
|
14
|
-
function getJEScheduleSortAccessor(sortKey) {
|
|
15
|
-
switch (sortKey) {
|
|
16
|
-
case 'vendor':
|
|
17
|
-
return (s) => s.vendor.name?.toLowerCase();
|
|
18
|
-
case 'category':
|
|
19
|
-
return (s) => s.jeDebit.account?.accountName?.toLowerCase();
|
|
20
|
-
case 'class':
|
|
21
|
-
return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
|
|
22
|
-
case 'scheduleCategory':
|
|
23
|
-
return (s) => s.jeScheduleType;
|
|
24
|
-
case 'startMonth':
|
|
25
|
-
return (s) => s.startDate?.valueOf();
|
|
26
|
-
case 'type':
|
|
27
|
-
return (s) => s.baseTransaction.typeOfTransaction;
|
|
28
|
-
case 'amortizationPeriod':
|
|
29
|
-
return (s) => s.period;
|
|
30
|
-
case 'jePostingDate':
|
|
31
|
-
return (s) => s.dayOfPostingDate;
|
|
32
|
-
case 'remainingMonths':
|
|
33
|
-
return (s) => s.period;
|
|
34
|
-
case 'runningBalance':
|
|
35
|
-
return (s) => s.balanceAsOfToday?.amount;
|
|
36
|
-
case 'totalAmount':
|
|
37
|
-
return (s) => s.baseTransaction.amount.amount;
|
|
38
|
-
case 'transactionDate':
|
|
39
|
-
return (s) => s.baseTransaction.date.valueOf();
|
|
40
|
-
case 'memo':
|
|
41
|
-
return (s) => s.baseTransaction.memo?.toLowerCase();
|
|
42
|
-
default:
|
|
43
|
-
return (s) => s.startDate?.valueOf();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
|
|
47
|
-
const accessor = getJEScheduleSortAccessor(sortKey);
|
|
48
|
-
return orderBy(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
|
|
49
|
-
}
|
|
50
13
|
export function getExpenseAutomationJESchedulesView(state) {
|
|
51
14
|
const jeScheduledTransaction = [];
|
|
52
15
|
const failedJeScheduledTransaction = [];
|
|
@@ -96,21 +59,13 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
96
59
|
const jeScheduleDetails = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleKey, state);
|
|
97
60
|
failedJeScheduledTransaction.push(jeScheduleDetails);
|
|
98
61
|
});
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
|
|
102
|
-
const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
|
|
103
|
-
schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
|
|
104
|
-
const unsortedResolveSchedules = [];
|
|
62
|
+
const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
|
|
63
|
+
const resolveSchedules = [];
|
|
105
64
|
failedJeScheduledTransaction.forEach((schedule) => {
|
|
106
65
|
schedule.scheduledJournalEntry.forEach((journalEntry) => {
|
|
107
|
-
|
|
108
|
-
...schedule,
|
|
109
|
-
scheduledJournalEntry: journalEntry,
|
|
110
|
-
});
|
|
66
|
+
resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
|
|
111
67
|
});
|
|
112
68
|
});
|
|
113
|
-
const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
|
|
114
69
|
const allSteps = monthYearPeriodId != null
|
|
115
70
|
? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
116
71
|
: [];
|
|
@@ -124,9 +79,7 @@ export function getExpenseAutomationJESchedulesView(state) {
|
|
|
124
79
|
allAccountList: filteredAccounts,
|
|
125
80
|
accountListNestedAccountHierarchy,
|
|
126
81
|
allClassList: allClasses,
|
|
127
|
-
completedSchedules,
|
|
128
82
|
draftSchedules,
|
|
129
|
-
ongoingSchedules,
|
|
130
83
|
resolveSchedules: resolveSchedules,
|
|
131
84
|
accountSettingsView,
|
|
132
85
|
postStatusById: postStatusById,
|
|
@@ -36,7 +36,7 @@ export function getExpenseAutomationMissingReceiptsView(state) {
|
|
|
36
36
|
transaction.lines.length > 0 &&
|
|
37
37
|
transaction.lines[0]
|
|
38
38
|
?.class != null
|
|
39
|
-
? transaction.lines[0].class
|
|
39
|
+
? transaction.lines[0].class.className.toLowerCase()
|
|
40
40
|
: null;
|
|
41
41
|
case 'vendor':
|
|
42
42
|
default:
|
|
@@ -5,7 +5,7 @@ import omit from 'lodash/omit';
|
|
|
5
5
|
import orderBy from 'lodash/orderBy';
|
|
6
6
|
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
7
7
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
8
|
-
import {
|
|
8
|
+
import { getAccountsByType } from '../../../entity/account/accountSelector';
|
|
9
9
|
import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../entity/accountRecon/accountReconSelector';
|
|
10
10
|
import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
|
|
11
11
|
import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
|
|
@@ -80,30 +80,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
80
80
|
totalVariancePercentage: undefined,
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
|
-
excludedAccountReconciliationByAccountID: {},
|
|
84
|
-
excludedAccountReconciliationBySectionID: {
|
|
85
|
-
assets: {
|
|
86
|
-
sectionId: 'assets',
|
|
87
|
-
accountIDs: [],
|
|
88
|
-
totalBankBalance: undefined,
|
|
89
|
-
totalClearedBalance: undefined,
|
|
90
|
-
totalReconciledBalance: undefined,
|
|
91
|
-
totalVariance: undefined,
|
|
92
|
-
totalVariancePercentage: undefined,
|
|
93
|
-
},
|
|
94
|
-
liabilities: {
|
|
95
|
-
sectionId: 'liabilities',
|
|
96
|
-
accountIDs: [],
|
|
97
|
-
totalBankBalance: undefined,
|
|
98
|
-
totalClearedBalance: undefined,
|
|
99
|
-
totalReconciledBalance: undefined,
|
|
100
|
-
totalVariance: undefined,
|
|
101
|
-
totalVariancePercentage: undefined,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
105
|
-
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
106
|
-
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
107
83
|
};
|
|
108
84
|
}
|
|
109
85
|
const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
|
|
@@ -263,44 +239,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
263
239
|
totalVariancePercentage: liabilityTotals.variancePercentage,
|
|
264
240
|
},
|
|
265
241
|
};
|
|
266
|
-
const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
|
|
267
|
-
const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
|
|
268
|
-
const excludedAssetAccountIDs = [];
|
|
269
|
-
const excludedLiabilityAccountIDs = [];
|
|
270
|
-
reconciliationViewState.excludedAccountIDs.forEach((accountID) => {
|
|
271
|
-
const isAsset = bankAccountIdSet.has(accountID);
|
|
272
|
-
const isLiability = creditCardIdSet.has(accountID);
|
|
273
|
-
if (!isAsset && !isLiability) {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (isAsset) {
|
|
277
|
-
excludedAssetAccountIDs.push(accountID);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
excludedLiabilityAccountIDs.push(accountID);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
const excludedAccountReconciliationBySectionID = {
|
|
284
|
-
assets: {
|
|
285
|
-
sectionId: 'assets',
|
|
286
|
-
accountIDs: excludedAssetAccountIDs,
|
|
287
|
-
},
|
|
288
|
-
liabilities: {
|
|
289
|
-
sectionId: 'liabilities',
|
|
290
|
-
accountIDs: excludedLiabilityAccountIDs,
|
|
291
|
-
},
|
|
292
|
-
};
|
|
293
|
-
const excludedAccountReconciliationByAccountID = {};
|
|
294
|
-
reconciliationViewState.excludedAccountIDs.forEach((excludedAccountID) => {
|
|
295
|
-
const account = getAccountByAccountId(accountState, excludedAccountID);
|
|
296
|
-
const exclusionInfo = reconciliationViewState.excludedAccountExclusionInfo[excludedAccountID];
|
|
297
|
-
if (account != null) {
|
|
298
|
-
excludedAccountReconciliationByAccountID[excludedAccountID] = {
|
|
299
|
-
...account,
|
|
300
|
-
...exclusionInfo,
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
242
|
const accountListNestedAccountHierarchy = getNestedAccountListHierarchy(accountListState, 'accountList');
|
|
305
243
|
const classListNestedAccountHierarchy = getNestedClassListHierarchy(classListState);
|
|
306
244
|
const accountsList = getAccountList(accountState, accountListState, 'accountList');
|
|
@@ -358,11 +296,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
|
|
|
358
296
|
allClassList: allClasses,
|
|
359
297
|
reviewTabSelectedVendorByTransactionId,
|
|
360
298
|
reconListUIState: reconciliationViewState.reconListUIState,
|
|
361
|
-
excludedAccountReconciliationBySectionID,
|
|
362
|
-
excludedAccountReconciliationByAccountID,
|
|
363
|
-
excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
|
|
364
|
-
includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
|
|
365
|
-
excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
|
|
366
299
|
};
|
|
367
300
|
});
|
|
368
301
|
export const isAccountReconReport = (reportId) => {
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const JE_SCHEDULE_SORT_KEYS = [
|
|
3
|
-
'vendor',
|
|
4
|
-
'category',
|
|
5
|
-
'class',
|
|
6
|
-
'scheduleCategory',
|
|
7
|
-
'startMonth',
|
|
8
|
-
'type',
|
|
9
|
-
'amortizationPeriod',
|
|
10
|
-
'jePostingDate',
|
|
11
|
-
'remainingMonths',
|
|
12
|
-
'runningBalance',
|
|
13
|
-
'totalAmount',
|
|
14
|
-
'transactionDate',
|
|
15
|
-
'memo',
|
|
16
|
-
];
|
|
17
|
-
export const toJEScheduleSortKey = (v) => stringToUnion(v, JE_SCHEDULE_SORT_KEYS);
|
|
1
|
+
export {};
|
|
@@ -416,14 +416,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
|
|
|
416
416
|
transactionsWithNoSortKeyValue.push(transaction);
|
|
417
417
|
}
|
|
418
418
|
break;
|
|
419
|
-
case 'invoiceNumber':
|
|
420
|
-
if (transaction.documentId != null) {
|
|
421
|
-
transactionsWithSortKeyValue.push(transaction);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
transactionsWithNoSortKeyValue.push(transaction);
|
|
425
|
-
}
|
|
426
|
-
break;
|
|
427
419
|
case 'dueDate':
|
|
428
420
|
if (currentTab === 'draft') {
|
|
429
421
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -526,8 +518,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
|
|
|
526
518
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
527
519
|
case 'paymentMethod':
|
|
528
520
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
529
|
-
case 'invoiceNumber':
|
|
530
|
-
return transaction.documentId;
|
|
531
521
|
}
|
|
532
522
|
}, getColumnWiseSortOrder(sortOrder));
|
|
533
523
|
return [
|
|
@@ -3,7 +3,6 @@ import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState'
|
|
|
3
3
|
import { getContactsByIds } from '../../../../entity/billPay/contact/contactSelector';
|
|
4
4
|
import { getPaymentAccountsByPaymentAccountIds } from '../../../../entity/paymentAccount/paymentAccountSelector';
|
|
5
5
|
import { getVendorByVendorId } from '../../../../entity/vendor/vendorSelector';
|
|
6
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
7
6
|
import { getAccountList } from '../../../accountList/accountListSelector';
|
|
8
7
|
import { getAllFundingAccounts, } from '../../commonSetup/setupViewSelector';
|
|
9
8
|
import { getAllDepositAccounts } from '../../zeniAccounts/depositAccountList/depositAccountListSelector';
|
|
@@ -74,14 +73,11 @@ export const getReviewPageBillDetail = (state, billId) => {
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
if (sourceBillDetail != null) {
|
|
77
|
-
|
|
76
|
+
sourceBillDetailFetchState = reduceFetchState([
|
|
78
77
|
sourceBillDetail.fetchStatus,
|
|
79
78
|
accountListState.byReportId['billPayAccountList'],
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
fetchStateList.push(classListState);
|
|
83
|
-
}
|
|
84
|
-
sourceBillDetailFetchState = reduceFetchState(fetchStateList).fetchState;
|
|
79
|
+
classListState,
|
|
80
|
+
]).fetchState;
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
else {
|
|
@@ -3,7 +3,6 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
3
3
|
import { reduceAllFetchState, reduceAnyFetchState, } from '../../../../commonStateTypes/reduceFetchState';
|
|
4
4
|
import { getApprovalRulesByIds } from '../../../../entity/approvalRule/approvalRuleSelector';
|
|
5
5
|
import { getClassesByIds } from '../../../../entity/class/classSelector';
|
|
6
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
7
6
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
8
7
|
import { getUserRoleByUserId } from '../../../../entity/userRole/userRoleSelector';
|
|
9
8
|
export const getBillPaySetupApproverView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -45,7 +44,7 @@ export const getBillPaySetupApproverView = createSelector((state) => state.billP
|
|
|
45
44
|
newApprovalRuleId,
|
|
46
45
|
};
|
|
47
46
|
});
|
|
48
|
-
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (
|
|
47
|
+
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
|
|
49
48
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
50
49
|
const { approverIds, attributes } = approverListState;
|
|
51
50
|
const allApprovalRules = getApprovalRulesByIds(approvalRuleState, approvalRuleIds);
|
|
@@ -93,9 +92,10 @@ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => s
|
|
|
93
92
|
allAttributes,
|
|
94
93
|
filteredAttributes,
|
|
95
94
|
billPaySetupApproverViewUpdateData,
|
|
96
|
-
approverListFetchStatus:
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
approverListFetchStatus: reduceAllFetchState([
|
|
96
|
+
approverListState.fetchStatus,
|
|
97
|
+
classListState,
|
|
98
|
+
]),
|
|
99
99
|
fetchState,
|
|
100
100
|
allAccountingClasses,
|
|
101
101
|
error,
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { concat, from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
|
|
4
3
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
5
4
|
import { fetchBillPayApproversDetails, fetchBillPayApproversList, } from '../billPaySetupApproverViewReducer';
|
|
6
5
|
export const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe(filter(fetchBillPayApproversDetails.match), mergeMap((action) => {
|
|
7
6
|
const { cacheOverride, includeUserRoles } = action.payload;
|
|
8
7
|
const { billPaySetupApproverViewState, classListState } = state$.value;
|
|
9
8
|
const { approverListState } = billPaySetupApproverViewState;
|
|
10
|
-
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
|
|
11
9
|
const actions = [];
|
|
12
10
|
if (cacheOverride === true) {
|
|
13
11
|
actions.push(fetchBillPayApproversList(cacheOverride, includeUserRoles));
|
|
14
|
-
|
|
15
|
-
actions.push(fetchClassList());
|
|
16
|
-
}
|
|
12
|
+
actions.push(fetchClassList());
|
|
17
13
|
}
|
|
18
14
|
else {
|
|
19
15
|
if (billPaySetupApproverViewState.hasValidState() === false &&
|
|
20
16
|
approverListState.fetchStatus.fetchState !== 'In-Progress') {
|
|
21
17
|
actions.push(fetchBillPayApproversList(true, includeUserRoles));
|
|
22
18
|
}
|
|
23
|
-
if (
|
|
24
|
-
classListState.hasValidState() === false &&
|
|
19
|
+
if (classListState.hasValidState() === false &&
|
|
25
20
|
classListState.fetchState !== 'In-Progress') {
|
|
26
21
|
actions.push(fetchClassList());
|
|
27
22
|
}
|
|
@@ -24,7 +24,6 @@ import { getAccountTypeSubConfigCodeKey, getBillPaymentSubConfigCodeKey, getBill
|
|
|
24
24
|
import { getBillPayConfigByKey, getBillPayConfigByKeys, getInternationalMethodCode, } from '../billPayConfig/billPayConfigSelector';
|
|
25
25
|
import { ACCOUNT_TYPE_CODES, BILL_PAYMENT_METHOD_CODE, BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES, BILL_PAYMENT_WIRE_SUB_CODES, INTERNATIONAL_CODES, INTERNATIONAL_SUB_CODES, PAYMENT_ACH_SUB_CODES, getBillPayConfigMethodKey, toBillPaymentSubConfigCodeKeyType, } from '../billPayConfig/billPayConfigState';
|
|
26
26
|
import { getDuplicateBills, } from '../billPayReview/billPayReviewSelector';
|
|
27
|
-
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
28
27
|
import { getBillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelector';
|
|
29
28
|
import { getPreviousBills, } from '../previousBills/previousBillsSelector';
|
|
30
29
|
export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
|
|
@@ -173,15 +172,12 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
173
172
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
174
173
|
billStage = billPayInfo?.stage.code ?? 'draft';
|
|
175
174
|
if (billViewState != null) {
|
|
176
|
-
|
|
175
|
+
fetchState = reduceFetchState([
|
|
177
176
|
sourceBillDetail.fetchStatus,
|
|
178
177
|
accountListState.byReportId.billPayAccountList,
|
|
178
|
+
classListState,
|
|
179
179
|
billPaySetupApproverViewState,
|
|
180
|
-
];
|
|
181
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
182
|
-
fetchStateList.push(classListState);
|
|
183
|
-
}
|
|
184
|
-
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
180
|
+
]).fetchState;
|
|
185
181
|
deleteStatus = billViewState.deleteStatus;
|
|
186
182
|
billActivities = getBillActivities(state, billId, billPayInfo?.stage.code);
|
|
187
183
|
}
|
|
@@ -195,14 +191,11 @@ export const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, i
|
|
|
195
191
|
}
|
|
196
192
|
}
|
|
197
193
|
else {
|
|
198
|
-
|
|
194
|
+
fetchState = reduceFetchState([
|
|
199
195
|
accountListState.byReportId.billPayAccountList,
|
|
196
|
+
classListState,
|
|
200
197
|
billPaySetupApproverViewState,
|
|
201
|
-
];
|
|
202
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
203
|
-
newBillFetchStateList.push(classListState);
|
|
204
|
-
}
|
|
205
|
-
fetchState = reduceFetchState(newBillFetchStateList).fetchState;
|
|
198
|
+
]).fetchState;
|
|
206
199
|
}
|
|
207
200
|
if (sourceBillDetail != null && fetchState == 'Completed') {
|
|
208
201
|
const updatedRecord = sourceBillDetail.billDetailLocalData;
|
|
@@ -219,8 +219,6 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
219
219
|
return card.cardName.toLowerCase();
|
|
220
220
|
case 'cardType':
|
|
221
221
|
return card.type.code;
|
|
222
|
-
case 'accountType':
|
|
223
|
-
return card.type.code.includes('credit') ? 'credit' : 'debit';
|
|
224
222
|
case 'status':
|
|
225
223
|
return card.status.code;
|
|
226
224
|
case 'utilisation':
|
|
@@ -2,7 +2,7 @@ import recordGet from 'lodash/get';
|
|
|
2
2
|
import { reduceFetchState } from '../../../../commonStateTypes/reduceFetchState';
|
|
3
3
|
import { getBankAccountByBankAccountId } from '../../../../entity/bankAccount/bankAccountSelector';
|
|
4
4
|
import { getAllCurrencies } from '../../../../entity/currency/currencySelector';
|
|
5
|
-
import { getCurrentTenant
|
|
5
|
+
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
6
6
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
7
7
|
import { getAccountList, getNestedAccountListHierarchy, } from '../../../accountList/accountListSelector';
|
|
8
8
|
import { getBankAccount, } from '../../../bankAccountView/bankAccountViewSelector';
|
|
@@ -63,16 +63,13 @@ export const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
63
63
|
paymentTo: reimbursementInfo?.toAccount.billAccountId,
|
|
64
64
|
};
|
|
65
65
|
if (sourceRemiDetail != null) {
|
|
66
|
-
|
|
66
|
+
fetchState = reduceFetchState([
|
|
67
67
|
sourceRemiDetail.fetchStatus,
|
|
68
68
|
accountListState.byReportId.reimbursementAccountList,
|
|
69
|
+
classListState,
|
|
69
70
|
merchantListState,
|
|
70
71
|
reimbursementConfigState,
|
|
71
|
-
];
|
|
72
|
-
if (getIsAccountingClassesEnabled(state)) {
|
|
73
|
-
fetchStateList.push(classListState);
|
|
74
|
-
}
|
|
75
|
-
fetchState = reduceFetchState(fetchStateList).fetchState;
|
|
72
|
+
]).fetchState;
|
|
76
73
|
remiStage = reimbursementInfo?.stage.code ?? 'draft';
|
|
77
74
|
createdBy = getUserByUserId(userState, reimbursement?.createdBy ?? '');
|
|
78
75
|
createTime = reimbursement?.createTime;
|