@zeniai/client-epic-state 4.15.41 → 4.15.42
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/README.md +1 -19
- package/lib/commonPayloadTypes/recommendationPayload.d.ts +0 -1
- package/lib/commonStateTypes/common.d.ts +1 -1
- package/lib/commonStateTypes/fiscalYearHelpers/getFYMonths.d.ts +2 -2
- package/lib/commonStateTypes/fiscalYearHelpers/getFYQuarterAndYear.d.ts +2 -2
- package/lib/commonStateTypes/timePeriod.d.ts +7 -7
- package/lib/commonStateTypes/timePeriod.js +2 -2
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
- 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/accountSelector.d.ts +3 -3
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -22
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/approvalRule/approvalRuleState.d.ts +2 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.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/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/file/fileState.d.ts +3 -3
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +2 -2
- package/lib/entity/notification/types/notificationTypes.d.ts +2 -2
- 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 +2 -2
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskState.d.ts +3 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/tenant/tenantReducer.d.ts +2 -2
- 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 -24
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- 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 +13 -22
- 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/auditReportViewReducer.d.ts +2 -2
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- package/lib/view/balanceSheet/balanceSheetReducer.js +6 -1
- package/lib/view/bankAccountView/bankAccountViewReducer.js +1 -0
- package/lib/view/billPayCard/billPayCardSelector.d.ts +2 -2
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +3 -3
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +3 -3
- package/lib/view/cashFlow/cashFlowReducer.js +4 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +2 -2
- package/lib/view/cashPosition/cashPositionReducer.js +1 -0
- package/lib/view/cashPosition/cashPositionSelector.d.ts +2 -2
- package/lib/view/common/reportsHelpers.d.ts +1 -1
- package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +0 -7
- package/lib/view/commonVendorView/vendorView/epics/fetchAndUpdateVendorRecommendationsEpic.js +3 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +2 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/companyViewReducer.d.ts +1 -1
- package/lib/view/companyView/companyViewReducer.js +10 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +3 -3
- package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +1 -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 +7 -30
- 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 +42 -98
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +10 -86
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +11 -11
- 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/selectors/jeSchedulesViewSelector.js +2 -5
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -12
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.js +4 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +4 -4
- 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/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardState.d.ts +1 -1
- package/lib/view/notificationView/notificationViewReducer.d.ts +8 -8
- package/lib/view/notificationView/notificationViewState.d.ts +2 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +3 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
- 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/opExByVendor/opExByVendorState.d.ts +1 -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/referralView/referralState.d.ts +1 -1
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +2 -2
- package/lib/view/reportUIOptions/reportUIOptionsReducer.d.ts +8 -8
- 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/scheduleAccruedDetailView/LinkBillExpenseView/linkBillExpense.d.ts +1 -1
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +4 -4
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +2 -2
- package/lib/view/settingsView/settingsViewReducer.js +1 -0
- package/lib/view/settingsView/settingsViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +1 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +1 -5
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +6 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +2 -2
- 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/billPay/editBillView/epics/saveBillDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +2 -2
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +7 -7
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +3 -11
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -11
- 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.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewReducer.d.ts +2 -2
- 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 +4 -5
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPayState.d.ts +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.d.ts +0 -14
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigPayload.js +1 -78
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigReducer.js +1 -3
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.d.ts +1 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigSelector.js +1 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountsConfig/zeniAccountsConfigState.d.ts +0 -9
- 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/taskManager/taskListView/taskList.d.ts +3 -3
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +1 -1
- package/lib/view/tasksCard/fetchTasksCardEpic.js +2 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +2 -2
- package/lib/view/tasksCard/tasksCardSelector.js +1 -1
- package/lib/view/topEx/topExSelector.d.ts +3 -3
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +52 -45
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +4 -22
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +13 -66
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +4 -13
- package/lib/view/transactionDetail/transactionDetailReducer.js +21 -51
- package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -3
- 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/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/lib/zeniUrl.d.ts +1 -1
- package/package.json +12 -14
- 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 -254
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +0 -103
- package/lib/view/expenseAutomationView/types/reconciliationViewState.js +0 -37
package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js
CHANGED
|
@@ -10,7 +10,6 @@ const expenseAutomationViewReducer_1 = require("../../expenseAutomationViewReduc
|
|
|
10
10
|
const fluxAnalysisViewReducer_1 = require("../../reducers/fluxAnalysisViewReducer");
|
|
11
11
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
12
12
|
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
13
|
-
const reconciliationViewReducer_1 = require("../../reducers/reconciliationViewReducer");
|
|
14
13
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
15
14
|
const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(expenseAutomationViewReducer_1.refreshExpenseAutomationCurrentTab.match), (0, operators_1.switchMap)(() => {
|
|
16
15
|
const state = state$.value;
|
|
@@ -19,7 +18,6 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
|
|
|
19
18
|
const { selectedTransactionCategorizationTab } = state.expenseAutomationTransactionsViewState;
|
|
20
19
|
const { selectedPeriodByTenantId, currentSelectedView } = state.expenseAutomationViewState;
|
|
21
20
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
22
|
-
const { selectedAccountId } = state.expenseAutomationReconciliationViewState;
|
|
23
21
|
const period = (0, timePeriod_1.convertToPeriod)(selectedPeriod);
|
|
24
22
|
const timePeriodStart = (0, timePeriod_1.toAbsoluteDay)(period.start);
|
|
25
23
|
const timePeriodEnd = (0, timePeriod_1.toAbsoluteDay)(period.end);
|
|
@@ -50,18 +48,6 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
|
|
|
50
48
|
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId),
|
|
51
49
|
(0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId, currentTenant.tenantId),
|
|
52
50
|
]);
|
|
53
|
-
case 'reconciliation': {
|
|
54
|
-
if (selectedAccountId != null) {
|
|
55
|
-
return (0, rxjs_1.from)([
|
|
56
|
-
(0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, selectedAccountId, true, true),
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return (0, rxjs_1.from)([
|
|
61
|
-
(0, reconciliationViewReducer_1.fetchReconciliation)(selectedPeriod, undefined, true, true),
|
|
62
|
-
]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
51
|
case 'transaction_categorization':
|
|
66
52
|
default:
|
|
67
53
|
return (0, rxjs_1.from)([
|
|
@@ -40,17 +40,13 @@ const updateTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actio
|
|
|
40
40
|
}));
|
|
41
41
|
exports.updateTransactionCategorizationEpic = updateTransactionCategorizationEpic;
|
|
42
42
|
function prepareTransactionPayload(selectedTab, transactionState, vendorState, transactionsViewState, transactionId, saveUpdates) {
|
|
43
|
-
var _a
|
|
43
|
+
var _a;
|
|
44
44
|
const detail = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionId);
|
|
45
45
|
const tranDetail = (0, get_1.default)(transactionsViewState.transactionCategorizationView[selectedTab]
|
|
46
46
|
.transactionReviewLocalDataById, transactionId, undefined);
|
|
47
47
|
const tranVendorUpdates = (_a = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionReviewLocalData) === null || _a === void 0 ? void 0 : _a.vendorUpdates;
|
|
48
|
-
const tranCustomerUpdates = (_b = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionReviewLocalData) === null || _b === void 0 ? void 0 : _b.customerUpdates;
|
|
49
|
-
const tranSelectedEntity = (_c = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionReviewLocalData) === null || _c === void 0 ? void 0 : _c.selectedEntity;
|
|
50
48
|
let vendorUpdates = undefined;
|
|
51
|
-
if ((tranVendorUpdates === null || tranVendorUpdates === void 0 ? void 0 : tranVendorUpdates.qboId) != null
|
|
52
|
-
tranSelectedEntity != null &&
|
|
53
|
-
tranSelectedEntity.type === 'vendor') {
|
|
49
|
+
if ((tranVendorUpdates === null || tranVendorUpdates === void 0 ? void 0 : tranVendorUpdates.qboId) != null) {
|
|
54
50
|
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, tranVendorUpdates.qboId);
|
|
55
51
|
if (vendor != null) {
|
|
56
52
|
vendorUpdates = {
|
|
@@ -65,23 +61,8 @@ function prepareTransactionPayload(selectedTab, transactionState, vendorState, t
|
|
|
65
61
|
};
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
let customerUpdates = undefined;
|
|
69
|
-
if (tranSelectedEntity != null && tranSelectedEntity.type === 'customer') {
|
|
70
|
-
if ((tranCustomerUpdates === null || tranCustomerUpdates === void 0 ? void 0 : tranCustomerUpdates.qboId) != null) {
|
|
71
|
-
customerUpdates = {
|
|
72
|
-
id: tranCustomerUpdates.qboId,
|
|
73
|
-
name: tranCustomerUpdates.name,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
customerUpdates = {
|
|
78
|
-
id: tranSelectedEntity.id,
|
|
79
|
-
name: tranSelectedEntity.name,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
64
|
if (detail != null) {
|
|
84
|
-
const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates
|
|
65
|
+
const transUpdates = toTransactionUpdatePayload(saveUpdates.updates, detail, vendorUpdates);
|
|
85
66
|
const entityUpdates = toEntityUpdatePayload(saveUpdates.entityRelatedUpdates);
|
|
86
67
|
return {
|
|
87
68
|
entity_related_updates: entityUpdates,
|
|
@@ -110,10 +91,12 @@ function preparePayload(selectedTab, transactionState, vendorState, transactions
|
|
|
110
91
|
return payload;
|
|
111
92
|
}
|
|
112
93
|
}
|
|
113
|
-
const toTransactionUpdatePayload = (updates, detail, vendorUpdates
|
|
94
|
+
const toTransactionUpdatePayload = (updates, detail, vendorUpdates) => {
|
|
114
95
|
var _a, _b;
|
|
115
96
|
const transaction = Object.assign({}, detail);
|
|
116
97
|
transaction.memo = (_a = updates.memo) !== null && _a !== void 0 ? _a : '';
|
|
98
|
+
transaction.vendorId = vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.id;
|
|
99
|
+
transaction.vendorName = vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.name;
|
|
117
100
|
const recommendationUpdates = {};
|
|
118
101
|
for (const key in updates.updatesByLineId) {
|
|
119
102
|
const lineUpdates = updates.updatesByLineId[key];
|
|
@@ -150,17 +133,11 @@ const toTransactionUpdatePayload = (updates, detail, vendorUpdates, customerUpda
|
|
|
150
133
|
transaction.lines = newLineMap;
|
|
151
134
|
}
|
|
152
135
|
transaction.recommendations = recommendationUpdates;
|
|
153
|
-
// Added this check because now customer are also part of Expense,Journal Entry and Check type of transactions
|
|
154
136
|
if ((0, customerTransaction_1.isCustomerTransaction)(transaction)) {
|
|
155
137
|
return (0, customerTransactionPayload_1.toCustomerTransactionPayload)(transaction);
|
|
156
138
|
}
|
|
157
139
|
else if ((0, vendorTransaction_1.isVendorTransaction)(transaction)) {
|
|
158
|
-
|
|
159
|
-
return (0, vendorTransactionPayload_1.toVendorTransactionWithCustomerPayload)(transaction, customerUpdates);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
|
|
163
|
-
}
|
|
140
|
+
return (0, vendorTransactionPayload_1.toVendorTransactionPayload)(transaction, vendorUpdates);
|
|
164
141
|
}
|
|
165
142
|
else if ((0, otherTransaction_1.isTransferTransaction)(transaction)) {
|
|
166
143
|
return (0, otherTransactionPayload_1.toTransferTransactionPayload)(transaction);
|
|
@@ -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" | "account_recon" | "missing_receipts" | "flux_analysis" | "month_end_insights"], {
|
|
12
|
+
newSelectedView: "transaction_categorization" | "je_schedules" | "account_recon" | "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,7 +22,11 @@ const expenseAutomationView = (0, toolkit_1.createSlice)({
|
|
|
22
22
|
reducer() {
|
|
23
23
|
//do nothing
|
|
24
24
|
},
|
|
25
|
-
prepare(
|
|
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) {
|
|
26
30
|
return {
|
|
27
31
|
payload: { cacheOverride, refreshViewInBackground },
|
|
28
32
|
};
|
|
@@ -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',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toTransactionUpdatesFromTransactionCategorizationLocalData = void 0;
|
|
4
|
+
const entity_1 = require("../../../entity/genericEntity/entity");
|
|
4
5
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
5
6
|
const recommendationState_1 = require("../../recommendation/recommendationState");
|
|
6
7
|
const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTransactionHelper");
|
|
@@ -9,7 +10,7 @@ const saveTransactionHelper_1 = require("../../transactionDetail/epics/saveTrans
|
|
|
9
10
|
* @param transactionCategorizationLocalData
|
|
10
11
|
*/
|
|
11
12
|
const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionCategorizationLocalData, transaction, uncategorizedIncomeExpense) => {
|
|
12
|
-
var _a, _b, _c
|
|
13
|
+
var _a, _b, _c;
|
|
13
14
|
const updates = {
|
|
14
15
|
updatesByLineId: {},
|
|
15
16
|
};
|
|
@@ -18,39 +19,25 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
18
19
|
const isTransactionMisCategorized = (0, saveTransactionHelper_1.isTransactionMiscategorized)(transaction, true);
|
|
19
20
|
const isTransactionUnCategorized = (0, saveTransactionHelper_1.isTransactionUncategorized)(transaction, uncategorizedIncomeExpense);
|
|
20
21
|
updates.memo = transactionCategorizationLocalData.memo;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
currentSelectedEntity != null &&
|
|
24
|
-
currentSelectedEntity.type === 'vendor') {
|
|
25
|
-
updates.vendorId = currentSelectedEntity.id;
|
|
26
|
-
}
|
|
27
|
-
if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) === true &&
|
|
28
|
-
currentSelectedEntity != null &&
|
|
29
|
-
currentSelectedEntity.type === 'customer') {
|
|
30
|
-
updates.customerId = currentSelectedEntity.id;
|
|
22
|
+
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) === true) {
|
|
23
|
+
updates.vendorId = (_a = transactionCategorizationLocalData.vendorUpdates) === null || _a === void 0 ? void 0 : _a.id;
|
|
31
24
|
}
|
|
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;
|
|
32
34
|
let lastUpdatedCategory;
|
|
33
35
|
let lastUpdatedClass;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
updatedEntityId = (_b = transactionCategorizationLocalData.vendorUpdates) === null || _b === void 0 ? void 0 : _b.qboId;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
if (((_c = transactionCategorizationLocalData.customerUpdates) === null || _c === void 0 ? void 0 : _c.qboId) !==
|
|
44
|
-
transaction.customerId) {
|
|
45
|
-
updatedEntityId =
|
|
46
|
-
(_d = transactionCategorizationLocalData.customerUpdates) === null || _d === void 0 ? void 0 : _d.qboId;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
(_e = transaction.lines) === null || _e === void 0 ? void 0 : _e.forEach((line) => {
|
|
50
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
51
|
-
const currentSelectedEntityLine = transactionCategorizationLocalData.lineItemById[line.id]
|
|
52
|
-
.selectedEntityLine;
|
|
53
|
-
const entityDetails = getEntityDetails(currentSelectedEntity, transactionCategorizationLocalData.lineItemById[line.id], transactionCategorizationLocalData.vendorUpdates, transactionCategorizationLocalData.customerUpdates, currentSelectedEntityLine);
|
|
36
|
+
// single recommendation to just pick the last recommendation in the list of lines
|
|
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);
|
|
54
41
|
if (line.type === 'transaction_with_account_and_class_line' ||
|
|
55
42
|
line.type === 'transaction_with_product_or_service_line' ||
|
|
56
43
|
line.type === 'journal_entry_transaction_line') {
|
|
@@ -63,44 +50,24 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
63
50
|
};
|
|
64
51
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
65
52
|
line.platformLineDetailType === 'deposit_line_detail') {
|
|
66
|
-
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor:
|
|
67
|
-
currentSelectedEntityLine.type === 'vendor'
|
|
68
|
-
? lineItem.vendor
|
|
69
|
-
: undefined, customer: currentSelectedEntityLine != null &&
|
|
70
|
-
currentSelectedEntityLine.type === 'customer'
|
|
71
|
-
? lineItem.customer
|
|
72
|
-
: undefined });
|
|
53
|
+
updatesByLineId[line.id] = Object.assign(Object.assign({}, updatesByLineId[line.id]), { vendor: lineItem.vendor });
|
|
73
54
|
}
|
|
74
55
|
let hasCategoryChanged = false;
|
|
75
56
|
let hasClassChanged = false;
|
|
76
57
|
const accountLine = line;
|
|
77
58
|
hasCategoryChanged =
|
|
78
|
-
((
|
|
79
|
-
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);
|
|
80
61
|
hasClassChanged =
|
|
81
|
-
Boolean((
|
|
82
|
-
((
|
|
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;
|
|
83
64
|
const recommendedAccountBase = (0, saveTransactionHelper_1.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
84
65
|
const recommendedClassBase = (0, saveTransactionHelper_1.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
? currentSelectedEntityLine === null || currentSelectedEntityLine === void 0 ? void 0 : currentSelectedEntityLine.qboId
|
|
91
|
-
: undefined;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else if (((_h = accountLine.customer) === null || _h === void 0 ? void 0 : _h.id) != null &&
|
|
95
|
-
(currentSelectedEntityLine === null || currentSelectedEntityLine === void 0 ? void 0 : currentSelectedEntityLine.type) === 'customer') {
|
|
96
|
-
updatedLineEntityId =
|
|
97
|
-
((_j = accountLine.customer) === null || _j === void 0 ? void 0 : _j.id) !== ((_k = lineItem.customer) === null || _k === void 0 ? void 0 : _k.id)
|
|
98
|
-
? currentSelectedEntityLine === null || currentSelectedEntityLine === void 0 ? void 0 : currentSelectedEntityLine.qboId
|
|
99
|
-
: undefined;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
updatedLineEntityId = undefined;
|
|
103
|
-
}
|
|
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;
|
|
104
71
|
if (entityDetails != null &&
|
|
105
72
|
(hasCategoryChanged === true || hasClassChanged === true)) {
|
|
106
73
|
lastUpdatedCategory =
|
|
@@ -116,17 +83,16 @@ const toTransactionUpdatesFromTransactionCategorizationLocalData = (transactionC
|
|
|
116
83
|
if (recommended.class != null ||
|
|
117
84
|
recommended.account != null ||
|
|
118
85
|
updatedEntityId != null) {
|
|
119
|
-
const vendorIdToUpdate = (_l = transactionCategorizationLocalData.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const entityId =
|
|
86
|
+
const vendorIdToUpdate = (_l = transactionCategorizationLocalData.vendorUpdates) === null || _l === void 0 ? void 0 : _l.qboId;
|
|
87
|
+
let entityId = entityDetails.entityId;
|
|
88
|
+
if (line.type === 'journal_entry_transaction_line' ||
|
|
89
|
+
line.platformLineDetailType === 'deposit_line_detail') {
|
|
90
|
+
const entityId = (_m = accountLine.vendor) === null || _m === void 0 ? void 0 : _m.id;
|
|
124
91
|
if (entityId != null) {
|
|
125
92
|
doUpdateEntityUpdates(entityUpdates, entityId, entityDetails.entityType, recommended, false, updatedLineEntityId);
|
|
126
93
|
}
|
|
127
94
|
}
|
|
128
95
|
else {
|
|
129
|
-
let entityId = entityDetails.entityId;
|
|
130
96
|
if (vendorIdToUpdate != null) {
|
|
131
97
|
entityId = vendorIdToUpdate;
|
|
132
98
|
}
|
|
@@ -169,49 +135,27 @@ const doUpdateEntityUpdates = (entityUpdates, entityId, entityType, recommendati
|
|
|
169
135
|
entityUpdates[entityKey] = Object.assign(Object.assign({}, entityUpdate), { recommendations: recommendation });
|
|
170
136
|
}
|
|
171
137
|
};
|
|
172
|
-
const getEntityDetails = (
|
|
138
|
+
const getEntityDetails = (entity, lineItemLocalData, vendorUpdates) => {
|
|
173
139
|
var _a, _b, _c;
|
|
174
|
-
if (
|
|
140
|
+
if (entity != null) {
|
|
175
141
|
return {
|
|
176
|
-
entityId:
|
|
177
|
-
entityType:
|
|
142
|
+
entityId: (_a = entity.qboId) !== null && _a !== void 0 ? _a : entity.id,
|
|
143
|
+
entityType: entity.type,
|
|
178
144
|
};
|
|
179
145
|
}
|
|
180
146
|
if (lineItemLocalData.lineEntity != null) {
|
|
181
147
|
return {
|
|
182
|
-
entityId: (
|
|
148
|
+
entityId: (_b = lineItemLocalData.lineEntity.qboId) !== null && _b !== void 0 ? _b : lineItemLocalData.lineEntity.id,
|
|
183
149
|
entityType: lineItemLocalData.vendor != null ? 'vendor' : 'customer',
|
|
184
150
|
};
|
|
185
151
|
}
|
|
186
|
-
if (
|
|
187
|
-
currentSelectedEntityLine.type === 'vendor') {
|
|
188
|
-
if (vendorUpdates != null && vendorUpdates.id != null) {
|
|
189
|
-
return {
|
|
190
|
-
entityId: vendorUpdates.id,
|
|
191
|
-
entityType: 'vendor',
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (currentSelectedEntityLine != null &&
|
|
196
|
-
currentSelectedEntityLine.type === 'customer') {
|
|
197
|
-
if (customerUpdates != null && customerUpdates.id != null) {
|
|
198
|
-
return {
|
|
199
|
-
entityId: customerUpdates.id,
|
|
200
|
-
entityType: 'customer',
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (((_b = lineItemLocalData.customer) === null || _b === void 0 ? void 0 : _b.id) != null &&
|
|
205
|
-
currentSelectedEntityLine != null &&
|
|
206
|
-
currentSelectedEntityLine.type === 'customer') {
|
|
152
|
+
if (vendorUpdates != null && vendorUpdates.id != null) {
|
|
207
153
|
return {
|
|
208
|
-
entityId:
|
|
209
|
-
entityType: '
|
|
154
|
+
entityId: vendorUpdates.id,
|
|
155
|
+
entityType: 'vendor',
|
|
210
156
|
};
|
|
211
157
|
}
|
|
212
|
-
if (((_c = lineItemLocalData.vendor) === null || _c === void 0 ? void 0 : _c.id) != null
|
|
213
|
-
currentSelectedEntityLine != null &&
|
|
214
|
-
currentSelectedEntityLine.type === 'vendor') {
|
|
158
|
+
if (((_c = lineItemLocalData.vendor) === null || _c === void 0 ? void 0 : _c.id) != null) {
|
|
215
159
|
return {
|
|
216
160
|
entityId: lineItemLocalData.vendor.id,
|
|
217
161
|
entityType: 'vendor',
|
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,43 +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
|
-
logo: transaction.logo,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
if ((0, vendorTransaction_1.isVendorTransaction)(transaction) &&
|
|
46
|
-
transaction.customerId != null &&
|
|
47
|
-
transaction.customerName != null) {
|
|
48
|
-
transactionLocal.selectedEntity = {
|
|
49
|
-
id: transaction.customerId,
|
|
50
|
-
name: transaction.customerName,
|
|
51
|
-
type: 'customer',
|
|
52
|
-
qboId: transaction.customerId,
|
|
53
|
-
zeniId: transaction.customerId,
|
|
54
|
-
logo: transaction.logo,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
22
|
transactionLocal.vendorUpdates = undefined;
|
|
58
|
-
transactionLocal.customerUpdates = undefined;
|
|
59
23
|
transactionLocal.lineItemById =
|
|
60
24
|
transaction.lines != null && transaction.lines.length > 0
|
|
61
25
|
? buildLineItemById(transaction, transaction.recommendations)
|
|
@@ -89,34 +53,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
89
53
|
logo: accountLine.vendor.logo,
|
|
90
54
|
}
|
|
91
55
|
: undefined;
|
|
92
|
-
record.customer =
|
|
93
|
-
accountLine.customer != null &&
|
|
94
|
-
Boolean(accountLine.customer.id) === true &&
|
|
95
|
-
Boolean(accountLine.customer.name) === true
|
|
96
|
-
? {
|
|
97
|
-
id: accountLine.customer.id,
|
|
98
|
-
name: accountLine.customer.name,
|
|
99
|
-
logo: accountLine.customer.logo,
|
|
100
|
-
}
|
|
101
|
-
: undefined;
|
|
102
|
-
record.selectedEntityLine =
|
|
103
|
-
record.vendor != null
|
|
104
|
-
? {
|
|
105
|
-
id: record.vendor.id,
|
|
106
|
-
name: record.vendor.name,
|
|
107
|
-
type: 'vendor',
|
|
108
|
-
qboId: record.vendor.id,
|
|
109
|
-
zeniId: record.vendor.id,
|
|
110
|
-
}
|
|
111
|
-
: record.customer != null
|
|
112
|
-
? {
|
|
113
|
-
id: record.customer.id,
|
|
114
|
-
name: record.customer.name,
|
|
115
|
-
type: 'customer',
|
|
116
|
-
qboId: record.customer.id,
|
|
117
|
-
zeniId: record.customer.id,
|
|
118
|
-
}
|
|
119
|
-
: undefined;
|
|
56
|
+
record.customer = accountLine.customer;
|
|
120
57
|
record.billable = accountLine.billable;
|
|
121
58
|
record.categorizationStatus = accountLine.categorizationStatus;
|
|
122
59
|
record.reviewPendingReasons = accountLine.reviewPendingReasons;
|
|
@@ -152,7 +89,7 @@ const buildLineItemById = (transaction, recommendations) => {
|
|
|
152
89
|
});
|
|
153
90
|
return lineItemData;
|
|
154
91
|
};
|
|
155
|
-
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId,
|
|
92
|
+
const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, transactionLineId, transactionDetailLocalData, updatedItem, uncategorizedAccounts, vendorId, selectedAccount, selectedClassBase) => {
|
|
156
93
|
const newLineItems = {};
|
|
157
94
|
let selectedCheckBoxTransactionIds = draft.selectedCheckBoxTransactionIds;
|
|
158
95
|
if (transaction.lines != null) {
|
|
@@ -187,11 +124,8 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
187
124
|
}
|
|
188
125
|
}
|
|
189
126
|
else {
|
|
190
|
-
if ((transactionDetailLocalData.
|
|
191
|
-
transactionDetailLocalData.
|
|
192
|
-
(record.customer != null && record.customer.id === customerId) ||
|
|
193
|
-
(transactionDetailLocalData.vendor != null &&
|
|
194
|
-
transactionDetailLocalData.vendor.id === vendorId) ||
|
|
127
|
+
if ((transactionDetailLocalData.vendor != null &&
|
|
128
|
+
transactionDetailLocalData.vendor.id === vendorId) ||
|
|
195
129
|
(record.vendor != null && record.vendor.id === vendorId)) {
|
|
196
130
|
// if the vendor is same, then set the account and class with the selected ones and add the transaction to the selected list
|
|
197
131
|
if (selectedAccount != null &&
|
|
@@ -240,7 +174,7 @@ const toSetAllLineItemsToCategoryClass = (draft, transaction, transactionId, tra
|
|
|
240
174
|
}
|
|
241
175
|
});
|
|
242
176
|
}
|
|
243
|
-
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 });
|
|
244
178
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
245
179
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
246
180
|
}
|
|
@@ -304,7 +238,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
|
|
|
304
238
|
const newLineItem = newLineItems[matchingEntityLineId];
|
|
305
239
|
newLineItems[matchingEntityLineId] = Object.assign(Object.assign({}, newLineItem), { class: matchingRecord.class, account: matchingRecord.account, lineEntity: matchingRecord.lineEntity });
|
|
306
240
|
}
|
|
307
|
-
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 });
|
|
308
242
|
if (!(0, exports.checkIfAllLineItemsAreCategoryClassFilled)(transaction, newLocalData, uncategorizedAccounts)) {
|
|
309
243
|
selectedCheckBoxTransactionIds = selectedCheckBoxTransactionIds.filter((id) => id !== transaction.id);
|
|
310
244
|
}
|
|
@@ -316,7 +250,7 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
316
250
|
const lineItems = Object.values(transactionDetailLocalData.lineItemById);
|
|
317
251
|
const isVendorTransactionAvailable = (0, vendorTransaction_1.isVendorTransaction)(transaction);
|
|
318
252
|
return lineItems.every((lineItem) => {
|
|
319
|
-
var _a, _b, _c;
|
|
253
|
+
var _a, _b, _c, _d, _e;
|
|
320
254
|
return lineItem.account != null &&
|
|
321
255
|
Boolean(lineItem.account.qboId) === true &&
|
|
322
256
|
lineItem.class != null &&
|
|
@@ -326,20 +260,10 @@ const checkIfAllLineItemsAreCategoryClassFilled = (transaction, transactionDetai
|
|
|
326
260
|
(_b = uncategorizedAccounts.expense) === null || _b === void 0 ? void 0 : _b.qboId,
|
|
327
261
|
(_c = uncategorizedAccounts.income) === null || _c === void 0 ? void 0 : _c.qboId,
|
|
328
262
|
].includes(lineItem.account.qboId)) &&
|
|
329
|
-
(
|
|
330
|
-
? transactionDetailLocalData.vendor != null &&
|
|
331
|
-
transactionDetailLocalData.vendor.id != null &&
|
|
263
|
+
(isVendorTransactionAvailable
|
|
264
|
+
? ((_d = transactionDetailLocalData.vendor) === null || _d === void 0 ? void 0 : _d.id) != null &&
|
|
332
265
|
Boolean(transactionDetailLocalData.vendor.id) === true
|
|
333
|
-
: lineItem.vendor != null &&
|
|
334
|
-
lineItem.vendor.id != null &&
|
|
335
|
-
Boolean(lineItem.vendor.id) === true) ||
|
|
336
|
-
(isVendorTransactionAvailable
|
|
337
|
-
? transactionDetailLocalData.customer != null &&
|
|
338
|
-
transactionDetailLocalData.customer.id != null &&
|
|
339
|
-
Boolean(transactionDetailLocalData.customer.id) === true
|
|
340
|
-
: lineItem.customer != null &&
|
|
341
|
-
lineItem.customer.id != null &&
|
|
342
|
-
Boolean(lineItem.customer.id) === true));
|
|
266
|
+
: ((_e = lineItem.vendor) === null || _e === void 0 ? void 0 : _e.id) != null && Boolean(lineItem.vendor.id) === true);
|
|
343
267
|
});
|
|
344
268
|
};
|
|
345
269
|
exports.checkIfAllLineItemsAreCategoryClassFilled = checkIfAllLineItemsAreCategoryClassFilled;
|