@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.
Files changed (171) hide show
  1. package/lib/commonPayloadTypes/agingReportPayloadTypes.d.ts +1 -0
  2. package/lib/commonPayloadTypes/commonPayload.d.ts +8 -0
  3. package/lib/commonPayloadTypes/commonPayload.js +20 -0
  4. package/lib/commonPayloadTypes/subAccountView/subAccountPayloadHelper.js +2 -2
  5. package/lib/commonStateTypes/accountView/{getNestedAccountIDHeirarchyForReport.d.ts → getNestedAccountIDHierarchyForReport.d.ts} +2 -2
  6. package/lib/commonStateTypes/accountView/nestedAccountID.d.ts +2 -2
  7. package/lib/commonStateTypes/agingBalance/agingBalance.d.ts +4 -0
  8. package/lib/commonStateTypes/agingBalance/agingBalance.js +4 -1
  9. package/lib/commonStateTypes/classesView/getNestedClassIDHierarchyForReport.d.ts +2 -2
  10. package/lib/commonStateTypes/classesView/nestedClassID.d.ts +2 -2
  11. package/lib/commonStateTypes/customerView/getNestedCustomerHierarchy.d.ts +9 -0
  12. package/lib/commonStateTypes/customerView/getNestedCustomerHierarchy.js +46 -0
  13. package/lib/commonStateTypes/customerView/nestedCustomerID.d.ts +42 -0
  14. package/lib/commonStateTypes/customerView/nestedCustomerID.js +9 -0
  15. package/lib/commonStateTypes/selectorTypes/classesViewSelectorReport.d.ts +2 -2
  16. package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +4 -7
  17. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  18. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
  19. package/lib/entity/account/accountState.d.ts +1 -1
  20. package/lib/entity/account/subAccountSelector.d.ts +1 -1
  21. package/lib/entity/account/subAccountSelector.js +7 -7
  22. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  23. package/lib/entity/accountGroup/accountGroupV2Selector.js +3 -3
  24. package/lib/entity/class/classReducer.d.ts +4 -4
  25. package/lib/entity/class/classSelectorV2.d.ts +1 -1
  26. package/lib/entity/class/classSelectorV2.js +10 -10
  27. package/lib/entity/class/classState.d.ts +1 -1
  28. package/lib/entity/customer/customerPayload.d.ts +1 -1
  29. package/lib/entity/customer/customerPayload.js +1 -1
  30. package/lib/entity/customer/customerReducer.d.ts +1 -1
  31. package/lib/entity/customer/customerSelector.d.ts +1 -1
  32. package/lib/entity/customerIncome/customerIncomeTrend.d.ts +1 -1
  33. package/lib/entity/customerIncome/customerIncomeTrendReducer.d.ts +1 -1
  34. package/lib/entity/forecast/forecastState.d.ts +1 -1
  35. package/lib/entity/notification/notificationPayload.d.ts +46 -0
  36. package/lib/entity/notification/notificationPayload.js +144 -0
  37. package/lib/entity/notification/notificationReducer.d.ts +20 -0
  38. package/lib/entity/notification/notificationReducer.js +118 -0
  39. package/lib/entity/notification/notificationSelector.d.ts +9 -0
  40. package/lib/entity/notification/notificationSelector.js +36 -0
  41. package/lib/entity/notification/notificationState.d.ts +7 -0
  42. package/lib/entity/notification/notificationState.js +2 -0
  43. package/lib/entity/notification/types/notificationSelectorTypes.d.ts +8 -0
  44. package/lib/entity/notification/types/notificationSelectorTypes.js +2 -0
  45. package/lib/entity/notification/types/notificationStateTypes.d.ts +50 -0
  46. package/lib/entity/notification/types/notificationStateTypes.js +2 -0
  47. package/lib/entity/notification/types/notificationTypes.d.ts +24 -0
  48. package/lib/entity/notification/types/notificationTypes.js +58 -0
  49. package/lib/entity/sectionAccountsView/getNestedAccountIDHierarchyForSection.js +9 -9
  50. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  51. package/lib/entity/sectionAccountsView/sectionAccountsViewEpic.js +2 -2
  52. package/lib/entity/sectionAccountsView/sectionAccountsViewSelector.js +3 -3
  53. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  54. package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -2
  55. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  56. package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.js +7 -7
  57. package/lib/entity/sectionClassesViewV2/selectorHelpers/getNestedClassIDHierarchyForSection.js +7 -7
  58. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  59. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  60. package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
  61. package/lib/entity/tenant/clearAllEpic.js +5 -1
  62. package/lib/entity/transaction/stateTypes/customerTransaction.d.ts +1 -1
  63. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  64. package/lib/epic.d.ts +7 -3
  65. package/lib/epic.js +5 -1
  66. package/lib/index.d.ts +24 -14
  67. package/lib/index.js +35 -13
  68. package/lib/reducer.d.ts +7 -1
  69. package/lib/reducer.js +6 -0
  70. package/lib/view/accountList/accountListReducer.js +2 -2
  71. package/lib/view/accountList/accountListSelector.d.ts +3 -3
  72. package/lib/view/accountList/accountListSelector.js +3 -3
  73. package/lib/view/accountList/accountListState.d.ts +2 -2
  74. package/lib/view/accountMappingView/accountMappingReducer.js +19 -19
  75. package/lib/view/accountMappingView/accountMappingState.d.ts +8 -8
  76. package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +8 -8
  77. package/lib/view/accountMappingView/accountMappingViewSelector.js +7 -7
  78. package/lib/view/apAgingView/apAgingReport/apAgingReducer.d.ts +7 -5
  79. package/lib/view/apAgingView/apAgingReport/apAgingReducer.js +34 -15
  80. package/lib/view/apAgingView/apAgingReport/apAgingSelector.d.ts +1 -1
  81. package/lib/view/apAgingView/apAgingReport/apAgingSelector.js +29 -16
  82. package/lib/view/apAgingView/apAgingReport/apAgingState.d.ts +6 -3
  83. package/lib/view/apAgingView/apAgingReport/fetchApAgingEpic.js +11 -7
  84. package/lib/view/arAgingView/arAgingDetail/arAgingDetailSelector.d.ts +1 -1
  85. package/lib/view/arAgingView/arAgingReport/arAgingPayload.js +8 -1
  86. package/lib/view/arAgingView/arAgingReport/arAgingReducer.d.ts +13 -7
  87. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +49 -15
  88. package/lib/view/arAgingView/arAgingReport/arAgingSelector.d.ts +12 -6
  89. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +68 -35
  90. package/lib/view/arAgingView/arAgingReport/arAgingState.d.ts +12 -4
  91. package/lib/view/arAgingView/arAgingReport/fetchArAgingEpic.js +10 -7
  92. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  93. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  94. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  95. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  96. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  97. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  98. package/lib/view/classList/classListSelector.d.ts +3 -3
  99. package/lib/view/classList/classListSelector.js +3 -3
  100. package/lib/view/classList/classListState.d.ts +2 -2
  101. package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewSelector.d.ts +4 -4
  102. package/lib/view/commonVendorView/transactionVendorView/transactionVendorViewSelector.js +4 -4
  103. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +4 -4
  104. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +4 -4
  105. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +4 -4
  106. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +4 -4
  107. package/lib/view/dashboard/dashboardEpic.js +6 -4
  108. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  109. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  110. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  111. package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewReducer.js +3 -3
  112. package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewSelector.js +3 -3
  113. package/lib/view/netBurnOrIncomeClassesView/netBurnOrIncomeClassesViewState.d.ts +2 -2
  114. package/lib/view/notificationView/epics/fetchNotificationUnreadCountEpic.d.ts +10 -0
  115. package/lib/view/notificationView/epics/fetchNotificationUnreadCountEpic.js +39 -0
  116. package/lib/view/notificationView/epics/fetchNotificationViewEpic.d.ts +9 -0
  117. package/lib/view/notificationView/epics/fetchNotificationViewEpic.js +56 -0
  118. package/lib/view/notificationView/epics/updateNotificationViewAllNotificationsStatusEpic.d.ts +9 -0
  119. package/lib/view/notificationView/epics/updateNotificationViewAllNotificationsStatusEpic.js +50 -0
  120. package/lib/view/notificationView/epics/updateNotificationViewNotificationStatusEpic.d.ts +9 -0
  121. package/lib/view/notificationView/epics/updateNotificationViewNotificationStatusEpic.js +86 -0
  122. package/lib/view/notificationView/notificationView.helpers.d.ts +2 -0
  123. package/lib/view/notificationView/notificationView.helpers.js +11 -0
  124. package/lib/view/notificationView/notificationViewPayload.d.ts +48 -0
  125. package/lib/view/notificationView/notificationViewPayload.js +2 -0
  126. package/lib/view/notificationView/notificationViewReducer.d.ts +64 -0
  127. package/lib/view/notificationView/notificationViewReducer.js +372 -0
  128. package/lib/view/notificationView/notificationViewSelector.d.ts +29 -0
  129. package/lib/view/notificationView/notificationViewSelector.js +89 -0
  130. package/lib/view/notificationView/notificationViewState.d.ts +31 -0
  131. package/lib/view/notificationView/notificationViewState.js +19 -0
  132. package/lib/view/opExClassesView/opExClassesViewReducer.js +3 -3
  133. package/lib/view/opExClassesView/opExClassesViewSelector.js +3 -3
  134. package/lib/view/opExClassesView/opExClassesViewState.d.ts +2 -2
  135. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  136. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  137. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  138. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  139. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  140. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +3 -3
  141. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -2
  142. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +2 -2
  143. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  144. package/lib/view/revenueClassesView/revenueClassesViewReducer.js +3 -3
  145. package/lib/view/revenueClassesView/revenueClassesViewSelector.js +3 -3
  146. package/lib/view/revenueClassesView/revenueClassesViewState.d.ts +2 -2
  147. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +5 -5
  148. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +5 -5
  149. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +2 -2
  150. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +2 -2
  151. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
  152. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  153. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -4
  154. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -4
  155. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.d.ts +4 -4
  156. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +4 -4
  157. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
  158. package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +37 -5
  159. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  160. package/lib/view/topEx/topExSelector.d.ts +1 -1
  161. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -4
  162. package/lib/view/transactionDetail/transactionDetailSelector.js +4 -4
  163. package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -1
  164. package/lib/view/transactionDetail/transactionDetailTypes.d.ts +1 -1
  165. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +1 -1
  166. package/lib/zeniAPI.d.ts +2 -0
  167. package/lib/zeniAPI.js +8 -0
  168. package/package.json +2 -1
  169. package/lib/commonStateTypes/accountView/{getNestedAccountIDHeirarchyForReport.js → getNestedAccountIDHierarchyForReport.js} +0 -0
  170. package/lib/entity/customer/{customer.d.ts → customerState.d.ts} +4 -4
  171. /package/lib/entity/customer/{customer.js → customerState.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { NestedAccountHeirarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
1
+ import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { Recommendation } from '../../commonStateTypes/recommendationBase';
3
3
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { AccountBase } from '../../entity/account/accountState';
@@ -20,13 +20,13 @@ export interface AccountMappingView extends SelectorView {
20
20
  prepaidExpensesRecommendation: Recommendation[];
21
21
  fixedAssetsRecommendation: Recommendation[];
22
22
  accruedExpensesRecommendation: Recommendation[];
23
- incomeAccountHierachy: NestedAccountHeirarchyForReport[];
24
- expenseAccountHierarchy: NestedAccountHeirarchyForReport[];
25
- billPayAccountHierarchy: NestedAccountHeirarchyForReport[];
26
- reimbursementsAccountHierarchy: NestedAccountHeirarchyForReport[];
27
- prepaidExpensesAccountHierarchy: NestedAccountHeirarchyForReport[];
28
- fixedAssetsAccountHierarchy: NestedAccountHeirarchyForReport[];
29
- accruedExpensesAccountHierarchy: NestedAccountHeirarchyForReport[];
23
+ incomeAccountHierachy: NestedAccountHierarchyForReport[];
24
+ expenseAccountHierarchy: NestedAccountHierarchyForReport[];
25
+ billPayAccountHierarchy: NestedAccountHierarchyForReport[];
26
+ reimbursementsAccountHierarchy: NestedAccountHierarchyForReport[];
27
+ prepaidExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
28
+ fixedAssetsAccountHierarchy: NestedAccountHierarchyForReport[];
29
+ accruedExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
30
30
  accountMappingLocalData?: AccountMappingLocalData;
31
31
  saveState: FetchStateAndError;
32
32
  }
@@ -83,13 +83,13 @@ exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.a
83
83
  fixedAssetsRecommendation: accountMappingState.fixedAssetsRecommendations,
84
84
  accruedExpensesRecommendation: accountMappingState.accruedExpensesRecommendations,
85
85
  accountMappingLocalData: accountMappingState.data,
86
- incomeAccountHierachy: accountMappingState.incomeNestedAccountListHeirarchy,
87
- expenseAccountHierarchy: accountMappingState.expenseNestedAccountListHeirarchy,
88
- billPayAccountHierarchy: accountMappingState.billPayNestedAccountListHeirarchy,
89
- reimbursementsAccountHierarchy: accountMappingState.reimbursementsNestedAccountListHeirarchy,
90
- prepaidExpensesAccountHierarchy: accountMappingState.prepaidExpensesNestedAccountListHeirarchy,
91
- fixedAssetsAccountHierarchy: accountMappingState.fixedAssetsNestedAccountListHeirarchy,
92
- accruedExpensesAccountHierarchy: accountMappingState.accruedExpensesNestedAccountListHeirarchy,
86
+ incomeAccountHierachy: accountMappingState.incomeNestedAccountListHierarchy,
87
+ expenseAccountHierarchy: accountMappingState.expenseNestedAccountListHierarchy,
88
+ billPayAccountHierarchy: accountMappingState.billPayNestedAccountListHierarchy,
89
+ reimbursementsAccountHierarchy: accountMappingState.reimbursementsNestedAccountListHierarchy,
90
+ prepaidExpensesAccountHierarchy: accountMappingState.prepaidExpensesNestedAccountListHierarchy,
91
+ fixedAssetsAccountHierarchy: accountMappingState.fixedAssetsNestedAccountListHierarchy,
92
+ accruedExpensesAccountHierarchy: accountMappingState.accruedExpensesNestedAccountListHierarchy,
93
93
  fetchState: fetchState.fetchState,
94
94
  saveState,
95
95
  };
@@ -1,15 +1,17 @@
1
- import { ApAgingState } from './apAgingState';
1
+ import { ApAgingState, APAgingBalancesByAgingBalancesKey } from './apAgingState';
2
2
  import { ApAgingPayload } from './apAgingPayload';
3
3
  import { ZeniAPIStatus } from '../../../responsePayload';
4
4
  import { AgingReportUIState } from '../../../commonStateTypes/viewAndReport/agingReportStateTypes';
5
5
  export declare const inititalUIState: AgingReportUIState;
6
6
  export declare const initialState: ApAgingState;
7
- export declare const fetchApAging: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, reportDate?: import("dayjs").Dayjs | undefined], {
8
- cacheOverride: boolean;
9
- reportDate: import("dayjs").Dayjs | undefined;
7
+ export declare const initialStateAgingBalances: APAgingBalancesByAgingBalancesKey;
8
+ export declare const fetchApAging: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportDate: import("dayjs").Dayjs, cacheOverride?: any], {
9
+ cacheOverride: any;
10
+ reportDate: import("dayjs").Dayjs;
10
11
  }, string, never, never>, updateApAgingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<AgingReportUIState>, string>, updateApAgingOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
