@zeniai/client-epic-state 4.15.36 → 4.15.37
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/commonPayloadTypes/recommendationPayload.d.ts +0 -1
- 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 +0 -1
- package/lib/configureStore.js +1 -2
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyReducer.js +1 -0
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +6 -16
- 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 +0 -4
- package/lib/entity/task/taskState.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.d.ts +1 -1
- package/lib/entity/transaction/payloadTypes/customerTransactionPayload.js +2 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +6 -9
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.d.ts +1 -9
- package/lib/entity/transaction/payloadTypes/vendorTransactionPayload.js +2 -23
- package/lib/entity/transaction/stateTypes/transaction.d.ts +1 -3
- 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 +0 -5
- package/lib/entity/transaction/stateTypes/vendorTransaction.js +1 -5
- package/lib/entity/transaction/toSupportedTransaction.js +1 -6
- package/lib/entity/transaction/transactionReducer.d.ts +0 -17
- package/lib/entity/transaction/transactionReducer.js +2 -47
- package/lib/entity/transaction/transactionSelector.d.ts +0 -2
- package/lib/entity/transaction/transactionSelector.js +0 -5
- package/lib/entity/transaction/transactionState.d.ts +4 -6
- package/lib/entity/vendorExpense/vendorExpenseReducer.js +1 -0
- package/lib/entity/vendorExpense/vendorExpenseSelector.d.ts +2 -2
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +1 -6
- package/lib/index.d.ts +12 -20
- package/lib/index.js +27 -56
- package/lib/init.d.ts +1 -2
- package/lib/init.js +2 -9
- package/lib/reducer.d.ts +1 -7
- package/lib/reducer.js +0 -6
- package/lib/view/accountList/accountListReducer.js +3 -1
- package/lib/view/accountMappingView/accountMappingReducer.js +1 -0
- package/lib/view/apAgingView/apAgingDetail/apAgingDetailReducer.js +2 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheet/balanceSheetReducer.js +6 -1
- package/lib/view/bankAccountView/bankAccountViewReducer.js +1 -0
- 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 +4 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionReducer.js +1 -0
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +3 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyView/companyViewReducer.js +10 -1
- package/lib/view/dashboard/dashboardEpic.js +2 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +10 -24
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +0 -14
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +5 -32
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +5 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +2 -17
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -2
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +1 -1
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +35 -111
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +10 -84
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -12
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +7 -66
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -10
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.js +4 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/netBurnOrIncome/netBurnOrIncomeReducer.js +10 -3
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +6 -1
- package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardReducer.js +1 -0
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +3 -0
- package/lib/view/opEx/opExForTimeFrameEpic.js +1 -1
- package/lib/view/opEx/opExReducer.js +14 -4
- package/lib/view/opExByVendor/opExByVendorReducer.js +3 -1
- package/lib/view/opExClassesView/opExClassesViewReducer.js +6 -1
- package/lib/view/people/fetchPeopleEpic.js +3 -1
- package/lib/view/people/invitePeopleEpic.js +3 -1
- package/lib/view/people/inviteZeniPeopleEpic.js +3 -1
- package/lib/view/people/peopleReducer.js +1 -0
- package/lib/view/people/peopleSaveUpdatesEpic.js +1 -1
- package/lib/view/profitAndLoss/profitAndLossReducer.js +6 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
- package/lib/view/recommendation/recommendationReducer.js +4 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.js +3 -1
- package/lib/view/revenue/revenueReducer.js +10 -3
- package/lib/view/revenueClassesView/revenueClassesViewReducer.js +6 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/settingsView/settingsViewReducer.js +1 -0
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +1 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +6 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/validateBillsBulkActionEpic.ts.js +3 -4
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchBillAndInitializeLocalStoreEpic.js +3 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +3 -11
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -3
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRecommendationsAndUpdateMerchantRecommendationsEpic.js +6 -2
- package/lib/view/spendManagement/reimbursement/editRemiView/epics/fetchRemiAndInitializeLocalStoreEpic.js +3 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +1 -0
- package/lib/view/subscriptionView/subscriptionViewReducer.js +1 -0
- package/lib/view/subscriptionView/types/subscriptionTypes.js +1 -0
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +3 -1
- package/lib/view/tasksCard/fetchTasksCardEpic.js +2 -1
- 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 +15 -45
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +4 -22
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +13 -69
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -11
- package/lib/view/transactionDetail/transactionDetailReducer.js +21 -51
- package/lib/view/transactionDetail/transactionDetailState.d.ts +0 -1
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +0 -8
- package/lib/view/transactionList/transactionListByEntitySelector.js +2 -0
- package/lib/view/transactionList/transactionListReducer.js +6 -4
- package/lib/view/trendWithTransactions/trendWithTransactionsReducer.js +1 -0
- package/lib/view/userFinancialAccount/userFinancialAccountReducer.js +3 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +3 -8
- package/lib/entity/accountRecon/accountReconPayload.d.ts +0 -70
- package/lib/entity/accountRecon/accountReconPayload.js +0 -125
- package/lib/entity/accountRecon/accountReconReducer.d.ts +0 -16
- package/lib/entity/accountRecon/accountReconReducer.js +0 -71
- package/lib/entity/accountRecon/accountReconSelector.d.ts +0 -28
- package/lib/entity/accountRecon/accountReconSelector.js +0 -44
- package/lib/entity/accountRecon/accountReconState.d.ts +0 -70
- package/lib/entity/accountRecon/accountReconState.js +0 -28
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.d.ts +0 -35
- package/lib/entity/transaction/payloadTypes/reconciliationTransactionPayloads.js +0 -53
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.d.ts +0 -32
- package/lib/entity/transaction/stateTypes/reconciliationTransaction.js +0 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.d.ts +0 -15
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +0 -118
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.d.ts +0 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/initialiseLocalDataForSelectedAccountIdEpic.js +0 -49
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.d.ts +0 -14
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationDetailEpic.js +0 -169
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -154
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.d.ts +0 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +0 -110
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.d.ts +0 -7
- package/lib/view/expenseAutomationView/helpers/reconciliationHelpers.js +0 -18
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +0 -28
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +0 -51
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +0 -66
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +0 -384
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +0 -51
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +0 -7
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +0 -5
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +0 -250
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -103
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -38
|
@@ -11,7 +11,6 @@ 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");
|
|
15
14
|
const transactionCategorizationSelector_1 = require("./selectors/transactionCategorizationSelector");
|
|
16
15
|
const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps, stepIndex, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) => {
|
|
17
16
|
if (stepIndex === 0) {
|
|
@@ -25,7 +24,7 @@ const isPreviousStepDisabled = (selectedTransactionCategorizationTab, allSteps,
|
|
|
25
24
|
};
|
|
26
25
|
function getExpenseAutomationView(state) {
|
|
27
26
|
var _a, _b, _c;
|
|
28
|
-
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState,
|
|
27
|
+
const { expenseAutomationViewState, tenantState, expenseAutomationMissingReceiptsViewState, expenseAutomationJESchedulesViewState, expenseAutomationTransactionsViewState, monthEndCloseChecksState, companyState, } = state;
|
|
29
28
|
const { loggedInUser, currentTenantId } = tenantState;
|
|
30
29
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
31
30
|
const { currentSelectedView, selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
@@ -43,15 +42,9 @@ function getExpenseAutomationView(state) {
|
|
|
43
42
|
const missingReceipts = (0, missingReceiptsSelector_1.getExpenseAutomationMissingReceiptsView)(state);
|
|
44
43
|
const fluxAnalysis = (0, fluxAnalysisViewSelector_1.getExpenseAutomationFluxAnalysisView)(state);
|
|
45
44
|
const monthEndInsights = (0, companyMonthEndReportViewSelector_1.getCompanyMonthEndReportSelectorView)(state, currentTenant.companyId, loggedInUser);
|
|
46
|
-
const reconciliation = (0, reconciliationViewSelector_1.getExpenseAutomationReconciliationView)(state);
|
|
47
45
|
const expenseAutomationTransactionsView = (0, transactionCategorizationSelector_1.getExpenseAutomationTransactionView)(state);
|
|
48
46
|
const jeSchedules = (0, jeSchedulesViewSelector_1.getExpenseAutomationJESchedulesView)(state);
|
|
49
47
|
switch (currentSelectedView) {
|
|
50
|
-
case 'reconciliation':
|
|
51
|
-
currentSelectedViewFetchState = reconciliation.fetchStatus;
|
|
52
|
-
currentSelectedViewBackgroundRefreshFetchState =
|
|
53
|
-
reconciliation.refreshStatus;
|
|
54
|
-
break;
|
|
55
48
|
case 'flux_analysis':
|
|
56
49
|
currentSelectedViewFetchState = fluxAnalysis.fetchStatus;
|
|
57
50
|
currentSelectedViewBackgroundRefreshFetchState =
|
|
@@ -97,7 +90,6 @@ function getExpenseAutomationView(state) {
|
|
|
97
90
|
expenseAutomationJESchedulesViewState,
|
|
98
91
|
monthEndCloseChecksView,
|
|
99
92
|
expenseAutomationTransactionsView,
|
|
100
|
-
expenseAutomationReconciliationViewState,
|
|
101
93
|
];
|
|
102
94
|
let allSteps = [];
|
|
103
95
|
let auditSummary = undefined;
|
|
@@ -130,9 +122,6 @@ function getExpenseAutomationView(state) {
|
|
|
130
122
|
? (0, monthEndCloseChecksViewSelector_1.isMonthEndInsightDisabled)(currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, auditSummary)
|
|
131
123
|
: true });
|
|
132
124
|
return;
|
|
133
|
-
case 'reconciliation':
|
|
134
|
-
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: reconciliation.completionStatus });
|
|
135
|
-
return;
|
|
136
125
|
case 'flux_analysis':
|
|
137
126
|
default:
|
|
138
127
|
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { completionStatus: fluxAnalysis.completionStatus });
|
|
@@ -142,10 +131,7 @@ function getExpenseAutomationView(state) {
|
|
|
142
131
|
allSteps.forEach((stepDetail, index, allStepsOriginal) => {
|
|
143
132
|
allStepsOriginal[index] = Object.assign(Object.assign({}, stepDetail), { isNextDisabled: index === allStepsOriginal.length - 1
|
|
144
133
|
? allStepsOriginal[0].isDisabled
|
|
145
|
-
:
|
|
146
|
-
reconciliation.selectedTab === 'review'
|
|
147
|
-
? false
|
|
148
|
-
: allStepsOriginal[index + 1].isDisabled, isPrevDisabled: isPreviousStepDisabled(selectedTransactionCategorizationTab, allStepsOriginal, index, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) });
|
|
134
|
+
: allStepsOriginal[index + 1].isDisabled, isPrevDisabled: isPreviousStepDisabled(selectedTransactionCategorizationTab, allStepsOriginal, index, currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, reportEmailSentDate, auditSummary) });
|
|
149
135
|
});
|
|
150
136
|
}
|
|
151
137
|
const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)(fetchStateVariables); // Add more states
|
|
@@ -160,7 +146,6 @@ function getExpenseAutomationView(state) {
|
|
|
160
146
|
jeSchedules,
|
|
161
147
|
transactionView: expenseAutomationTransactionsView,
|
|
162
148
|
missingReceipts,
|
|
163
|
-
reconciliation,
|
|
164
149
|
currentSelectedViewFetchState,
|
|
165
150
|
currentSelectedViewBackgroundRefreshFetchState,
|
|
166
151
|
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", "account_recon", "missing_receipts", "flux_analysis", "month_end_insights"];
|
|
4
|
+
export declare const toExpenseAutomationViewType: (v: string) => "transaction_categorization" | "je_schedules" | "account_recon" | "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
|
+
'account_recon', // Not part of scope in v1
|
|
9
9
|
'missing_receipts',
|
|
10
10
|
'flux_analysis',
|
|
11
11
|
'month_end_insights',
|
|
@@ -2,7 +2,6 @@
|
|
|
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");
|
|
6
5
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
7
6
|
const recommendationState_1 = require("../../recommendation/recommendationState");
|
|
8
7
|
const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTransactionHelper");
|
|
@@ -11,7 +10,7 @@ const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTrans
|
|
|
11
10
|
* @param transactionCategorizationLocalData
|
|
12
11
|
*/
|
|
13
12
|
const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionCategorizationLocalData, transaction, uncategorizedIncomeExpense) => {
|
|
14
|
-
var _a;
|
|
13
|
+
var _a, _b, _c;
|
|
15
14
|
const updates = {
|
|
16
15
|
updatesByLineId: {},
|
|
17
16
|
};
|
|
@@ -20,27 +19,25 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
20
19
|
const isTransactionMisCategorized = (0, saveTransactionHelper_1.isTransactionMiscategorized)(transaction, true);
|
|
21
20
|
const isTransactionUnCategorized = (0, saveTransactionHelper_1.isTransactionUncategorized)(transaction, uncategorizedIncomeExpense);
|
|
22
21
|
updates.memo = transactionCategorizationLocalData.memo;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
currentSelectedEntity != null &&
|
|
26
|
-
currentSelectedEntity.type === 'vendor') {
|
|
27
|
-
updates.vendorId = currentSelectedEntity.id;
|
|
22
|
+
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) === true) {
|
|
23
|
+
updates.vendorId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.id;
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
const entity = transaction.vendorId != null
|
|
26
|
+
? {
|
|
27
|
+
id: transaction.vendorId,
|
|
28
|
+
name: (_b = transaction.vendorName) !== null && _b !== void 0 ? _b : '',
|
|
29
|
+
type: (0, entity_1.toEntityType)('vendor'),
|
|
30
|
+
qboId: transaction.vendorId,
|
|
31
|
+
zeniId: transaction.vendorId,
|
|
32
|
+
}
|
|
33
|
+
: undefined;
|
|
35
34
|
let lastUpdatedCategory;
|
|
36
35
|
let lastUpdatedClass;
|
|
37
36
|
// single recommendation to just pick the last recommendation in the list of lines
|
|
38
|
-
(
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
40
|
-
const updatedEntityId = (
|
|
41
|
-
const
|
|
42
|
-
.selectedEntityLine;
|
|
43
|
-
const entityDetails = getEntityDetails(entity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates, transactionCategorizationLocalData.customerUpdates, currentSelectedEntityLine);
|
|
37
|
+
(_c = transaction.lines) === null || _c === void 0 ? void 0 : _c.forEach((line) => {
|
|
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);
|
|
44
41
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
45
42
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
46
43
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -53,34 +50,24 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
53
50
|
};
|
|
54
51
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
55
52
|
line.platformLineDetailType === 'deposit_line_detail') {
|
|
56
|
-
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor:
|
|
57
|
-
currentSelectedEntityLine.type === 'vendor'
|
|
58
|
-
? lineItem.vendor
|
|
59
|
-
: undefined, customer: currentSelectedEntityLine != null &&
|
|
60
|
-
currentSelectedEntityLine.type === 'customer'
|
|
61
|
-
? lineItem.customer
|
|
62
|
-
: undefined });
|
|
53
|
+
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor });
|
|
63
54
|
}
|
|
64
55
|
let hasCategoryChanged = false;
|
|
65
56
|
let hasClassChanged = false;
|
|
66
57
|
const accountLine = line;
|
|
67
58
|
hasCategoryChanged =
|
|
68
|
-
((
|
|
69
|
-
Boolean((
|
|
59
|
+
((_b = lineItem.account) === null || _b === void 0 ? void 0 : _b.qboId) !== accountLine.account.qboId &&
|
|
60
|
+
Boolean((_c = lineItem.account) === null || _c === void 0 ? void 0 : _c.qboId);
|
|
70
61
|
hasClassChanged =
|
|
71
|
-
Boolean((
|
|
72
|
-
((
|
|
62
|
+
Boolean((_d = lineItem.class) === null || _d === void 0 ? void 0 : _d.qboId) &&
|
|
63
|
+
((_e = lineItem.class) === null || _e === void 0 ? void 0 : _e.qboId) !== accountLine.class.qboId;
|
|
73
64
|
const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
74
65
|
const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
75
|
-
const updatedLineEntityId = ((
|
|
76
|
-
? ((
|
|
77
|
-
? (
|
|
78
|
-
: (
|
|
79
|
-
:
|
|
80
|
-
? ((_p = accountLine.customer) === null || _p === void 0 ? void 0 : _p.id) != ((_q = lineItem.customer) === null || _q === void 0 ? void 0 : _q.id)
|
|
81
|
-
? (_r = lineItem.customer) === null || _r === void 0 ? void 0 : _r.id
|
|
82
|
-
: (_s = accountLine.customer) === null || _s === void 0 ? void 0 : _s.id
|
|
83
|
-
: undefined;
|
|
66
|
+
const updatedLineEntityId = ((_f = accountLine.vendor) === null || _f === void 0 ? void 0 : _f.id) != null
|
|
67
|
+
? ((_g = accountLine.vendor) === null || _g === void 0 ? void 0 : _g.id) != ((_h = lineItem.vendor) === null || _h === void 0 ? void 0 : _h.id)
|
|
68
|
+
? (_j = lineItem.vendor) === null || _j === void 0 ? void 0 : _j.id
|
|
69
|
+
: (_k = accountLine.vendor) === null || _k === void 0 ? void 0 : _k.id
|
|
70
|
+
: undefined;
|
|
84
71
|
if (entityDetails != null &&
|
|
85
72
|
(hasCategoryChanged === true || hasClassChanged === true)) {
|
|
86
73
|
lastUpdatedCategory =
|
|
@@ -96,16 +83,16 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
96
83
|
if (recommended.class != null ||
|
|
97
84
|
recommended.account != null ||
|
|
98
85
|
updatedEntityId != null) {
|
|
99
|
-
const vendorIdToUpdate = (
|
|
86
|
+
const vendorIdToUpdate = (_l = transactionCategorizationLocalData.vendorUpdates) === null || _l === void 0 ? void 0 : _l.qboId;
|
|
87
|
+
let entityId = entityDetails.entityId;
|
|
100
88
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
101
89
|
line.platformLineDetailType === 'deposit_line_detail') {
|
|
102
|
-
const entityId = (
|
|
90
|
+
const entityId = (_m = accountLine.vendor) === null || _m === void 0 ? void 0 : _m.id;
|
|
103
91
|
if (entityId != null) {
|
|
104
92
|
doUpdateEntityUpdates(entityUpdates, entityId, entityDetails.entityType, recommended, false, updatedLineEntityId);
|
|
105
93
|
}
|
|
106
94
|
}
|
|
107
95
|
else {
|
|
108
|
-
let entityId = entityDetails.entityId;
|
|
109
96
|
if (vendorIdToUpdate != null) {
|
|
110
97
|
entityId = vendorIdToUpdate;
|
|
111
98
|
}
|
|
@@ -148,8 +135,8 @@ const doUpdateEntityUpdates = (entityUpdates, entityId, entityType, recommendati
|
|
|
148
135
|
entityUpdates[entityKey] = Object.assign(Object.assign({}, entityUpdate), { recommendations: recommendation });
|
|
149
136
|
}
|
|
150
137
|
};
|
|
151
|
-
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates
|
|
152
|
-
var _a, _b, _c
|
|
138
|
+
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
139
|
+
var _a, _b, _c;
|
|
153
140
|
if (entity != null) {
|
|
154
141
|
return {
|
|
155
142
|
entityId: (_a = entity.qboId) !== null && _a !== void 0 ? _a : entity.id,
|
|
@@ -162,35 +149,13 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
|
|
|
162
149
|
entityType: lineItemLocalData.vendor != null ? 'vendor' : 'customer',
|
|
163
150
|
};
|
|
164
151
|
}
|
|
165
|
-
if (
|
|
166
|
-
currentSelectedEntityLine.type === 'vendor') {
|
|
167
|
-
if (vendorUpdates != null && vendorUpdates.id != null) {
|
|
168
|
-
return {
|
|
169
|
-
entityId: vendorUpdates.id,
|
|
170
|
-
entityType: 'vendor',
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (currentSelectedEntityLine != null &&
|
|
175
|
-
currentSelectedEntityLine.type === 'customer') {
|
|
176
|
-
if (customerUpdates != null && customerUpdates.id != null) {
|
|
177
|
-
return {
|
|
178
|
-
entityId: customerUpdates.id,
|
|
179
|
-
entityType: 'customer',
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (((_c = lineItemLocalData.customer) === null || _c === void 0 ? void 0 : _c.id) != null &&
|
|
184
|
-
currentSelectedEntityLine != null &&
|
|
185
|
-
currentSelectedEntityLine.type === 'customer') {
|
|
152
|
+
if (vendorUpdates != null && vendorUpdates.id != null) {
|
|
186
153
|
return {
|
|
187
|
-
entityId:
|
|
188
|
-
entityType: '
|
|
154
|
+
entityId: vendorUpdates.id,
|
|
155
|
+
entityType: 'vendor',
|
|
189
156
|
};
|
|
190
157
|
}
|
|
191
|
-
if (((
|
|
192
|
-
currentSelectedEntityLine != null &&
|
|
193
|
-
currentSelectedEntityLine.type === 'vendor') {
|
|
158
|
+
if (((_c = lineItemLocalData.vendor) === null || _c === void 0 ? void 0 : _c.id) != null) {
|
|
194
159
|
return {
|
|
195
160
|
entityId: lineItemLocalData.vendor.id,
|
|
196
161
|
entityType: 'vendor',
|
|
@@ -198,44 +163,3 @@ const getEntityDetails = (entity, lineItemLocalData, vendorUpdates, customerUpda
|
|
|
198
163
|
}
|
|
199
164
|
return undefined;
|
|
200
165
|
};
|
|
201
|
-
const getEntityFromTransaction = (transaction, currentSelectedEntity) => {
|
|
202
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
|
|
203
|
-
const vendor = transaction.vendor;
|
|
204
|
-
const customer = transaction.customer;
|
|
205
|
-
if (customer != null &&
|
|
206
|
-
currentSelectedEntity != null &&
|
|
207
|
-
currentSelectedEntity.type === 'customer') {
|
|
208
|
-
return {
|
|
209
|
-
id: customer.id,
|
|
210
|
-
name: customer.name,
|
|
211
|
-
type: (0, entity_1.toEntityType)('customer'),
|
|
212
|
-
qboId: customer.id,
|
|
213
|
-
zeniId: customer.id,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
if (vendor != null &&
|
|
217
|
-
currentSelectedEntity != null &&
|
|
218
|
-
currentSelectedEntity.type === 'vendor') {
|
|
219
|
-
return {
|
|
220
|
-
id: vendor.id,
|
|
221
|
-
name: vendor.name,
|
|
222
|
-
type: (0, entity_1.toEntityType)('vendor'),
|
|
223
|
-
qboId: vendor.id,
|
|
224
|
-
zeniId: vendor.id,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
if ((0, customerTransaction_1.isCustomerTransaction)(transaction)) {
|
|
229
|
-
const customerEntity = transaction.customer;
|
|
230
|
-
if (customerEntity != null) {
|
|
231
|
-
return {
|
|
232
|
-
id: customerEntity.id,
|
|
233
|
-
name: customerEntity.name,
|
|
234
|
-
type: (0, entity_1.toEntityType)('customer'),
|
|
235
|
-
qboId: customerEntity.id,
|
|
236
|
-
zeniId: customerEntity.id,
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return undefined;
|
|
241
|
-
};
|
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,
|
|
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;
|
|
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,41 +19,7 @@ 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;
|
|
33
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
|
|
34
|
-
transaction.vendorId != null &&
|
|
35
|
-
transaction.vendorName != null) {
|
|
36
|
-
transactionLocal.selectedEntity = {
|
|
37
|
-
id: transaction.vendorId,
|
|
38
|
-
name: transaction.vendorName,
|
|
39
|
-
type: 'vendor',
|
|
40
|
-
qboId: transaction.vendorId,
|
|
41
|
-
zeniId: transaction.vendorId,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
|
|
45
|
-
transaction.customerId != null &&
|
|
46
|
-
transaction.customerName != null) {
|
|
47
|
-
transactionLocal.selectedEntity = {
|
|
48
|
-
id: transaction.customerId,
|
|
49
|
-
name: transaction.customerName,
|
|
50
|
-
type: 'customer',
|
|
51
|
-
qboId: transaction.customerId,
|
|
52
|
-
zeniId: transaction.customerId,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
22
|
transactionLocal.vendorUpdates = undefined;
|
|
56
|
-
transactionLocal.customerUpdates = undefined;
|
|
57
23
|
transactionLocal.lineItemById =
|
|
58
24
|
transaction.lines != null && transaction.lines.length > 0
|
|
59
25
|
? buildLineItemById(transaction, transaction.recommendations)
|
|
@@ -87,34 +53,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
87
53
|
logo: accountLine.vendor.logo,
|
|
88
54
|
}
|
|
89
55
|
: undefined;
|
|
90
|
-
record.customer =
|
|
91
|
-
accountLine.customer != null &&
|
|
92
|
-
Boolean(accountLine.customer.id) === true &&
|
|
93
|
-
Boolean(accountLine.customer.name) === true
|
|
94
|
-
? {
|
|
95
|
-
id: accountLine.customer.id,
|
|
96
|
-
name: accountLine.customer.name,
|
|
97
|
-
logo: accountLine.customer.logo,
|
|
98
|
-
}
|
|
99
|
-
: undefined;
|
|
100
|
-
record.selectedEntityLine =
|
|
101
|
-
record.vendor != null
|
|
102
|
-
? {
|
|
103
|
-
id: record.vendor.id,
|
|
104
|
-
name: record.vendor.name,
|
|
105
|
-
type: 'vendor',
|
|
106
|
-
qboId: record.vendor.id,
|
|
107
|
-
zeniId: record.vendor.id,
|
|
108
|
-
}
|
|
109
|
-
: record.customer != null
|
|
110
|
-
? {
|
|
111
|
-
id: record.customer.id,
|
|
112
|
-
name: record.customer.name,
|
|
113
|
-
type: 'customer',
|
|
114
|
-
qboId: record.customer.id,
|
|
115
|
-
zeniId: record.customer.id,
|
|
116
|
-
}
|
|
117
|
-
: undefined;
|
|
56
|
+
record.customer = accountLine.customer;
|
|
118
57
|
record.billable = accountLine.billable;
|
|
119
58
|
record.categorizationStatus = accountLine.categorizationStatus;
|
|
120
59
|
record.reviewPendingReasons = accountLine.reviewPendingReasons;
|
|
@@ -150,7 +89,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
150
89
|
});
|
|
151
90
|
return lineItemData;
|
|
152
91
|
};
|
|
153
|
-
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId,
|
|
92
|
+
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId, selectedAccount, selectedClassBase) => {
|
|
154
93
|
const newLineItems = {};
|
|
155
94
|
let selectedCheckBoxTransactionIds = draft.selectedCheckBoxTransactionIds;
|
|
156
95
|
if (transaction.lines != null) {
|
|
@@ -185,11 +124,8 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
185
124
|
}
|
|
186
125
|
}
|
|
187
126
|
else {
|
|
188
|
-
if ((transactionDetailLocalData.
|
|
189
|
-
transactionDetailLocalData.
|
|
190
|
-
(record.customer != null && record.customer.id === customerId) ||
|
|
191
|
-
(transactionDetailLocalData.vendor != null &&
|
|
192
|
-
transactionDetailLocalData.vendor.id === vendorId) ||
|
|
127
|
+
if ((transactionDetailLocalData.vendor != null &&
|
|
128
|
+
transactionDetailLocalData.vendor.id === vendorId) ||
|
|
193
129
|
(record.vendor != null && record.vendor.id === vendorId)) {
|
|
194
130
|
// if the vendor is same, then set the account and class with the selected ones and add the transaction to the selected list
|
|
195
131
|
if (selectedAccount != null &&
|
|
@@ -238,7 +174,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
238
174
|
}
|
|
239
175
|
});
|
|
240
176
|
}
|
|
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, vendor: transactionDetailLocalData.vendor,
|
|
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 });
|
|
242
178
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
243
179
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
244
180
|
}
|
|
@@ -302,7 +238,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
302
238
|
const newLineItem = newLineItems[matchingEntityLineId];
|
|
303
239
|
newLineItems[matchingEntityLineId] = Object.assign(Object.assign({}, newLineItem), { class: matchingRecord.class, account: matchingRecord.account, lineEntity: matchingRecord.lineEntity });
|
|
304
240
|
}
|
|
305
|
-
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,
|
|
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 });
|
|
306
242
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
307
243
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
308
244
|
}
|
|
@@ -314,7 +250,7 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
314
250
|
const lineItems = Object.values(transactionDetailLocalData.lineItemById);
|
|
315
251
|
const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
|
|
316
252
|
return lineItems.every((lineItem) => {
|
|
317
|
-
var _a, _b, _c;
|
|
253
|
+
var _a, _b, _c, _d, _e;
|
|
318
254
|
return lineItem.account != null &&
|
|
319
255
|
Boolean(lineItem.account.qboId) === true &&
|
|
320
256
|
lineItem.class != null &&
|
|
@@ -324,20 +260,10 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
324
260
|
(_b = uncategorizedAccounts.expense) === null || _b === void 0 ? void 0 : _b.qboId,
|
|
325
261
|
(_c = uncategorizedAccounts.income) === null || _c === void 0 ? void 0 : _c.qboId,
|
|
326
262
|
].includes(lineItem.account.qboId)) &&
|
|
327
|
-
(
|
|
328
|
-
? transactionDetailLocalData.vendor != null &&
|
|
329
|
-
transactionDetailLocalData.vendor.id != null &&
|
|
263
|
+
(isVendorTransactionAvailable
|
|
264
|
+
? ((_d = transactionDetailLocalData.vendor) === null || _d === void 0 ? void 0 : _d.id) != null &&
|
|
330
265
|
Boolean(transactionDetailLocalData.vendor.id) === true
|
|
331
|
-
: lineItem.vendor != null &&
|
|
332
|
-
lineItem.vendor.id != null &&
|
|
333
|
-
Boolean(lineItem.vendor.id) === true) ||
|
|
334
|
-
(isVendorTransactionAvailable
|
|
335
|
-
? transactionDetailLocalData.customer != null &&
|
|
336
|
-
transactionDetailLocalData.customer.id != null &&
|
|
337
|
-
Boolean(transactionDetailLocalData.customer.id) === true
|
|
338
|
-
: lineItem.customer != null &&
|
|
339
|
-
lineItem.customer.id != null &&
|
|
340
|
-
Boolean(lineItem.customer.id) === true));
|
|
266
|
+
: ((_e = lineItem.vendor) === null || _e === void 0 ? void 0 : _e.id) != null && Boolean(lineItem.vendor.id) === true);
|
|
341
267
|
});
|
|
342
268
|
};
|
|
343
269
|
exports.checkIfAllLineItemsAreCategoryClassFilled = checkIfAllLineItemsAreCategoryClassFilled;
|
|
@@ -4,7 +4,6 @@ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePerio
|
|
|
4
4
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
7
|
-
import { CustomerBase } from '../../../entity/customer/customerState';
|
|
8
7
|
import { Entity } from '../../../entity/genericEntity/entity';
|
|
9
8
|
import { RecommendationByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
|
|
10
9
|
import { SupportedTransaction } from '../../../entity/transaction/transactionState';
|
|
@@ -77,22 +76,12 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
77
76
|
selectedTransaction: SupportedTransaction;
|
|
78
77
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
79
78
|
updatedVendor?: VendorBase;
|
|
80
|
-
|
|
81
|
-
}, "expenseAutomationTransactionsView/updateSelectedVendorForTransaction">, updateSelectedCustomerForTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
82
|
-
selectedTab: TransactionsTab;
|
|
83
|
-
transactionId: ID;
|
|
84
|
-
lineId: ID;
|
|
85
|
-
selectedTransaction: SupportedTransaction;
|
|
86
|
-
uncategorizedAccounts: UncategorizedAccounts;
|
|
87
|
-
updatedCustomer?: CustomerBase;
|
|
88
|
-
selectedEntity?: Entity;
|
|
89
|
-
}, "expenseAutomationTransactionsView/updateSelectedCustomerForTransaction">, setAllItemsToCategoryClassInLocalDataForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, lineId: string, transactions: SupportedTransaction[], uncategorizedAccounts: UncategorizedAccounts, vendorId?: string | undefined, customerId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined, lineEntity?: Entity | undefined, recommendations?: Recommendation[] | undefined], {
|
|
79
|
+
}, "expenseAutomationTransactionsView/updateSelectedVendorForTransaction">, setAllItemsToCategoryClassInLocalDataForCategorization: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, lineId: string, transactions: SupportedTransaction[], uncategorizedAccounts: UncategorizedAccounts, vendorId?: string | undefined, selectedAccount?: AccountBase | undefined, selectedClassBase?: ClassBase | undefined, lineEntity?: Entity | undefined, recommendations?: Recommendation[] | undefined], {
|
|
90
80
|
selectedTab: "review" | "autoCategorized";
|
|
91
81
|
transactionId: string;
|
|
92
82
|
lineId: string;
|
|
93
83
|
transactions: SupportedTransaction[];
|
|
94
84
|
vendorId: string | undefined;
|
|
95
|
-
customerId: string | undefined;
|
|
96
85
|
lineEntity: Entity | undefined;
|
|
97
86
|
selectedAccount: AccountBase | undefined;
|
|
98
87
|
selectedClassBase: ClassBase | undefined;
|