@zeniai/client-epic-state 4.20.8 → 4.20.9-betaAK1

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 (229) 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/commonStateTypes/animations.js +3 -0
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  6. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
  7. package/lib/entity/account/accountPayload.d.ts +2 -0
  8. package/lib/entity/account/accountReducer.d.ts +5 -2
  9. package/lib/entity/account/accountReducer.js +7 -2
  10. package/lib/entity/account/accountState.d.ts +1 -1
  11. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  12. package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
  13. package/lib/entity/accountRecon/accountReconPayload.js +4 -2
  14. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  15. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  16. package/lib/entity/class/classReducer.d.ts +4 -4
  17. package/lib/entity/class/classState.d.ts +1 -1
  18. package/lib/entity/forecast/forecastState.d.ts +1 -1
  19. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  20. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  21. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  22. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  23. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  24. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  25. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  26. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  27. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  28. package/lib/entity/snackbar/snackbarTypes.js +6 -0
  29. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  30. package/lib/entity/tenant/tenantReducer.d.ts +5 -2
  31. package/lib/entity/tenant/tenantReducer.js +9 -2
  32. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  33. package/lib/entity/tenant/tenantSelector.js +9 -1
  34. package/lib/entity/tenant/tenantState.d.ts +1 -0
  35. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  36. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  37. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +9 -0
  38. package/lib/entity/transaction/payloadTypes/transactionPayload.js +79 -1
  39. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  40. package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
  41. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  42. package/lib/epic.d.ts +11 -1
  43. package/lib/epic.js +11 -1
  44. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  45. package/lib/esm/commonStateTypes/animations.js +3 -0
  46. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
  47. package/lib/esm/entity/account/accountReducer.js +6 -1
  48. package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
  49. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  50. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  51. package/lib/esm/entity/snackbar/snackbarTypes.js +6 -0
  52. package/lib/esm/entity/tenant/tenantReducer.js +8 -1
  53. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  54. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  55. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +79 -1
  56. package/lib/esm/epic.js +11 -1
  57. package/lib/esm/index.js +14 -11
  58. package/lib/esm/reducer.js +3 -0
  59. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  60. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  61. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  62. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  63. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  64. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  65. package/lib/esm/view/companyView/companyViewReducer.js +26 -1
  66. package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
  67. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  68. package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +44 -0
  69. package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  70. package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +44 -0
  71. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  72. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  73. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +2 -1
  74. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  75. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  76. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  77. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
  78. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
  79. package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
  80. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  81. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  82. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +13 -4
  83. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  84. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
  85. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
  86. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  87. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  88. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  89. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  90. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  91. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
  92. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  93. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  94. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  95. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  96. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  97. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  98. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  99. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  100. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  101. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  102. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  103. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  104. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  105. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  106. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  107. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  108. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  109. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  110. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  111. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  112. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  113. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  114. package/lib/index.d.ts +23 -16
  115. package/lib/index.js +61 -32
  116. package/lib/reducer.d.ts +3 -0
  117. package/lib/reducer.js +3 -0
  118. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  119. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  120. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  121. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  122. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  123. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  124. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  125. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  126. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  127. package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
  128. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  129. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  130. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  131. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  132. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  133. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  134. package/lib/view/classList/fetchClassListEpic.js +8 -1
  135. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  136. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  137. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  138. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  139. package/lib/view/companyView/companyViewReducer.d.ts +6 -1
  140. package/lib/view/companyView/companyViewReducer.js +28 -2
  141. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
  142. package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
  143. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
  144. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
  145. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  146. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +8 -0
  147. package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +48 -0
  148. package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
  149. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +9 -0
  150. package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +48 -0
  151. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  152. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  153. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +2 -1
  154. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  155. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  156. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  157. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  158. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  159. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
  160. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  161. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
  162. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
  163. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
  164. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  165. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -0
  166. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
  167. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
  168. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  169. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  170. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +13 -4
  171. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
  172. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
  173. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
  174. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
  175. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
  176. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  177. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  178. package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
  179. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
  180. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  181. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  182. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  183. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  184. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  185. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  186. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  187. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  188. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  189. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  190. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  191. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  192. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
  193. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  194. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  195. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  196. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  197. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  198. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  199. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  200. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  201. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  202. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  203. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  204. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  205. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  206. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  207. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  208. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  209. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  210. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
  211. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  212. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  213. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  214. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  215. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  216. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  217. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  218. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  219. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  220. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  221. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  222. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  223. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  224. package/lib/view/topEx/topExSelector.d.ts +1 -1
  225. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  226. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  227. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  228. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  229. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
