@zeniai/client-epic-state 4.20.1-beta11ND → 4.20.2-beta0ND

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 (125) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonStateTypes/animations.d.ts +1 -1
  4. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  5. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  9. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  10. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  11. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  12. package/lib/entity/tenant/tenantReducer.js +1 -0
  13. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  14. package/lib/entity/tenant/tenantSelector.js +9 -1
  15. package/lib/entity/tenant/tenantState.d.ts +1 -0
  16. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  17. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  18. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  19. package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  21. package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
  22. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  23. package/lib/epic.d.ts +2 -1
  24. package/lib/epic.js +2 -1
  25. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  27. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  28. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  29. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  30. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  31. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  32. package/lib/esm/epic.js +2 -1
  33. package/lib/esm/index.js +8 -7
  34. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  35. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  36. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  37. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  38. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  39. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  41. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  42. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  43. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  44. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  45. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  46. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  47. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  48. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  49. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  50. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  51. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
  52. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
  53. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  54. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +1 -2
  55. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  56. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  57. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  58. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  59. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  60. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  61. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  62. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  63. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  64. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  65. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  66. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  67. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  68. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  69. package/lib/index.d.ts +13 -10
  70. package/lib/index.js +42 -32
  71. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  72. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  73. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  74. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  75. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  76. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  77. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  78. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  79. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  80. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  81. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  82. package/lib/view/classList/fetchClassListEpic.js +8 -1
  83. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  84. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  85. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  86. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  88. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  89. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  90. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  91. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  92. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  93. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  94. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  95. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  96. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  97. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  98. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  99. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  100. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  101. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
  102. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  103. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
  104. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  105. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +1 -2
  106. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  107. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  108. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  109. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  110. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  111. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  112. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  113. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  114. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  115. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  116. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  117. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  118. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  119. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  120. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  121. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  122. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  123. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  124. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  125. 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;
@@ -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',
@@ -307,6 +308,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
307
308
  startDate,
308
309
  type: 'default',
309
310
  label: col.className,
311
+ id: col.classId,
310
312
  }));
311
313
  // Add a "Total" column
312
314
  balances.push({
@@ -316,6 +318,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
316
318
  startDate,
317
319
  type: 'default',
318
320
  label: 'Total',
321
+ id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
319
322
  });
320
323
  return balances;
321
324
  }
@@ -71,9 +71,8 @@ function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmou
71
71
  const currencyCode = firstHeader?.balance.currencyCode ?? fallback.currencyCode;
72
72
  const currencySymbol = firstHeader?.balance.currencySymbol ?? fallback.currencySymbol;
73
73
  const timeframe = firstHeader?.balanceTimeFrame ?? 'month';
74
- const emptySlice = (0, horizontalSectionEmptyBalancesSlice_1.getEmptyHorizontalSectionBalancesSlice)(report.firstMonthOfFY, timeframe);
75
74
  if (report.selectedPeriod == null) {
76
- return emptySlice;
75
+ return (0, horizontalSectionEmptyBalancesSlice_1.getEmptyHorizontalSectionBalancesSlice)(report.firstMonthOfFY, timeframe);
77
76
  }
78
77
  const { startDate, endDate } = report.selectedPeriod;
