@zeniai/client-epic-state 5.0.31-betaAR11 → 5.0.31-betaAR3
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/entity/account/accountSelector.d.ts +7 -2
- package/lib/entity/account/accountSelector.js +0 -3
- package/lib/esm/entity/account/accountSelector.js +0 -3
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +25 -12
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +25 -12
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
3
4
|
import { AdditionalBalancesOptions } from '../../commonStateTypes/coaBalance/additionalBalances/getAdditionalBalances';
|
|
4
5
|
import { COABalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
|
|
5
6
|
import { ID } from '../../commonStateTypes/common';
|
|
6
|
-
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
7
7
|
import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
8
8
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
9
9
|
import { Account, AccountBase, AccountState, AccountType } from './accountState';
|
|
@@ -132,7 +132,12 @@ export declare const getAllAccounts: (accountState: AccountState) => Account[];
|
|
|
132
132
|
export interface AccountFilterOption {
|
|
133
133
|
accountId: ID;
|
|
134
134
|
accountName: string;
|
|
135
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Account type for the underlying account (e.g. 'bank', 'credit_card', 'expenses').
|
|
137
|
+
* Required by the Payment Account Type filter dropdown so it can show only the
|
|
138
|
+
* types actually present on the tenant rather than the full ALL_ACCOUNT_TYPES list.
|
|
139
|
+
*/
|
|
140
|
+
accountType: AccountType | undefined;
|
|
136
141
|
}
|
|
137
142
|
/**
|
|
138
143
|
* Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
|
|
@@ -208,9 +208,6 @@ const getTransactionFilterAccountOptions = (accountState) => {
|
|
|
208
208
|
const paymentAccountNames = [];
|
|
209
209
|
const categoryOptions = [];
|
|
210
210
|
for (const account of accounts) {
|
|
211
|
-
if (account.accountType == null) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
211
|
const option = {
|
|
215
212
|
accountId: account.accountId,
|
|
216
213
|
accountName: account.accountName,
|
|
@@ -194,9 +194,6 @@ export const getTransactionFilterAccountOptions = (accountState) => {
|
|
|
194
194
|
const paymentAccountNames = [];
|
|
195
195
|
const categoryOptions = [];
|
|
196
196
|
for (const account of accounts) {
|
|
197
|
-
if (account.accountType == null) {
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
197
|
const option = {
|
|
201
198
|
accountId: account.accountId,
|
|
202
199
|
accountName: account.accountName,
|
|
@@ -332,20 +332,33 @@ const getCategoryValueForTransaction = (key, transaction) => {
|
|
|
332
332
|
return undefined;
|
|
333
333
|
}
|
|
334
334
|
case 'payment_account_name': {
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
335
|
+
// Get from transaction.account or from lines
|
|
336
|
+
if (transaction.transaction.account?.accountName) {
|
|
337
|
+
return transaction.transaction.account.accountName;
|
|
338
|
+
}
|
|
339
|
+
// Get from first line's account
|
|
340
|
+
const firstLine = transaction.transaction.lines?.[0];
|
|
341
|
+
if (firstLine?.type === 'transaction_with_account_and_class_line' ||
|
|
342
|
+
firstLine?.type === 'transaction_with_product_or_service_line' ||
|
|
343
|
+
firstLine?.type === 'journal_entry_transaction_line') {
|
|
344
|
+
const accountLine = firstLine;
|
|
345
|
+
return accountLine.account?.accountName;
|
|
346
|
+
}
|
|
347
|
+
return undefined;
|
|
340
348
|
}
|
|
341
349
|
case 'payment_account_type': {
|
|
342
|
-
//
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
350
|
+
// Similar to payment_account_name but for type
|
|
351
|
+
if (transaction.transaction.account?.accountType) {
|
|
352
|
+
return transaction.transaction.account.accountType;
|
|
353
|
+
}
|
|
354
|
+
const firstLineForType = transaction.transaction.lines?.[0];
|
|
355
|
+
if (firstLineForType?.type === 'transaction_with_account_and_class_line' ||
|
|
356
|
+
firstLineForType?.type === 'transaction_with_product_or_service_line' ||
|
|
357
|
+
firstLineForType?.type === 'journal_entry_transaction_line') {
|
|
358
|
+
const accountLineForType = firstLineForType;
|
|
359
|
+
return accountLineForType.account?.accountType;
|
|
360
|
+
}
|
|
361
|
+
return undefined;
|
|
349
362
|
}
|
|
350
363
|
case 'category': {
|
|
351
364
|
// Get from transactionLocalData (preferred) or from transaction lines
|