1
  import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
2
2
  export const ALL_ACCOUNT_RECON_SECTION_IDS = ['assets', 'liabilities'];
3
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
- const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
3
+ export const toAccountReconSectionID = (v) => stringToUnion(v, ALL_ACCOUNT_RECON_SECTION_IDS);
@@ -1,3 +1,4 @@
1
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
1
2
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
2
3
  import { getAccountBase } from '../../../entity/account/accountSelector';
3
4
  import { getClassById } from '../../../entity/class/classSelector';
@@ -6,7 +7,7 @@ import { getUserByUserId } from '../../../entity/user/userSelector';
6
7
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
7
8
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
8
9
  export function getExpenseAutomationFluxAnalysisView(state) {
9
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
10
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
10
11
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
11
12
  const fetchStateAndError = {
12
13
  fetchState,
@@ -91,10 +92,17 @@ export function getExpenseAutomationFluxAnalysisView(state) {
91
92
  },
92
93
  };
93
94
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
95
+ const monthEndFetchState = monthYearPeriodId != null
96
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
97
+ : { fetchState: 'Not-Started', error: undefined };
98
+ const reducedFetchStatus = reduceAnyFetchState([
99
+ fetchStateAndError,
100
+ monthEndFetchState,
101
+ ]);
94
102
  return {
95
103
  sections,
96
104
  totalBalancesAndVariance,
97
- fetchStatus: fetchStateAndError,
105
+ fetchStatus: reducedFetchStatus,
98
106
  bulkReviewStatus,
99
107
  reviewOperatingExpensesIds,
100
108
  selectedSectionIds,
@@ -1,4 +1,6 @@
1
1
  import omit from 'lodash/omit';
2
+ import orderBy from 'lodash/orderBy';
3
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
2
4
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
3
5
  import { getAccountIdsForTypes } from '../../../entity/account/accountSelector';
4
6
  import { getJEScheduledTransactionByJEScheduleTransactionKey, } from '../../../entity/jeSchedules/jeSchedulesSelector';
@@ -10,10 +12,48 @@ import { filterNestedAccountHierarchyById } from '../../scheduleView/scheduleDet
10
12
  import { getAccountLabelForScheduleType, getAccountsTypesForScheduleList, } from '../../scheduleView/scheduleListView/scheduleListHelper';
11
13
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
12
14
  import { getJEAccountSettingsView } from './jeAccountSettingsViewSelector';
15
+ function getJEScheduleSortAccessor(sortKey) {
16
+ switch (sortKey) {
17
+ case 'vendor':
18
+ return (s) => s.vendor.name?.toLowerCase();
19
+ case 'category':
20
+ return (s) => s.jeDebit.account?.accountName?.toLowerCase();
21
+ case 'class':
22
+ return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
23
+ case 'depCategory':
24
+ return (s) => s.jeCredit.account?.accountName?.toLowerCase();
25
+ case 'scheduleCategory':
26
+ return (s) => s.jeScheduleType;
27
+ case 'startMonth':
28
+ return (s) => s.startDate?.valueOf();
29
+ case 'type':
30
+ return (s) => s.baseTransaction.typeOfTransaction;
31
+ case 'amortizationPeriod':
32
+ return (s) => s.period;
33
+ case 'jePostingDate':
34
+ return (s) => s.dayOfPostingDate;
35
+ case 'remainingMonths':
36
+ return (s) => s.period;
37
+ case 'runningBalance':
38
+ return (s) => s.balanceAsOfToday?.amount;
39
+ case 'totalAmount':
40
+ return (s) => s.baseTransaction.amount.amount;
41
+ case 'transactionDate':
42
+ return (s) => s.baseTransaction.date.valueOf();
43
+ case 'memo':
44
+ return (s) => s.baseTransaction.memo?.toLowerCase();
45
+ default:
46
+ return (s) => s.startDate?.valueOf();
47
+ }
48
+ }
49
+ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
50
+ const accessor = getJEScheduleSortAccessor(sortKey);
51
+ return orderBy(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
52
+ }
13
53
  export function getExpenseAutomationJESchedulesView(state) {
14
54
  const jeScheduledTransaction = [];
15
55
  const failedJeScheduledTransaction = [];
16
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
56
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
57
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
18
58
  const accountSettingsView = getJEAccountSettingsView(state);
19
59
  const currentTenant = getCurrentTenant(state);
@@ -59,18 +99,33 @@ export function getExpenseAutomationJESchedulesView(state) {
59
99
  const jeScheduleDetails = getJEScheduledTransactionByJEScheduleTransactionKey(jeScheduleKey, state);
60
100
  failedJeScheduledTransaction.push(jeScheduleDetails);
61
101
  });
62
- const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
63
- const resolveSchedules = [];
102
+ const { sortKey, sortOrder } = uiState;
103
+ const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
104
+ const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
105
+ const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
106
+ schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
107
+ const unsortedResolveSchedules = [];
64
108
  failedJeScheduledTransaction.forEach((schedule) => {
65
109
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
66
- resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
110
+ unsortedResolveSchedules.push({
111
+ ...schedule,
112
+ scheduledJournalEntry: journalEntry,
113
+ });
67
114
  });
68
115
  });
