@zeniai/client-epic-state 4.20.0 → 4.20.1-beta10ND

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/coaBalance/additionalBalances/getSummationBalance.d.ts +1 -1
  3. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  4. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  5. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  7. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  9. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  10. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  11. package/lib/entity/tenant/tenantReducer.js +1 -0
  12. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  13. package/lib/entity/tenant/tenantSelector.js +9 -1
  14. package/lib/entity/tenant/tenantState.d.ts +1 -0
  15. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  16. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  17. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  18. package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  19. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  20. package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
  21. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  22. package/lib/epic.d.ts +2 -1
  23. package/lib/epic.js +2 -1
  24. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  25. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  26. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  27. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  28. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  29. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  30. package/lib/esm/epic.js +2 -1
  31. package/lib/esm/index.js +10 -8
  32. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  33. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  34. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  35. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  36. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  37. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  38. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  39. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  40. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  41. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  42. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  43. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  44. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  45. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  46. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  47. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  48. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  49. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
  50. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
  51. package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +17 -0
  52. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +6 -8
  53. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +132 -73
  54. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  55. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  56. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  57. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  58. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  59. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  60. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  61. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  62. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  63. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  64. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  65. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  66. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  67. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  68. package/lib/index.d.ts +15 -11
  69. package/lib/index.js +44 -32
  70. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  71. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  72. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  73. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  74. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  75. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  76. package/lib/view/aiCfoView/aiCfoViewState.d.ts +18 -1
  77. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  78. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  79. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  80. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  81. package/lib/view/classList/fetchClassListEpic.js +8 -1
  82. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  83. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  84. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  85. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  87. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  88. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  89. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  90. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  91. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  92. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  93. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  94. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  95. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  96. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  97. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  98. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  99. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  100. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
  101. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  102. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
  103. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +9 -0
  104. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +20 -0
  105. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +6 -8
  106. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +132 -73
  107. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  108. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  109. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  110. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  111. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  112. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  113. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  114. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  115. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  116. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  117. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  118. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  119. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  120. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  121. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  122. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  123. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  124. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  125. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  126. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSch
5
5
  import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
6
  import { ZeniAPIStatus } from '../../../responsePayload';
7
7
  import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
8
- import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState } from '../types/jeSchedulesViewState';
8
+ import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
9
9
  export declare const accountSettingsInitialState: AccountSettingsState;
10
10
  export declare const initialState: JESchedulesViewState;
11
11
  export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
@@ -56,7 +56,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
56
56
  accountPayload: AccountMetadataPayload[];
57
57
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
58
  status: ZeniAPIStatus;
59
- }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
59
+ }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
60
  localData: Partial<JEScheduleLocalData>;
61
61
  scheduledJournalEntryID: ID;
62
62
  }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
4
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
7
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -48,6 +48,8 @@ exports.initialState = {
48
48
  uiState: {
49
49
  searchString: '',
50
50
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
51
+ sortKey: 'startMonth',
52
+ sortOrder: 'descending',
51
53
  totalCount: 0,
52
54
  limit: 10,
53
55
  },
@@ -369,12 +371,26 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
369
371
  clearJeAccountSettingsLocalData(draft) {
370
372
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
371
373
  },
374
+ updateJESchedulesUIState(draft, action) {
375
+ if (action.payload.sortKey != null) {
376
+ draft.uiState.sortKey = action.payload.sortKey;
377
+ }
378
+ if (action.payload.sortOrder != null) {
379
+ draft.uiState.sortOrder = action.payload.sortOrder;
380
+ }
381
+ if (action.payload.searchString != null) {
382
+ draft.uiState.searchString = action.payload.searchString;
383
+ }
384
+ if (action.payload.scrollPosition != null) {
385
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
386
+ }
387
+ },
372
388
  clearExpenseAutomationJESchedulesView(draft) {
373
389
  Object.assign(draft, exports.initialState);
374
390
  },
375
391
  },
376
392
  });
377
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
393
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
378
394
  exports.default = expenseAutomationJESchedulesView.reducer;