79
78
  const balances = report.classColumns.map((col, columnIndex) => ({
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
7
7
  export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
8
8
  export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
9
9
  export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
10
- declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "accruedExpenseCategory" | "scheduleCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "startMonth" | "endMonth";
10
+ declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "user" | "createTime" | "class" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
11
11
  export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
12
12
  export interface DownloadJEScheduleTabOptions {
13
13
  categoryId: ID;
@@ -424,6 +424,14 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
424
424
  transactionsWithNoSortKeyValue.push(transaction);
425
425
  }
426
426
  break;
427
+ case 'invoiceNumber':
428
+ if (transaction.documentId != null) {
429
+ transactionsWithSortKeyValue.push(transaction);
430
+ }
431
+ else {
432
+ transactionsWithNoSortKeyValue.push(transaction);
433
+ }
434
+ break;
427
435
  case 'dueDate':
428
436
  if (currentTab === 'draft') {
429
437
  if (Boolean(transaction.dueDate) === true) {
@@ -526,6 +534,8 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
526
534
  return transaction.totalAmountInUSD?.amount ?? 0;
527
535
  case 'paymentMethod':
528
536
  return transaction.billPayInfo.billPaymentMethodType.name;
537
+ case 'invoiceNumber':
538
+ return transaction.documentId;
529
539
  }
530
540
  }, getColumnWiseSortOrder(sortOrder));
531
541
  return [
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
37
37
  export type BillTab = ReturnType<typeof toBillTabType>;
38
38
  declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
39
39
  export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
40
- declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
40
+ declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
41
41
  export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
42
42
  export interface BillPayFilters {
43
43
  categories: BillPayFilterCategory[];
@@ -47,6 +47,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
47
47
  'invoiceDate',
48
48
  'name',
49
49
  'paymentMethod',
50
+ 'invoiceNumber',
50
51
  ];
51
52
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
52
53
  const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
@@ -8,6 +8,7 @@ const get_1 = __importDefault(require("lodash/get"));
8
8
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
9
9
  const contactSelector_1 = require("../../../../entity/billPay/contact/contactSelector");
10
10
  const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
11
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
11
12
  const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
12
13
  const accountListSelector_1 = require("../../../accountList/accountListSelector");
13
14
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
@@ -80,11 +81,14 @@ const getReviewPageBillDetail = (state, billId) => {
80
81
  }
81
82
  }
82
83
  if (sourceBillDetail != null) {
83
- sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)([
84
+ const fetchStateList = [
84
85
  sourceBillDetail.fetchStatus,
85
86
  accountListState.byReportId['billPayAccountList'],
86
- classListState,
87
- ]).fetchState;
87
+ ];
88
+ if ((0, tenantSelector_1.getIsAccountingClassesEnabled)(state)) {
89
+ fetchStateList.push(classListState);
90
+ }
91
+ sourceBillDetailFetchState = (0, reduceFetchState_1.reduceFetchState)(fetchStateList).fetchState;
88
92
  }
89
93
  }
90
94
  else {
@@ -9,6 +9,7 @@ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
9
9
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
10
10
  const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
11
11
  const classSelector_1 = require("../../../../entity/class/classSelector");
12
+ const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
12
13
  const userSelector_1 = require("../../../../entity/user/userSelector");
13
14
  const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
14
15
  exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
@@ -50,7 +51,7 @@ exports.getBillPaySetupApproverView = (0, toolkit_1.createSelector)((state) => s
50
51
  newApprovalRuleId,
51
52
  };
52
53
  });
53
- exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
54
+ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => (0, tenantSelector_1.getIsAccountingClassesEnabled)(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
54
55
  const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
55
56
  const { approverIds, attributes } = approverListState;
56
57
  const allApprovalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, approvalRuleIds);
@@ -98,10 +99,9 @@ exports.getBillPaySetupApproverUpdateDataView = (0, toolkit_1.createSelector)((s
98
99
  allAttributes,
99
100
  filteredAttributes,
100
101
  billPaySetupApproverViewUpdateData,
101
- approverListFetchStatus: (0, reduceFetchState_1.reduceAllFetchState)([
102
- approverListState.fetchStatus,
103
- classListState,
104
- ]),
102
+ approverListFetchStatus: isAccountingClassesEnabled
103
+ ? (0, reduceFetchState_1.reduceAllFetchState)([approverListState.fetchStatus, classListState])
104
+ : approverListState.fetchStatus,
105
105
  fetchState,
106
106
  allAccountingClasses,
107
107
  error,
@@ -3,23 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchBillPayApproversDetailsEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
+ const tenantSelector_1 = require("../../../../../entity/tenant/tenantSelector");
6
7
  const classListReducer_1 = require("../../../../classList/classListReducer");
7
8
  const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
8
9
  const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.fetchBillPayApproversDetails.match), (0, operators_1.mergeMap)((action) => {
9
10
  const { cacheOverride, includeUserRoles } = action.payload;
10
11
  const { billPaySetupApproverViewState, classListState } = state$.value;
11
12
  const { approverListState } = billPaySetupApproverViewState;
13
+ const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
12
14
  const actions = [];
13
15
  if (cacheOverride === true) {
14
16
  actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(cacheOverride, includeUserRoles));
15
- actions.push((0, classListReducer_1.fetchClassList)());
17
+ if (isAccountingClassesEnabled) {
18
+ actions.push((0, classListReducer_1.fetchClassList)());
19
+ }
16
20
  }
17
21
  else {
18
22
  if (billPaySetupApproverViewState.hasValidState() === false &&
19
23
  approverListState.fetchStatus.fetchState !== 'In-Progress') {
20
24
  actions.push((0, billPaySetupApproverViewReducer_1.fetchBillPayApproversList)(true, includeUserRoles));
21
25
  }
22
- if (classListState.hasValidState() === false &&
26
+ if (isAccountingClassesEnabled &&
27
+ classListState.hasValidState() === false &&
23
28
  classListState.fetchState !== 'In-Progress') {
24
29
  actions.push((0, classListReducer_1.fetchClassList)());
25
30
  }