116
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
69
117
  const allSteps = monthYearPeriodId != null
70
118
  ? getAllSteps(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
71
119
  : [];
72
120
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
73
121
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
122
+ const monthEndFetchState = monthYearPeriodId != null
123
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
124
+ : { fetchState: 'Not-Started', error: undefined };
125
+ const reducedFetchStatus = reduceAnyFetchState([
126
+ { fetchState, error },
127
+ monthEndFetchState,
128
+ ]);
74
129
  return {
75
130
  uncategorizedAccounts,
76
131
  allDepreciationAccountList: filteredDepAccounts,
@@ -79,15 +134,17 @@ export function getExpenseAutomationJESchedulesView(state) {
79
134
  allAccountList: filteredAccounts,
80
135
  accountListNestedAccountHierarchy,
81
136
  allClassList: allClasses,
137
+ completedSchedules,
82
138
  draftSchedules,
139
+ ongoingSchedules,
83
140
  resolveSchedules: resolveSchedules,
84
141
  accountSettingsView,
85
142
  postStatusById: postStatusById,
86
143
  ignoreStatusById: ignoreStatusById,
87
- fetchState: fetchState,
144
+ fetchState: reducedFetchStatus.fetchState,
88
145
  jeScheduleLocalDataById: jeScheduleLocalDataById,
89
146
  uiState: uiState,
90
- error: error,
147
+ error: reducedFetchStatus.error,
91
148
  refreshStatus,
92
149
  completionStatus,
93
150
  };
@@ -1,4 +1,5 @@
1
1
  import orderBy from 'lodash/orderBy';
2
+ import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
2
3
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
3
4
  import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
4
5
  import { getSupportedTransactionById, getSupportedTransactionsByIds, } from '../../../entity/transaction/transactionSelector';
@@ -7,7 +8,7 @@ import { getCompletedTransactionsCacheKey } from '../reducers/missingReceiptsVie
7
8
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
8
9
  import { isUnmatchedTabFileStatus, } from '../types/missingReceiptsViewState';
9
10
  export function getExpenseAutomationMissingReceiptsView(state) {
10
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
11
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
11
12
  const currentTenant = getCurrentTenant(state);
12
13
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
13
14
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -36,7 +37,7 @@ export function getExpenseAutomationMissingReceiptsView(state) {
36
37
  transaction.lines.length > 0 &&
37
38
  transaction.lines[0]
38
39
  ?.class != null
39
- ? transaction.lines[0].class.className.toLowerCase()
40
+ ? transaction.lines[0].class?.className.toLowerCase()
40
41
  : null;
41
42
  case 'vendor':
42
43
  default:
@@ -175,9 +176,16 @@ export function getExpenseAutomationMissingReceiptsView(state) {
175
176
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
176
177
  };
177
178
  });
179
+ const monthEndFetchState = monthYearPeriodId != null
180
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
181
+ : { fetchState: 'Not-Started', error: undefined };
182
+ const reducedFetchStatus = reduceAnyFetchState([
183
+ { fetchState, error },
184
+ monthEndFetchState,
185
+ ]);
178
186
  return {
179
- fetchState,
180
- error,
187
+ fetchState: reducedFetchStatus.fetchState,
188
+ error: reducedFetchStatus.error,
181
189
  uploadReceiptStatusById,
182
190
  uiState,
183
191
  refreshStatus,
@@ -190,6 +198,7 @@ export function getExpenseAutomationMissingReceiptsView(state) {
190
198
  batchStatus: currentBatchStatus,
191
199
  batchDetails: resolvedBatchDetails,
192
200
  completedSubTab: bulkUpload.completedSubTab,
201
+ currentBatchId: bulkUpload.currentBatchId,
193
202
  completedTransactions: {
194
203
  fetchState: completedTransactionsForPeriod?.fetchState ?? {
195
204
  fetchState: 'Not-Started',
@@ -9,11 +9,12 @@ import { getAccountsByType } from '../../../entity/account/accountSelector';
9
9
  import { getAccountReconByAccountIdAndSelectedPeriod } from '../../../entity/accountRecon/accountReconSelector';
10
10
  import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
11
11
  import { getVendorByVendorId } from '../../../entity/vendor/vendorSelector';
12
+ import { date } from '../../../zeniDayJS';
12
13
  import { getAccountList, getNestedAccountListHierarchy, } from '../../accountList/accountListSelector';
13
14
  import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
14
15
  import { initialActionFetchState, initialReconciliationTabsState, initialState, } from '../reducers/reconciliationViewReducer';
15
16
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
16
- export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => 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) => {
17
+ export const getExpenseAutomationReconciliationView = createSelector((state) => state, (state) => 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) => {
17
18
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
18
19
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
19
20
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -35,6 +36,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
35
36
  }
36
37
  return acc;
37
38
  }, []);
39
+ const monthYearPeriodId = selectedPeriod != null ? toMonthYearPeriodId(selectedPeriod) : null;
40
+ const monthEndFetchState = monthYearPeriodId != null
41
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
42
+ fetchState: 'Not-Started',
43
+ error: undefined,
44
+ })
45
+ : { fetchState: 'Not-Started', error: undefined };
38
46
  if (accountReconForMonthYearPeriod == null) {
39
47
  return {
40
48
  bankAccounts: [],
@@ -44,10 +52,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
44
52
  classListNestedAccountHierarchy: [],
45
53
  allAccountList: [],
46
54
  allClassList: [],
47
- fetchStatus: {
48
- fetchState: reconciliationViewState.fetchState,
49
- error: reconciliationViewState.error,
50
- },
55
+ fetchStatus: reduceAnyFetchState([
56
+ {
57
+ fetchState: reconciliationViewState.fetchState,
58
+ error: reconciliationViewState.error,
59
+ },
60
+ monthEndFetchState,
61
+ ]),
51
62
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
52
63
  .plaidConnectionDetails,
53
64
  completionStatus: 'incomplete',
@@ -80,6 +91,30 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
80
91
  totalVariancePercentage: undefined,
81
92
  },
82
93
  },
94
+ excludedAccountReconciliationByAccountID: {},
95
+ excludedAccountReconciliationBySectionID: {
96
+ assets: {
97
+ sectionId: 'assets',
98
+ accountIDs: [],
99
+ totalBankBalance: undefined,
100
+ totalClearedBalance: undefined,
101
+ totalReconciledBalance: undefined,
102
+ totalVariance: undefined,
103
+ totalVariancePercentage: undefined,
104
+ },
105
+ liabilities: {
106
+ sectionId: 'liabilities',
107
+ accountIDs: [],
108
+ totalBankBalance: undefined,
109
+ totalClearedBalance: undefined,
110
+ totalReconciledBalance: undefined,
111
+ totalVariance: undefined,
112
+ totalVariancePercentage: undefined,
113
+ },
114
+ },
115
+ excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
116
+ includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
117
+ excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
83
118
  };
84
119
  }