379
395
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
380
396
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -18,10 +18,12 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
18
  allDepreciationAccountList: AccountBase[];
19
19
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
20
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
+ completedSchedules: JEScheduledTransaction[];
21
22
  completionStatus: CompletionStatusType;
22
23
  draftSchedules: JEScheduledTransaction[];
23
24
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
24
25
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
+ ongoingSchedules: JEScheduledTransaction[];
25
27
  postStatusById: Record<ID, FetchStateAndError>;
26
28
  refreshStatus: FetchStateAndError;
27
29
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpenseAutomationFluxAnalysisView = getExpenseAutomationFluxAnalysisView;
4
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
4
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
6
  const accountSelector_1 = require("../../../entity/account/accountSelector");
6
7
  const classSelector_1 = require("../../../entity/class/classSelector");
@@ -9,7 +10,7 @@ const userSelector_1 = require("../../../entity/user/userSelector");
9
10
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
10
11
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
11
12
  function getExpenseAutomationFluxAnalysisView(state) {
12
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
13
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
13
14
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
14
15
  const fetchStateAndError = {
15
16
  fetchState,
@@ -94,10 +95,17 @@ function getExpenseAutomationFluxAnalysisView(state) {
94
95
  },
95
96
  };
96
97
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
98
+ const monthEndFetchState = monthYearPeriodId != null
99
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
100
+ : { fetchState: 'Not-Started', error: undefined };
101
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
102
+ fetchStateAndError,
103
+ monthEndFetchState,
104
+ ]);
97
105
  return {
98
106
  sections,
99
107
  totalBalancesAndVariance,
100
- fetchStatus: fetchStateAndError,
108
+ fetchStatus: reducedFetchStatus,
101
109
  bulkReviewStatus,
102
110
  reviewOperatingExpensesIds,
103
111
  selectedSectionIds,
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
+ const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
10
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
11
  const accountSelector_1 = require("../../../entity/account/accountSelector");
10
12
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -16,10 +18,48 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
16
18
  const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
17
19
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
18
20
  const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
21
+ function getJEScheduleSortAccessor(sortKey) {
22
+ switch (sortKey) {
23
+ case 'vendor':
24
+ return (s) => s.vendor.name?.toLowerCase();
25
+ case 'category':
26
+ return (s) => s.jeDebit.account?.accountName?.toLowerCase();
27
+ case 'class':
28
+ return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
29
+ case 'depCategory':
30
+ return (s) => s.jeCredit.account?.accountName?.toLowerCase();
31
+ case 'scheduleCategory':
32
+ return (s) => s.jeScheduleType;
33
+ case 'startMonth':
34
+ return (s) => s.startDate?.valueOf();
35
+ case 'type':
36
+ return (s) => s.baseTransaction.typeOfTransaction;
37
+ case 'amortizationPeriod':
38
+ return (s) => s.period;
39
+ case 'jePostingDate':
40
+ return (s) => s.dayOfPostingDate;
41
+ case 'remainingMonths':
42
+ return (s) => s.period;
43
+ case 'runningBalance':
44
+ return (s) => s.balanceAsOfToday?.amount;
45
+ case 'totalAmount':
46
+ return (s) => s.baseTransaction.amount.amount;
47
+ case 'transactionDate':
48
+ return (s) => s.baseTransaction.date.valueOf();
49
+ case 'memo':
50
+ return (s) => s.baseTransaction.memo?.toLowerCase();
51
+ default:
52
+ return (s) => s.startDate?.valueOf();
53
+ }
54
+ }
55
+ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
56
+ const accessor = getJEScheduleSortAccessor(sortKey);
57
+ return (0, orderBy_1.default)(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
58
+ }
19
59
  function getExpenseAutomationJESchedulesView(state) {
20
60
  const jeScheduledTransaction = [];
21
61
  const failedJeScheduledTransaction = [];
22
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
62
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
23
63
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
24
64
  const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
25
65
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -65,18 +105,33 @@ function getExpenseAutomationJESchedulesView(state) {
65
105
  const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
66
106
  failedJeScheduledTransaction.push(jeScheduleDetails);
67
107
  });
68
- const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
69
- const resolveSchedules = [];
108
+ const { sortKey, sortOrder } = uiState;
109
+ const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
110
+ const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
111
+ const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
112
+ schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
113
+ const unsortedResolveSchedules = [];
70
114
  failedJeScheduledTransaction.forEach((schedule) => {
71
115
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
72
- resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
116
+ unsortedResolveSchedules.push({
117
+ ...schedule,
118
+ scheduledJournalEntry: journalEntry,
119
+ });
73
120
  });
74
121
  });
