@zeniai/client-epic-state 4.20.2-betaNB1 → 4.20.2-betaNB2

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.
@@ -3,6 +3,7 @@ import { getSummationFreeRangeTotalBalance } from '../../commonStateTypes/coaBal
3
3
  import { defaultCustomerCurrency } from '../../commonStateTypes/currencyHelper';
4
4
  import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
5
5
  import { getSectionClassesViewReport } from '../../entity/sectionClassesViewV2/sectionClassesViewSelector';
6
+ import { HORIZONTAL_CLASS_TOTAL_BALANCE_ID, } from './profitAndLossClassesByClassHorizontalSelectorTypes';
6
7
  import { enrichProfitAndLossByClassHorizontalReport } from './profitAndLossHorizontalEnrichment';
7
8
  export const profitAndLossHorizontalIdsInOrder = [
8
9
  'income',
@@ -303,6 +304,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
303
304
  startDate,
304
305
  type: 'default',
305
306
  label: col.className,
307
+ id: col.classId,
306
308
  }));
307
309
  // Add a "Total" column
308
310
  balances.push({
@@ -312,6 +314,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
312
314
  startDate,
313
315
  type: 'default',
314
316
  label: 'Total',
317
+ id: HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
315
318
  });
316
319
  return balances;
317
320
  }
@@ -1,5 +1,6 @@
1
1
  import recordGet from 'lodash/get';
2
2
  import { reduceFetchState } from '../../commonStateTypes/reduceFetchState';
3
+ import { getIsAccountingClassesEnabled } from '../../entity/tenant/tenantSelector';
3
4
  import { toTransactionTypeStrict } from '../../entity/transaction/stateTypes/transactionType';
4
5
  import { getTransactionWithCOT } from '../../entity/transaction/transactionHelper';
5
6
  import { getSupportedTransactionById } from '../../entity/transaction/transactionSelector';
@@ -51,9 +52,14 @@ export const getTransactionDetail = (state, transactionId, fetchLinkedTransactio
51
52
  }
52
53
  }
53
54
  const accountsList = getAccountList(accountState, accountListState, 'accountList');
54
- const classList = getClassList(classState, classListState);
55
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
56
+ const classList = isAccountingClassesEnabled
57
+ ? getClassList(classState, classListState)
58
+ : { classes: [], nestedClassHierarchy: [], fetchState: 'Completed', error: undefined, version: 0 };
55
59
  const accountsHierarchyList = getNestedAccountListHierarchy(accountListState, 'accountList');
56
- const classHierarchyList = getNestedClassListHierarchy(classListState);
60
+ const classHierarchyList = isAccountingClassesEnabled
61
+ ? getNestedClassListHierarchy(classListState)
62
+ : [];
57
63
  const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
58
64
  const vendors = getVendorsByVendorIds(vendorState, vendorListState.vendorIds);
59
65
  return {
@@ -71,6 +77,7 @@ export const getTransactionDetail = (state, transactionId, fetchLinkedTransactio
71
77
  classHierarchyList,
72
78
  accountsHierarchyList,
73
79
  classList: classList,
80
+ isAccountingClassesEnabled,
74
81
  isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
75
82
  transactionDetailLocalData: transactionDetail?.transactionDetailLocalData ??
76
83
  initialSupportedTransactionDetail.transactionDetailLocalData,