85
120
  const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
@@ -217,6 +252,8 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
217
252
  .transactionFetchState,
218
253
  accountListState.byReportId.accountList,
219
254
  ]),
255
+ accountDetectionReason: accountReconForMonthYearPeriod.reconciliationByAccountID[accountID]
256
+ .accountDetectionReason,
220
257
  };
221
258
  });
222
259
  const accountReconciliationBySectionID = {
@@ -239,6 +276,88 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
239
276
  totalVariancePercentage: liabilityTotals.variancePercentage,
240
277
  },
241
278
  };
279
+ const bankAccountIdSet = new Set(uniqueBankAccounts.map((a) => a.accountId));
280
+ const creditCardIdSet = new Set(uniqueCreditCards.map((a) => a.accountId));
281
+ const excludedAssetAccountIDs = [];
282
+ const excludedLiabilityAccountIDs = [];
283
+ reconciliationViewState.excludedAccountIDs.forEach((accountID) => {
284
+ const isAsset = bankAccountIdSet.has(accountID);
285
+ const isLiability = creditCardIdSet.has(accountID);
286
+ if (!isAsset && !isLiability) {
287
+ return;
288
+ }
289
+ if (isAsset) {
290
+ excludedAssetAccountIDs.push(accountID);
291
+ }
292
+ else {
293
+ excludedLiabilityAccountIDs.push(accountID);
294
+ }
295
+ });
296
+ const excludedAccountReconciliationBySectionID = {
297
+ assets: {
298
+ sectionId: 'assets',
299
+ accountIDs: excludedAssetAccountIDs,
300
+ },
301
+ liabilities: {
302
+ sectionId: 'liabilities',
303
+ accountIDs: excludedLiabilityAccountIDs,
304
+ },
305
+ };
306
+ const excludedAccountReconciliationByAccountID = {};
307
+ const accountsInState = Object.values(accountState.accountsByKey);
308
+ const accountsInStateMap = new Map(accountsInState.map((a) => [a.accountId, a]));
309
+ reconciliationViewState.excludedAccountIDs.forEach((excludedAccountID) => {
310
+ const account = accountsInStateMap.get(excludedAccountID);
311
+ const exclusionInfo = reconciliationViewState.excludedAccountExclusionInfo[excludedAccountID];
312
+ if (account != null) {
313
+ excludedAccountReconciliationByAccountID[excludedAccountID] = {
314
+ refreshStatus: { fetchState: 'Not-Started' },
315
+ statementUpdateStatus: { fetchState: 'Not-Started' },
316
+ statementUploadStatus: { fetchState: 'Not-Started' },
317
+ statementDeleteStatus: { fetchState: 'Not-Started' },
318
+ localData: {},
319
+ connectionInProgress: false,
320
+ statementParseInProgress: false,
321
+ accountConnectionStatus: 'not_connected',
322
+ transactionFetchState: { fetchState: 'Not-Started' },
323
+ accountReconEntity: {
324
+ account: {
325
+ accountId: account.accountId,
326
+ accountName: account.accountName,
327
+ accountType: account.accountType,
328
+ accountSubType: account.accountSubType,
329
+ accountDescription: account.accountDescription,
330
+ qboId: account.qboId,
331
+ coaId: account.coaId,
332
+ labels: account.labels,
333
+ },
334
+ currency: {
335
+ currencyCode: exclusionInfo?.bankBalance?.currencyCode ??
336
+ exclusionInfo?.clearedBalance?.currencyCode ??
337
+ 'USD',
338
+ currencySymbol: exclusionInfo?.bankBalance?.currencySymbol ??
339
+ exclusionInfo?.clearedBalance?.currencySymbol ??
340
+ '$',
341
+ },
342
+ startDate: date(new Date().toDateString()),
343
+ endDate: date(new Date().toDateString()),
344
+ statementStatus: { code: 'not_found', label: 'Not Found' },
345
+ transactionsToReconcile: [],
346
+ transactionsToReview: [],
347
+ balance: exclusionInfo?.bankBalance,
348
+ clearedBalance: exclusionInfo?.clearedBalance,
349
+ variance: exclusionInfo?.variance,
350
+ variancePercentage: exclusionInfo?.variance != null &&
351
+ exclusionInfo?.bankBalance != null &&
352
+ exclusionInfo?.bankBalance.amount !== 0
353
+ ? Math.abs((exclusionInfo.variance.amount /
354
+ exclusionInfo.bankBalance.amount) *
355
+ 100)
356
+ : undefined,
357
+ },
358
+ };
359
+ }
360
+ });
242
361
  const accountListNestedAccountHierarchy = getNestedAccountListHierarchy(accountListState, 'accountList');
