@zeniai/client-epic-state 5.0.31-betaAR9 → 5.0.31-betaML2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountSelector.d.ts +6 -33
- package/lib/entity/account/accountSelector.js +8 -37
- package/lib/entity/account/accountState.d.ts +1 -6
- package/lib/entity/account/accountState.js +4 -11
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelector.d.ts +0 -5
- package/lib/entity/class/classSelector.js +0 -8
- package/lib/entity/class/classState.d.ts +1 -1
- 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/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +6 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/esm/entity/account/accountSelector.js +7 -35
- package/lib/esm/entity/account/accountState.js +1 -7
- package/lib/esm/entity/class/classSelector.js +0 -7
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +14 -15
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +81 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -5
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +5 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +66 -11
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +27 -57
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +15 -185
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +12 -1
- package/lib/index.d.ts +20 -20
- package/lib/index.js +51 -49
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -5
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +29 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +16 -6
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +67 -12
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +3 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +3 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +28 -59
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +13 -3
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/spendManagementFilterHelpers.d.ts +4 -45
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +16 -186
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +12 -1
- package/package.json +1 -1
|
@@ -3,41 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getLastTransferEntryReplacement = getLastTransferEntryReplacement;
|
|
7
7
|
exports.getExpenseAutomationTransactionView = getExpenseAutomationTransactionView;
|
|
8
8
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
9
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
10
10
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
11
|
+
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
11
12
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
12
13
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
13
14
|
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
14
|
-
const spendManagementFilterHelpers_1 = require("../../spendManagement/spendManagementFilterHelpers");
|
|
15
15
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
16
16
|
const classListSelector_1 = require("../../classList/classListSelector");
|
|
17
17
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
date: transaction.date,
|
|
22
|
-
amount: transaction.amount,
|
|
23
|
-
vendorName: transaction.vendorName,
|
|
24
|
-
customerName: transaction.customerName,
|
|
25
|
-
vendorId: transaction.vendorId,
|
|
26
|
-
customerId: transaction.customerId,
|
|
27
|
-
description: transaction.description,
|
|
28
|
-
memo: transaction.memo,
|
|
29
|
-
type: transaction.type,
|
|
30
|
-
typeName: transaction.typeName,
|
|
31
|
-
createTime: transaction.createTime,
|
|
32
|
-
transaction: transaction,
|
|
33
|
-
transactionLocalData,
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
exports.toTransactionView = toTransactionView;
|
|
18
|
+
function getLastTransferEntryReplacement(state) {
|
|
19
|
+
return state.expenseAutomationTransactionsViewState.lastTransferEntryReplacement;
|
|
20
|
+
}
|
|
37
21
|
function getExpenseAutomationTransactionView(state) {
|
|
38
22
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
|
|
39
23
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
40
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId,
|
|
24
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
41
25
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
42
26
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
43
27
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -54,42 +38,10 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
54
38
|
? transactionIdsBySelectedPeriod[monthYearPeriodId]
|
|
55
39
|
: null;
|
|
56
40
|
const transactionIds = transactionIdsForSelectedPeriod ?? [];
|
|
57
|
-
const
|
|
58
|
-
const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
|
|
59
|
-
const transactionLocalDataMap = new Map();
|
|
60
|
-
transactionIds.forEach((transactionId) => {
|
|
61
|
-
const transactionData = transactionReviewLocalDataById[transactionId];
|
|
62
|
-
if (transactionData != null) {
|
|
63
|
-
transactionLocalDataMap.set(transactionId, {
|
|
64
|
-
transactionId,
|
|
65
|
-
transactionReviewLocalData: transactionData.transactionReviewLocalData,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
// Step 2: Convert to TransactionView and apply advanced filters
|
|
70
|
-
const transactionViews = transactionsWithCOT.map((transaction) => {
|
|
71
|
-
const localData = transactionLocalDataMap.get(transaction.id);
|
|
72
|
-
return (0, exports.toTransactionView)(transaction, localData);
|
|
73
|
-
});
|
|
74
|
-
// Apply advanced filters if they exist
|
|
75
|
-
const filteredTransactionViews = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('transaction_categorization', transactionViews, filters);
|
|
76
|
-
// Convert back to TransactionWithCOT for return
|
|
77
|
-
const filteredTransactionsWithCOT = filteredTransactionViews.map((view) => view.transaction);
|
|
78
|
-
// Get transactionLocalData for filtered transactions
|
|
79
|
-
// Also include transactionLocalData for transactions that don't exist in transactionState
|
|
80
|
-
// but have local data (to match original behavior)
|
|
81
|
-
const filteredTransactionIds = new Set(filteredTransactionViews.map((view) => view.id));
|
|
82
|
-
const filteredTransactionLocalData = transactionIds
|
|
41
|
+
const transactionLocalData = transactionIds
|
|
83
42
|
.map((transactionId) => {
|
|
84
43
|
const transactionData = transactionReviewLocalDataById[transactionId];
|
|
85
|
-
if (transactionData
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
// Include if transaction is in filtered results, or if transaction doesn't exist in state
|
|
89
|
-
// (to maintain backward compatibility with tests)
|
|
90
|
-
const transactionExists = transactions.some((t) => t.id === transactionId);
|
|
91
|
-
if (filteredTransactionIds.has(transactionId) ||
|
|
92
|
-
!transactionExists) {
|
|
44
|
+
if (transactionData != null) {
|
|
93
45
|
return {
|
|
94
46
|
transactionId,
|
|
95
47
|
transactionReviewLocalData: transactionData.transactionReviewLocalData,
|
|
@@ -97,7 +49,9 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
97
49
|
}
|
|
98
50
|
return null;
|
|
99
51
|
})
|
|
100
|
-
.filter((
|
|
52
|
+
.filter((transaction) => transaction != null);
|
|
53
|
+
const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
|
|
54
|
+
const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
|
|
101
55
|
const monthEndFetchState = monthYearPeriodId != null
|
|
102
56
|
? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
|
|
103
57
|
: { fetchState: 'Not-Started', error: undefined };
|
|
@@ -140,11 +94,24 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
140
94
|
: [];
|
|
141
95
|
const transactionCompletionStatus = allSteps.find((step) => step.step === 'transaction_categorization')?.completionStatus;
|
|
142
96
|
const completionStatus = transactionCompletionStatus ?? 'incomplete';
|
|
97
|
+
const transferAccountsFromApi = expenseAutomationTransactionsViewState.transferAccounts.accountIds
|
|
98
|
+
.map((id) => (0, accountSelector_1.getAccountBaseForTransferAccounts)(accountState, id))
|
|
99
|
+
.filter((account) => account != null);
|
|
100
|
+
/**
|
|
101
|
+
* Credit transfer picker uses transfer-account ids from a dedicated fetch. If that list
|
|
102
|
+
* resolves to nothing while the COA list is loaded, fall back to the full COA list so the
|
|
103
|
+
* credit dropdown is not empty.
|
|
104
|
+
*/
|
|
105
|
+
const transferAccountsList = transferAccountsFromApi.length > 0
|
|
106
|
+
? transferAccountsFromApi
|
|
107
|
+
: accountList.accounts
|
|
108
|
+
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
109
|
+
.filter((account) => account != null);
|
|
143
110
|
return {
|
|
144
111
|
version: 0,
|
|
145
112
|
fetchState: fetchStatus.fetchState,
|
|
146
113
|
error: fetchStatus.error,
|
|
147
|
-
transactions:
|
|
114
|
+
transactions: transactionsWithCOT,
|
|
148
115
|
selectedCheckBoxTransactionIds,
|
|
149
116
|
transactionIdsWithUnsavedData,
|
|
150
117
|
uncategorizedAccounts: uncategorizedIncomeExpense,
|
|
@@ -153,16 +120,18 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
153
120
|
classList: allClasses,
|
|
154
121
|
accountsHierarchyList,
|
|
155
122
|
classHierarchyList,
|
|
156
|
-
transactionLocalData
|
|
123
|
+
transactionLocalData,
|
|
157
124
|
uiState,
|
|
158
125
|
refreshStatus,
|
|
159
126
|
saveStatus,
|
|
160
127
|
markAsNotMiscategorizedStatus,
|
|
128
|
+
createTransferEntryStatus: expenseAutomationTransactionsViewState.createTransferEntryStatus,
|
|
161
129
|
completionStatus,
|
|
162
130
|
totalCountByTab,
|
|
163
131
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
164
132
|
uploadReceiptStatusById,
|
|
165
133
|
selectedTransactionId,
|
|
166
134
|
selectedTransactionLineId,
|
|
135
|
+
transferAccounts: transferAccountsList,
|
|
167
136
|
};
|
|
168
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
3
|
import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
4
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
@@ -14,7 +14,6 @@ import { TransactionCategory, TransactionType } from '../../../entity/transactio
|
|
|
14
14
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
15
15
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
16
16
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
17
|
-
import { TransactionFilters } from '../../spendManagement/spendManagementFilterHelpers';
|
|
18
17
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
19
18
|
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
20
19
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
@@ -90,7 +89,6 @@ export interface SupportedTransactionCategorization {
|
|
|
90
89
|
}
|
|
91
90
|
export declare const initialSupportedTransactionCategorization: SupportedTransactionCategorization;
|
|
92
91
|
export interface TransactionsTabViewState extends FetchedState {
|
|
93
|
-
filters: TransactionFilters;
|
|
94
92
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
95
93
|
refreshStatus: FetchStateAndError;
|
|
96
94
|
saveStatus: FetchStateAndError;
|
|
@@ -103,9 +101,21 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
103
101
|
selectedTransactionId?: ID;
|
|
104
102
|
selectedTransactionLineId?: ID;
|
|
105
103
|
}
|
|
104
|
+
export interface TransferAccountsState {
|
|
105
|
+
accountIds: ID[];
|
|
106
|
+
fetchState: FetchState;
|
|
107
|
+
}
|
|
108
|
+
export type TransferEntryRouteReplacement = {
|
|
109
|
+
newTransactionId: TransactionID;
|
|
110
|
+
previousTransactionId: TransactionID;
|
|
111
|
+
};
|
|
106
112
|
export type TransactionsViewState = {
|
|
113
|
+
createTransferEntryStatus: FetchState;
|
|
114
|
+
/** Set when create-transfer returns a new transaction id; host navigates then acknowledges. */
|
|
115
|
+
lastTransferEntryReplacement: TransferEntryRouteReplacement | undefined;
|
|
107
116
|
selectedTransactionCategorizationTab: TransactionsTab;
|
|
108
117
|
transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
|
|
118
|
+
transferAccounts: TransferAccountsState;
|
|
109
119
|
};
|
|
110
120
|
export interface TransactionLineUpdates {
|
|
111
121
|
account?: AccountBase;
|
|
@@ -17,7 +17,7 @@ export declare const fetchFinanceStatement: import("@reduxjs/toolkit").ActionCre
|
|
|
17
17
|
firstMonthOfFY: Month;
|
|
18
18
|
maxNumOfPeriodsToHighlight: number;
|
|
19
19
|
thisPeriod: TimeframeTick;
|
|
20
|
-
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
}, "financeStatement/updateFinanceStatementThisPeriod">, updateCOABalancesRange: import("@reduxjs/toolkit").ActionCreatorWithPayload<COABalancesRange, "financeStatement/updateCOABalancesRange">, updateSelectedReportId: import("@reduxjs/toolkit").ActionCreatorWithPayload<"cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts", "financeStatement/updateSelectedReportId">, updateFinanceStatementAdditionalBalancesSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
21
|
additionalBalances: COABalanceType[];
|
|
22
22
|
coaBalances: COABalance[];
|
|
23
23
|
firstMonthOfFY: Month;
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined], {
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | undefined;
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -2,8 +2,8 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
2
2
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
3
|
import { ReportsResyncState } from './reportsResyncState';
|
|
4
4
|
export declare const initialReportsResyncState: ReportsResyncState;
|
|
5
|
-
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation"], {
|
|
6
|
-
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
5
|
+
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts"], {
|
|
6
|
+
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts";
|
|
7
7
|
}, "initiateReportsResync/initiateReportsResync", never, never>, initiateReportsClassViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
8
|
reportIdToResync: ReportID;
|
|
9
9
|
}, "initiateReportsResync/initiateReportsClassViewRefetching">, reportsResyncSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { Amount } from '../../commonStateTypes/amount';
|
|
2
|
-
import { ID } from '../../commonStateTypes/common';
|
|
3
1
|
import { TimePeriod } from '../../commonStateTypes/timePeriod';
|
|
4
|
-
import { TransactionType } from '../../entity/transaction/stateTypes/transactionType';
|
|
5
|
-
import { SupportedTransactionWithCOT } from '../../entity/transaction/transactionState';
|
|
6
2
|
import { UserRoleType } from '../../entity/userRole/userRoleType';
|
|
7
3
|
import { RootState } from '../../reducer';
|
|
8
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
9
|
-
import { TransactionReviewLocalDataSelectorView } from '../expenseAutomationView/selectorTypes/transactionsViewSelectorTypes';
|
|
10
5
|
import { TaskListFilterCategoryField, TaskListFilters } from '../taskManager/taskListView/taskList';
|
|
11
6
|
import { TaskWithUserDetails } from '../taskManager/taskListView/taskListSelector';
|
|
12
7
|
import { BillTransactionView } from './billPay/billList/billListSelector';
|
|
@@ -15,8 +10,8 @@ import { PaymentHistoryFilterCategoryDropdownOption, PaymentHistoryFilters } fro
|
|
|
15
10
|
import { ChargeCardRepaymentWithUser } from './chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector';
|
|
16
11
|
import { ReimbursementView } from './reimbursement/remiListView/remiListSelector';
|
|
17
12
|
import { ReimbursementFilters, RemiListViewFilterCategoryField } from './reimbursement/remiListView/remiListState';
|
|
18
|
-
export type SpendManagementFiltersType = BillPayFilters | ReimbursementFilters | TaskListFilters |
|
|
19
|
-
export type SpendManagementFilterEntityType = 'bill_pay' | 'reimbursement' | 'task_management' | '
|
|
13
|
+
export type SpendManagementFiltersType = BillPayFilters | ReimbursementFilters | TaskListFilters | PaymentHistoryFilters;
|
|
14
|
+
export type SpendManagementFilterEntityType = 'bill_pay' | 'reimbursement' | 'task_management' | 'charge_card_payment_history';
|
|
20
15
|
export type FilterCategoryType = 'searchAutocomplete' | 'user' | 'dateRange' | 'numberRange' | 'dropdown';
|
|
21
16
|
export interface MatchingOperatorDropdownOption {
|
|
22
17
|
label: 'is' | 'is not';
|
|
@@ -38,45 +33,9 @@ export interface TaskFilterCategoryDropdownOption {
|
|
|
38
33
|
multiple?: boolean;
|
|
39
34
|
type?: FilterCategoryType;
|
|
40
35
|
}
|
|
41
|
-
export type SpendManagementFilterCategoryDropdownOption = BillPayFilterCategoryDropdownOption | ReimbursementFilterCategoryDropdownOption | TaskFilterCategoryDropdownOption |
|
|
42
|
-
export interface TransactionFilterCategoryDropdownOption {
|
|
43
|
-
value: TransactionFilterCategoryField;
|
|
44
|
-
multiple?: boolean;
|
|
45
|
-
type?: FilterCategoryType;
|
|
46
|
-
}
|
|
47
|
-
export type TransactionFilterEntityType = 'transaction_categorization' | 'customer' | 'vendor' | 'merchant';
|
|
48
|
-
export type TransactionFilterCategoryField = 'payment_account_name' | 'payment_account_type' | 'payee' | 'category' | 'class' | 'amount';
|
|
49
|
-
export declare const TRANSACTION_FILTER_CATEGORIES: TransactionFilterCategoryDropdownOption[];
|
|
50
|
-
export interface TransactionFilters {
|
|
51
|
-
categories: TransactionFilterCategory[];
|
|
52
|
-
categoryCombinationOperator: CategoryCombinationOperator;
|
|
53
|
-
}
|
|
54
|
-
/** Amount filter operators for transaction_categorization (expense automation). Other entities use only equal/not-equal. */
|
|
55
|
-
export type TransactionFilterAmountMatchingOperator = 'equal' | 'not-equal' | 'lessThan' | 'greaterThan' | 'inBetween';
|
|
56
|
-
export interface TransactionFilterCategory {
|
|
57
|
-
field: TransactionFilterCategoryField;
|
|
58
|
-
matchingOperator: TransactionFilterAmountMatchingOperator;
|
|
59
|
-
values: (string | ZeniDate)[];
|
|
60
|
-
valuesCombinationOperator: 'ANY';
|
|
61
|
-
}
|
|
62
|
-
export interface TransactionView {
|
|
63
|
-
amount: Amount;
|
|
64
|
-
createTime: ZeniDate;
|
|
65
|
-
date: ZeniDate;
|
|
66
|
-
description: string;
|
|
67
|
-
id: ID;
|
|
68
|
-
memo: string;
|
|
69
|
-
transaction: SupportedTransactionWithCOT;
|
|
70
|
-
type: TransactionType;
|
|
71
|
-
customerId?: ID;
|
|
72
|
-
customerName?: string;
|
|
73
|
-
transactionLocalData?: TransactionReviewLocalDataSelectorView;
|
|
74
|
-
typeName?: string;
|
|
75
|
-
vendorId?: ID;
|
|
76
|
-
vendorName?: string;
|
|
77
|
-
}
|
|
36
|
+
export type SpendManagementFilterCategoryDropdownOption = BillPayFilterCategoryDropdownOption | ReimbursementFilterCategoryDropdownOption | TaskFilterCategoryDropdownOption | PaymentHistoryFilterCategoryDropdownOption;
|
|
78
37
|
export type FilterCategoryValueType = string | number | ZeniDate;
|
|
79
|
-
export declare const applyAdvancedFiltersOnList: (entity: SpendManagementFilterEntityType, allItems: BillTransactionView[] | ReimbursementView[] | TaskWithUserDetails[] |
|
|
38
|
+
export declare const applyAdvancedFiltersOnList: (entity: SpendManagementFilterEntityType, allItems: BillTransactionView[] | ReimbursementView[] | TaskWithUserDetails[] | ChargeCardRepaymentWithUser[], filters?: BillPayFilters | ReimbursementFilters | TaskListFilters | PaymentHistoryFilters, filteredItems?: (BillTransactionView | ReimbursementView | TaskWithUserDetails | ChargeCardRepaymentWithUser)[], index?: number) => (BillTransactionView | ReimbursementView | TaskWithUserDetails | ChargeCardRepaymentWithUser)[];
|
|
80
39
|
export declare const isBillListDownloadable: (state: RootState, currentTimePeriod: TimePeriod) => boolean;
|
|
81
40
|
export declare const isRemiListDownloadable: (state: RootState, currentTimePeriod: TimePeriod) => boolean;
|
|
82
41
|
export declare const hideCreatedByFilter: (userRole: UserRoleType[]) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.hideCreatedByFilter = exports.isRemiListDownloadable = exports.isBillListDownloadable = exports.applyAdvancedFiltersOnList =
|
|
6
|
+
exports.hideCreatedByFilter = exports.isRemiListDownloadable = exports.isBillListDownloadable = exports.applyAdvancedFiltersOnList = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
9
9
|
const userRoleType_1 = require("../../entity/userRole/userRoleType");
|
|
@@ -13,81 +13,28 @@ const billListState_1 = require("./billPay/billList/billListState");
|
|
|
13
13
|
const helpers_1 = require("./helpers");
|
|
14
14
|
const remiListSelector_1 = require("./reimbursement/remiListView/remiListSelector");
|
|
15
15
|
const remiListState_1 = require("./reimbursement/remiListView/remiListState");
|
|
16
|
-
exports.TRANSACTION_FILTER_CATEGORIES = [
|
|
17
|
-
{ value: 'payment_account_name', type: 'dropdown' },
|
|
18
|
-
{ value: 'payment_account_type', type: 'dropdown' },
|
|
19
|
-
{ value: 'payee', type: 'searchAutocomplete' },
|
|
20
|
-
{ value: 'category', type: 'dropdown' },
|
|
21
|
-
{ value: 'class', type: 'dropdown' },
|
|
22
|
-
{ value: 'amount', type: 'numberRange' },
|
|
23
|
-
];
|
|
24
16
|
//filters items against filter values representing a range. ex: date (from-to), amount(1k<-->5k)
|
|
25
|
-
// For amount: supports new transaction_categorization operators (inBetween, lessThan, greaterThan) and
|
|
26
|
-
// backward compatibility for old format values: ["1000<->5000"] with matchingOperator "equal".
|
|
27
|
-
// Other entities (bill_pay, reimbursement, etc.) use only equal/not-equal and are unchanged.
|
|
28
17
|
const filterItemOnRangeCategoryType = (valueForItem, currentFilter) => {
|
|
29
18
|
let doesItemFallInValueRange = false;
|
|
30
19
|
const filterField = currentFilter.field;
|
|
31
20
|
if (filterField === 'amount') {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const min = Number(values[0]);
|
|
39
|
-
const max = Number(values[1]);
|
|
40
|
-
doesItemFallInValueRange = currentValue >= min && currentValue <= max;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else if (op === 'lessThan') {
|
|
44
|
-
if (values.length >= 1) {
|
|
45
|
-
const threshold = Number(values[0]);
|
|
46
|
-
doesItemFallInValueRange = currentValue < threshold;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else if (op === 'greaterThan') {
|
|
50
|
-
if (values.length >= 1) {
|
|
51
|
-
const threshold = Number(values[0]);
|
|
52
|
-
doesItemFallInValueRange = currentValue > threshold;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else if (op === 'equal' &&
|
|
56
|
-
values.length === 1 &&
|
|
57
|
-
String(values[0]).includes('<->')) {
|
|
58
|
-
// Backward compatibility: old format ["1000<->5000"] with matchingOperator "equal"
|
|
59
|
-
const parts = String(values[0]).split('<->');
|
|
60
|
-
const lowerValue = Number(parts[0] ?? '');
|
|
61
|
-
const higherValue = Number(parts[1] ?? '');
|
|
62
|
-
doesItemFallInValueRange =
|
|
63
|
-
currentValue >= lowerValue && currentValue <= higherValue;
|
|
64
|
-
}
|
|
65
|
-
else if (op === 'equal' && values.length === 1) {
|
|
66
|
-
// New format: exact match on single value (expense automation)
|
|
67
|
-
const val = Number(values[0]);
|
|
68
|
-
doesItemFallInValueRange = currentValue === val;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
// Existing logic for equal/not-equal (bill_pay, reimbursement, etc. or multiple range values)
|
|
72
|
-
for (const filterValue of values) {
|
|
73
|
-
const lowerValue = Number.parseInt(filterValue?.toString()?.split('<->')[0] ?? '', 10);
|
|
74
|
-
const higherValue = Number.parseInt(filterValue?.toString()?.split('<->')[1] ?? '', 10);
|
|
75
|
-
if (currentValue >= lowerValue && currentValue <= higherValue) {
|
|
76
|
-
doesItemFallInValueRange = true;
|
|
77
|
-
}
|
|
21
|
+
for (const filterValue of currentFilter.values) {
|
|
22
|
+
const currentValue = parseInt(valueForItem.toString());
|
|
23
|
+
const lowerValue = parseInt(filterValue?.toString()?.split('<->')[0] ?? '');
|
|
24
|
+
const higherValue = parseInt(filterValue?.toString()?.split('<->')[1] ?? '');
|
|
25
|
+
if (currentValue >= lowerValue && currentValue <= higherValue) {
|
|
26
|
+
doesItemFallInValueRange = true;
|
|
78
27
|
}
|
|
79
28
|
}
|
|
80
|
-
return op === 'not-equal'
|
|
81
|
-
? !doesItemFallInValueRange
|
|
82
|
-
: doesItemFallInValueRange;
|
|
83
29
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
30
|
+
else {
|
|
31
|
+
const currentValue = valueForItem;
|
|
32
|
+
const lowerValue = currentFilter.values[0];
|
|
33
|
+
const higherValue = currentFilter.values[1];
|
|
34
|
+
if (currentValue.isSameOrAfter(lowerValue) &&
|
|
35
|
+
currentValue.isSameOrBefore(higherValue)) {
|
|
36
|
+
doesItemFallInValueRange = true;
|
|
37
|
+
}
|
|
91
38
|
}
|
|
92
39
|
return currentFilter.matchingOperator === 'equal'
|
|
93
40
|
? doesItemFallInValueRange
|
|
@@ -172,11 +119,7 @@ const applyAdvancedFiltersOnList = (entity, allItems, filters, filteredItems = [
|
|
|
172
119
|
? getCategoryValueForReimbursement(key, item)
|
|
173
120
|
: entity === 'task_management'
|
|
174
121
|
? getCategoryValueForTaskList(key, item)
|
|
175
|
-
:
|
|
176
|
-
? getCategoryValueForTransaction(key, item)
|
|
177
|
-
: entity === 'charge_card_payment_history'
|
|
178
|
-
? getCategoryValueForPaymentHistory(key, item)
|
|
179
|
-
: undefined;
|
|
122
|
+
: getCategoryValueForPaymentHistory(key, item);
|
|
180
123
|
if (categoryValue == null) {
|
|
181
124
|
if (currentFilter.matchingOperator === 'not-equal') {
|
|
182
125
|
return true;
|
|
@@ -298,119 +241,6 @@ const getCategoryValueForReimbursement = (key, reimbursement) => {
|
|
|
298
241
|
return undefined;
|
|
299
242
|
}
|
|
300
243
|
};
|
|
301
|
-
const getCategoryValueForTransaction = (key, transaction) => {
|
|
302
|
-
switch (key) {
|
|
303
|
-
case 'amount': {
|
|
304
|
-
// Get from transactionLocalData line items (preferred) - sum all line item amounts
|
|
305
|
-
const localDataForAmount = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
306
|
-
if (localDataForAmount?.lineItemById) {
|
|
307
|
-
const lineItems = Object.values(localDataForAmount.lineItemById);
|
|
308
|
-
if (lineItems.length > 0) {
|
|
309
|
-
// Sum all line item amounts
|
|
310
|
-
const totalAmount = lineItems.reduce((sum, lineItem) => sum + (lineItem.amount?.amount ?? 0), 0);
|
|
311
|
-
return totalAmount;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
// Fallback to transaction-level amount or sum from transaction lines
|
|
315
|
-
if (transaction.transaction.lines &&
|
|
316
|
-
transaction.transaction.lines.length > 0) {
|
|
317
|
-
const totalAmount = transaction.transaction.lines.reduce((sum, line) => sum + (line.amount?.amount ?? 0), 0);
|
|
318
|
-
return totalAmount;
|
|
319
|
-
}
|
|
320
|
-
// Final fallback to transaction amount
|
|
321
|
-
return transaction.amount.amount;
|
|
322
|
-
}
|
|
323
|
-
case 'payee': {
|
|
324
|
-
// Priority: vendorName > customerName > from transactionLocalData
|
|
325
|
-
if (transaction.vendorName) {
|
|
326
|
-
return transaction.vendorName;
|
|
327
|
-
}
|
|
328
|
-
if (transaction.customerName) {
|
|
329
|
-
return transaction.customerName;
|
|
330
|
-
}
|
|
331
|
-
// Check transactionLocalData for vendor/customer
|
|
332
|
-
const localData = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
333
|
-
if (localData?.vendor?.name) {
|
|
334
|
-
return localData.vendor.name;
|
|
335
|
-
}
|
|
336
|
-
if (localData?.customer?.name) {
|
|
337
|
-
return localData.customer.name;
|
|
338
|
-
}
|
|
339
|
-
return undefined;
|
|
340
|
-
}
|
|
341
|
-
case 'payment_account_name': {
|
|
342
|
-
// Match the value the row renders: TransactionCategorizationListRow reads
|
|
343
|
-
// `currentTransaction?.account?.accountName` for the Payment Account Name
|
|
344
|
-
// column. Returning the same field here keeps filter-match parity with the
|
|
345
|
-
// visible cell, so any row a user can see is also a row the filter can match.
|
|
346
|
-
return transaction.transaction.account?.accountName;
|
|
347
|
-
}
|
|
348
|
-
case 'payment_account_type': {
|
|
349
|
-
// Compare against the raw `paymentType` enum (e.g. "credit_card", "check",
|
|
350
|
-
// "cash"). The same enum is what TransactionCategorizationListRow uses for
|
|
351
|
-
// its icon switch on line ~1675, and it's what the dropdown options emit
|
|
352
|
-
// as `value`. Display labels come from each account's `paymentTypeName`
|
|
353
|
-
// field (populated by mapAccountBasePayloadToAccountBase from the backend
|
|
354
|
-
// payload) — no client-side label map required.
|
|
355
|
-
return transaction.transaction.paymentType;
|
|
356
|
-
}
|
|
357
|
-
case 'category': {
|
|
358
|
-
// Get from transactionLocalData (preferred) or from transaction lines
|
|
359
|
-
const localDataForCategory = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
360
|
-
if (localDataForCategory) {
|
|
361
|
-
// Get category from first line item or most common
|
|
362
|
-
const firstLineItem = Object.values(localDataForCategory.lineItemById)[0];
|
|
363
|
-
if (firstLineItem?.account?.accountId) {
|
|
364
|
-
return firstLineItem.account.accountId;
|
|
365
|
-
}
|
|
366
|
-
if (firstLineItem?.account?.qboId) {
|
|
367
|
-
return firstLineItem.account.qboId;
|
|
368
|
-
}
|
|
369
|
-
if (firstLineItem?.account?.accountName) {
|
|
370
|
-
return firstLineItem.account.accountName;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
// Fallback to transaction lines
|
|
374
|
-
const firstLineForCategory = transaction.transaction.lines?.[0];
|
|
375
|
-
if (firstLineForCategory?.type ===
|
|
376
|
-
'transaction_with_account_and_class_line' ||
|
|
377
|
-
firstLineForCategory?.type ===
|
|
378
|
-
'transaction_with_product_or_service_line' ||
|
|
379
|
-
firstLineForCategory?.type === 'journal_entry_transaction_line') {
|
|
380
|
-
const account = firstLineForCategory.account;
|
|
381
|
-
return account?.accountId ?? account?.qboId ?? account?.accountName;
|
|
382
|
-
}
|
|
383
|
-
return undefined;
|
|
384
|
-
}
|
|
385
|
-
case 'class': {
|
|
386
|
-
// Similar to category but for class
|
|
387
|
-
const localDataForClass = transaction.transactionLocalData?.transactionReviewLocalData;
|
|
388
|
-
if (localDataForClass) {
|
|
389
|
-
const firstLineItemForClass = Object.values(localDataForClass.lineItemById)[0];
|
|
390
|
-
if (firstLineItemForClass?.class?.classId) {
|
|
391
|
-
return firstLineItemForClass.class.classId;
|
|
392
|
-
}
|
|
393
|
-
if (firstLineItemForClass?.class?.qboId) {
|
|
394
|
-
return firstLineItemForClass.class.qboId;
|
|
395
|
-
}
|
|
396
|
-
if (firstLineItemForClass?.class?.className) {
|
|
397
|
-
return firstLineItemForClass.class.className;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
const firstLineForClass = transaction.transaction.lines?.[0];
|
|
401
|
-
if (firstLineForClass?.type === 'transaction_with_account_and_class_line' ||
|
|
402
|
-
firstLineForClass?.type ===
|
|
403
|
-
'transaction_with_product_or_service_line' ||
|
|
404
|
-
firstLineForClass?.type === 'journal_entry_transaction_line') {
|
|
405
|
-
const classData = firstLineForClass.class;
|
|
406
|
-
return classData?.classId ?? classData?.qboId ?? classData?.className;
|
|
407
|
-
}
|
|
408
|
-
return undefined;
|
|
409
|
-
}
|
|
410
|
-
default:
|
|
411
|
-
return undefined;
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
244
|
const getCategoryValueForPaymentHistory = (key, repayment) => {
|
|
415
245
|
switch (key) {
|
|
416
246
|
case 'repaymentDate':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|