@zeniai/client-epic-state 4.15.34 → 4.15.35
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/timePeriod.d.ts +1 -1
- package/lib/commonStateTypes/timePeriod.js +2 -2
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.js +1 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/configureStore.js +2 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconPayload.js +125 -0
- package/lib/entity/accountRecon/accountReconReducer.d.ts +16 -0
- package/lib/entity/accountRecon/accountReconReducer.js +71 -0
- package/lib/entity/accountRecon/accountReconSelector.d.ts +28 -0
- package/lib/entity/accountRecon/accountReconSelector.js +44 -0
- package/lib/entity/accountRecon/accountReconState.d.ts +70 -0
- package/lib/entity/accountRecon/accountReconState.js +28 -0
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyReducer.js +0 -1
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +16 -6
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- 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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/tenant/tenantReducer.js +0 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +1 -2
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +35 -0
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +53 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +7 -3
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +9 -1
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +23 -2
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +32 -0
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -1
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionType.js +1 -1
- package/lib/entity/transaction/stateTypes/vendorTransaction.d.ts +5 -0
- package/lib/entity/transaction/stateTypes/vendorTransaction.js +5 -1
- package/lib/entity/transaction/toSupportedTransaction.js +6 -1
- package/lib/entity/transaction/transactionReducer.d.ts +17 -0
- package/lib/entity/transaction/transactionReducer.js +47 -2
- package/lib/entity/transaction/transactionSelector.d.ts +2 -0
- package/lib/entity/transaction/transactionSelector.js +5 -0
- package/lib/entity/transaction/transactionState.d.ts +6 -4
- package/lib/entity/vendorExpense/vendorExpenseReducer.js +0 -1
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/epic.d.ts +6 -1
- package/lib/epic.js +6 -1
- package/lib/index.d.ts +16 -7
- package/lib/index.js +52 -27
- package/lib/init.d.ts +2 -1
- package/lib/init.js +9 -2
- package/lib/reducer.d.ts +7 -1
- package/lib/reducer.js +6 -0
- package/lib/view/accountList/accountListReducer.js +1 -3
- package/lib/view/accountMappingView/accountMappingReducer.js +0 -1
- package/lib/view/apAgingView/apAgingDetail/apAgingDetailReducer.js +1 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheet/balanceSheetReducer.js +1 -6
- package/lib/view/bankAccountView/bankAccountViewReducer.js +0 -1
- 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/cashFlow/cashFlowReducer.js +1 -4
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionReducer.js +0 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +1 -3
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyView/companyViewReducer.js +1 -10
- package/lib/view/dashboard/dashboardEpic.js +0 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +15 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +118 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +49 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +169 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +154 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +6 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +110 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +24 -10
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +14 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +20 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +1 -5
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +17 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +18 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +81 -30
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +54 -10
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +28 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +51 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +66 -0
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +384 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +5 -4
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +51 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +7 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +5 -0
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +250 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +103 -0
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +38 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +8 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.js +1 -4
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/netBurnOrIncome/netBurnOrIncomeReducer.js +3 -10
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +1 -6
- package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardReducer.js +0 -1
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +0 -3
- package/lib/view/opEx/opExForTimeFrameEpic.js +1 -1
- package/lib/view/opEx/opExReducer.js +4 -14
- package/lib/view/opExByVendor/opExByVendorReducer.js +1 -3
- package/lib/view/opExClassesView/opExClassesViewReducer.js +1 -6
- package/lib/view/people/fetchPeopleEpic.js +1 -3
- package/lib/view/people/invitePeopleEpic.js +1 -3
- package/lib/view/people/inviteZeniPeopleEpic.js +1 -3
- package/lib/view/people/peopleReducer.js +0 -1
- package/lib/view/people/peopleSaveUpdatesEpic.js +1 -1
- package/lib/view/profitAndLoss/profitAndLossReducer.js +1 -6
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
- package/lib/view/recommendation/recommendationReducer.js +1 -4
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.js +1 -3
- package/lib/view/revenue/revenueReducer.js +3 -10
- package/lib/view/revenueClassesView/revenueClassesViewReducer.js +1 -6
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.js +0 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +5 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +0 -6
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +4 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +1 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +11 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +3 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +2 -6
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +1 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +0 -1
- package/lib/view/spendManagement/zeniAccounts/expressPay/epics/fetchExpressPayInitialDetailsEpic.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/expressPay/epics/fetchExpressPayInitialDetailsEpic.js +7 -7
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +5 -4
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPayState.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts +14 -0
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js +78 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js +3 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts +2 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js +2 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts +9 -0
- package/lib/view/subscriptionView/subscriptionViewReducer.js +0 -1
- package/lib/view/subscriptionView/types/subscriptionTypes.js +0 -1
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -3
- package/lib/view/tasksCard/fetchTasksCardEpic.js +1 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/tasksCard/tasksCardSelector.js +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +13 -4
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +16 -3
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +22 -5
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +6 -0
- package/lib/view/transactionList/transactionListByEntitySelector.js +0 -2
- package/lib/view/transactionList/transactionListReducer.js +4 -6
- package/lib/view/trendWithTransactions/trendWithTransactionsReducer.js +0 -1
- package/lib/view/userFinancialAccount/userFinancialAccountReducer.js +1 -3
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +1 -0
- package/package.json +9 -3
|
@@ -8,8 +8,8 @@ export declare const fetchAllExpenseAutomationTabs: import("@reduxjs/toolkit").A
|
|
|
8
8
|
}, "expenseAutomationView/fetchAllExpenseAutomationTabs", never, never>, updateCurrentSelectedPeriod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, newSelectedPeriod: MonthYearPeriod], {
|
|
9
9
|
newSelectedPeriod: MonthYearPeriod;
|
|
10
10
|
tenantId: string;
|
|
11
|
-
}, "expenseAutomationView/updateCurrentSelectedPeriod", never, never>, updateCurrentSelectedView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedView: "transaction_categorization" | "je_schedules" | "
|
|
12
|
-
newSelectedView: "transaction_categorization" | "je_schedules" | "
|
|
11
|
+
}, "expenseAutomationView/updateCurrentSelectedPeriod", never, never>, updateCurrentSelectedView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights"], {
|
|
12
|
+
newSelectedView: "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
|
|
13
13
|
}, "expenseAutomationView/updateCurrentSelectedView", never, never>, clearExpenseAutomationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/clearExpenseAutomationView">, initializeSelectedPeriodForTenants: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
14
|
selectedPeriodByTenantId: Record<ID, MonthYearPeriod>;
|
|
15
15
|
}, "expenseAutomationView/initializeSelectedPeriodForTenants">, refreshExpenseAutomationCurrentTab: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationView/refreshExpenseAutomationCurrentTab">;
|
|
@@ -22,11 +22,7 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
|
|
|
22
22
|
reducer() {
|
|
23
23
|
//do nothing
|
|
24
24
|
},
|
|
25
|
-
prepare(
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
27
|
-
cacheOverride = false,
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
29
|
-
refreshViewInBackground = false) {
|
|
25
|
+
prepare(cacheOverride = false, refreshViewInBackground = false) {
|
|
30
26
|
return {
|
|
31
27
|
payload: { cacheOverride, refreshViewInBackground },
|
|
32
28
|
};
|
|
@@ -11,6 +11,7 @@ const expenseAutomationViewSelectorTypes_1 = require("./selectorTypes/expenseAut
|
|
|
11
11
|
const fluxAnalysisViewSelector_1 = require("./selectors/fluxAnalysisViewSelector");
|
|
12
12
|
const jeSchedulesViewSelector_1 = require("./selectors/jeSchedulesViewSelector");
|
|
13
13
|
const missingReceiptsSelector_1 = require("./selectors/missingReceiptsSelector");
|
|
14
|
+
const reconciliationViewSelector_1 = require("./selectors/reconciliationViewSelector");
|
|
14
15
|
const transactionCategorizationSelector_1 = require("./selectors/transactionCategorizationSelector");
|
|
15
16
|
const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps, stepIndex, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) => {
|
|
16
17
|
if (stepIndex === 0) {
|
|
@@ -24,7 +25,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
|
|
|
24
25
|
};
|
|
25
26
|
function getExpenseAutomationView(state) {
|
|
26
27
|
var _a, _b, _c;
|
|
27
|
-
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, monthEndCloseChecksState, companyState, } = state;
|
|
28
|
+
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, expenseAutomationReconciliationViewState, monthEndCloseChecksState, companyState, } = state;
|
|
28
29
|
const { loggedInUser, currentTenantId } = tenantState;
|
|
29
30
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
30
31
|
const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
@@ -42,9 +43,15 @@ function getExpenseAutomationView(state) {
|
|
|
42
43
|
const missingReceipts = (0, missingReceiptsSelector_1.getExpenseAutomationMissingReceiptsView)(state);
|
|
43
44
|
const fluxAnalysis = (0, fluxAnalysisViewSelector_1.getExpenseAutomationFluxAnalysisView)(state);
|
|
44
45
|
const monthEndInsights = (0, companyMonthEndReportViewSelector_1.getCompanyMonthEndReportSelectorView)(state, currentTenant.companyId, loggedInUser);
|
|
46
|
+
const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
|
|
45
47
|
const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
|
|
46
48
|
const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
|
|
47
49
|
switch (currentSelectedView) {
|
|
50
|
+
case 'reconciliation':
|
|
51
|
+
currentSelectedViewFetchState = reconciliation.fetchStatus;
|
|
52
|
+
currentSelectedViewBackgroundRefreshFetchState =
|
|
53
|
+
reconciliation.refreshStatus;
|
|
54
|
+
break;
|
|
48
55
|
case 'flux_analysis':
|
|
49
56
|
currentSelectedViewFetchState = fluxAnalysis.fetchStatus;
|
|
50
57
|
currentSelectedViewBackgroundRefreshFetchState =
|
|
@@ -90,6 +97,7 @@ function getExpenseAutomationView(state) {
|
|
|
90
97
|
expenseAutomationJESchedulesViewState,
|
|
91
98
|
monthEndCloseChecksView,
|
|
92
99
|
expenseAutomationTransactionsView,
|
|
100
|
+
expenseAutomationReconciliationViewState,
|
|
93
101
|
];
|
|
94
102
|
let allSteps = [];
|
|
95
103
|
let auditSummary = undefined;
|
|
@@ -122,6 +130,9 @@ function getExpenseAutomationView(state) {
|
|
|
122
130
|
? (0, monthEndCloseChecksViewSelector_1.isMonthEndInsightDisabled)(currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, auditSummary)
|
|
123
131
|
: true });
|
|
124
132
|
return;
|
|
133
|
+
case 'reconciliation':
|
|
134
|
+
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: reconciliation.completionStatus });
|
|
135
|
+
return;
|
|
125
136
|
case 'flux_analysis':
|
|
126
137
|
default:
|
|
127
138
|
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: fluxAnalysis.completionStatus });
|
|
@@ -131,7 +142,10 @@ function getExpenseAutomationView(state) {
|
|
|
131
142
|
allSteps.forEach((stepDetail, index, allStepsOriginal) => {
|
|
132
143
|
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { isNextDisabled: index === allStepsOriginal.length - 1
|
|
133
144
|
? allStepsOriginal[0].isDisabled
|
|
134
|
-
:
|
|
145
|
+
: stepDetail.step === 'reconciliation' &&
|
|
146
|
+
reconciliation.selectedTab === 'review'
|
|
147
|
+
? false
|
|
148
|
+
: allStepsOriginal[index + 1].isDisabled, isPrevDisabled: isPreviousStepDisabled(selectedTransactionCategorizationTab, allStepsOriginal, index, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) });
|
|
135
149
|
});
|
|
136
150
|
}
|
|
137
151
|
const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)(fetchStateVariables); // Add more states
|
|
@@ -146,6 +160,7 @@ function getExpenseAutomationView(state) {
|
|
|
146
160
|
jeSchedules,
|
|
147
161
|
transactionView: expenseAutomationTransactionsView,
|
|
148
162
|
missingReceipts,
|
|
163
|
+
reconciliation,
|
|
149
164
|
currentSelectedViewFetchState,
|
|
150
165
|
currentSelectedViewBackgroundRefreshFetchState,
|
|
151
166
|
fluxAnalysis,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../commonStateTypes/common';
|
|
2
2
|
import { MonthYearPeriod } from '../../commonStateTypes/timePeriod';
|
|
3
|
-
export declare const EXPENSE_AUTOMATION_VIEW_TYPES: readonly ["transaction_categorization", "je_schedules", "
|
|
4
|
-
export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "
|
|
3
|
+
export declare const EXPENSE_AUTOMATION_VIEW_TYPES: readonly ["transaction_categorization", "je_schedules", "reconciliation", "missing_receipts", "flux_analysis", "month_end_insights"];
|
|
4
|
+
export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "reconciliation" | "missing_receipts" | "flux_analysis" | "month_end_insights";
|
|
5
5
|
export type ExpenseAutomationViewType = ReturnType<typeof toExpenseAutomationViewType>;
|
|
6
6
|
export interface ExpenseAutomationViewState extends FetchedState {
|
|
7
7
|
saveStatus: FetchStateAndError;
|
|
@@ -5,7 +5,7 @@ const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
|
5
5
|
exports.EXPENSE_AUTOMATION_VIEW_TYPES = [
|
|
6
6
|
'transaction_categorization',
|
|
7
7
|
'je_schedules',
|
|
8
|
-
'
|
|
8
|
+
'reconciliation',
|
|
9
9
|
'missing_receipts',
|
|
10
10
|
'flux_analysis',
|
|
11
11
|
'month_end_insights',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CurrencyPayload } from '../../../commonPayloadTypes/v2/viewAndReportPayloadv2';
|
|
2
|
+
import { ReconciliationDataPayload } from '../../../entity/accountRecon/accountReconPayload';
|
|
3
|
+
import { MatchedTransactionPayload } from '../../../entity/transaction/payloadTypes/reconciliationTransactionPayloads';
|
|
4
|
+
export declare const getAllReviewTransactionsFromReconcilePayload: (reconcilePayload: ReconciliationDataPayload[]) => {
|
|
5
|
+
allReconciledTransactions: MatchedTransactionPayload[];
|
|
6
|
+
currencyPayload: CurrencyPayload;
|
|
7
|
+
}[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllReviewTransactionsFromReconcilePayload = void 0;
|
|
4
|
+
const getAllReviewTransactionsFromReconcilePayload = (reconcilePayload) => {
|
|
5
|
+
const transactionsPerRecon = reconcilePayload.map((reconcile) => {
|
|
6
|
+
const allReconciledTransactions = [];
|
|
7
|
+
const currencyPayload = reconcile.currency;
|
|
8
|
+
reconcile.transactions.reconcile.forEach((reconciledTransaction) => {
|
|
9
|
+
allReconciledTransactions.push(reconciledTransaction);
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
allReconciledTransactions,
|
|
13
|
+
currencyPayload,
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
return transactionsPerRecon;
|
|
17
|
+
};
|
|
18
|
+
exports.getAllReviewTransactionsFromReconcilePayload = getAllReviewTransactionsFromReconcilePayload;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toTransactionUpdatesFromTransactionCategorizationLocalData = void 0;
|
|
4
4
|
const entity_1 = require("../../../entity/genericEntity/entity");
|
|
5
|
+
const customerTransaction_1 = require("../../../entity/transaction/stateTypes/customerTransaction");
|
|
5
6
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
6
7
|
const recommendationState_1 = require("../../recommendation/recommendationState");
|
|
7
8
|
const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTransactionHelper");
|
|
@@ -10,7 +11,7 @@ const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTrans
|
|
|
10
11
|
* @param transactionCategorizationLocalData
|
|
11
12
|
*/
|
|
12
13
|
const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionCategorizationLocalData, transaction, uncategorizedIncomeExpense) => {
|
|
13
|
-
var _a, _b
|
|
14
|
+
var _a, _b;
|
|
14
15
|
const updates = {
|
|
15
16
|
updatesByLineId: {},
|
|
16
17
|
};
|
|
@@ -22,22 +23,18 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
22
23
|
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) === true) {
|
|
23
24
|
updates.vendorId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.id;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
qboId: transaction.vendorId,
|
|
31
|
-
zeniId: transaction.vendorId,
|
|
32
|
-
}
|
|
33
|
-
: undefined;
|
|
26
|
+
// This needs to be changed to customerUpdates as of now we are not updating customerId so we are using the one from the transaction
|
|
27
|
+
if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) === true) {
|
|
28
|
+
updates.customerId = transaction.customerId;
|
|
29
|
+
}
|
|
30
|
+
const entity = getEntityFromTransaction(transaction);
|
|
34
31
|
let lastUpdatedCategory;
|
|
35
32
|
let lastUpdatedClass;
|
|
36
33
|
// single recommendation to just pick the last recommendation in the list of lines
|
|
37
|
-
(
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
39
|
-
const updatedEntityId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.qboId;
|
|
40
|
-
const entityDetails = getEntityDetails(entity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates);
|
|
34
|
+
(_b = transaction.lines) === null || _b === void 0 ? void 0 : _b.forEach((line) => {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
36
|
+
const updatedEntityId = (_b = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.qboId) !== null && _b !== void 0 ? _b : (_c = transactionCategorizationLocalData.customerUpdates) === null || _c === void 0 ? void 0 : _c.qboId;
|
|
37
|
+
const entityDetails = getEntityDetails(entity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates, transactionCategorizationLocalData.customerUpdates);
|
|
41
38
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
42
39
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
43
40
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -50,24 +47,28 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
50
47
|
};
|
|
51
48
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
52
49
|
line.platformLineDetailType === 'deposit_line_detail') {
|
|
53
|
-
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor });
|
|
50
|
+
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor, customer: lineItem.customer });
|
|
54
51
|
}
|
|
55
52
|
let hasCategoryChanged = false;
|
|
56
53
|
let hasClassChanged = false;
|
|
57
54
|
const accountLine = line;
|
|
58
55
|
hasCategoryChanged =
|
|
59
|
-
((
|
|
60
|
-
Boolean((
|
|
56
|
+
((_d = lineItem.account) === null || _d === void 0 ? void 0 : _d.qboId) !== accountLine.account.qboId &&
|
|
57
|
+
Boolean((_e = lineItem.account) === null || _e === void 0 ? void 0 : _e.qboId);
|
|
61
58
|
hasClassChanged =
|
|
62
|
-
Boolean((
|
|
63
|
-
((
|
|
59
|
+
Boolean((_f = lineItem.class) === null || _f === void 0 ? void 0 : _f.qboId) &&
|
|
60
|
+
((_g = lineItem.class) === null || _g === void 0 ? void 0 : _g.qboId) !== accountLine.class.qboId;
|
|
64
61
|
const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
65
62
|
const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
66
|
-
const updatedLineEntityId = ((
|
|
67
|
-
? ((
|
|
68
|
-
? (
|
|
69
|
-
: (
|
|
70
|
-
:
|
|
63
|
+
const updatedLineEntityId = ((_h = accountLine.vendor) === null || _h === void 0 ? void 0 : _h.id) != null
|
|
64
|
+
? ((_j = accountLine.vendor) === null || _j === void 0 ? void 0 : _j.id) != ((_k = lineItem.vendor) === null || _k === void 0 ? void 0 : _k.id)
|
|
65
|
+
? (_l = lineItem.vendor) === null || _l === void 0 ? void 0 : _l.id
|
|
66
|
+
: (_m = accountLine.vendor) === null || _m === void 0 ? void 0 : _m.id
|
|
67
|
+
: ((_o = accountLine.customer) === null || _o === void 0 ? void 0 : _o.id) != null
|
|
68
|
+
? ((_p = accountLine.customer) === null || _p === void 0 ? void 0 : _p.id) != ((_q = lineItem.customer) === null || _q === void 0 ? void 0 : _q.id)
|
|
69
|
+
? (_r = lineItem.customer) === null || _r === void 0 ? void 0 : _r.id
|
|
70
|
+
: (_s = accountLine.customer) === null || _s === void 0 ? void 0 : _s.id
|
|
71
|
+
: undefined;
|
|
71
72
|
if (entityDetails != null &&
|
|
72
73
|
(hasCategoryChanged === true || hasClassChanged === true)) {
|
|
73
74
|
lastUpdatedCategory =
|
|
@@ -83,16 +84,16 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
83
84
|
if (recommended.class != null ||
|
|
84
85
|
recommended.account != null ||
|
|
85
86
|
updatedEntityId != null) {
|
|
86
|
-
const vendorIdToUpdate = (
|
|
87
|
-
let entityId = entityDetails.entityId;
|
|
87
|
+
const vendorIdToUpdate = (_t = transactionCategorizationLocalData.vendorUpdates) === null || _t === void 0 ? void 0 : _t.qboId;
|
|
88
88
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
89
89
|
line.platformLineDetailType === 'deposit_line_detail') {
|
|
90
|
-
const entityId = (
|
|
90
|
+
const entityId = (_v = (_u = accountLine.vendor) === null || _u === void 0 ? void 0 : _u.id) !== null && _v !== void 0 ? _v : (_w = accountLine.customer) === null || _w === void 0 ? void 0 : _w.id;
|
|
91
91
|
if (entityId != null) {
|
|
92
92
|
doUpdateEntityUpdates(entityUpdates, entityId, entityDetails.entityType, recommended, false, updatedLineEntityId);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
96
|
+
let entityId = entityDetails.entityId;
|
|
96
97
|
if (vendorIdToUpdate != null) {
|
|
97
98
|
entityId = vendorIdToUpdate;
|
|
98
99
|
}
|
|
@@ -135,8 +136,8 @@ const doUpdateEntityUpdates = (entityUpdates, entityId, entityType, recommendati
|
|
|
135
136
|
entityUpdates[entityKey] = Object.assign(Object.assign({}, entityUpdate), { recommendations: recommendation });
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
|
-
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
139
|
-
var _a, _b, _c;
|
|
139
|
+
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpdates) => {
|
|
140
|
+
var _a, _b, _c, _d;
|
|
140
141
|
if (entity != null) {
|
|
141
142
|
return {
|
|
142
143
|
entityId: (_a = entity.qboId) !== null && _a !== void 0 ? _a : entity.id,
|
|
@@ -155,7 +156,19 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
|
155
156
|
entityType: 'vendor',
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
|
-
if (
|
|
159
|
+
if (customerUpdates != null && customerUpdates.id != null) {
|
|
160
|
+
return {
|
|
161
|
+
entityId: customerUpdates.id,
|
|
162
|
+
entityType: 'customer',
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (((_c = lineItemLocalData.customer) === null || _c === void 0 ? void 0 : _c.id) != null) {
|
|
166
|
+
return {
|
|
167
|
+
entityId: lineItemLocalData.customer.id,
|
|
168
|
+
entityType: 'customer',
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (((_d = lineItemLocalData.vendor) === null || _d === void 0 ? void 0 : _d.id) != null) {
|
|
159
172
|
return {
|
|
160
173
|
entityId: lineItemLocalData.vendor.id,
|
|
161
174
|
entityType: 'vendor',
|
|
@@ -163,3 +176,41 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
|
163
176
|
}
|
|
164
177
|
return undefined;
|
|
165
178
|
};
|
|
179
|
+
const getEntityFromTransaction = (transaction) => {
|
|
180
|
+
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) ||
|
|
181
|
+
(0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction)) {
|
|
182
|
+
const vendor = transaction.vendor;
|
|
183
|
+
const customer = transaction.customer;
|
|
184
|
+
if (customer != null) {
|
|
185
|
+
return {
|
|
186
|
+
id: customer.id,
|
|
187
|
+
name: customer.name,
|
|
188
|
+
type: (0, entity_1.toEntityType)('customer'),
|
|
189
|
+
qboId: customer.id,
|
|
190
|
+
zeniId: customer.id,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (vendor != null) {
|
|
194
|
+
return {
|
|
195
|
+
id: vendor.id,
|
|
196
|
+
name: vendor.name,
|
|
197
|
+
type: (0, entity_1.toEntityType)('vendor'),
|
|
198
|
+
qboId: vendor.id,
|
|
199
|
+
zeniId: vendor.id,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if ((0, customerTransaction_1.isCustomerTransaction)(transaction)) {
|
|
204
|
+
const customer = transaction.customer;
|
|
205
|
+
if (customer) {
|
|
206
|
+
return {
|
|
207
|
+
id: customer.id,
|
|
208
|
+
name: customer.name,
|
|
209
|
+
type: (0, entity_1.toEntityType)('customer'),
|
|
210
|
+
qboId: customer.id,
|
|
211
|
+
zeniId: customer.id,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return undefined;
|
|
216
|
+
};
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
|
8
8
|
import { TransactionReviewLocalData, TransactionsTabViewState } from '../types/transactionsViewState';
|
|
9
9
|
export declare const MAX_SELECTION_LIMIT = 5;
|
|
10
10
|
export declare const toTransactionDetailLocalData: (transaction: SupportedTransaction) => TransactionReviewLocalData;
|
|
11
|
-
export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, vendorId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase) => TransactionReviewLocalData;
|
|
11
|
+
export declare const toSetAllLineItemsToCategoryClass: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionId: ID, transactionLineId: ID, transactionDetailLocalData: TransactionReviewLocalData, updatedItem: "category" | "class", uncategorizedAccounts: UncategorizedAccounts, vendorId?: ID, customerId?: ID, selectedAccount?: AccountBase, selectedClassBase?: ClassBase) => TransactionReviewLocalData;
|
|
12
12
|
export declare const setEntityRecommendationForLineIdInLocalData: (draft: TransactionsTabViewState, transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, entity: Entity, recommendationLineIds: ID[], uncategorizedAccounts: UncategorizedAccounts, recommendationByLineId?: RecommendationByLineId) => TransactionReviewLocalData;
|
|
13
13
|
export declare const checkIfAllLineItemsAreCategoryClassFilled: (transaction: SupportedTransaction, transactionDetailLocalData: TransactionReviewLocalData, uncategorizedAccounts: UncategorizedAccounts) => boolean;
|
|
@@ -19,7 +19,29 @@ const toTransactionDetailLocalData = (transaction) => {
|
|
|
19
19
|
logo: transaction.logo,
|
|
20
20
|
}
|
|
21
21
|
: undefined;
|
|
22
|
+
transactionLocal.customer =
|
|
23
|
+
transaction.customerId != null &&
|
|
24
|
+
transaction.customerName != null &&
|
|
25
|
+
Boolean(transaction.customerId) === true &&
|
|
26
|
+
Boolean(transaction.customerName) === true
|
|
27
|
+
? {
|
|
28
|
+
id: transaction.customerId,
|
|
29
|
+
name: transaction.customerName,
|
|
30
|
+
logo: transaction.logo,
|
|
31
|
+
}
|
|
32
|
+
: undefined;
|
|
22
33
|
transactionLocal.vendorUpdates = undefined;
|
|
34
|
+
if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) &&
|
|
35
|
+
transaction.customerName != null) {
|
|
36
|
+
transactionLocal.customerUpdates = {
|
|
37
|
+
id: transaction.customerId,
|
|
38
|
+
name: transaction.customerName,
|
|
39
|
+
qboId: transaction.customerId,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
transactionLocal.customerUpdates = undefined;
|
|
44
|
+
}
|
|
23
45
|
transactionLocal.lineItemById =
|
|
24
46
|
transaction.lines != null && transaction.lines.length > 0
|
|
25
47
|
? buildLineItemById(transaction, transaction.recommendations)
|
|
@@ -53,7 +75,16 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
53
75
|
logo: accountLine.vendor.logo,
|
|
54
76
|
}
|
|
55
77
|
: undefined;
|
|
56
|
-
record.customer =
|
|
78
|
+
record.customer =
|
|
79
|
+
accountLine.customer != null &&
|
|
80
|
+
Boolean(accountLine.customer.id) === true &&
|
|
81
|
+
Boolean(accountLine.customer.name) === true
|
|
82
|
+
? {
|
|
83
|
+
id: accountLine.customer.id,
|
|
84
|
+
name: accountLine.customer.name,
|
|
85
|
+
logo: accountLine.customer.logo,
|
|
86
|
+
}
|
|
87
|
+
: undefined;
|
|
57
88
|
record.billable = accountLine.billable;
|
|
58
89
|
record.categorizationStatus = accountLine.categorizationStatus;
|
|
59
90
|
record.reviewPendingReasons = accountLine.reviewPendingReasons;
|
|
@@ -89,7 +120,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
89
120
|
});
|
|
90
121
|
return lineItemData;
|
|
91
122
|
};
|
|
92
|
-
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId, selectedAccount, selectedClassBase) => {
|
|
123
|
+
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId, customerId, selectedAccount, selectedClassBase) => {
|
|
93
124
|
const newLineItems = {};
|
|
94
125
|
let selectedCheckBoxTransactionIds = draft.selectedCheckBoxTransactionIds;
|
|
95
126
|
if (transaction.lines != null) {
|
|
@@ -124,8 +155,11 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
157
|
else {
|
|
127
|
-
if ((transactionDetailLocalData.
|
|
128
|
-
transactionDetailLocalData.
|
|
158
|
+
if ((transactionDetailLocalData.customer != null &&
|
|
159
|
+
transactionDetailLocalData.customer.id === customerId) ||
|
|
160
|
+
(record.customer != null && record.customer.id === customerId) ||
|
|
161
|
+
(transactionDetailLocalData.vendor != null &&
|
|
162
|
+
transactionDetailLocalData.vendor.id === vendorId) ||
|
|
129
163
|
(record.vendor != null && record.vendor.id === vendorId)) {
|
|
130
164
|
// if the vendor is same, then set the account and class with the selected ones and add the transaction to the selected list
|
|
131
165
|
if (selectedAccount != null &&
|
|
@@ -174,7 +208,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
174
208
|
}
|
|
175
209
|
});
|
|
176
210
|
}
|
|
177
|
-
const newLocalData = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData), { sortedLineItems: transactionDetailLocalData.sortedLineItems, memo: transactionDetailLocalData.memo, lineItemById: newLineItems, transactionDate: transactionDetailLocalData.transactionDate, transactionType: transactionDetailLocalData.transactionType, transactionTypeName: transactionDetailLocalData.transactionTypeName, vendor: transactionDetailLocalData.vendor, vendorUpdates: transactionDetailLocalData.vendorUpdates, vendorDetails: transactionDetailLocalData.vendorDetails });
|
|
211
|
+
const newLocalData = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData), { sortedLineItems: transactionDetailLocalData.sortedLineItems, memo: transactionDetailLocalData.memo, lineItemById: newLineItems, transactionDate: transactionDetailLocalData.transactionDate, transactionType: transactionDetailLocalData.transactionType, transactionTypeName: transactionDetailLocalData.transactionTypeName, vendor: transactionDetailLocalData.vendor, customer: transactionDetailLocalData.customer, vendorUpdates: transactionDetailLocalData.vendorUpdates, customerUpdates: transactionDetailLocalData.customerUpdates, vendorDetails: transactionDetailLocalData.vendorDetails, customerDetails: transactionDetailLocalData.customerDetails });
|
|
178
212
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
179
213
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
180
214
|
}
|
|
@@ -238,7 +272,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
238
272
|
const newLineItem = newLineItems[matchingEntityLineId];
|
|
239
273
|
newLineItems[matchingEntityLineId] = Object.assign(Object.assign({}, newLineItem), { class: matchingRecord.class, account: matchingRecord.account, lineEntity: matchingRecord.lineEntity });
|
|
240
274
|
}
|
|
241
|
-
const newLocalData = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData), { sortedLineItems: transactionDetailLocalData.sortedLineItems, memo: transactionDetailLocalData.memo, lineItemById: newLineItems, transactionDate: transactionDetailLocalData.transactionDate, transactionType: transactionDetailLocalData.transactionType, transactionTypeName: transactionDetailLocalData.transactionTypeName, vendorUpdates: transactionDetailLocalData.vendorUpdates, vendorDetails: transactionDetailLocalData.vendorDetails, vendor: transactionDetailLocalData.vendor });
|
|
275
|
+
const newLocalData = Object.assign(Object.assign({}, transactionsViewState_1.initialSupportedTransactionCategorization.transactionReviewLocalData), { sortedLineItems: transactionDetailLocalData.sortedLineItems, memo: transactionDetailLocalData.memo, lineItemById: newLineItems, transactionDate: transactionDetailLocalData.transactionDate, transactionType: transactionDetailLocalData.transactionType, transactionTypeName: transactionDetailLocalData.transactionTypeName, vendorUpdates: transactionDetailLocalData.vendorUpdates, customerUpdates: transactionDetailLocalData.customerUpdates, vendorDetails: transactionDetailLocalData.vendorDetails, customerDetails: transactionDetailLocalData.customerDetails, vendor: transactionDetailLocalData.vendor, customer: transactionDetailLocalData.customer });
|
|
242
276
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
243
277
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
244
278
|
}
|
|
@@ -250,7 +284,7 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
250
284
|
const lineItems = Object.values(transactionDetailLocalData.lineItemById);
|
|
251
285
|
const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
|
|
252
286
|
return lineItems.every((lineItem) => {
|
|
253
|
-
var _a, _b, _c
|
|
287
|
+
var _a, _b, _c;
|
|
254
288
|
return lineItem.account != null &&
|
|
255
289
|
Boolean(lineItem.account.qboId) === true &&
|
|
256
290
|
lineItem.class != null &&
|
|
@@ -260,10 +294,20 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
260
294
|
(_b = uncategorizedAccounts.expense) === null || _b === void 0 ? void 0 : _b.qboId,
|
|
261
295
|
(_c = uncategorizedAccounts.income) === null || _c === void 0 ? void 0 : _c.qboId,
|
|
262
296
|
].includes(lineItem.account.qboId)) &&
|
|
263
|
-
(isVendorTransactionAvailable
|
|
264
|
-
?
|
|
297
|
+
((isVendorTransactionAvailable
|
|
298
|
+
? transactionDetailLocalData.vendor != null &&
|
|
299
|
+
transactionDetailLocalData.vendor.id != null &&
|
|
265
300
|
Boolean(transactionDetailLocalData.vendor.id) === true
|
|
266
|
-
:
|
|
301
|
+
: lineItem.vendor != null &&
|
|
302
|
+
lineItem.vendor.id != null &&
|
|
303
|
+
Boolean(lineItem.vendor.id) === true) ||
|
|
304
|
+
(isVendorTransactionAvailable
|
|
305
|
+
? transactionDetailLocalData.customer != null &&
|
|
306
|
+
transactionDetailLocalData.customer.id != null &&
|
|
307
|
+
Boolean(transactionDetailLocalData.customer.id) === true
|
|
308
|
+
: lineItem.customer != null &&
|
|
309
|
+
lineItem.customer.id != null &&
|
|
310
|
+
Boolean(lineItem.customer.id) === true));
|
|
267
311
|
});
|
|
268
312
|
};
|
|
269
313
|
exports.checkIfAllLineItemsAreCategoryClassFilled = checkIfAllLineItemsAreCategoryClassFilled;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
2
|
+
import { AccountPayload } from '../../../entity/account/accountPayload';
|
|
3
|
+
import { ReconciliationDataPayload, TransactionsToReviewPayload } from '../../../entity/accountRecon/accountReconPayload';
|
|
4
|
+
import { AccountReconciliationEntity } from '../../../entity/accountRecon/accountReconSelector';
|
|
5
|
+
import { MatchedTransactionPayload } from '../../../entity/transaction/payloadTypes/reconciliationTransactionPayloads';
|
|
6
|
+
import { UserPayload } from '../../../entity/user/userPayload';
|
|
7
|
+
import { RootState } from '../../../reducer';
|
|
8
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
9
|
+
import { BalancesLocalData, SaveReconcileDetailActionPayload } from '../types/reconciliationViewState';
|
|
10
|
+
export interface AccountAndPaymentAccountPayload extends AccountPayload {
|
|
11
|
+
payment_account_id: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface ReconciliationPayload {
|
|
14
|
+
accounts: AccountAndPaymentAccountPayload[];
|
|
15
|
+
reconciliation: ReconciliationDataPayload[];
|
|
16
|
+
users: UserPayload[];
|
|
17
|
+
}
|
|
18
|
+
export type ReconciliationResponse = ZeniAPIResponse<ReconciliationPayload>;
|
|
19
|
+
export interface SaveReconciliationReviewPayload {
|
|
20
|
+
reconciliation: MatchedTransactionPayload;
|
|
21
|
+
}
|
|
22
|
+
export type SaveReconciliationReviewResponse = ZeniAPIResponse<SaveReconciliationReviewPayload>;
|
|
23
|
+
export declare function createSaveReconciliationPayloadBasedOnActionAndMethod(state: RootState, selectedPeriod: MonthYearPeriod, localData: BalancesLocalData, accountReconciliationEntity: AccountReconciliationEntity, action: SaveReconcileDetailActionPayload, method: 'PUT' | 'POST'): {
|
|
24
|
+
transactions: {
|
|
25
|
+
reconcile: MatchedTransactionPayload[];
|
|
26
|
+
review: TransactionsToReviewPayload[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSaveReconciliationPayloadBasedOnActionAndMethod = createSaveReconciliationPayloadBasedOnActionAndMethod;
|
|
4
|
+
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
5
|
+
const accountReconPayload_1 = require("../../../entity/accountRecon/accountReconPayload");
|
|
6
|
+
const reconciliationTransactionPayloads_1 = require("../../../entity/transaction/payloadTypes/reconciliationTransactionPayloads");
|
|
7
|
+
function createSaveReconciliationPayloadBasedOnActionAndMethod(state, selectedPeriod, localData, accountReconciliationEntity, action, method) {
|
|
8
|
+
var _a;
|
|
9
|
+
const { balance, initialClearedBalance } = accountReconciliationEntity;
|
|
10
|
+
const { expenseAutomationReconciliationViewState: { selectedAccountId, reconTabsState: { reconcile: { localData: { selectedTransactionIds }, }, }, }, } = state;
|
|
11
|
+
const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod, true);
|
|
12
|
+
let payload = {};
|
|
13
|
+
payload = Object.assign({ action: action.reconcileAction === 'save_reconcile_for_later'
|
|
14
|
+
? 'save_for_later'
|
|
15
|
+
: action.reconcileAction, account_type: 'bank', bank_balance: (_a = balance === null || balance === void 0 ? void 0 : balance.amount) !== null && _a !== void 0 ? _a : 0, cleared_balance: localData.clearedBalance.amount, variance: localData.variance.amount, currency_code: balance === null || balance === void 0 ? void 0 : balance.currencyCode }, ((initialClearedBalance === null || initialClearedBalance === void 0 ? void 0 : initialClearedBalance.amount) != null
|
|
16
|
+
? {
|
|
17
|
+
initial_cleared_balance: initialClearedBalance.amount,
|
|
18
|
+
}
|
|
19
|
+
: {}));
|
|
20
|
+
if (method === 'POST') {
|
|
21
|
+
payload = Object.assign(Object.assign({}, payload), { account_id: selectedAccountId, start_date: period.start, end_date: period.end });
|
|
22
|
+
}
|
|
23
|
+
if (action.reconcileAction === 'exclude') {
|
|
24
|
+
payload = Object.assign(Object.assign({}, payload), { exclude_transaction_ids: [action.excludeTransactionId] });
|
|
25
|
+
}
|
|
26
|
+
const reconciledTransactionsPayload = createReconcileTransactionPayload(selectedTransactionIds, accountReconciliationEntity);
|
|
27
|
+
const reviewTransactionsPayload = createReviewTransactionPayload(accountReconciliationEntity);
|
|
28
|
+
return Object.assign(Object.assign({}, payload), { transactions: {
|
|
29
|
+
reconcile: reconciledTransactionsPayload,
|
|
30
|
+
review: reviewTransactionsPayload,
|
|
31
|
+
} });
|
|
32
|
+
}
|
|
33
|
+
function createReconcileTransactionPayload(selectedIds, accountReconciliationEntity) {
|
|
34
|
+
const matchedTransactionsPayload = [];
|
|
35
|
+
const matchedReconcileTransactions = accountReconciliationEntity.transactionsToReconcile.map((transaction) => {
|
|
36
|
+
return Object.assign(Object.assign({}, transaction), { isTransactionChecked: selectedIds.includes(transaction.id) });
|
|
37
|
+
});
|
|
38
|
+
matchedReconcileTransactions.forEach((transaction) => {
|
|
39
|
+
const matchTransactionPayload = (0, reconciliationTransactionPayloads_1.toMatchedTransactionPayload)(transaction);
|
|
40
|
+
matchedTransactionsPayload.push(matchTransactionPayload);
|
|
41
|
+
});
|
|
42
|
+
return matchedTransactionsPayload;
|
|
43
|
+
}
|
|
44
|
+
function createReviewTransactionPayload(accountReconciliationEntity) {
|
|
45
|
+
const reviewTransactionsPayload = [];
|
|
46
|
+
accountReconciliationEntity.transactionsToReview.forEach((transaction) => {
|
|
47
|
+
const matchTransactionPayload = (0, accountReconPayload_1.toTransactionsToReviewPayload)(transaction);
|
|
48
|
+
reviewTransactionsPayload.push(matchTransactionPayload);
|
|
49
|
+
});
|
|
50
|
+
return reviewTransactionsPayload;
|
|
51
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
|
+
import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
5
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
6
|
+
import { ReconciliationPayload } from '../payload/reconciliationPayload';
|
|
7
|
+
import { ActionFetchStates, ReconReconcileSortKey, ReconReviewSortKey, ReconciliationReviewTabLocalData, ReconciliationTabsState, ReconciliationViewState, ReconciliationViewTabType, SaveReconcileDetailActionPayload, SaveReconciliationDetailFailurePayload, TransactionSummary } from '../types/reconciliationViewState';
|
|
8
|
+
export declare const initialReconciliationTabsState: ReconciliationTabsState;
|
|
9
|
+
export declare const initialActionFetchState: ActionFetchStates;
|
|
10
|
+
export declare const initialState: ReconciliationViewState;
|
|
11
|
+
export declare const fetchReconciliation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedPeriod: MonthYearPeriod, accountId?: string | undefined, cacheOverride?: any, refreshViewInBackground?: any], {
|
|
12
|
+
selectedPeriod: MonthYearPeriod;
|
|
13
|
+
accountId: string | undefined;
|
|
14
|
+
cacheOverride: any;
|
|
15
|
+
refreshViewInBackground: any;
|
|
16
|
+
}, "expenseAutomationReconciliationView/fetchReconciliation", never, never>, fetchReconciliationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
|
+
selectedPeriod: MonthYearPeriod;
|
|
18
|
+
error: ZeniAPIStatus;
|
|
19
|
+
refreshViewInBackground: boolean;
|
|
20
|
+
accountId?: ID;
|
|
21
|
+
reconciliationId?: ID;
|
|
22
|
+
}, "expenseAutomationReconciliationView/fetchReconciliationFailure">, fetchReconciliationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedPeriod: MonthYearPeriod, reconciliation: ReconciliationPayload, refreshViewInBackground?: any, accountId?: string | undefined, reconciliationId?: string | undefined], {
|
|
23
|
+
selectedPeriod: MonthYearPeriod;
|
|
24
|
+
reconciliation: ReconciliationPayload;
|
|
25
|
+
refreshViewInBackground: any;
|
|
26
|
+
accountId: string | undefined;
|
|
27
|
+
reconciliationId: string | undefined;
|
|
28
|
+
}, "expenseAutomationReconciliationView/fetchReconciliationSuccess", never, never>, saveReconciliationDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<SaveReconcileDetailActionPayload, "expenseAutomationReconciliationView/saveReconciliationDetail">, saveReconciliationDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<SaveReconciliationDetailFailurePayload, "expenseAutomationReconciliationView/saveReconciliationDetailFailure">, updateSelectedAccountId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
29
|
+
selectedAccountId?: ID;
|
|
30
|
+
}, "expenseAutomationReconciliationView/updateSelectedAccountId">, setConnectionInProgressForAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
|
+
accountId: ID;
|
|
32
|
+
connectionInProgress: boolean;
|
|
33
|
+
}, "expenseAutomationReconciliationView/setConnectionInProgressForAccount">, updateReconcileTabLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
|
+
selectedTransactionIds: ID[];
|
|
35
|
+
}, "expenseAutomationReconciliationView/updateReconcileTabLocalData">, updateReconcileTabListSortState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
36
|
+
sortKey: ReconReconcileSortKey;
|
|
37
|
+
sortOrder: SortOrder;
|
|
38
|
+
}, "expenseAutomationReconciliationView/updateReconcileTabListSortState">, updateReconcileTabListScrollState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
39
|
+
scrollYOffset: number;
|
|
40
|
+
}, "expenseAutomationReconciliationView/updateReconcileTabListScrollState">, saveReconciliationDetailSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<SaveReconcileDetailActionPayload, "expenseAutomationReconciliationView/saveReconciliationDetailSuccess">, updateSelectedTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
41
|
+
selectedTab: ReconciliationViewTabType;
|
|
42
|
+
}, "expenseAutomationReconciliationView/updateSelectedTab">, updateBalancesLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
43
|
+
clearedBalance: Amount;
|
|
44
|
+
variance: Amount;
|
|
45
|
+
variancePercentage: number;
|
|
46
|
+
payments: TransactionSummary;
|
|
47
|
+
deposits: TransactionSummary;
|
|
48
|
+
}, "expenseAutomationReconciliationView/updateBalancesLocalData">, initialiseLocalDataForSelectedAccountId: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationReconciliationView/initialiseLocalDataForSelectedAccountId">, clearExpenseAutomationReconciliationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationReconciliationView/clearExpenseAutomationReconciliationView">, updateSelectedDrawerAccountId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
49
|
+
selectedDrawerAccountId?: ID;
|
|
50
|
+
}, "expenseAutomationReconciliationView/updateSelectedDrawerAccountId">, updateReviewTabSortState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
51
|
+
sortKey: ReconReviewSortKey;
|
|
52
|
+
sortOrder: SortOrder;
|
|
53
|
+
}, "expenseAutomationReconciliationView/updateReviewTabSortState">, initializeReconciliationReviewTabLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[localData: Record<string, ReconciliationReviewTabLocalData>], {
|
|
54
|
+
localData: Record<string, ReconciliationReviewTabLocalData>;
|
|
55
|
+
}, "expenseAutomationReconciliationView/initializeReconciliationReviewTabLocalData", never, never>, updateReviewTabLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
|
+
data: ReconciliationReviewTabLocalData;
|
|
57
|
+
transactionId: ID;
|
|
58
|
+
}, "expenseAutomationReconciliationView/updateReviewTabLocalData">, saveReconciliationReview: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: string], {
|
|
59
|
+
transactionId: string;
|
|
60
|
+
}, "expenseAutomationReconciliationView/saveReconciliationReview", never, never>, updateSaveReconciliationReviewFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
61
|
+
transactionId: ID;
|
|
62
|
+
fetchState: FetchState;
|
|
63
|
+
error?: ZeniAPIStatus;
|
|
64
|
+
}, "expenseAutomationReconciliationView/updateSaveReconciliationReviewFetchStatus">;
|
|
65
|
+
declare const _default: import("redux").Reducer<ReconciliationViewState>;
|
|
66
|
+
export default _default;
|