243
362
  const classListNestedAccountHierarchy = getNestedClassListHierarchy(classListState);
244
363
  const accountsList = getAccountList(accountState, accountListState, 'accountList');
@@ -270,10 +389,13 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
270
389
  bankAccounts: uniqueBankAccounts,
271
390
  creditCards: uniqueCreditCards,
272
391
  accountReconciliationsByAccountID: reconList,
273
- fetchStatus: {
274
- fetchState: reconciliationViewState.fetchState,
275
- error: reconciliationViewState.error,
276
- },
392
+ fetchStatus: reduceAnyFetchState([
393
+ {
394
+ fetchState: reconciliationViewState.fetchState,
395
+ error: reconciliationViewState.error,
396
+ },
397
+ monthEndFetchState,
398
+ ]),
277
399
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
278
400
  .plaidConnectionDetails,
279
401
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -296,6 +418,11 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
296
418
  allClassList: allClasses,
297
419
  reviewTabSelectedVendorByTransactionId,
298
420
  reconListUIState: reconciliationViewState.reconListUIState,
421
+ excludedAccountReconciliationBySectionID,
422
+ excludedAccountReconciliationByAccountID,
423
+ excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
424
+ includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
425
+ excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
299
426
  };
300
427
  });
301
428
  export const isAccountReconReport = (reportId) => {
@@ -1,14 +1,14 @@
1
1
  import omit from 'lodash/omit';
2
- import { reduceAllFetchState } from '../../../commonStateTypes/reduceFetchState';
2
+ import { reduceAllFetchState, reduceAnyFetchState, } from '../../../commonStateTypes/reduceFetchState';
3
3
  import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
- import { getCurrentTenant } from '../../../entity/tenant/tenantSelector';
4
+ import { getIsAccountingClassesEnabled, getCurrentTenant, } from '../../../entity/tenant/tenantSelector';
5
5
  import { getTransactionWithCOT } from '../../../entity/transaction/transactionHelper';
6
6
  import { getSupportedTransactionsByIds } from '../../../entity/transaction/transactionSelector';
7
7
  import { getAccountList, getNestedAccountListHierarchy, getUncategorizedAccounts, } from '../../accountList/accountListSelector';
8
8
  import { getClassList, getNestedClassListHierarchy, } from '../../classList/classListSelector';
9
9
  import { getAllSteps } from '../selectorTypes/expenseAutomationViewSelectorTypes';
10
10
  export function getExpenseAutomationTransactionView(state) {
11
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
11
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
12
12
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
13
13
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
14
14
  const uncategorizedIncomeExpense = getUncategorizedAccounts(accountState, accountListState, 'accountList');
@@ -41,10 +41,20 @@ export function getExpenseAutomationTransactionView(state) {
41
41
  .filter((transaction) => transaction != null);
42
42
  const transactions = getSupportedTransactionsByIds(transactionState, transactionIds);
43
43
  const transactionsWithCOT = transactions.map((transaction) => getTransactionWithCOT(transaction));
44
- const fetchStatus = reduceAllFetchState([
44
+ const monthEndFetchState = monthYearPeriodId != null
45
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
46
+ : { fetchState: 'Not-Started', error: undefined };
47
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
48
+ const allFetchStateList = [
45
49
  accountList,
46
- classList,
47
50
  expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
51
+ ];
52
+ if (isAccountingClassesEnabled) {
53
+ allFetchStateList.push(classList);
54
+ }
55
+ const fetchStatus = reduceAnyFetchState([
56
+ reduceAllFetchState(allFetchStateList),
57
+ monthEndFetchState,
48
58
  ]);
49
59
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
50
60
  .uiState.totalCount;
@@ -1 +1,24 @@
1
- export {};
1
+ import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
2
+ const JE_SCHEDULE_SORT_KEYS = [
3
+ 'vendor',
4
+ 'category',
5
+ 'class',
6
+ 'depCategory',
7
+ 'scheduleCategory',
8
+ 'startMonth',
9
+ 'type',
10
+ 'amortizationPeriod',
11
+ 'jePostingDate',
12
+ 'remainingMonths',
13
+ 'runningBalance',
14
+ 'totalAmount',
15
+ 'transactionDate',
16
+ 'memo',
17
+ ];
18
+ export const toJEScheduleSortKey = (v) => stringToUnion(v, JE_SCHEDULE_SORT_KEYS);
19
+ const JE_SCHEDULE_MAIN_TABS = [
20
+ 'pending_review',
21
+ 'ongoing',
22
+ 'completed',
23
+ ];
24
+ export const toJEScheduleMainTab = (v) => stringToUnion(v, JE_SCHEDULE_MAIN_TABS);
@@ -3,6 +3,7 @@ import { getSummationFreeRangeTotalBalance } from '../../commonStateTypes/coaBal
3
3
  import { defaultCustomerCurrency } from '../../commonStateTypes/currencyHelper';
4
4
  import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
5
5
  import { getSectionClassesViewReport } from '../../entity/sectionClassesViewV2/sectionClassesViewSelector';
6
+ import { HORIZONTAL_CLASS_TOTAL_BALANCE_ID, } from './profitAndLossClassesByClassHorizontalSelectorTypes';
6
7
  import { enrichProfitAndLossByClassHorizontalReport } from './profitAndLossHorizontalEnrichment';
7
8
  /** Standard class ID returned by the accounting platform for transactions without an assigned class. */
8
9
  export const NOT_SPECIFIED_CLASS_ID = 'not_specified';
@@ -317,6 +318,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
317
318
  startDate,
318
319
  type: 'default',
319
320
  label: col.className,
321
+ id: col.classId,
320
322
  }));
321
323
  // Add a "Total" column
322
324
  balances.push({
@@ -326,6 +328,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
326
328
  startDate,
327
329
  type: 'default',
328
330
  label: 'Total',
331
+ id: HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
329
332
  });
330
333
  return balances;
331
334
  }
@@ -0,0 +1,26 @@
1
+ import { date } from '../../../zeniDayJS';
2
+ export const mapPayloadToAutoTransferRule = (payload) => ({
3
+ amount: payload.amount,
4
+ autoTransferRuleId: payload.auto_transfer_rule_id,
5
+ createTime: payload.create_time != null ? date(payload.create_time) : undefined,
6
+ currencyCode: payload.currency_code,
7
+ currencySymbol: payload.currency_symbol ?? '$',
8
+ destinationBankAccountId: payload.destination_bank_account_id,
9
+ destinationBankAccountMetadata: payload.destination_bank_account_metadata?.map((m) => ({
10
+ accountId: m.account_id,
11
+ accountType: m.account_type,
12
+ percentage: m.percentage,
13
+ })) ?? undefined,
14
+ destinationBankAccountType: payload.destination_bank_account_type ?? undefined,
15
+ frequency: payload.frequency,
16
+ isActive: payload.is_active,
17
+ isDeleted: payload.is_deleted,
18
+ lastRunTime: payload.last_run_time,
19
+ nextTransferDate: payload.next_transfer_date != null
20
+ ? date(payload.next_transfer_date)
21
+ : undefined,
22
+ ruleType: payload.rule_type,
23
+ sourceBankAccountId: payload.source_bank_account_id,
24
+ sourceBankAccountType: payload.source_bank_account_type,
25
+ updateTime: payload.update_time != null ? date(payload.update_time) : undefined,
26
+ });