122
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
75
123
  const allSteps = monthYearPeriodId != null
76
124
  ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
77
125
  : [];
78
126
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
79
127
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
128
+ const monthEndFetchState = monthYearPeriodId != null
129
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
130
+ : { fetchState: 'Not-Started', error: undefined };
131
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
132
+ { fetchState, error },
133
+ monthEndFetchState,
134
+ ]);
80
135
  return {
81
136
  uncategorizedAccounts,
82
137
  allDepreciationAccountList: filteredDepAccounts,
@@ -85,15 +140,17 @@ function getExpenseAutomationJESchedulesView(state) {
85
140
  allAccountList: filteredAccounts,
86
141
  accountListNestedAccountHierarchy,
87
142
  allClassList: allClasses,
143
+ completedSchedules,
88
144
  draftSchedules,
145
+ ongoingSchedules,
89
146
  resolveSchedules: resolveSchedules,
90
147
  accountSettingsView,
91
148
  postStatusById: postStatusById,
92
149
  ignoreStatusById: ignoreStatusById,
93
- fetchState: fetchState,
150
+ fetchState: reducedFetchStatus.fetchState,
94
151
  jeScheduleLocalDataById: jeScheduleLocalDataById,
95
152
  uiState: uiState,
96
- error: error,
153
+ error: reducedFetchStatus.error,
97
154
  refreshStatus,
98
155
  completionStatus,
99
156
  };
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationMissingReceiptsView = getExpenseAutomationMissingReceiptsView;
7
7
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
9
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
10
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
11
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
@@ -13,7 +14,7 @@ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewRed
13
14
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
14
15
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
15
16
  function getExpenseAutomationMissingReceiptsView(state) {
16
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
18
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
19
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
19
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -42,7 +43,7 @@ function getExpenseAutomationMissingReceiptsView(state) {
42
43
  transaction.lines.length > 0 &&
43
44
  transaction.lines[0]
44
45
  ?.class != null
45
- ? transaction.lines[0].class.className.toLowerCase()
46
+ ? transaction.lines[0].class?.className.toLowerCase()
46
47
  : null;
47
48
  case 'vendor':
48
49
  default:
@@ -181,9 +182,16 @@ function getExpenseAutomationMissingReceiptsView(state) {
181
182
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
182
183
  };
183
184
  });
185
+ const monthEndFetchState = monthYearPeriodId != null
186
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
187
+ : { fetchState: 'Not-Started', error: undefined };
188
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
189
+ { fetchState, error },
190
+ monthEndFetchState,
191
+ ]);
184
192
  return {
185
- fetchState,
186
- error,
193
+ fetchState: reducedFetchStatus.fetchState,
194
+ error: reducedFetchStatus.error,
187
195
  uploadReceiptStatusById,
188
196
  uiState,
189
197
  refreshStatus,
@@ -19,7 +19,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
19
19
  const classListSelector_1 = require("../../classList/classListSelector");
20
20
  const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
21
21
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
22
- exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
22
+ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
23
23
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
24
24
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
25
25
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -41,6 +41,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
41
41
  }
42
42
  return acc;
43
43
  }, []);
