@zeniai/client-epic-state 4.20.0 → 4.20.1-beta10ND
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/coaBalance/additionalBalances/getSummationBalance.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/tenant/tenantSelector.d.ts +1 -0
- package/lib/entity/tenant/tenantSelector.js +9 -1
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -1
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -1
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/esm/entity/tenant/tenantReducer.js +1 -0
- package/lib/esm/entity/tenant/tenantSelector.js +7 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -1
- package/lib/esm/epic.js +2 -1
- package/lib/esm/index.js +10 -8
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
- package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
- package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +17 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +6 -8
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +132 -73
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/index.d.ts +15 -11
- package/lib/index.js +44 -32
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +18 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +8 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +9 -0
- package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +20 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +6 -8
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +132 -73
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enrichProfitAndLossByClassHorizontalReport = enrichProfitAndLossByClassHorizontalReport;
|
|
4
4
|
const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
|
|
5
|
+
const horizontalSectionEmptyBalancesSlice_1 = require("./horizontalSectionEmptyBalancesSlice");
|
|
5
6
|
const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
|
|
6
7
|
/**
|
|
7
8
|
* Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
|
|
@@ -28,30 +29,31 @@ function enrichHorizontalSection(report, section) {
|
|
|
28
29
|
return total?.balance.amount ?? 0;
|
|
29
30
|
});
|
|
30
31
|
section.sectionHeaderBalancesSlice = buildHorizontalClassColumnBalancesSlice(report, classAmounts, section.sectionTotal.amount);
|
|
31
|
-
const
|
|
32
|
+
const parentIndices = computeHorizontalAccountParentIndices(section.accounts);
|
|
33
|
+
const childrenRowIndicesByParent = buildHorizontalAccountChildIndicesByParent(parentIndices);
|
|
32
34
|
const childrenRecord = {};
|
|
33
35
|
childrenRowIndicesByParent.forEach((childIndices, parentIndex) => {
|
|
34
36
|
childrenRecord[parentIndex] = childIndices;
|
|
35
37
|
});
|
|
36
38
|
section.treeLayout = {
|
|
37
39
|
rootAccountRowIndices: section.accounts
|
|
38
|
-
.map((_, i) =>
|
|
40
|
+
.map((_, i) => (parentIndices[i] === -1 ? i : -1))
|
|
39
41
|
.filter((i) => i >= 0),
|
|
40
42
|
childrenRowIndicesByParent: childrenRecord,
|
|
41
43
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const siblingsPerRow = buildSiblingIndicesPerRow(section.accounts, parentIndices);
|
|
45
|
+
const hasChildFlags = computeHorizontalHasChildFlags(parentIndices);
|
|
46
|
+
for (let accountIndex = 0; accountIndex < section.accounts.length; accountIndex++) {
|
|
47
|
+
const row = section.accounts[accountIndex];
|
|
48
|
+
// Same column order as `report.classColumns` (see `pivotSectionToHorizontal`).
|
|
49
|
+
const classRowAmounts = row.classBalances.map((classBalance) => classBalance.balance.amount);
|
|
48
50
|
row.accountReportData = {
|
|
49
51
|
accountId: row.accountId,
|
|
50
52
|
accountName: row.accountName,
|
|
51
53
|
accountType: row.accountType,
|
|
52
54
|
depth: row.depth,
|
|
53
55
|
balancesInTimeframe: buildHorizontalClassColumnBalancesSlice(report, classRowAmounts, row.rowTotal.amount),
|
|
54
|
-
horizontalTreeView:
|
|
56
|
+
horizontalTreeView: buildHorizontalTreeViewFromPrecomputed(section.accounts, accountIndex, parentIndices, siblingsPerRow, hasChildFlags),
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -69,23 +71,14 @@ function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmou
|
|
|
69
71
|
const currencyCode = firstHeader?.balance.currencyCode ?? fallback.currencyCode;
|
|
70
72
|
const currencySymbol = firstHeader?.balance.currencySymbol ?? fallback.currencySymbol;
|
|
71
73
|
const timeframe = firstHeader?.balanceTimeFrame ?? 'month';
|
|
72
|
-
const emptySlice =
|
|
73
|
-
balances: [],
|
|
74
|
-
additionalBalances: [],
|
|
75
|
-
filter: {
|
|
76
|
-
firstMonthOfFY: report.firstMonthOfFY,
|
|
77
|
-
timeframe,
|
|
78
|
-
balancesRange: { numberOfPeriods: 0, orderBy: 'ascending_date' },
|
|
79
|
-
additionalBalances: [],
|
|
80
|
-
},
|
|
81
|
-
};
|
|
74
|
+
const emptySlice = (0, horizontalSectionEmptyBalancesSlice_1.getEmptyHorizontalSectionBalancesSlice)(report.firstMonthOfFY, timeframe);
|
|
82
75
|
if (report.selectedPeriod == null) {
|
|
83
76
|
return emptySlice;
|
|
84
77
|
}
|
|
85
78
|
const { startDate, endDate } = report.selectedPeriod;
|
|
86
|
-
const balances = report.classColumns.map((col,
|
|
79
|
+
const balances = report.classColumns.map((col, columnIndex) => ({
|
|
87
80
|
balance: {
|
|
88
|
-
amount: classAmounts[
|
|
81
|
+
amount: classAmounts[columnIndex] ?? 0,
|
|
89
82
|
currencyCode,
|
|
90
83
|
currencySymbol,
|
|
91
84
|
},
|
|
@@ -123,64 +116,143 @@ function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmou
|
|
|
123
116
|
},
|
|
124
117
|
};
|
|
125
118
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Parent index per DFS row — O(n). Matches the scan in the former
|
|
121
|
+
* `findHorizontalAccountParentIndex` (depth <= 2 rows have no parent).
|
|
122
|
+
*/
|
|
123
|
+
function computeHorizontalAccountParentIndices(rows) {
|
|
124
|
+
const accountRowCount = rows.length;
|
|
125
|
+
const parentIndex = new Array(accountRowCount).fill(-1);
|
|
126
|
+
const stack = [];
|
|
127
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
128
|
+
const accountRow = rows[rowIndex];
|
|
129
|
+
if (accountRow == null) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const depth = accountRow.depth;
|
|
133
|
+
while (stack.length > 0) {
|
|
134
|
+
const topRow = rows[stack[stack.length - 1]];
|
|
135
|
+
if (topRow == null) {
|
|
136
|
+
stack.pop();
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (topRow.depth < depth) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
stack.pop();
|
|
143
|
+
}
|
|
144
|
+
if (depth > 2 && stack.length > 0) {
|
|
145
|
+
const peek = stack[stack.length - 1];
|
|
146
|
+
const parentRow = rows[peek];
|
|
147
|
+
if (parentRow != null && parentRow.depth === depth - 1) {
|
|
148
|
+
parentIndex[rowIndex] = peek;
|
|
136
149
|
}
|
|
137
|
-
return -1;
|
|
138
150
|
}
|
|
151
|
+
stack.push(rowIndex);
|
|
139
152
|
}
|
|
140
|
-
return
|
|
153
|
+
return parentIndex;
|
|
141
154
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
for (let
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
/** Sibling row indices (same parent + depth), in traversal order — O(n). */
|
|
156
|
+
function buildSiblingIndicesPerRow(rows, parentIndices) {
|
|
157
|
+
const accountRowCount = rows.length;
|
|
158
|
+
const keyToIndices = new Map();
|
|
159
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
160
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
161
|
+
const accountRow = rows[rowIndex];
|
|
162
|
+
if (parentRowIndex == null || accountRow == null) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
const key = `${parentRowIndex}:${accountRow.depth}`;
|
|
166
|
+
let siblingGroup = keyToIndices.get(key);
|
|
167
|
+
if (siblingGroup == null) {
|
|
168
|
+
siblingGroup = [];
|
|
169
|
+
keyToIndices.set(key, siblingGroup);
|
|
170
|
+
}
|
|
171
|
+
siblingGroup.push(rowIndex);
|
|
172
|
+
}
|
|
173
|
+
const siblingsPerRow = new Array(accountRowCount);
|
|
174
|
+
for (let rowIndex = 0; rowIndex < accountRowCount; rowIndex++) {
|
|
175
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
176
|
+
const accountRow = rows[rowIndex];
|
|
177
|
+
if (parentRowIndex == null || accountRow == null) {
|
|
178
|
+
siblingsPerRow[rowIndex] = [rowIndex];
|
|
179
|
+
continue;
|
|
151
180
|
}
|
|
181
|
+
const key = `${parentRowIndex}:${accountRow.depth}`;
|
|
182
|
+
const group = keyToIndices.get(key);
|
|
183
|
+
siblingsPerRow[rowIndex] = group != null ? group : [rowIndex];
|
|
152
184
|
}
|
|
153
|
-
return
|
|
185
|
+
return siblingsPerRow;
|
|
154
186
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
|
|
187
|
+
function computeHorizontalHasChildFlags(parentIndices) {
|
|
188
|
+
const rowCount = parentIndices.length;
|
|
189
|
+
const flags = new Array(rowCount).fill(false);
|
|
190
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
191
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
192
|
+
if (parentRowIndex != null &&
|
|
193
|
+
parentRowIndex >= 0 &&
|
|
194
|
+
parentRowIndex < rowCount) {
|
|
195
|
+
flags[parentRowIndex] = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return flags;
|
|
158
199
|
}
|
|
159
|
-
function
|
|
160
|
-
const
|
|
200
|
+
function buildHorizontalSubAccountAncestorMetadataFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags) {
|
|
201
|
+
const chain = [];
|
|
161
202
|
let walkRowIndex = currentRowIndex;
|
|
162
203
|
while (walkRowIndex >= 0) {
|
|
163
|
-
|
|
164
|
-
|
|
204
|
+
chain.unshift(walkRowIndex);
|
|
205
|
+
const parentRowIndex = parentIndices[walkRowIndex];
|
|
206
|
+
if (parentRowIndex == null) {
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
walkRowIndex = parentRowIndex;
|
|
165
210
|
}
|
|
166
|
-
return
|
|
167
|
-
const
|
|
211
|
+
return chain.map((rowIndex) => {
|
|
212
|
+
const accountRow = dfsOrderedAccountRows[rowIndex];
|
|
213
|
+
const siblingIndices = siblingsPerRow[rowIndex];
|
|
214
|
+
const hasChild = hasChildFlags[rowIndex];
|
|
215
|
+
if (accountRow == null || siblingIndices == null) {
|
|
216
|
+
return {
|
|
217
|
+
depth: 0,
|
|
218
|
+
hasSibling: false,
|
|
219
|
+
hasChildren: hasChild === true,
|
|
220
|
+
isLastNode: true,
|
|
221
|
+
name: '',
|
|
222
|
+
};
|
|
223
|
+
}
|
|
168
224
|
return {
|
|
169
|
-
depth:
|
|
225
|
+
depth: accountRow.depth - 2,
|
|
170
226
|
hasSibling: siblingIndices.length > 1,
|
|
171
|
-
hasChildren:
|
|
227
|
+
hasChildren: hasChild === true,
|
|
172
228
|
isLastNode: rowIndex === siblingIndices[siblingIndices.length - 1],
|
|
173
|
-
name:
|
|
229
|
+
name: accountRow.accountName,
|
|
174
230
|
};
|
|
175
231
|
});
|
|
176
232
|
}
|
|
177
|
-
function
|
|
233
|
+
function buildHorizontalTreeViewFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags) {
|
|
234
|
+
const siblingIndices = siblingsPerRow[currentRowIndex];
|
|
235
|
+
const accountRow = dfsOrderedAccountRows[currentRowIndex];
|
|
236
|
+
const hasChildrenFlag = hasChildFlags[currentRowIndex];
|
|
237
|
+
const treeDepth = accountRow != null ? Math.max(0, accountRow.depth - 2) : 0;
|
|
238
|
+
const hasChildren = hasChildrenFlag === true;
|
|
239
|
+
const siblings = siblingIndices ?? [currentRowIndex];
|
|
240
|
+
return {
|
|
241
|
+
subAccountAncestorMetadata: buildHorizontalSubAccountAncestorMetadataFromPrecomputed(dfsOrderedAccountRows, currentRowIndex, parentIndices, siblingsPerRow, hasChildFlags),
|
|
242
|
+
treeDepth,
|
|
243
|
+
hasChildren,
|
|
244
|
+
hasSiblings: siblings.length > 1,
|
|
245
|
+
isLeaf: !hasChildren,
|
|
246
|
+
isLastNode: currentRowIndex === siblings[siblings.length - 1],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function buildHorizontalAccountChildIndicesByParent(parentIndices) {
|
|
178
250
|
const childIndicesByParentRowIndex = new Map();
|
|
179
|
-
for (let rowIndex = 0; rowIndex <
|
|
180
|
-
const parentRowIndex =
|
|
181
|
-
if (parentRowIndex >= 0) {
|
|
251
|
+
for (let rowIndex = 0; rowIndex < parentIndices.length; rowIndex++) {
|
|
252
|
+
const parentRowIndex = parentIndices[rowIndex];
|
|
253
|
+
if (parentRowIndex != null && parentRowIndex >= 0) {
|
|
182
254
|
let childRowIndices = childIndicesByParentRowIndex.get(parentRowIndex);
|
|
183
|
-
if (childRowIndices
|
|
255
|
+
if (childRowIndices == null) {
|
|
184
256
|
childRowIndices = [];
|
|
185
257
|
childIndicesByParentRowIndex.set(parentRowIndex, childRowIndices);
|
|
186
258
|
}
|
|
@@ -189,16 +261,3 @@ function buildHorizontalAccountChildIndicesByParent(dfsOrderedAccountRows) {
|
|
|
189
261
|
}
|
|
190
262
|
return childIndicesByParentRowIndex;
|
|
191
263
|
}
|
|
192
|
-
function buildHorizontalTreeView(dfsOrderedAccountRows, currentRowIndex) {
|
|
193
|
-
const treeDepth = Math.max(0, dfsOrderedAccountRows[currentRowIndex].depth - 2);
|
|
194
|
-
const siblingIndices = getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, currentRowIndex);
|
|
195
|
-
const hasChildren = horizontalAccountHasChildRows(dfsOrderedAccountRows, currentRowIndex);
|
|
196
|
-
return {
|
|
197
|
-
subAccountAncestorMetadata: buildHorizontalSubAccountAncestorMetadata(dfsOrderedAccountRows, currentRowIndex),
|
|
198
|
-
treeDepth,
|
|
199
|
-
hasChildren,
|
|
200
|
-
hasSiblings: siblingIndices.length > 1,
|
|
201
|
-
isLeaf: !hasChildren,
|
|
202
|
-
isLastNode: currentRowIndex === siblingIndices[siblingIndices.length - 1],
|
|
203
|
-
};
|
|
204
|
-
}
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -424,6 +424,14 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
424
424
|
transactionsWithNoSortKeyValue.push(transaction);
|
|
425
425
|
}
|
|
426
426
|
break;
|
|
427
|
+
case 'invoiceNumber':
|
|
428
|
+
if (transaction.documentId != null) {
|
|
429
|
+
transactionsWithSortKeyValue.push(transaction);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
transactionsWithNoSortKeyValue.push(transaction);
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
427
435
|
case 'dueDate':
|
|
428
436
|
if (currentTab === 'draft') {
|
|
429
437
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -526,6 +534,8 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
526
534
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
527
535
|
case 'paymentMethod':
|
|
528
536
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
537
|
+
case 'invoiceNumber':
|
|
538
|
+
return transaction.documentId;
|
|
529
539
|
}
|
|
530
540
|
}, getColumnWiseSortOrder(sortOrder));
|
|
531
541
|
return [
|
|
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
|
|
|
37
37
|
export type BillTab = ReturnType<typeof toBillTabType>;
|
|
38
38
|
declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
|
|
39
39
|
export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
|
|
40
|
-
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
|
|
40
|
+
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
|
|
41
41
|
export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
|
|
42
42
|
export interface BillPayFilters {
|
|
43
43
|
categories: BillPayFilterCategory[];
|
|
@@ -47,6 +47,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
|
|
|
47
47
|
'invoiceDate',
|
|
48
48
|
'name',
|
|
49
49
|
'paymentMethod',
|
|
50
|
+
'invoiceNumber',
|
|
50
51
|
];
|
|
51
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
53
|
const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
|
|
@@ -8,6 +8,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
8
8
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
9
9
|
const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
|
|
10
10
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
11
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
11
12
|
const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
12
13
|
const accountListSelector_1 = require("../../../accountList/accountListSelector");
|
|
13
14
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
@@ -80,11 +81,14 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
if (sourceBillDetail != null) {
|
|
83
|
-
|
|
84
|
+
const fetchStateList = [
|
|
84
85
|
sourceBillDetail.fetchStatus,
|
|
85
86
|
accountListState.byReportId['billPayAccountList'],
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
];
|
|
88
|
+
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
89
|
+
fetchStateList.push(classListState);
|
|
90
|
+
}
|
|
91
|
+
sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
else {
|
|
@@ -9,6 +9,7 @@ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
|
9
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
10
10
|
const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
|
|
11
11
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
12
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
12
13
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
13
14
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
14
15
|
exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -50,7 +51,7 @@ exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => s
|
|
|
50
51
|
newApprovalRuleId,
|
|
51
52
|
};
|
|
52
53
|
});
|
|
53
|
-
exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
|
|
54
|
+
exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => (0, tenantSelector_1.getIsAccountingClassesEnabled)(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
|
|
54
55
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
55
56
|
const { approverIds, attributes } = approverListState;
|
|
56
57
|
const allApprovalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
|
|
@@ -98,10 +99,9 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
|
|
|
98
99
|
allAttributes,
|
|
99
100
|
filteredAttributes,
|
|
100
101
|
billPaySetupApproverViewUpdateData,
|
|
101
|
-
approverListFetchStatus:
|
|
102
|
-
approverListState.fetchStatus,
|
|
103
|
-
|
|
104
|
-
]),
|
|
102
|
+
approverListFetchStatus: isAccountingClassesEnabled
|
|
103
|
+
? (0, reduceFetchState_1.reduceAllFetchState)([approverListState.fetchStatus, classListState])
|
|
104
|
+
: approverListState.fetchStatus,
|
|
105
105
|
fetchState,
|
|
106
106
|
allAccountingClasses,
|
|
107
107
|
error,
|
|
@@ -3,23 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchBillPayApproversDetailsEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
|
|
6
7
|
const classListReducer_1 = require("../../../../classList/classListReducer");
|
|
7
8
|
const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
|
|
8
9
|
const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPayApproversDetails.match), (0, operators_1.mergeMap)((action) => {
|
|
9
10
|
const { cacheOverride, includeUserRoles } = action.payload;
|
|
10
11
|
const { billPaySetupApproverViewState, classListState } = state$.value;
|
|
11
12
|
const { approverListState } = billPaySetupApproverViewState;
|
|
13
|
+
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
12
14
|
const actions = [];
|
|
13
15
|
if (cacheOverride === true) {
|
|
14
16
|
actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(cacheOverride, includeUserRoles));
|
|
15
|
-
|
|
17
|
+
if (isAccountingClassesEnabled) {
|
|
18
|
+
actions.push((0, classListReducer_1.fetchClassList)());
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
else {
|
|
18
22
|
if (billPaySetupApproverViewState.hasValidState() === false &&
|
|
19
23
|
approverListState.fetchStatus.fetchState !== 'In-Progress') {
|
|
20
24
|
actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(true, includeUserRoles));
|
|
21
25
|
}
|
|
22
|
-
if (
|
|
26
|
+
if (isAccountingClassesEnabled &&
|
|
27
|
+
classListState.hasValidState() === false &&
|
|
23
28
|
classListState.fetchState !== 'In-Progress') {
|
|
24
29
|
actions.push((0, classListReducer_1.fetchClassList)());
|
|
25
30
|
}
|
|
@@ -16,6 +16,7 @@ const companySelector_1 = require("../../../../entity/company/companySelector");
|
|
|
16
16
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
17
17
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
18
18
|
const paymentInstrumentSelector_1 = require("../../../../entity/paymentInstrument/paymentInstrumentSelector");
|
|
19
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
19
20
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
20
21
|
const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
21
22
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -181,12 +182,15 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
181
182
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
182
183
|
billStage = billPayInfo?.stage.code ?? 'draft';
|
|
183
184
|
if (billViewState != null) {
|
|
184
|
-
|
|
185
|
+
const fetchStateList = [
|
|
185
186
|
sourceBillDetail.fetchStatus,
|
|
186
187
|
accountListState.byReportId.billPayAccountList,
|
|
187
|
-
classListState,
|
|
188
188
|
billPaySetupApproverViewState,
|
|
189
|
-
]
|
|
189
|
+
];
|
|
190
|
+
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
191
|
+
fetchStateList.push(classListState);
|
|
192
|
+
}
|
|
193
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
190
194
|
deleteStatus = billViewState.deleteStatus;
|
|
191
195
|
billActivities = (0, billDetailViewSelector_1.getBillActivities)(state, billId, billPayInfo?.stage.code);
|
|
192
196
|
}
|
|
@@ -200,11 +204,14 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
else {
|
|
203
|
-
|
|
207
|
+
const newBillFetchStateList = [
|
|
204
208
|
accountListState.byReportId.billPayAccountList,
|
|
205
|
-
classListState,
|
|
206
209
|
billPaySetupApproverViewState,
|
|
207
|
-
]
|
|
210
|
+
];
|
|
211
|
+
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
212
|
+
newBillFetchStateList.push(classListState);
|
|
213
|
+
}
|
|
214
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)(newBillFetchStateList).fetchState;
|
|
208
215
|
}
|
|
209
216
|
if (sourceBillDetail != null && fetchState == 'Completed') {
|
|
210
217
|
const updatedRecord = sourceBillDetail.billDetailLocalData;
|
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -233,6 +233,8 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
233
233
|
return card.cardName.toLowerCase();
|
|
234
234
|
case 'cardType':
|
|
235
235
|
return card.type.code;
|
|
236
|
+
case 'accountType':
|
|
237
|
+
return card.type.code.includes('credit') ? 'credit' : 'debit';
|
|
236
238
|
case 'status':
|
|
237
239
|
return card.status.code;
|
|
238
240
|
case 'utilisation':
|
|
@@ -69,13 +69,16 @@ const getEditRemiDetail = (state, reimbursementId) => {
|
|
|
69
69
|
paymentTo: reimbursementInfo?.toAccount.billAccountId,
|
|
70
70
|
};
|
|
71
71
|
if (sourceRemiDetail != null) {
|
|
72
|
-
|
|
72
|
+
const fetchStateList = [
|
|
73
73
|
sourceRemiDetail.fetchStatus,
|
|
74
74
|
accountListState.byReportId.reimbursementAccountList,
|
|
75
|
-
classListState,
|
|
76
75
|
merchantListState,
|
|
77
76
|
reimbursementConfigState,
|
|
78
|
-
]
|
|
77
|
+
];
|
|
78
|
+
if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
|
|
79
|
+
fetchStateList.push(classListState);
|
|
80
|
+
}
|
|
81
|
+
fetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
|
|
79
82
|
remiStage = reimbursementInfo?.stage.code ?? 'draft';
|
|
80
83
|
createdBy = (0, userSelector_1.getUserByUserId)(userState, reimbursement?.createdBy ?? '');
|
|
81
84
|
createTime = reimbursement?.createTime;
|
|
@@ -42,6 +42,7 @@ export interface ReimbursementView extends Reimbursement {
|
|
|
42
42
|
approvers: Approvers;
|
|
43
43
|
submittedBy: User | undefined;
|
|
44
44
|
bulkSelectInfo?: RemiBulkSelectInfo;
|
|
45
|
+
createdByUser?: User;
|
|
45
46
|
}
|
|
46
47
|
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
|
|
47
48
|
export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
@@ -51,6 +51,7 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
51
51
|
return {
|
|
52
52
|
...reimbursement,
|
|
53
53
|
submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
|
|
54
|
+
createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
|
|
54
55
|
approvers: approvers,
|
|
55
56
|
};
|
|
56
57
|
});
|
|
@@ -423,6 +424,14 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
423
424
|
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
424
425
|
}
|
|
425
426
|
break;
|
|
427
|
+
case 'createdBy':
|
|
428
|
+
if (reimbursement.createdByUser != null) {
|
|
429
|
+
reimbursementsWithSortKeyValue.push(reimbursement);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
426
435
|
}
|
|
427
436
|
});
|
|
428
437
|
const getColumnWiseSortOrder = (sortOrder) => {
|
|
@@ -430,6 +439,7 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
430
439
|
case 'reportName':
|
|
431
440
|
case 'type':
|
|
432
441
|
case 'status':
|
|
442
|
+
case 'createdBy':
|
|
433
443
|
return sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
434
444
|
default:
|
|
435
445
|
return sortOrder === 'ascending' ? 'desc' : 'asc';
|
|
@@ -449,6 +459,8 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
449
459
|
return getStatusPerTab(reimbursement);
|
|
450
460
|
case 'amount':
|
|
451
461
|
return reimbursement.amount.amount ?? 0;
|
|
462
|
+
case 'createdBy':
|
|
463
|
+
return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
|
|
452
464
|
}
|
|
453
465
|
}, getColumnWiseSortOrder(sortOrder));
|
|
454
466
|
return [
|
|
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
|
|
|
38
38
|
export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
|
|
39
39
|
export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
|
|
40
40
|
export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
|
|
41
|
-
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
|
|
41
|
+
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
|
|
42
42
|
export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
|
|
43
43
|
export interface ReimbursementFilters {
|
|
44
44
|
categories: ReimbursementFilterCategory[];
|
|
@@ -78,8 +78,8 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
78
78
|
lineItem.account?.qboId !== accountLine.account.qboId &&
|
|
79
79
|
Boolean(lineItem.account?.qboId);
|
|
80
80
|
hasClassChanged =
|
|
81
|
-
|
|
82
|
-
lineItem.class?.qboId !== accountLine.class
|
|
81
|
+
(lineItem.class?.qboId != null || accountLine.class?.qboId != null) &&
|
|
82
|
+
lineItem.class?.qboId !== accountLine.class?.qboId;
|
|
83
83
|
const recommendedAccountBase = (0, exports.toRecommendedAccountBase)(lineItem.amount.amount, lineItem.account);
|
|
84
84
|
const recommendedClassBase = (0, exports.toRecommendedClassBase)(lineItem.amount.amount, lineItem.class);
|
|
85
85
|
const latestRecommendedCategory = lineItem.recommendedAccount;
|