11
12
  error: ZeniAPIStatus<Record<string, unknown>>;
12
- }, string, never, never>, updateApAgingOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: ApAgingPayload], {
13
+ }, string, never, never>, updateApAgingOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportDate: import("dayjs").Dayjs, data: ApAgingPayload], {
14
+ reportDate: import("dayjs").Dayjs;
13
15
  data: ApAgingPayload;
14
16
  }, string, never, never>, clearApAging: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
15
17
  declare const _default: import("@reduxjs/toolkit").Reducer<ApAgingState, import("@reduxjs/toolkit").AnyAction>;
@@ -1,47 +1,54 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearApAging = exports.updateApAgingOnSuccess = exports.updateApAgingOnFailure = exports.updateApAgingUIState = exports.fetchApAging = exports.initialState = exports.inititalUIState = void 0;
4
+ exports.clearApAging = exports.updateApAgingOnSuccess = exports.updateApAgingOnFailure = exports.updateApAgingUIState = exports.fetchApAging = exports.initialStateAgingBalances = exports.initialState = exports.inititalUIState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const apAgingPayload_1 = require("./apAgingPayload");
7
7
  const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
8
8
  const viewAndReportPayloadv2_1 = require("../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
9
+ const zeniDayJS_1 = require("../../../zeniDayJS");
9
10
  const vendorState_1 = require("../../../entity/vendor/vendorState");
10
11
  exports.inititalUIState = {
11
12
  searchString: '',
12
13
  sortKey: 'vendor',
13
14
  sortOrder: 'ascending',
14
15
  downloadState: 'Not-Started',
15
- selectedDate: undefined,
16
+ selectedDate: (0, zeniDayJS_1.dateNow)(),
17
+ agingDateSelectionType: 'custom_date',
16
18
  };
17
19
  exports.initialState = {
18
20
  reportId: 'accounts_payable_aging',
19
21
  reportTitle: 'AP Aging',
20
22
  firstMonthOfFY: 1,
21
- apAgingBalancesByVendorId: {},
22
23
  fetchState: 'Not-Started',
23
24
  error: undefined,
24
25
  uiState: exports.inititalUIState,
25
- apAgingTotals: [],
26
+ apAgingBalancesByDate: {},
26
27
  agingPeriods: [],
27
28
  bookCloseDate: undefined,
28
29
  dataAvailable: undefined,
29
30
  currency: vendorState_1.defaultVendorCurrency,
30
31
  };
32
+ exports.initialStateAgingBalances = {
33
+ apAgingBalancesByVendorId: {},
34
+ apAgingTotals: [],
35
+ };
31
36
  const apAging = (0, toolkit_1.createSlice)({
32
37
  name: 'apAging',
33
38
  initialState: exports.initialState,
34
39
  reducers: {
35
40
  fetchApAging: {
36
41
  reducer(draft, action) {
37
- const { cacheOverride } = action.payload;
38
- if (cacheOverride) {
42
+ const { cacheOverride, reportDate } = action.payload;
43
+ const key = (0, agingBalance_1.getAgingBalancesKey)(reportDate);
44
+ const record = draft.apAgingBalancesByDate[key];
45
+ draft.uiState.selectedDate = reportDate;
46
+ if (cacheOverride || record == null) {
39
47
  draft.fetchState = 'In-Progress';
40
48
  draft.error = undefined;
41
49
  }
42
50
  },
43
- prepare(cacheOverride = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
44
- reportDate) {
51
+ prepare(reportDate, cacheOverride = false) {
45
52
  return {
46
53
  payload: {
47
54
  cacheOverride,
@@ -51,25 +58,25 @@ const apAging = (0, toolkit_1.createSlice)({
51
58
  },
52
59
  },
53
60
  updateApAgingOnSuccess: {
54
- prepare(data) {
61
+ prepare(reportDate, data) {
55
62
  return {
56
63
  payload: {
64
+ reportDate,
57
65
  data,
58
66
  },
59
67
  };
60
68
  },
61
69
  reducer(draft, action) {
62
- const { data } = action.payload;
63
- draft.fetchState = 'Completed';
64
- draft.error = undefined;
70
+ const { data, reportDate } = action.payload;
65
71
  const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(data);
66
72
  draft.firstMonthOfFY = report.firstMonthOfFY;
67
- draft.currency = report.currency;
68
73
  draft.bookCloseDate = report.bookCloseDate;
69
74
  draft.dataAvailable = report.dataAvailable;
70
- draft.apAgingBalancesByVendorId = (0, apAgingPayload_1.toApAgingDataByVendorId)(data);
71
- draft.apAgingTotals = (0, apAgingPayload_1.toApAgingTotals)(data);
75
+ doUpdateApAgingBalancesByDate(draft.apAgingBalancesByDate, reportDate, data);
72
76
  draft.agingPeriods = data.aging_periods.map((elem) => (0, agingBalance_1.toAgingPeriod)(elem));
77
+ draft.uiState.selectedDate = reportDate;
78
+ draft.fetchState = 'Completed';
79
+ draft.error = undefined;
73
80
  },
74
81
  },
75
82
  updateApAgingUIState(draft, action) {
@@ -88,6 +95,10 @@ const apAging = (0, toolkit_1.createSlice)({
88
95
  if (action.payload.selectedDate != null) {
89
96
  draft.uiState.selectedDate = action.payload.selectedDate;
90
97
  }
98
+ if (action.payload.agingDateSelectionType != null) {
99
+ draft.uiState.agingDateSelectionType =
100
+ action.payload.agingDateSelectionType;
101
+ }
91
102
  },
92
103
  updateApAgingOnFailure: {
93
104
  reducer(draft, action) {
@@ -105,3 +116,11 @@ const apAging = (0, toolkit_1.createSlice)({
105
116
  });
106
117
  _a = apAging.actions, exports.fetchApAging = _a.fetchApAging, exports.updateApAgingUIState = _a.updateApAgingUIState, exports.updateApAgingOnFailure = _a.updateApAgingOnFailure, exports.updateApAgingOnSuccess = _a.updateApAgingOnSuccess, exports.clearApAging = _a.clearApAging;
107
118
  exports.default = apAging.reducer;
119
+ const doUpdateApAgingBalancesByDate = (draft, reportDate, data) => {
120
+ const key = (0, agingBalance_1.getAgingBalancesKey)(reportDate);
121
+ const agingBalances = {
122
+ apAgingBalancesByVendorId: (0, apAgingPayload_1.toApAgingDataByVendorId)(data),
123
+ apAgingTotals: (0, apAgingPayload_1.toApAgingTotals)(data),
124
+ };
125
+ draft[key] = agingBalances;
126
+ };
@@ -10,7 +10,7 @@ export interface AgingBalancesByVendor {
10
10
  apAgingBalances: AgingBalance[];
11
11
  }
12
12
  export interface ApAgingReport extends SelectorReport {
13
- agingBalancesByVendor: AgingBalancesByVendor[];
13
+ agingBalances: AgingBalancesByVendor[];
14
14
  totalBalances: AgingBalance[];
15
15
  apAgingUIState: AgingReportUIState;
16
16
  agingPeriods: AgingPeriod[];
@@ -5,18 +5,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getApAgingReport = void 0;
7
7
  const toolkit_1 = require("@reduxjs/toolkit");
8
- const keys_1 = __importDefault(require("lodash/keys"));
9
8
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const keys_1 = __importDefault(require("lodash/keys"));
10
+ const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
10
11
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
11
12
  exports.getApAgingReport = (0, toolkit_1.createSelector)((state) => state.apAgingState, (state) => state.vendorState, (apAgingState, vendorState) => {
12
- const { reportId, reportTitle, fetchState, uiState, firstMonthOfFY, apAgingTotals, apAgingBalancesByVendorId, agingPeriods, currency, } = apAgingState;
13
- const { searchString, sortOrder, sortKey } = uiState;
14
- const agingBalancesByVendor = (0, keys_1.default)(apAgingBalancesByVendorId).map((vendorId) => {
13
+ const { reportId, reportTitle, fetchState, uiState, firstMonthOfFY, agingPeriods, currency, } = apAgingState;
14
+ const { searchString, sortOrder, sortKey, selectedDate } = uiState;
15
+ const balancesKey = (0, agingBalance_1.getAgingBalancesKey)(selectedDate);
16
+ const apAgingBalancesByDate = apAgingState.apAgingBalancesByDate[balancesKey];
17
+ const apAgingBalancesByVendorId = apAgingBalancesByDate != null
18
+ ? apAgingBalancesByDate.apAgingBalancesByVendorId
19
+ : {};
20
+ const apAgingTotals = apAgingBalancesByDate != null
21
+ ? apAgingBalancesByDate.apAgingTotals
22
+ : [];
23
+ const agingBalances = getAgingBalancesByVendor(vendorState, apAgingBalancesByVendorId, currency, searchString, sortKey, sortOrder);
24
+ return {
25
+ agingBalances,
26
+ reportId,
27
+ reportTitle,
28
+ fetchState,
29
+ firstMonthOfFY,
30
+ agingPeriods,
31
+ apAgingUIState: uiState,
32
+ totalBalances: apAgingTotals,
33
+ };
34
+ });
35
+ const getAgingBalancesByVendor = (vendorState, agingBalancesByVendorId, currency, searchString, sortKey, sortOrder) => {
36
+ const agingBalancesByVendor = (0, keys_1.default)(agingBalancesByVendorId).map((vendorId) => {
15
37
  const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
16
38
  if (vendor == null) {
17
39
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
18
40
  }
19
- const apAgingBalances = apAgingBalancesByVendorId[vendorId];
41
+ const apAgingBalances = agingBalancesByVendorId[vendorId];
20
42
  const { currencyCode, currencySymbol } = currency;
21
43
  const vendorTotal = apAgingBalances.reduce((prev, curr) => {
22
44
  return prev + curr.balance.amount;
@@ -45,14 +67,5 @@ exports.getApAgingReport = (0, toolkit_1.createSelector)((state) => state.apAgin
45
67
  }
46
68
  }
47
69
  }, sortOrder === 'ascending' ? 'asc' : 'desc');
48
- return {
49
- agingBalancesByVendor: sortedAgingBalancesByVendor,
50
- reportId,
51
- reportTitle,
52
- fetchState,
53
- firstMonthOfFY,
54
- agingPeriods,
55
- apAgingUIState: uiState,
56
- totalBalances: apAgingTotals,
57
- };
58
- });
70
+ return sortedAgingBalancesByVendor;
71
+ };
@@ -1,10 +1,13 @@
1
1
  import { ReportV2 } from '../../../commonStateTypes/v2/viewAndReport';
2
2
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
3
- import { AgingBalance, AgingPeriod } from '../../../commonStateTypes/agingBalance/agingBalance';
3
+ import { AgingBalance, AgingBalancesKey, AgingPeriod } from '../../../commonStateTypes/agingBalance/agingBalance';
4
4
  import { AgingReportUIState } from '../../../commonStateTypes/viewAndReport/agingReportStateTypes';
5
- export interface ApAgingState extends ReportV2, FetchStateAndError {
5
+ export interface APAgingBalancesByAgingBalancesKey {
6
6
  apAgingBalancesByVendorId: Record<ID, AgingBalance[]>;
7
- uiState: AgingReportUIState;
8
7
  apAgingTotals: AgingBalance[];
8
+ }
9
+ export interface ApAgingState extends ReportV2, FetchStateAndError {
10
+ apAgingBalancesByDate: Record<AgingBalancesKey, APAgingBalancesByAgingBalancesKey>;
11
+ uiState: AgingReportUIState;
9
12
  agingPeriods: AgingPeriod[];
10
13
  }
@@ -6,23 +6,27 @@ const operators_1 = require("rxjs/operators");
6
6
  const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
8
  const apAgingReducer_1 = require("./apAgingReducer");
9
+ const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
10
+ const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
9
11
  const fetchApAgingEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(apAgingReducer_1.fetchApAging.match), (0, operators_1.switchMap)((action) => {
10
- var _a;
11
- const state = state$.value;
12
- const { reportDate } = action.payload;
12
+ const { reportDate, cacheOverride } = action.payload;
13
13
  const queryParam = {
14
14
  is_employee_allowed: true,
15
- report_date: reportDate != null
16
- ? reportDate.format('YYYY-MM-DD')
17
- : (_a = state.apAgingState.uiState.selectedDate) === null || _a === void 0 ? void 0 : _a.date.format('YYYY-MM-DD'),
15
+ report_date: reportDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
18
16
  };
17
+ const apAgingState = state$.value.apAgingState;
18
+ const key = (0, agingBalance_1.getAgingBalancesKey)(reportDate);
19
+ if (apAgingState.apAgingBalancesByDate[key] != null &&
20
+ cacheOverride === false) {
21
+ return (0, rxjs_1.from)([]);
22
+ }
19
23
  return zeniAPI
20
24
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/2.0/reports/accounts_payable_aging?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
21
25
  .pipe((0, operators_1.mergeMap)((response) => {
22
26
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
23
27
  const actions = [
24
28
  (0, vendorReducer_1.updateVendors)(response.data.report.vendors, 'merge'),
25
- (0, apAgingReducer_1.updateApAgingOnSuccess)(response.data.report),
29
+ (0, apAgingReducer_1.updateApAgingOnSuccess)(reportDate, response.data.report),
26
30
  ];
27
31
  return (0, rxjs_1.from)(actions);
28
32
  }
@@ -2,7 +2,7 @@ import { RootState } from '../../../reducer';
2
2
  import { AgingBalance, AgingPeriod } from '../../../commonStateTypes/agingBalance/agingBalance';
3
3
  import { ID } from '../../../commonStateTypes/common';
4
4
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
5
- import { Customer } from '../../../entity/customer/customer';
5
+ import { Customer } from '../../../entity/customer/customerState';
6
6
  import { AgingDetailReportUIState, AgingDetailReportInvoice } from '../../../commonStateTypes/viewAndReport/agingReportStateTypes';
7
7
  import { ZeniDate } from '../../../zeniDayJS';
8
8
  export interface ArAgingDetail extends SelectorView {
@@ -12,13 +12,20 @@ const toArAgingDataByCustomerId = (data) => {
12
12
  const agingPeriod = (0, agingBalance_1.toAgingPeriod)(period);
13
13
  const customerIds = (0, keys_1.default)(data[agingPeriod].customers);
14
14
  customerIds.forEach((id) => {
15
- var _a, _b;
15
+ var _a, _b, _c, _d, _e;
16
16
  const agingBalance = {
17
17
  balance: {
18
18
  amount: (_b = (_a = data[agingPeriod].customers[id].amount) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0,
19
19
  currencyCode: data.currency.currency_code,
20
20
  currencySymbol: data.currency.currency_symbol,
21
21
  },
22
+ totalBalance: ((_c = data[agingPeriod].customers[id].amount) === null || _c === void 0 ? void 0 : _c.total_value) != null
23
+ ? {
24
+ amount: (_e = (_d = data[agingPeriod].customers[id].amount) === null || _d === void 0 ? void 0 : _d.total_value) !== null && _e !== void 0 ? _e : 0,
25
+ currencyCode: data.currency.currency_code,
26
+ currencySymbol: data.currency.currency_symbol,
27
+ }
28
+ : undefined,
22
29
  period: agingPeriod,
23
30
  };
24
31
  if (result[id] != null) {
@@ -1,16 +1,22 @@
1
- import { ArAgingState } from './arAgingState';
1
+ import { ARAgingBalancesByAgingBalancesKey, ArAgingState, ArAgingUIState } from './arAgingState';
2
2
  import { ArAgingPayload } from './arAgingPayload';
3
3
  import { ZeniAPIStatus } from '../../../responsePayload';
4
4
  import { AgingReportUIState } from '../../../commonStateTypes/viewAndReport/agingReportStateTypes';
5
- export declare const inititalUIState: AgingReportUIState;
5
+ import { ID } from '../../../commonStateTypes/common';
6
+ export declare const inititalUIState: ArAgingUIState;
6
7
  export declare const initialState: ArAgingState;
7
- export declare const fetchArAging: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined, reportDate?: import("dayjs").Dayjs | undefined], {
8
- cacheOverride: boolean;
9
- reportDate: import("dayjs").Dayjs | undefined;
8
+ export declare const initialStateAgingBalances: ARAgingBalancesByAgingBalancesKey;
9
+ export declare const fetchArAging: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportDate: import("dayjs").Dayjs, cacheOverride?: any], {
10
+ cacheOverride: any;
11
+ reportDate: import("dayjs").Dayjs;
10
12
  }, string, never, never>, updateArAgingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<AgingReportUIState>, string>, updateArAgingOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
11
13
  error: ZeniAPIStatus<Record<string, unknown>>;
12
- }, string, never, never>, updateArAgingOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: ArAgingPayload], {
14
+ }, string, never, never>, updateArAgingOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportDate: import("dayjs").Dayjs, data: ArAgingPayload], {
15
+ reportDate: import("dayjs").Dayjs;
13
16
  data: ArAgingPayload;
14
- }, string, never, never>, clearArAging: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
17
+ }, string, never, never>, updateArAgingNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
18
+ nodeId: ID;
19
+ isCollapsed: boolean;
20
+ }, string>, clearArAging: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
15
21
  declare const _default: import("@reduxjs/toolkit").Reducer<ArAgingState, import("@reduxjs/toolkit").AnyAction>;
16
22
  export default _default;
@@ -1,30 +1,41 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearArAging = exports.updateArAgingOnSuccess = exports.updateArAgingOnFailure = exports.updateArAgingUIState = exports.fetchArAging = exports.initialState = exports.inititalUIState = void 0;
4
+ exports.clearArAging = exports.updateArAgingNodeCollapseState = exports.updateArAgingOnSuccess = exports.updateArAgingOnFailure = exports.updateArAgingUIState = exports.fetchArAging = exports.initialStateAgingBalances = exports.initialState = exports.inititalUIState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const arAgingPayload_1 = require("./arAgingPayload");
7
7
  const agingBalance_1 = require("../../../commonStateTypes/agingBalance/agingBalance");
8
8
  const viewAndReportPayloadv2_1 = require("../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
9
+ const zeniDayJS_1 = require("../../../zeniDayJS");
10
+ const customerPayload_1 = require("../../../entity/customer/customerPayload");
11
+ const customerState_1 = require("../../../entity/customer/customerState");
12
+ const getNestedCustomerHierarchy_1 = require("../../../commonStateTypes/customerView/getNestedCustomerHierarchy");
9
13
  exports.inititalUIState = {
10
14
  searchString: '',
11
15
  sortKey: 'customer',
12
16
  sortOrder: 'ascending',
13
17
  downloadState: 'Not-Started',
14
- selectedDate: undefined,
18
+ selectedDate: (0, zeniDayJS_1.dateNow)(),
19
+ agingDateSelectionType: 'custom_date',
20
+ nodeCollapseState: {},
15
21
  };
16
22
  exports.initialState = {
17
23
  reportId: 'accounts_receivable_aging',
18
24
  reportTitle: 'AR Aging',
19
25
  firstMonthOfFY: 1,
20
- arAgingBalancesByCustomerId: {},
26
+ arAgingBalancesByDate: {},
21
27
  fetchState: 'Not-Started',
22
28
  error: undefined,
23
29
  uiState: exports.inititalUIState,
24
- arAgingTotals: [],
25
30
  agingPeriods: [],
26
31
  bookCloseDate: undefined,
27
32
  dataAvailable: undefined,
33
+ currency: customerState_1.defaultCustomerCurrency,
34
+ };
35
+ exports.initialStateAgingBalances = {
36
+ arAgingBalancesByCustomerId: {},
37
+ arAgingTotals: [],
38
+ nestedCustomerHierarchy: [],
28
39
  };
29
40
  const arAging = (0, toolkit_1.createSlice)({
30
41
  name: 'arAging',
@@ -32,14 +43,16 @@ const arAging = (0, toolkit_1.createSlice)({
32
43
  reducers: {
33
44
  fetchArAging: {
34
45
  reducer(draft, action) {
35
- const { cacheOverride } = action.payload;
36
- if (cacheOverride) {
46
+ const { cacheOverride, reportDate } = action.payload;
47
+ const key = (0, agingBalance_1.getAgingBalancesKey)(reportDate);
48
+ const record = draft.arAgingBalancesByDate[key];
49
+ draft.uiState.selectedDate = reportDate;
50
+ if (cacheOverride || record == null) {
37
51
  draft.fetchState = 'In-Progress';
38
52
  draft.error = undefined;
39
53
  }
40
54
  },
41
- prepare(cacheOverride = false, // eslint-disable-line @typescript-eslint/no-inferrable-types
42
- reportDate) {
55
+ prepare(reportDate, cacheOverride = false) {
43
56
  return {
44
57
  payload: {
45
58
  cacheOverride,
@@ -49,24 +62,25 @@ const arAging = (0, toolkit_1.createSlice)({
49
62
  },
50
63
  },
51
64
  updateArAgingOnSuccess: {
52
- prepare(data) {
65
+ prepare(reportDate, data) {
53
66
  return {
54
67
  payload: {
68
+ reportDate,
55
69
  data,
56
70
  },
57
71
  };
58
72
  },
59
73
  reducer(draft, action) {
60
- const { data } = action.payload;
61
- draft.fetchState = 'Completed';
62
- draft.error = undefined;
74
+ const { data, reportDate } = action.payload;
63
75
  const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(data);
64
76
  draft.firstMonthOfFY = report.firstMonthOfFY;
65
77
  draft.bookCloseDate = report.bookCloseDate;
66
78
  draft.dataAvailable = report.dataAvailable;
67
- draft.arAgingBalancesByCustomerId = (0, arAgingPayload_1.toArAgingDataByCustomerId)(data);
68
- draft.arAgingTotals = (0, arAgingPayload_1.toArAgingTotals)(data);
79
+ doUpdateArAgingBalancesByDate(draft.arAgingBalancesByDate, reportDate, data);
69
80
  draft.agingPeriods = data.aging_periods.map((elem) => (0, agingBalance_1.toAgingPeriod)(elem));
81
+ draft.uiState.selectedDate = reportDate;
82
+ draft.fetchState = 'Completed';
83
+ draft.error = undefined;
70
84
  },
71
85
  },
72
86
  updateArAgingUIState(draft, action) {
@@ -85,6 +99,16 @@ const arAging = (0, toolkit_1.createSlice)({
85
99
  if (action.payload.selectedDate != null) {
86
100
  draft.uiState.selectedDate = action.payload.selectedDate;
87
101
  }
102
+ if (action.payload.agingDateSelectionType != null) {
103
+ draft.uiState.agingDateSelectionType =
104
+ action.payload.agingDateSelectionType;
105
+ }
106
+ },
107
+ updateArAgingNodeCollapseState(draft, action) {
108
+ const nodeCollapseState = action.payload;
109
+ draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
110
+ [nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
111
+ });
88
112
  },
89
113
  updateArAgingOnFailure: {
90
114
  reducer(draft, action) {
@@ -100,5 +124,15 @@ const arAging = (0, toolkit_1.createSlice)({
100
124
  },
101
125
  },
102
126
  });
103
- _a = arAging.actions, exports.fetchArAging = _a.fetchArAging, exports.updateArAgingUIState = _a.updateArAgingUIState, exports.updateArAgingOnFailure = _a.updateArAgingOnFailure, exports.updateArAgingOnSuccess = _a.updateArAgingOnSuccess, exports.clearArAging = _a.clearArAging;
127
+ _a = arAging.actions, exports.fetchArAging = _a.fetchArAging, exports.updateArAgingUIState = _a.updateArAgingUIState, exports.updateArAgingOnFailure = _a.updateArAgingOnFailure, exports.updateArAgingOnSuccess = _a.updateArAgingOnSuccess, exports.updateArAgingNodeCollapseState = _a.updateArAgingNodeCollapseState, exports.clearArAging = _a.clearArAging;
104
128
  exports.default = arAging.reducer;
129
+ const doUpdateArAgingBalancesByDate = (draft, reportDate, data) => {
130
+ const key = (0, agingBalance_1.getAgingBalancesKey)(reportDate);
131
+ const allCustomers = data.customers.map((customer) => (0, customerPayload_1.toCustomer)(customer));
132
+ const agingBalances = {
133
+ arAgingBalancesByCustomerId: (0, arAgingPayload_1.toArAgingDataByCustomerId)(data),
134
+ arAgingTotals: (0, arAgingPayload_1.toArAgingTotals)(data),
135
+ nestedCustomerHierarchy: (0, getNestedCustomerHierarchy_1.getNestedCustomerHierarchy)(allCustomers),
136
+ };
137
+ draft[key] = agingBalances;
138
+ };
@@ -1,18 +1,24 @@
1
1
  import { RootState } from '../../../reducer';
2
2
  import { SelectorReport } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
- import { Customer } from '../../../entity/customer/customer';
3
+ import { Customer } from '../../../entity/customer/customerState';
4
4
  import { AgingBalance, AgingPeriod } from '../../../commonStateTypes/agingBalance/agingBalance';
5
5
  import { Amount } from '../../../commonStateTypes/amount';
6
- import { AgingReportUIState } from '../../../commonStateTypes/viewAndReport/agingReportStateTypes';
7
- export interface AgingBalancesByCustomer {
6
+ import { NestedCustomerID } from '../../../commonStateTypes/customerView/nestedCustomerID';
7
+ import { ArAgingUIState } from './arAgingState';
8
+ export interface NestedAgingBalancesByCustomer {
9
+ id: NestedCustomerID;
10
+ isLeafCustomer: boolean;
11
+ hasSiblings: boolean;
8
12
  customer: Customer;
9
- total: Amount;
10
13
  arAgingBalances: AgingBalance[];
14
+ children: NestedAgingBalancesByCustomer[];
15
+ total: Amount;
16
+ totalWithChildren: Amount;
11
17
  }
12
18
  export interface ArAgingReport extends SelectorReport {
13
- agingBalancesByCustomer: AgingBalancesByCustomer[];
19
+ agingBalances: NestedAgingBalancesByCustomer[];
14
20
  totalBalances: AgingBalance[];
15
- arAgingUIState: AgingReportUIState;
21
+ arAgingUIState: ArAgingUIState;
16
22
  agingPeriods: AgingPeriod[];
17
23
  }
18
24
  export declare const getArAgingReport: (state: RootState) => ArAgingReport;