44
+ const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
45
+ const monthEndFetchState = monthYearPeriodId != null
46
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
47
+ fetchState: 'Not-Started',
48
+ error: undefined,
49
+ })
50
+ : { fetchState: 'Not-Started', error: undefined };
44
51
  if (accountReconForMonthYearPeriod == null) {
45
52
  return {
46
53
  bankAccounts: [],
@@ -50,10 +57,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
50
57
  classListNestedAccountHierarchy: [],
51
58
  allAccountList: [],
52
59
  allClassList: [],
53
- fetchStatus: {
54
- fetchState: reconciliationViewState.fetchState,
55
- error: reconciliationViewState.error,
56
- },
60
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
61
+ {
62
+ fetchState: reconciliationViewState.fetchState,
63
+ error: reconciliationViewState.error,
64
+ },
65
+ monthEndFetchState,
66
+ ]),
57
67
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
58
68
  .plaidConnectionDetails,
59
69
  completionStatus: 'incomplete',
@@ -276,10 +286,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
276
286
  bankAccounts: uniqueBankAccounts,
277
287
  creditCards: uniqueCreditCards,
278
288
  accountReconciliationsByAccountID: reconList,
279
- fetchStatus: {
280
- fetchState: reconciliationViewState.fetchState,
281
- error: reconciliationViewState.error,
282
- },
289
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
290
+ {
291
+ fetchState: reconciliationViewState.fetchState,
292
+ error: reconciliationViewState.error,
293
+ },
294
+ monthEndFetchState,
295
+ ]),
283
296
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
284
297
  .plaidConnectionDetails,
285
298
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -14,7 +14,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
14
14
  const classListSelector_1 = require("../../classList/classListSelector");
15
15
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
16
16
  function getExpenseAutomationTransactionView(state) {
17
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
19
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
@@ -47,10 +47,16 @@ function getExpenseAutomationTransactionView(state) {
47
47
  .filter((transaction) => transaction != null);
48
48
  const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
49
49
  const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
50
- const fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)([
51
- accountList,
52
- classList,
53
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
50
+ const monthEndFetchState = monthYearPeriodId != null
51
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
52
+ : { fetchState: 'Not-Started', error: undefined };
53
+ const fetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
54
+ (0, reduceFetchState_1.reduceAllFetchState)([
55
+ accountList,
56
+ classList,
57
+ expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
58
+ ]),
59
+ monthEndFetchState,
54
60
  ]);
55
61
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
56
62
  .uiState.totalCount;
@@ -1,16 +1,21 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation } from '../../../commonStateTypes/recommendationBase';
4
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
4
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
6
  import { AccountBase } from '../../../entity/account/accountState';
6
7
  import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
7
8
  import { VendorBase } from '../../../entity/vendor/vendorState';
9
+ export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
10
+ export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
8
11
  export interface JESchedulesViewUIState {
9
12
  scrollPosition: {
10
13
  scrollTop: number;
11
14
  scrollLeft?: number;
12
15
  } | undefined;
13
16
  searchString: string;
17
+ sortKey: JEScheduleSortKey;
18
+ sortOrder: SortOrder;
14
19
  totalCount: number;
15
20
  limit?: number;
16
21
  }
