@zeniai/client-epic-state 4.10.6 → 4.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonPayloadTypes/agingReportPayloadTypes.d.ts +1 -0
- package/lib/commonPayloadTypes/commonPayload.d.ts +8 -0
- package/lib/commonPayloadTypes/commonPayload.js +20 -0
- package/lib/commonPayloadTypes/subAccountView/subAccountPayloadHelper.js +2 -2
- package/lib/commonStateTypes/accountView/{getNestedAccountIDHeirarchyForReport.d.ts → getNestedAccountIDHierarchyForReport.d.ts} +2 -2
- package/lib/commonStateTypes/accountView/nestedAccountID.d.ts +2 -2
- package/lib/commonStateTypes/agingBalance/agingBalance.d.ts +4 -0
- package/lib/commonStateTypes/agingBalance/agingBalance.js +4 -1
- package/lib/commonStateTypes/classesView/getNestedClassIDHierarchyForReport.d.ts +2 -2
- package/lib/commonStateTypes/classesView/nestedClassID.d.ts +2 -2
- package/lib/commonStateTypes/customerView/getNestedCustomerHierarchy.d.ts +9 -0
- package/lib/commonStateTypes/customerView/getNestedCustomerHierarchy.js +46 -0
- package/lib/commonStateTypes/customerView/nestedCustomerID.d.ts +42 -0
- package/lib/commonStateTypes/customerView/nestedCustomerID.js +9 -0
- package/lib/commonStateTypes/selectorTypes/classesViewSelectorReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +4 -7
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/account/subAccountSelector.d.ts +1 -1
- package/lib/entity/account/subAccountSelector.js +7 -7
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupV2Selector.js +3 -3
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelectorV2.d.ts +1 -1
- package/lib/entity/class/classSelectorV2.js +10 -10
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/customer/customerPayload.d.ts +1 -1
- package/lib/entity/customer/customerPayload.js +1 -1
- package/lib/entity/customer/customerReducer.d.ts +1 -1
- package/lib/entity/customer/customerSelector.d.ts +1 -1
- package/lib/entity/customerIncome/customerIncomeTrend.d.ts +1 -1
- package/lib/entity/customerIncome/customerIncomeTrendReducer.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/notification/notificationPayload.d.ts +46 -0
- package/lib/entity/notification/notificationPayload.js +144 -0
- package/lib/entity/notification/notificationReducer.d.ts +20 -0
- package/lib/entity/notification/notificationReducer.js +118 -0
- package/lib/entity/notification/notificationSelector.d.ts +9 -0
- package/lib/entity/notification/notificationSelector.js +36 -0
- package/lib/entity/notification/notificationState.d.ts +7 -0
- package/lib/entity/notification/notificationState.js +2 -0
- package/lib/entity/notification/types/notificationSelectorTypes.d.ts +8 -0
- package/lib/entity/notification/types/notificationSelectorTypes.js +2 -0
- package/lib/entity/notification/types/notificationStateTypes.d.ts +50 -0
- package/lib/entity/notification/types/notificationStateTypes.js +2 -0
- package/lib/entity/notification/types/notificationTypes.d.ts +24 -0
- package/lib/entity/notification/types/notificationTypes.js +58 -0
- package/lib/entity/sectionAccountsView/getNestedAccountIDHierarchyForSection.js +9 -9
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsViewEpic.js +2 -2
- package/lib/entity/sectionAccountsView/sectionAccountsViewSelector.js +3 -3
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -2
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.js +7 -7
- package/lib/entity/sectionClassesViewV2/selectorHelpers/getNestedClassIDHierarchyForSection.js +7 -7
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +5 -1
- package/lib/entity/transaction/stateTypes/customerTransaction.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/epic.d.ts +7 -3
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +24 -14
- package/lib/index.js +35 -13
- package/lib/reducer.d.ts +7 -1
- package/lib/reducer.js +6 -0
- package/lib/view/accountList/accountListReducer.js +2 -2
- package/lib/view/accountList/accountListSelector.d.ts +3 -3
- package/lib/view/accountList/accountListSelector.js +3 -3
- package/lib/view/accountList/accountListState.d.ts +2 -2
- package/lib/view/accountMappingView/accountMappingReducer.js +19 -19
- package/lib/view/accountMappingView/accountMappingState.d.ts +8 -8
- package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +8 -8
- package/lib/view/accountMappingView/accountMappingViewSelector.js +7 -7
- package/lib/view/apAgingView/apAgingReport/apAgingReducer.d.ts +7 -5
- package/lib/view/apAgingView/apAgingReport/apAgingReducer.js +34 -15
- package/lib/view/apAgingView/apAgingReport/apAgingSelector.d.ts +1 -1
- package/lib/view/apAgingView/apAgingReport/apAgingSelector.js +29 -16
- package/lib/view/apAgingView/apAgingReport/apAgingState.d.ts +6 -3
- package/lib/view/apAgingView/apAgingReport/fetchApAgingEpic.js +11 -7
- package/lib/view/arAgingView/arAgingDetail/arAgingDetailSelector.d.ts +1 -1
- package/lib/view/arAgingView/arAgingReport/arAgingPayload.js +8 -1
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.d.ts +13 -7
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +49 -15
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.d.ts +12 -6
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +68 -35
- package/lib/view/arAgingView/arAgingReport/arAgingState.d.ts +12 -4
- package/lib/view/arAgingView/arAgingReport/fetchArAgingEpic.js +10 -7
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- 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/classList/classListSelector.d.ts +3 -3
- package/lib/view/classList/classListSelector.js +3 -3
- package/lib/view/classList/classListState.d.ts +2 -2
- package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewSelector.d.ts +4 -4
- package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewSelector.js +4 -4
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +4 -4
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +4 -4
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +4 -4
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +4 -4
- package/lib/view/dashboard/dashboardEpic.js +6 -4
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +3 -3
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewSelector.js +3 -3
- package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewState.d.ts +2 -2
- package/lib/view/notificationView/epics/fetchNotificationUnreadCountEpic.d.ts +10 -0
- package/lib/view/notificationView/epics/fetchNotificationUnreadCountEpic.js +39 -0
- package/lib/view/notificationView/epics/fetchNotificationViewEpic.d.ts +9 -0
- package/lib/view/notificationView/epics/fetchNotificationViewEpic.js +56 -0
- package/lib/view/notificationView/epics/updateNotificationViewAllNotificationsStatusEpic.d.ts +9 -0
- package/lib/view/notificationView/epics/updateNotificationViewAllNotificationsStatusEpic.js +50 -0
- package/lib/view/notificationView/epics/updateNotificationViewNotificationStatusEpic.d.ts +9 -0
- package/lib/view/notificationView/epics/updateNotificationViewNotificationStatusEpic.js +86 -0
- package/lib/view/notificationView/notificationView.helpers.d.ts +2 -0
- package/lib/view/notificationView/notificationView.helpers.js +11 -0
- package/lib/view/notificationView/notificationViewPayload.d.ts +48 -0
- package/lib/view/notificationView/notificationViewPayload.js +2 -0
- package/lib/view/notificationView/notificationViewReducer.d.ts +64 -0
- package/lib/view/notificationView/notificationViewReducer.js +372 -0
- package/lib/view/notificationView/notificationViewSelector.d.ts +29 -0
- package/lib/view/notificationView/notificationViewSelector.js +89 -0
- package/lib/view/notificationView/notificationViewState.d.ts +31 -0
- package/lib/view/notificationView/notificationViewState.js +19 -0
- package/lib/view/opExClassesView/opExClassesViewReducer.js +3 -3
- package/lib/view/opExClassesView/opExClassesViewSelector.js +3 -3
- package/lib/view/opExClassesView/opExClassesViewState.d.ts +2 -2
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +3 -3
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/revenueClassesView/revenueClassesViewReducer.js +3 -3
- package/lib/view/revenueClassesView/revenueClassesViewSelector.js +3 -3
- package/lib/view/revenueClassesView/revenueClassesViewState.d.ts +2 -2
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +5 -5
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +5 -5
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -4
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -4
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +37 -5
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -4
- package/lib/view/transactionDetail/transactionDetailSelector.js +4 -4
- package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -1
- package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +1 -1
- package/lib/zeniAPI.d.ts +2 -0
- package/lib/zeniAPI.js +8 -0
- package/package.json +2 -1
- package/lib/commonStateTypes/accountView/{getNestedAccountIDHeirarchyForReport.js → getNestedAccountIDHierarchyForReport.js} +0 -0
- package/lib/entity/customer/{customer.d.ts → customerState.d.ts} +4 -4
- /package/lib/entity/customer/{customer.js → customerState.js} +0 -0
|
@@ -3,6 +3,7 @@ import { ID } from '../commonStateTypes/common';
|
|
|
3
3
|
import { AgingReportInvoice } from '../commonStateTypes/viewAndReport/agingReportStateTypes';
|
|
4
4
|
interface AgingAmountPayload {
|
|
5
5
|
value: number | null;
|
|
6
|
+
total_value?: number | null;
|
|
6
7
|
}
|
|
7
8
|
export interface AgingBalancePayload {
|
|
8
9
|
amount?: AgingAmountPayload;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { AllowedValueWithCode } from '../commonStateTypes/allowedValue';
|
|
1
2
|
export interface AllowedValueWithCodePayload {
|
|
2
3
|
code: string;
|
|
3
4
|
name: string;
|
|
4
5
|
}
|
|
6
|
+
export interface AllowedValueWithCodeOptionalPayload {
|
|
7
|
+
code: string | null;
|
|
8
|
+
name: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function isAllowedValueWithCodePayload(allowedValueWithCodePayload: any): allowedValueWithCodePayload is AllowedValueWithCodePayload;
|
|
11
|
+
export declare function isAllowedValueWithCodeOptionalPayload(allowedValueWithCodePayload: any): allowedValueWithCodePayload is AllowedValueWithCodeOptionalPayload;
|
|
12
|
+
export declare function toAllowedValueWithCode(allowedValueWithCodePayload: AllowedValueWithCodePayload): AllowedValueWithCode;
|
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toAllowedValueWithCode = exports.isAllowedValueWithCodeOptionalPayload = exports.isAllowedValueWithCodePayload = void 0;
|
|
4
|
+
function isAllowedValueWithCodePayload(allowedValueWithCodePayload // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
5
|
+
) {
|
|
6
|
+
return (isAllowedValueWithCodeOptionalPayload(allowedValueWithCodePayload) &&
|
|
7
|
+
allowedValueWithCodePayload.code != null &&
|
|
8
|
+
allowedValueWithCodePayload.name != null);
|
|
9
|
+
}
|
|
10
|
+
exports.isAllowedValueWithCodePayload = isAllowedValueWithCodePayload;
|
|
11
|
+
function isAllowedValueWithCodeOptionalPayload(allowedValueWithCodePayload // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
12
|
+
) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (((_a = Object.keys(allowedValueWithCodePayload)) !== null && _a !== void 0 ? _a : []).includes('code') &&
|
|
15
|
+
((_b = Object.keys(allowedValueWithCodePayload)) !== null && _b !== void 0 ? _b : []).includes('name'));
|
|
16
|
+
}
|
|
17
|
+
exports.isAllowedValueWithCodeOptionalPayload = isAllowedValueWithCodeOptionalPayload;
|
|
18
|
+
// This helper is useful if we have any difference in AllowedValueWithCode from AllowedValueWithCodePayload
|
|
19
|
+
function toAllowedValueWithCode(allowedValueWithCodePayload) {
|
|
20
|
+
return allowedValueWithCodePayload;
|
|
21
|
+
}
|
|
22
|
+
exports.toAllowedValueWithCode = toAllowedValueWithCode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSubAccountsMetadataForAccountList = void 0;
|
|
4
|
-
const
|
|
4
|
+
const getNestedAccountIDHierarchyForReport_1 = require("../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
5
5
|
const getSubAccountsMetadataForAccountList = (accountListWithBalances, accountMetadataRecordsByID, sectionId, classesViewParentID) => {
|
|
6
6
|
const accountMetadataWithBalances = [];
|
|
7
7
|
accountListWithBalances != null &&
|
|
@@ -11,7 +11,7 @@ const getSubAccountsMetadataForAccountList = (accountListWithBalances, accountMe
|
|
|
11
11
|
if (accountId != null) {
|
|
12
12
|
accountMetadataWithBalances.push({
|
|
13
13
|
accountsViewParentID: {
|
|
14
|
-
parentAccountId: (0,
|
|
14
|
+
parentAccountId: (0, getNestedAccountIDHierarchyForReport_1.getParentAccountId)(accountId),
|
|
15
15
|
sectionId,
|
|
16
16
|
},
|
|
17
17
|
accountMetadataPayload: accountMetadataRecordsByID[eachAccountId].accountMetadataPayload,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { AccountMetadataPayload } from '../../entity/account/accountPayload';
|
|
2
2
|
import { AccountMetadata } from '../../entity/account/accountState';
|
|
3
3
|
import { ID } from '../common';
|
|
4
|
-
import { AccountMetadataRecordsByID,
|
|
4
|
+
import { AccountMetadataRecordsByID, NestedAccountHierarchyForReport, NestedAccountID } from './nestedAccountID';
|
|
5
5
|
/**
|
|
6
6
|
* This function builds the hierarchy which is used to display all accounts
|
|
7
7
|
* in the selection view
|
|
8
8
|
* @param accountsMetadata
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export declare function geNestedAccountIDHierarchyForReport(accountsMetadata: AccountMetadata[]):
|
|
11
|
+
export declare function geNestedAccountIDHierarchyForReport(accountsMetadata: AccountMetadata[]): NestedAccountHierarchyForReport[];
|
|
12
12
|
/**
|
|
13
13
|
* Modified this function to remove recursion. The accounts metadata will ALWAYS be sorted such that all
|
|
14
14
|
* parent accounts of any will appear before any child account.
|
|
@@ -45,12 +45,12 @@ export interface NestedAccountIDHierarchy {
|
|
|
45
45
|
id: NestedAccountID;
|
|
46
46
|
children: NestedAccountIDHierarchy[];
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface NestedAccountHierarchyForReport {
|
|
49
49
|
accountId: NestedAccountID;
|
|
50
50
|
accountName: string;
|
|
51
51
|
qboId: ID | undefined;
|
|
52
52
|
coaId?: ID;
|
|
53
|
-
children:
|
|
53
|
+
children: NestedAccountHierarchyForReport[];
|
|
54
54
|
hasSiblings: boolean;
|
|
55
55
|
}
|
|
56
56
|
export declare type AccountMetadataRecordsByID = Record<ID, {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
1
2
|
import { Amount } from '../amount';
|
|
2
3
|
export declare const AGING_PERIODS: readonly ["current_due", "due_1-30_days", "due_31-60_days", "due_61-90_days", "due_over_90_days"];
|
|
3
4
|
export declare const toAgingPeriod: (v: string) => "current_due" | "due_1-30_days" | "due_31-60_days" | "due_61-90_days" | "due_over_90_days";
|
|
4
5
|
export declare type AgingPeriod = ReturnType<typeof toAgingPeriod>;
|
|
6
|
+
export declare const getAgingBalancesKey: (reportDate: ZeniDate) => string;
|
|
7
|
+
export declare type AgingBalancesKey = ReturnType<typeof getAgingBalancesKey>;
|
|
5
8
|
export interface AgingBalance {
|
|
6
9
|
balance: Amount;
|
|
7
10
|
period: AgingPeriod;
|
|
8
11
|
id?: string;
|
|
9
12
|
label?: string;
|
|
13
|
+
totalBalance?: Amount;
|
|
10
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toAgingPeriod = exports.AGING_PERIODS = void 0;
|
|
3
|
+
exports.getAgingBalancesKey = exports.toAgingPeriod = exports.AGING_PERIODS = void 0;
|
|
4
|
+
const formatZeniDateFY_1 = require("../fiscalYearHelpers/formatZeniDateFY");
|
|
4
5
|
const stringToUnion_1 = require("../stringToUnion");
|
|
5
6
|
exports.AGING_PERIODS = [
|
|
6
7
|
'current_due',
|
|
@@ -11,3 +12,5 @@ exports.AGING_PERIODS = [
|
|
|
11
12
|
];
|
|
12
13
|
const toAgingPeriod = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.AGING_PERIODS);
|
|
13
14
|
exports.toAgingPeriod = toAgingPeriod;
|
|
15
|
+
const getAgingBalancesKey = (reportDate) => `${reportDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)}`;
|
|
16
|
+
exports.getAgingBalancesKey = getAgingBalancesKey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NestedClassID,
|
|
1
|
+
import { NestedClassID, NestedClassHierarchyForReport, ClassMetadataRecordsByID } from './nestedClassID';
|
|
2
2
|
import { ClassMetadata } from '../../entity/class/classState';
|
|
3
3
|
import { ID } from '../common';
|
|
4
4
|
import { ClassMetadataPayload } from '../../entity/class/classPayload';
|
|
@@ -8,7 +8,7 @@ import { ClassMetadataPayload } from '../../entity/class/classPayload';
|
|
|
8
8
|
* @param classesMetadata
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export declare function geNestedClassIDHierarchyForReport(classesMetadata: ClassMetadata[]):
|
|
11
|
+
export declare function geNestedClassIDHierarchyForReport(classesMetadata: ClassMetadata[]): NestedClassHierarchyForReport[];
|
|
12
12
|
/**
|
|
13
13
|
* Modified this function to remove recursion. The classes metadata will ALWAYS be sorted such that all
|
|
14
14
|
* parent classes of any will appear before any child class.
|
|
@@ -41,13 +41,13 @@ export interface NestedClassIDHierarchy {
|
|
|
41
41
|
id: NestedClassID;
|
|
42
42
|
children: NestedClassIDHierarchy[];
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
44
|
+
export interface NestedClassHierarchyForReport {
|
|
45
45
|
classId: NestedClassID;
|
|
46
46
|
className: string;
|
|
47
47
|
qboId: ID | undefined;
|
|
48
48
|
fullyQualifiedAccountingClassName: string;
|
|
49
49
|
accountingClassNumber: string | undefined;
|
|
50
|
-
children:
|
|
50
|
+
children: NestedClassHierarchyForReport[];
|
|
51
51
|
hasSiblings: boolean;
|
|
52
52
|
}
|
|
53
53
|
export declare type ClassMetadataRecordsByID = Record<ID, {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Customer } from '../../entity/customer/customerState';
|
|
2
|
+
import { NestedCustomerHierarchy } from './nestedCustomerID';
|
|
3
|
+
/**
|
|
4
|
+
* This function builds the hierarchy which is used to display all customers
|
|
5
|
+
* in the selection view
|
|
6
|
+
* @param customers
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNestedCustomerHierarchy(customers: Customer[]): NestedCustomerHierarchy[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNestedCustomerHierarchy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This function builds the hierarchy which is used to display all customers
|
|
6
|
+
* in the selection view
|
|
7
|
+
* @param customers
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function getNestedCustomerHierarchy(customers) {
|
|
11
|
+
const parentCustomers = [];
|
|
12
|
+
customers.forEach((customerMeta) => {
|
|
13
|
+
if (customerMeta.isSubCustomer === false ||
|
|
14
|
+
// look for its parent in the entire metadata. If not found, then push this also as a rootNode
|
|
15
|
+
customers.find((eachCustomer) => eachCustomer.id === customerMeta.parentCustomerId) == null) {
|
|
16
|
+
parentCustomers.push(customerMeta);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const nestedParents = parentCustomers.map((parentCustomer) => {
|
|
20
|
+
const customerId = parentCustomer.id;
|
|
21
|
+
return {
|
|
22
|
+
customerId: [customerId],
|
|
23
|
+
customerName: parentCustomer.name,
|
|
24
|
+
qboId: parentCustomer.qboId,
|
|
25
|
+
children: getNestedChildren([customerId], customers),
|
|
26
|
+
hasSiblings: parentCustomers.length > 1,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return nestedParents;
|
|
30
|
+
}
|
|
31
|
+
exports.getNestedCustomerHierarchy = getNestedCustomerHierarchy;
|
|
32
|
+
const getNestedChildren = (parentCustomer, allCustomers) => {
|
|
33
|
+
const parentId = parentCustomer[0];
|
|
34
|
+
const children = allCustomers.filter((eachCustomer) => eachCustomer.parentCustomerId === parentId);
|
|
35
|
+
const nestedChildren = children.map((child) => {
|
|
36
|
+
const childId = [child.id, ...parentCustomer];
|
|
37
|
+
return {
|
|
38
|
+
customerId: childId,
|
|
39
|
+
customerName: child.name,
|
|
40
|
+
qboId: child.qboId,
|
|
41
|
+
children: getNestedChildren(childId, allCustomers),
|
|
42
|
+
hasSiblings: children.length > 1,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return nestedChildren;
|
|
46
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ID } from '../common';
|
|
2
|
+
export declare type CustomerIDPlus0SubCustomer = [thisCustomerId: string];
|
|
3
|
+
export declare type CustomerIDPlus1SubCustomer = [
|
|
4
|
+
thisCustomerId: string,
|
|
5
|
+
parentCustomerId: string
|
|
6
|
+
];
|
|
7
|
+
export declare type CustomerIDPlus2SubCustomer = [
|
|
8
|
+
thisCustomerId: string,
|
|
9
|
+
parentCustomerId: string,
|
|
10
|
+
greatParentCustomerId: string
|
|
11
|
+
];
|
|
12
|
+
export declare type CustomerIDPlus3SubCustomer = [
|
|
13
|
+
thisCustomerId: string,
|
|
14
|
+
parentCustomerId: string,
|
|
15
|
+
greatParentCustomerId: string,
|
|
16
|
+
greatGreatParentCustomerId: string
|
|
17
|
+
];
|
|
18
|
+
export declare type CustomerIDPlus4SubCustomer = [
|
|
19
|
+
thisCustomerId: string,
|
|
20
|
+
parentCustomerId: string,
|
|
21
|
+
greatParentCustomerId: string,
|
|
22
|
+
greatGreatParentCustomerId: string,
|
|
23
|
+
greatGreatGreatParentCustomerId: string
|
|
24
|
+
];
|
|
25
|
+
export declare const MAX_SUB_CUSTOMERS_SUPPORTED = 4;
|
|
26
|
+
/**
|
|
27
|
+
* Example usage:
|
|
28
|
+
* Root level customer ID = ["thisCustomerId"]
|
|
29
|
+
* ID of a customer with one parent customer, 1 level nesting = ["parentCustomerId", "thisCustomerId"];
|
|
30
|
+
* ID of a customer which has a parent and a grand parent, 2 level nesting = ["grandParentCustomerId", "parentCustomerId", "thisCustomerId"]
|
|
31
|
+
* and so on..
|
|
32
|
+
*/
|
|
33
|
+
export declare type NestedCustomerID = CustomerIDPlus0SubCustomer | CustomerIDPlus1SubCustomer | CustomerIDPlus2SubCustomer | CustomerIDPlus3SubCustomer | CustomerIDPlus4SubCustomer;
|
|
34
|
+
export declare function getNestedCustomerIDStr(nestedCustomerId: NestedCustomerID): `${string}-${string}-${string}-${string}-${string}`;
|
|
35
|
+
export declare type NestedCustomerIDStr = ReturnType<typeof getNestedCustomerIDStr>;
|
|
36
|
+
export interface NestedCustomerHierarchy {
|
|
37
|
+
customerId: NestedCustomerID;
|
|
38
|
+
customerName: string;
|
|
39
|
+
qboId: ID | undefined;
|
|
40
|
+
children: NestedCustomerHierarchy[];
|
|
41
|
+
hasSiblings: boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNestedCustomerIDStr = exports.MAX_SUB_CUSTOMERS_SUPPORTED = void 0;
|
|
4
|
+
exports.MAX_SUB_CUSTOMERS_SUPPORTED = 4; // QBO limitation, there can only be 4 nested subcustomers under a customer (i.e) customer -> subcustomer1 -> subcustomer2 -> subcustomer3 -> subcustomer4.
|
|
5
|
+
function getNestedCustomerIDStr(nestedCustomerId) {
|
|
6
|
+
const [customerId, parentCustomerId, greatParentCustomerId, greatGreatParentCustomerId, greatGreatGreatParentCustomerId,] = nestedCustomerId;
|
|
7
|
+
return `${customerId}-${parentCustomerId !== null && parentCustomerId !== void 0 ? parentCustomerId : ''}-${greatParentCustomerId !== null && greatParentCustomerId !== void 0 ? greatParentCustomerId : ''}-${greatGreatParentCustomerId !== null && greatGreatParentCustomerId !== void 0 ? greatGreatParentCustomerId : ''}-${greatGreatGreatParentCustomerId !== null && greatGreatGreatParentCustomerId !== void 0 ? greatGreatGreatParentCustomerId : ''}`;
|
|
8
|
+
}
|
|
9
|
+
exports.getNestedCustomerIDStr = getNestedCustomerIDStr;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SectionClassesViewReportV2 } from '../../entity/sectionClassesViewV2/sectionClassesViewSelectorTypes';
|
|
2
|
-
import {
|
|
2
|
+
import { NestedClassHierarchyForReport, NestedClassID } from '../classesView/nestedClassID';
|
|
3
3
|
import { COABalancesFilterClassesView } from '../coaBalance/coaBalancesFilterClassesView';
|
|
4
4
|
import { DataAvailable } from '../dataAvailable';
|
|
5
5
|
import { SelectorReport } from '../viewAndReport/viewAndReport';
|
|
@@ -9,7 +9,7 @@ export interface ClassesViewSelectorReportV2<SectionID extends string, Calculate
|
|
|
9
9
|
calculatedSections: Record<CalculatedSectionID, CalculatedSection>;
|
|
10
10
|
idsInOrder: (SectionID | CalculatedSectionID)[];
|
|
11
11
|
dataAvailable?: DataAvailable;
|
|
12
|
-
|
|
12
|
+
classHierarchy: NestedClassHierarchyForReport[];
|
|
13
13
|
classesToFilterOut: NestedClassID[];
|
|
14
14
|
filter: COABalancesFilterClassesView;
|
|
15
15
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Customer } from '../../entity/customer/
|
|
1
|
+
import { Customer } from '../../entity/customer/customerState';
|
|
2
2
|
import { TransactionType } from '../../entity/transaction/stateTypes/transactionType';
|
|
3
3
|
import { Vendor } from '../../entity/vendor/vendorState';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { Amount } from '../amount';
|
|
6
|
-
import { COABalanceMonthQuarterTimeframe } from '../coaBalance/coaBalance';
|
|
7
6
|
import { FetchState, ID } from '../common';
|
|
8
7
|
import { SortOrder } from '../selectorTypes/sortOrderTypes';
|
|
9
8
|
import { ReportID } from './viewAndReport';
|
|
9
|
+
export declare type AgingDateSelectionType = 'last_month' | 'last_quarter' | 'custom_date';
|
|
10
10
|
export declare type AgingReportId = Extract<ReportID, 'accounts_payable_aging' | 'accounts_receivable_aging'>;
|
|
11
11
|
export declare const AGING_REPORT_SORT_KEYS: readonly ["current_due", "due_1-30_days", "due_31-60_days", "due_61-90_days", "due_over_90_days", "vendor", "total", "customer"];
|
|
12
12
|
export declare const toAgingReportSortKey: (v: string) => "total" | "vendor" | "customer" | "current_due" | "due_1-30_days" | "due_31-60_days" | "due_61-90_days" | "due_over_90_days";
|
|
@@ -22,16 +22,13 @@ export interface AgingReportInvoice {
|
|
|
22
22
|
transactionType: TransactionType;
|
|
23
23
|
entityId: ID;
|
|
24
24
|
}
|
|
25
|
-
export interface AgingSelectedDate {
|
|
26
|
-
date: ZeniDate;
|
|
27
|
-
timeframe?: COABalanceMonthQuarterTimeframe;
|
|
28
|
-
}
|
|
29
25
|
export interface AgingReportUIState {
|
|
30
26
|
searchString: string;
|
|
31
27
|
sortKey: AgingReportSortKey;
|
|
32
28
|
sortOrder: SortOrder;
|
|
33
29
|
downloadState: FetchState;
|
|
34
|
-
selectedDate
|
|
30
|
+
selectedDate: ZeniDate;
|
|
31
|
+
agingDateSelectionType: AgingDateSelectionType;
|
|
35
32
|
}
|
|
36
33
|
export interface AgingDetailReportUIState {
|
|
37
34
|
sortKey: keyof AgingReportInvoice;
|
|
@@ -3,8 +3,8 @@ import { FetchStateAndError, ID } from '../common';
|
|
|
3
3
|
import { DataAvailable } from '../dataAvailable';
|
|
4
4
|
import { Month } from '../timePeriod';
|
|
5
5
|
import { ZeniDate } from '../../zeniDayJS';
|
|
6
|
-
export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "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", "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", "charge_cards", "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"];
|
|
7
|
-
export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "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" | "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" | "charge_cards" | "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";
|
|
6
|
+
export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "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", "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", "charge_cards", "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"];
|
|
7
|
+
export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "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" | "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" | "charge_cards" | "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";
|
|
8
8
|
export declare type ReportID = ReturnType<typeof toReportID>;
|
|
9
9
|
export declare type ReportIDPlusForecastID = ReportID | `${ReportID}+${ID}`;
|
|
10
10
|
/** Any view state should extend this interface */
|
|
@@ -13,7 +13,7 @@ export declare const toAccountTypeStrict: (v: string | null | undefined) => Acco
|
|
|
13
13
|
export declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
|
|
14
14
|
export declare type AccountLabel = ReturnType<typeof toAccountLabel>;
|
|
15
15
|
export declare const toAccountLabelStrict: (v: string | null | undefined) => AccountLabel | undefined;
|
|
16
|
-
export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-operating_expenses` | `${string}-operating_expenses_by_classes` | `${string}-revenue` | `${string}-revenue_by_classes` | `${string}-net_burn_or_income` | `${string}-net_burn_or_income_story_card` | `${string}-net_burn_or_income_by_classes` | `${string}-cash_position` | `${string}-top_expenses` | `${string}-profit_and_loss` | `${string}-profit_and_loss_by_classes` | `${string}-balance_sheet` | `${string}-cash_flow` | `${string}-dashboard` | `${string}-finance_statement` | `${string}-transaction_list_of_account` | `${string}-transaction_list_missing_receipt` | `${string}-transaction_list_of_account_by_class` | `${string}-transaction_detail` | `${string}-cash_in_cash_out` | `${string}-insights_dashboard` | `${string}-company_details` | `${string}-class_list` | `${string}-account_list` | `${string}-account_list_by_type` | `${string}-vendor` | `${string}-task_card` | `${string}-bill_pay` | `${string}-reimbursement` | `${string}-bill_pay_card` | `${string}-reimbursement_card` | `${string}-bill_pay_promo_card` | `${string}-zeni_accounts` | `${string}-zeni_accounts_promo_card` | `${string}-charge_cards` | `${string}-reimbursement_promo_card` | `${string}-onboarding` | `${string}-operating_expenses_by_vendor` | `${string}-operating_expenses_by_vendor_summary` | `${string}-vendors_tab` | `${string}-accounts_payable_aging` | `${string}-accounts_receivable_aging` | `${string}-vendor_global_review` | `${string}-prepaid_expenses` | `${string}-fixed_assets` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-operating_expenses+${string}` | `${string}-operating_expenses_by_classes+${string}` | `${string}-revenue+${string}` | `${string}-revenue_by_classes+${string}` | `${string}-net_burn_or_income+${string}` | `${string}-net_burn_or_income_story_card+${string}` | `${string}-net_burn_or_income_by_classes+${string}` | `${string}-cash_position+${string}` | `${string}-top_expenses+${string}` | `${string}-profit_and_loss+${string}` | `${string}-profit_and_loss_by_classes+${string}` | `${string}-balance_sheet+${string}` | `${string}-cash_flow+${string}` | `${string}-dashboard+${string}` | `${string}-finance_statement+${string}` | `${string}-transaction_list_of_account+${string}` | `${string}-transaction_list_missing_receipt+${string}` | `${string}-transaction_list_of_account_by_class+${string}` | `${string}-transaction_detail+${string}` | `${string}-cash_in_cash_out+${string}` | `${string}-insights_dashboard+${string}` | `${string}-company_details+${string}` | `${string}-class_list+${string}` | `${string}-account_list+${string}` | `${string}-account_list_by_type+${string}` | `${string}-vendor+${string}` | `${string}-task_card+${string}` | `${string}-bill_pay+${string}` | `${string}-reimbursement+${string}` | `${string}-bill_pay_card+${string}` | `${string}-reimbursement_card+${string}` | `${string}-bill_pay_promo_card+${string}` | `${string}-zeni_accounts+${string}` | `${string}-zeni_accounts_promo_card+${string}` | `${string}-charge_cards+${string}` | `${string}-reimbursement_promo_card+${string}` | `${string}-onboarding+${string}` | `${string}-operating_expenses_by_vendor+${string}` | `${string}-operating_expenses_by_vendor_summary+${string}` | `${string}-vendors_tab+${string}` | `${string}-accounts_payable_aging+${string}` | `${string}-accounts_receivable_aging+${string}` | `${string}-vendor_global_review+${string}` | `${string}-prepaid_expenses+${string}` | `${string}-fixed_assets+${string}`;
|
|
16
|
+
export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-operating_expenses` | `${string}-operating_expenses_by_classes` | `${string}-revenue` | `${string}-revenue_by_classes` | `${string}-net_burn_or_income` | `${string}-net_burn_or_income_story_card` | `${string}-net_burn_or_income_by_classes` | `${string}-cash_position` | `${string}-top_expenses` | `${string}-profit_and_loss` | `${string}-profit_and_loss_by_classes` | `${string}-balance_sheet` | `${string}-cash_flow` | `${string}-dashboard` | `${string}-finance_statement` | `${string}-transaction_list_of_account` | `${string}-transaction_list_missing_receipt` | `${string}-transaction_list_of_account_by_class` | `${string}-transaction_detail` | `${string}-cash_in_cash_out` | `${string}-insights_dashboard` | `${string}-company_details` | `${string}-class_list` | `${string}-account_list` | `${string}-account_list_by_type` | `${string}-vendor` | `${string}-task_card` | `${string}-bill_pay` | `${string}-reimbursement` | `${string}-bill_pay_card` | `${string}-reimbursement_card` | `${string}-bill_pay_promo_card` | `${string}-zeni_accounts` | `${string}-zeni_accounts_promo_card` | `${string}-charge_cards` | `${string}-reimbursement_promo_card` | `${string}-onboarding` | `${string}-operating_expenses_by_vendor` | `${string}-operating_expenses_by_vendor_summary` | `${string}-vendors_tab` | `${string}-accounts_payable_aging` | `${string}-accounts_receivable_aging` | `${string}-vendor_global_review` | `${string}-prepaid_expenses` | `${string}-fixed_assets` | `${string}-notification` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-operating_expenses+${string}` | `${string}-operating_expenses_by_classes+${string}` | `${string}-revenue+${string}` | `${string}-revenue_by_classes+${string}` | `${string}-net_burn_or_income+${string}` | `${string}-net_burn_or_income_story_card+${string}` | `${string}-net_burn_or_income_by_classes+${string}` | `${string}-cash_position+${string}` | `${string}-top_expenses+${string}` | `${string}-profit_and_loss+${string}` | `${string}-profit_and_loss_by_classes+${string}` | `${string}-balance_sheet+${string}` | `${string}-cash_flow+${string}` | `${string}-dashboard+${string}` | `${string}-finance_statement+${string}` | `${string}-transaction_list_of_account+${string}` | `${string}-transaction_list_missing_receipt+${string}` | `${string}-transaction_list_of_account_by_class+${string}` | `${string}-transaction_detail+${string}` | `${string}-cash_in_cash_out+${string}` | `${string}-insights_dashboard+${string}` | `${string}-company_details+${string}` | `${string}-class_list+${string}` | `${string}-account_list+${string}` | `${string}-account_list_by_type+${string}` | `${string}-vendor+${string}` | `${string}-task_card+${string}` | `${string}-bill_pay+${string}` | `${string}-reimbursement+${string}` | `${string}-bill_pay_card+${string}` | `${string}-reimbursement_card+${string}` | `${string}-bill_pay_promo_card+${string}` | `${string}-zeni_accounts+${string}` | `${string}-zeni_accounts_promo_card+${string}` | `${string}-charge_cards+${string}` | `${string}-reimbursement_promo_card+${string}` | `${string}-onboarding+${string}` | `${string}-operating_expenses_by_vendor+${string}` | `${string}-operating_expenses_by_vendor_summary+${string}` | `${string}-vendors_tab+${string}` | `${string}-accounts_payable_aging+${string}` | `${string}-accounts_receivable_aging+${string}` | `${string}-vendor_global_review+${string}` | `${string}-prepaid_expenses+${string}` | `${string}-fixed_assets+${string}` | `${string}-notification+${string}`;
|
|
17
17
|
export declare type AccountKey = ReturnType<typeof getAccountKey>;
|
|
18
18
|
export interface AccountState {
|
|
19
19
|
accountsByKey: Record<AccountKey, Account>;
|
|
@@ -19,7 +19,7 @@ export interface NestedAccountReport {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getNestedAccountReportForAccount: (accountState: AccountState, id: {
|
|
21
21
|
reportId: ReportIDPlusForecastID;
|
|
22
|
-
|
|
22
|
+
accountIdHierarchy: NestedAccountIDHierarchy;
|
|
23
23
|
classesViewParentId?: ClassesViewParentID;
|
|
24
24
|
accountsViewParentId?: AccountsViewParentID;
|
|
25
25
|
}, filter: COABalancesFilter, accountHasSiblings: boolean, additionalBalancesOptions?: AdditionalBalancesOptions | undefined) => NestedAccountReport | undefined;
|
|
@@ -15,7 +15,7 @@ const getNestedAccountReportForAccount = (accountState, id, filter, accountHasSi
|
|
|
15
15
|
balancesRange: filter.balancesRange,
|
|
16
16
|
};
|
|
17
17
|
const accountReport = (0, accountSelector_1.getAccount)(accountState, {
|
|
18
|
-
accountId: id.
|
|
18
|
+
accountId: id.accountIdHierarchy.id[0],
|
|
19
19
|
reportId: id.reportId,
|
|
20
20
|
classesViewParentId: id.classesViewParentId,
|
|
21
21
|
accountsViewParentId: id.accountsViewParentId,
|
|
@@ -24,18 +24,18 @@ const getNestedAccountReportForAccount = (accountState, id, filter, accountHasSi
|
|
|
24
24
|
return undefined;
|
|
25
25
|
}
|
|
26
26
|
const childrenReports = [];
|
|
27
|
-
id.
|
|
27
|
+
id.accountIdHierarchy.children.forEach((childAccount) => {
|
|
28
28
|
const report = (0, exports.getNestedAccountReportForAccount)(accountState, {
|
|
29
29
|
reportId: id.reportId,
|
|
30
|
-
|
|
30
|
+
accountIdHierarchy: childAccount,
|
|
31
31
|
classesViewParentId: id.classesViewParentId,
|
|
32
32
|
accountsViewParentId: id.accountsViewParentId != null
|
|
33
33
|
? {
|
|
34
|
-
parentAccountId: id.
|
|
34
|
+
parentAccountId: id.accountIdHierarchy.id,
|
|
35
35
|
sectionId: id.accountsViewParentId.sectionId,
|
|
36
36
|
}
|
|
37
37
|
: undefined,
|
|
38
|
-
}, filter, id.
|
|
38
|
+
}, filter, id.accountIdHierarchy.children.length > 1, additionalBalancesOptions);
|
|
39
39
|
if (report != null) {
|
|
40
40
|
childrenReports.push(report);
|
|
41
41
|
}
|
|
@@ -43,9 +43,9 @@ const getNestedAccountReportForAccount = (accountState, id, filter, accountHasSi
|
|
|
43
43
|
// sort the children accounts based on their totals.
|
|
44
44
|
const sortedChildren = (0, exports.sortNestedAccounts)(childrenReports, filter);
|
|
45
45
|
return {
|
|
46
|
-
id: id.
|
|
46
|
+
id: id.accountIdHierarchy.id,
|
|
47
47
|
account: accountReport,
|
|
48
|
-
isLeafAccount: id.
|
|
48
|
+
isLeafAccount: id.accountIdHierarchy.children.length === 0,
|
|
49
49
|
children: sortedChildren,
|
|
50
50
|
hasSiblings: accountHasSiblings,
|
|
51
51
|
};
|