@@ -1,2 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJEScheduleSortKey = void 0;
4
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
+ const JE_SCHEDULE_SORT_KEYS = [
6
+ 'vendor',
7
+ 'category',
8
+ 'class',
9
+ 'depCategory',
10
+ 'scheduleCategory',
11
+ 'startMonth',
12
+ 'type',
13
+ 'amortizationPeriod',
14
+ 'jePostingDate',
15
+ 'remainingMonths',
16
+ 'runningBalance',
17
+ 'totalAmount',
18
+ 'transactionDate',
19
+ 'memo',
20
+ ];
21
+ const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
22
+ exports.toJEScheduleSortKey = toJEScheduleSortKey;
@@ -0,0 +1,9 @@
1
+ import { COABalanceTimeFrame } from '../../commonStateTypes/coaBalance/coaBalance';
2
+ import { COABalancesSlice } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
3
+ import { Month } from '../../commonStateTypes/timePeriod';
4
+ /**
5
+ * Empty `COABalancesSlice` for horizontal P&L-by-class section / calculated headers when
6
+ * enrichment has not produced balances yet, or for UI mapping fallbacks.
7
+ * Structure matches {@link enrichProfitAndLossByClassHorizontalReport} output.
8
+ */
9
+ export declare function getEmptyHorizontalSectionBalancesSlice(firstMonthOfFY: Month, timeframe?: COABalanceTimeFrame): COABalancesSlice;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEmptyHorizontalSectionBalancesSlice = getEmptyHorizontalSectionBalancesSlice;
4
+ /**
5
+ * Empty `COABalancesSlice` for horizontal P&L-by-class section / calculated headers when
6
+ * enrichment has not produced balances yet, or for UI mapping fallbacks.
7
+ * Structure matches {@link enrichProfitAndLossByClassHorizontalReport} output.
8
+ */
9
+ function getEmptyHorizontalSectionBalancesSlice(firstMonthOfFY, timeframe = 'month') {
10
+ return {
11
+ balances: [],
12
+ additionalBalances: [],
13
+ filter: {
14
+ firstMonthOfFY,
15
+ timeframe,
16
+ balancesRange: { numberOfPeriods: 0, orderBy: 'ascending_date' },
17
+ additionalBalances: [],
18
+ },
19
+ };
20
+ }
@@ -6,6 +6,7 @@ const getSummationBalance_1 = require("../../commonStateTypes/coaBalance/additio
6
6
  const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
7
7
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
8
8
  const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
9
+ const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
9
10
  const profitAndLossHorizontalEnrichment_1 = require("./profitAndLossHorizontalEnrichment");
10
11
  exports.profitAndLossHorizontalIdsInOrder = [
11
12
  'income',
@@ -52,16 +53,11 @@ const getProfitAndLossClassesHorizontalView = (filter, accountState, classState,
52
53
  const calculatedSections = {};
53
54
  let reportCurrency = currencyHelper_1.defaultCustomerCurrency;
54
55
  if (fetchState.fetchState === 'Completed' && selectedPeriod != null) {
55
- // Get section reports using existing selector infrastructure
56
- const sectionReports = {};
57
- HORIZONTAL_PANDL_SECTION_IDS.forEach((sectionId) => {
58
- sectionReports[sectionId] = (0, sectionClassesViewSelector_1.getSectionClassesViewReport)(accountState, classState, sectionsState, { reportId, sectionId }, filter);
59
- });
60
56
  reportCurrency =
61
57
  profitAndLossClassesViewState.currency ?? currencyHelper_1.defaultCustomerCurrency;
62
- // Pivot each section from class→account to account→class
58
+ // Fetch each section and pivot class→account to account→class in one pass
63
59
  HORIZONTAL_PANDL_SECTION_IDS.forEach((sectionId) => {
64
- const sectionReport = sectionReports[sectionId];
60
+ const sectionReport = (0, sectionClassesViewSelector_1.getSectionClassesViewReport)(accountState, classState, sectionsState, { reportId, sectionId }, filter);
65
61
  if (sectionReport != null) {
66
62
  sections[sectionId] = pivotSectionToHorizontal(sectionReport, classColumns, SECTION_TITLES[sectionId] ?? sectionId, reportCurrency);
67
63
  }
@@ -265,7 +261,7 @@ function sumBalancesInSlice(balances) {
265
261
  if (balances.length === 0) {
266
262
  return 0;
267
263
  }
268
- const summed = (0, getSummationBalance_1.getSummationFreeRangeTotalBalance)([...balances]);
264
+ const summed = (0, getSummationBalance_1.getSummationFreeRangeTotalBalance)(balances);
269
265
  return summed?.balance.amount ?? 0;
270
266
  }
271
267
  /**
@@ -312,6 +308,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
312
308
  startDate,
313
309
  type: 'default',
314
310
  label: col.className,
311
+ id: col.classId,
315
312
  }));
316
313
  // Add a "Total" column
317
314
  balances.push({
@@ -321,6 +318,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
321
318
  startDate,
322
319
  type: 'default',
323
320
  label: 'Total',
321
+ id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
324
322
  });
325
323
  return balances;
326
324
  }