@zeniai/client-epic-state 5.2.30 → 5.2.32-betaAK0

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 (200) hide show
  1. package/lib/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  2. package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +6 -0
  3. package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +12 -1
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  5. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  6. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  7. package/lib/entity/class/classReducer.d.ts +4 -4
  8. package/lib/entity/class/classState.d.ts +1 -1
  9. package/lib/entity/forecast/forecastState.d.ts +1 -1
  10. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  11. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  12. package/lib/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  13. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  14. package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
  15. package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
  16. package/lib/epic.d.ts +10 -6
  17. package/lib/epic.js +15 -8
  18. package/lib/esm/commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod.js +16 -3
  19. package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +7 -0
  20. package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
  21. package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewEpic.js +2 -1
  22. package/lib/esm/epic.js +14 -7
  23. package/lib/esm/index.js +16 -13
  24. package/lib/esm/reducer.js +18 -12
  25. package/lib/esm/view/cashFlow/cashFlowGroupedSectionOrder.js +47 -0
  26. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewEpic.js +30 -0
  27. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewReducer.js +129 -0
  28. package/lib/esm/view/cashFlowClassesView/cashFlowClassesViewSelector.js +53 -0
  29. package/lib/esm/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +55 -0
  30. package/lib/esm/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +57 -0
  31. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewEpic.js +30 -0
  32. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewReducer.js +125 -0
  33. package/lib/esm/view/cashFlowProjectView/cashFlowProjectViewSelector.js +54 -0
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  35. package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
  36. package/lib/esm/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +1 -1
  37. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +1 -1
  38. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +1 -24
  39. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +10 -36
  40. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +2 -21
  41. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +11 -33
  42. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +9 -1
  43. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +2 -0
  44. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +1 -1
  45. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +15 -0
  46. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +1 -1
  47. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +1 -1
  48. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.js} +1 -1
  49. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.js} +4 -4
  50. package/lib/esm/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.js} +2 -4
  51. package/lib/esm/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.js +1 -1
  52. package/lib/esm/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewPayload.js +1 -0
  53. package/lib/esm/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.js → invoicingCouponRecordView/invoicingCouponRecordViewReducer.js} +4 -4
  54. package/lib/esm/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.js → invoicingCouponRecordView/invoicingCouponRecordViewSelector.js} +2 -2
  55. package/lib/esm/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewState.js +1 -0
  56. package/lib/esm/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.js +1 -1
  57. package/lib/esm/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.js +2 -2
  58. package/lib/esm/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.js +1 -0
  59. package/lib/esm/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.js → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.js} +4 -4
  60. package/lib/esm/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.js} +3 -3
  61. package/lib/esm/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewState.js +1 -0
  62. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.js} +1 -1
  63. package/lib/esm/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.js +1 -0
  64. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.js} +4 -4
  65. package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.js} +2 -2
  66. package/lib/esm/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.js +1 -0
  67. package/lib/esm/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.js +1 -1
  68. package/lib/index.d.ts +26 -20
  69. package/lib/index.js +88 -74
  70. package/lib/reducer.d.ts +6 -4
  71. package/lib/reducer.js +18 -12
  72. package/lib/rootStateTypes.d.ts +12 -8
  73. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  74. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  75. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
  76. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
  77. package/lib/view/cashFlow/cashFlowGroupedSectionOrder.d.ts +15 -0
  78. package/lib/view/cashFlow/cashFlowGroupedSectionOrder.js +50 -0
  79. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.d.ts +6 -0
  80. package/lib/view/cashFlowClassesView/cashFlowClassesViewEpic.js +34 -0
  81. package/lib/view/cashFlowClassesView/cashFlowClassesViewPayload.d.ts +14 -0
  82. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.d.ts +34 -0
  83. package/lib/view/cashFlowClassesView/cashFlowClassesViewReducer.js +133 -0
  84. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.d.ts +7 -0
  85. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelector.js +57 -0
  86. package/lib/view/cashFlowClassesView/cashFlowClassesViewSelectorTypes.d.ts +15 -0
  87. package/lib/view/cashFlowClassesView/cashFlowClassesViewState.d.ts +23 -0
  88. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.d.ts +9 -0
  89. package/lib/view/cashFlowClassesView/cashFlowForTimeframeClassesViewEpic.js +60 -0
  90. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.d.ts +10 -0
  91. package/lib/view/cashFlowProjectView/cashFlowForTimeframeProjectViewEpic.js +62 -0
  92. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.d.ts +6 -0
  93. package/lib/view/cashFlowProjectView/cashFlowProjectViewEpic.js +34 -0
  94. package/lib/view/cashFlowProjectView/cashFlowProjectViewPayload.d.ts +14 -0
  95. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.d.ts +33 -0
  96. package/lib/view/cashFlowProjectView/cashFlowProjectViewReducer.js +129 -0
  97. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.d.ts +7 -0
  98. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelector.js +58 -0
  99. package/lib/view/cashFlowProjectView/cashFlowProjectViewSelectorTypes.d.ts +19 -0
  100. package/lib/view/cashFlowProjectView/cashFlowProjectViewState.d.ts +22 -0
  101. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  102. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  103. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  104. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +29 -11
  105. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  106. package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
  107. package/lib/view/financeStatement/financeStatementSelector.js +21 -1
  108. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  109. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +2 -2
  110. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.d.ts +1 -1
  111. package/lib/view/invoicing/customerPaymentMethod/customerPaymentMethodEpic.js +2 -2
  112. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -1
  113. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +1 -1
  114. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.d.ts +3 -19
  115. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer.js +2 -25
  116. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +11 -11
  117. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +11 -38
  118. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewState.d.ts +4 -27
  119. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.d.ts +2 -3
  120. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogSubFamilyEpics.js +2 -22
  121. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -2
  122. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +9 -31
  123. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +12 -1
  124. package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +9 -1
  125. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +8 -0
  126. package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +2 -0
  127. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.d.ts +1 -1
  128. package/lib/view/invoicing/editInvoicingCustomerDetailView/initializeInvoicingCustomerAddressEpic.js +2 -2
  129. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +11 -2
  130. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +15 -0
  131. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.d.ts +1 -1
  132. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/fetchInvoicingSubscriptionFormPageEpic.js +2 -2
  133. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.d.ts +1 -1
  134. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/initializeInvoicingSubscriptionAddressEpic.js +2 -2
  135. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.d.ts} +1 -1
  136. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewEpics.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewEpics.js} +5 -5
  137. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.d.ts} +5 -5
  138. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewReducer.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewReducer.js} +4 -4
  139. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.d.ts} +3 -5
  140. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector.js} +4 -6
  141. package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.d.ts} +1 -1
  142. package/lib/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.d.ts +1 -1
  143. package/lib/view/invoicing/{invoicingCouponDetailView → invoicingCouponRecordView}/fetchInvoicingCouponDetailEpic.js +5 -5
  144. package/lib/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewPayload.js +2 -0
  145. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewReducer.d.ts} +6 -6
  146. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewReducer.js → invoicingCouponRecordView/invoicingCouponRecordViewReducer.js} +4 -4
  147. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewSelector.d.ts} +2 -2
  148. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewSelector.js → invoicingCouponRecordView/invoicingCouponRecordViewSelector.js} +4 -4
  149. package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewState.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewState.d.ts} +1 -1
  150. package/lib/view/invoicing/invoicingCouponRecordView/invoicingCouponRecordViewState.js +2 -0
  151. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.d.ts +1 -1
  152. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailEpic.js +5 -5
  153. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.d.ts +1 -1
  154. package/lib/view/invoicing/{invoicingCustomerDetailView → invoicingCustomerRecordView}/fetchInvoicingCustomerDetailPageEpic.js +4 -4
  155. package/lib/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.js +2 -0
  156. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.d.ts} +7 -7
  157. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewReducer.js → invoicingCustomerRecordView/invoicingCustomerRecordViewReducer.js} +4 -4
  158. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.d.ts} +2 -2
  159. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js → invoicingCustomerRecordView/invoicingCustomerRecordViewSelector.js} +5 -5
  160. package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewState.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewState.d.ts} +1 -1
  161. package/lib/view/invoicing/invoicingCustomerRecordView/invoicingCustomerRecordViewState.js +2 -0
  162. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.d.ts} +1 -1
  163. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewEpics.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewEpics.js} +5 -5
  164. package/lib/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.js +2 -0
  165. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.d.ts} +5 -5
  166. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewReducer.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewReducer.js} +4 -4
  167. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.d.ts} +2 -2
  168. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewSelector.js} +4 -4
  169. package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.d.ts} +1 -1
  170. package/lib/view/invoicing/invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewState.js +2 -0
  171. package/lib/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.d.ts +1 -1
  172. package/lib/view/invoicing/promotionalCreditAction/promotionalCreditActionEpic.js +2 -2
  173. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  174. package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
  175. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  176. package/lib/view/topEx/topExSelector.d.ts +1 -1
  177. package/package.json +71 -38
  178. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +0 -191
  179. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +0 -46
  180. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +0 -198
  181. /package/lib/esm/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewPayload.js} +0 -0
  182. /package/lib/esm/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.js → cashFlowClassesView/cashFlowClassesViewSelectorTypes.js} +0 -0
  183. /package/lib/esm/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewState.js} +0 -0
  184. /package/lib/esm/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewState.js → cashFlowProjectView/cashFlowProjectViewPayload.js} +0 -0
  185. /package/lib/esm/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.js → cashFlowProjectView/cashFlowProjectViewSelectorTypes.js} +0 -0
  186. /package/lib/esm/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewState.js → cashFlowProjectView/cashFlowProjectViewState.js} +0 -0
  187. /package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.js} +0 -0
  188. /package/lib/esm/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.js} +0 -0
  189. /package/lib/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewPayload.js} +0 -0
  190. /package/lib/view/{invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewState.js → cashFlowClassesView/cashFlowClassesViewSelectorTypes.js} +0 -0
  191. /package/lib/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewPayload.js → cashFlowClassesView/cashFlowClassesViewState.js} +0 -0
  192. /package/lib/view/{invoicing/invoicingCouponDetailView/invoicingCouponDetailViewState.js → cashFlowProjectView/cashFlowProjectViewPayload.js} +0 -0
  193. /package/lib/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.js → cashFlowProjectView/cashFlowProjectViewSelectorTypes.js} +0 -0
  194. /package/lib/view/{invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewState.js → cashFlowProjectView/cashFlowProjectViewState.js} +0 -0
  195. /package/lib/view/invoicing/{invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewPayload.d.ts → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.d.ts} +0 -0
  196. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewPayload.js} +0 -0
  197. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewState.js → invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewState.js} +0 -0
  198. /package/lib/view/invoicing/{invoicingCouponDetailView/invoicingCouponDetailViewPayload.d.ts → invoicingCouponRecordView/invoicingCouponRecordViewPayload.d.ts} +0 -0
  199. /package/lib/view/invoicing/{invoicingCustomerDetailView/invoicingCustomerDetailViewPayload.d.ts → invoicingCustomerRecordView/invoicingCustomerRecordViewPayload.d.ts} +0 -0
  200. /package/lib/view/invoicing/{invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewPayload.d.ts → invoicingSubscriptionRecordView/invoicingSubscriptionRecordViewPayload.d.ts} +0 -0
@@ -0,0 +1,30 @@
1
+ import { from } from 'rxjs';
2
+ import { filter, switchMap } from 'rxjs/operators';
3
+ import { fetchCashFlowForTimeframeProjectView, fetchCashFlowProjectView, } from './cashFlowProjectViewReducer';
4
+ export const fetchCashFlowProjectViewEpic = (actions$, state) => actions$.pipe(filter(fetchCashFlowProjectView.match), switchMap((action) => {
5
+ const { cacheOverride } = action.payload;
6
+ if (cacheOverride === true) {
7
+ return from([
8
+ fetchCashFlowForTimeframeProjectView('month', true),
9
+ fetchCashFlowForTimeframeProjectView('quarter', true),
10
+ fetchCashFlowForTimeframeProjectView('year', true),
11
+ ]);
12
+ }
13
+ else {
14
+ const fetchActions = [];
15
+ const projectFetchState = state.value.cashFlowProjectViewState.fetchState;
16
+ if (projectFetchState['month'].fetchState !== 'In-Progress' &&
17
+ projectFetchState['month'].fetchState !== 'Completed') {
18
+ fetchActions.push(fetchCashFlowForTimeframeProjectView('month'));
19
+ }
20
+ if (projectFetchState['quarter'].fetchState !== 'In-Progress' &&
21
+ projectFetchState['quarter'].fetchState !== 'Completed') {
22
+ fetchActions.push(fetchCashFlowForTimeframeProjectView('quarter'));
23
+ }
24
+ if (projectFetchState['year'].fetchState !== 'In-Progress' &&
25
+ projectFetchState['year'].fetchState !== 'Completed') {
26
+ fetchActions.push(fetchCashFlowForTimeframeProjectView('year'));
27
+ }
28
+ return from(fetchActions);
29
+ }
30
+ }));
@@ -0,0 +1,125 @@
1
+ import { createSlice } from '@reduxjs/toolkit';
2
+ import { mapReportPayloadV2ToReportV2 } from '../../commonPayloadTypes/v2/viewAndReportPayloadv2';
3
+ import { clearAll } from '../../rootActions';
4
+ export const initialState = {
5
+ bookCloseDate: undefined,
6
+ fetchState: {
7
+ month: {
8
+ fetchState: 'Not-Started',
9
+ error: undefined,
10
+ },
11
+ quarter: {
12
+ fetchState: 'Not-Started',
13
+ error: undefined,
14
+ },
15
+ year: {
16
+ fetchState: 'Not-Started',
17
+ error: undefined,
18
+ },
19
+ },
20
+ firstMonthOfFY: 1,
21
+ projectIds: [],
22
+ reportId: 'cash_flow_by_projects',
23
+ reportTitle: 'cash_flow_by_projects',
24
+ uiState: {
25
+ accountViewMode: 'account_group',
26
+ nodeCollapseState: {},
27
+ projectsToFilterOut: [],
28
+ scrollPosition: undefined,
29
+ },
30
+ };
31
+ const cashFlowProjectView = createSlice({
32
+ name: 'cashFlowProjectView',
33
+ initialState,
34
+ reducers: {
35
+ fetchCashFlowProjectView: {
36
+ prepare(cacheOverride = false) {
37
+ return { payload: { cacheOverride } };
38
+ },
39
+ reducer(
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
+ _draft,
42
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
+ _action) {
44
+ // nothing to do here
45
+ },
46
+ },
47
+ fetchCashFlowForTimeframeProjectView: {
48
+ prepare(timeframe, cacheOverride = false) {
49
+ return { payload: { timeframe, cacheOverride } };
50
+ },
51
+ reducer(draft, action) {
52
+ const timeframe = action.payload.timeframe;
53
+ draft.fetchState[timeframe].fetchState = 'In-Progress';
54
+ draft.fetchState[timeframe].error = undefined;
55
+ },
56
+ },
57
+ updateCashFlowForTimeframeProjectView(draft, action) {
58
+ doUpdateCashFlowProjectView(draft, action.payload.timeframe, action.payload.report);
59
+ },
60
+ updateCashFlowForTimeframeProjectViewFailure: {
61
+ prepare(error, timeframe) {
62
+ return {
63
+ payload: {
64
+ error,
65
+ timeframe,
66
+ },
67
+ };
68
+ },
69
+ reducer(draft, action) {
70
+ draft.fetchState[action.payload.timeframe] = {
71
+ fetchState: 'Error',
72
+ error: action.payload.error,
73
+ };
74
+ },
75
+ },
76
+ updateCashFlowProjectsToFilterOut(draft, action) {
77
+ draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
78
+ },
79
+ updateCashFlowProjectViewUIState(draft, action) {
80
+ const { nodeCollapseState, scrollPosition, resetLeftScroll } = action.payload;
81
+ if (nodeCollapseState != null) {
82
+ draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
83
+ [nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
84
+ });
85
+ }
86
+ // Mutually exclusive: resetLeftScroll clears only scrollLeft from the
87
+ // recorded position, scrollPosition replaces the whole record.
88
+ if (resetLeftScroll === true && draft.uiState.scrollPosition != null) {
89
+ draft.uiState.scrollPosition.scrollLeft = undefined;
90
+ }
91
+ else if (scrollPosition != null) {
92
+ draft.uiState.scrollPosition = scrollPosition;
93
+ }
94
+ },
95
+ updateCashFlowProjectViewAccountViewMode(draft, action) {
96
+ draft.uiState.accountViewMode = action.payload.viewMode;
97
+ },
98
+ resetCashFlowProjectNodeCollapseState(draft) {
99
+ draft.uiState.nodeCollapseState = {};
100
+ },
101
+ },
102
+ extraReducers: (builder) => {
103
+ builder.addCase(clearAll, (draft) => {
104
+ Object.assign(draft, initialState);
105
+ });
106
+ },
107
+ });
108
+ export const { fetchCashFlowProjectView, fetchCashFlowForTimeframeProjectView, updateCashFlowForTimeframeProjectView, updateCashFlowForTimeframeProjectViewFailure, updateCashFlowProjectsToFilterOut, updateCashFlowProjectViewUIState, updateCashFlowProjectViewAccountViewMode, resetCashFlowProjectNodeCollapseState, } = cashFlowProjectView.actions;
109
+ export default cashFlowProjectView.reducer;
110
+ const doUpdateCashFlowProjectView = (draft, timeframe, cashFlowReport) => {
111
+ const report = mapReportPayloadV2ToReportV2(cashFlowReport.report);
112
+ draft.currency = report.currency;
113
+ draft.dataAvailable = report.dataAvailable;
114
+ draft.firstMonthOfFY = report.firstMonthOfFY;
115
+ draft.bookCloseDate = report.bookCloseDate;
116
+ draft.status = report.status;
117
+ draft.fetchState[timeframe].fetchState = 'Completed';
118
+ draft.fetchState[timeframe].error = undefined;
119
+ // Populated once, as with classHierarchy in the classes view: a project added
120
+ // mid-session is not picked up until the store is cleared, even by a hard
121
+ // refresh. Matches profitAndLossProjectViewReducer.
122
+ if (draft.projectIds.length <= 0) {
123
+ draft.projectIds = cashFlowReport.report.projects.map((project) => project.accounting_project_id);
124
+ }
125
+ };
@@ -0,0 +1,54 @@
1
+ import { getCOABalances } from '../../commonStateTypes/coaBalance/getCOABalancesSlice';
2
+ import { reduceFetchStateParallelTimeframes } from '../../commonStateTypes/reduceFetchState';
3
+ import { getProjectsByIds } from '../../entity/project/projectSelector';
4
+ import { getSectionProjectViewReport } from '../../entity/sectionProjectView/sectionProjectViewSelector';
5
+ import { CASH_FLOW_GROUPED_BREAKDOWN_IDS, CASH_FLOW_GROUPED_CALCULATED_IDS, CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER, CASH_FLOW_GROUPED_IDS_IN_ORDER, CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER, CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER, } from '../cashFlow/cashFlowGroupedSectionOrder';
6
+ export const getCashFlowProjectView = (filter, accountState, projectState, sectionsState, cashFlowProjectViewState) => {
7
+ const fetchState = reduceFetchStateParallelTimeframes([
8
+ cashFlowProjectViewState.fetchState.month,
9
+ cashFlowProjectViewState.fetchState.quarter,
10
+ cashFlowProjectViewState.fetchState.year,
11
+ ]);
12
+ const reportId = 'cash_flow_by_projects';
13
+ const sections = {};
14
+ const calculatedSections = {};
15
+ if (fetchState.fetchState === 'Completed') {
16
+ CASH_FLOW_GROUPED_BREAKDOWN_IDS.forEach((sectionId) => {
17
+ sections[sectionId] = getSectionProjectViewReport(accountState, projectState, sectionsState, cashFlowProjectViewState.projectIds, { reportId, sectionId }, filter);
18
+ });
19
+ // These come back grouped, so each figure is read through the section layer
20
+ // and arrives already pruned by the class/project picker — the same source
21
+ // the breakdown rows above render from, so the two can never disagree.
22
+ CASH_FLOW_GROUPED_CALCULATED_IDS.forEach((calculatedSectionId) => {
23
+ calculatedSections[calculatedSectionId] = getCOABalances(
24
+ // Already built by the breakdown loop above; rebuilding it would repeat
25
+ // the whole section walk on every recompute.
26
+ sections[calculatedSectionId].sectionBalancesTotalByPeriod, filter);
27
+ });
28
+ calculatedSections['investingActivitiesTotal'] = getCOABalances(sections['investingActivities'].sectionBalancesTotalByPeriod, filter);
29
+ calculatedSections['financingActivitiesTotal'] = getCOABalances(sections['financingActivities'].sectionBalancesTotalByPeriod, filter);
30
+ }
31
+ return {
32
+ sections,
33
+ calculatedSections,
34
+ fetchState: fetchState.fetchState,
35
+ error: fetchState.error,
36
+ filter,
37
+ uiState: cashFlowProjectViewState.uiState,
38
+ projects: getProjectsByIds(projectState, cashFlowProjectViewState.projectIds),
39
+ projectsToFilterOut: cashFlowProjectViewState.uiState.projectsToFilterOut,
40
+ reportId: cashFlowProjectViewState.reportId,
41
+ reportTitle: cashFlowProjectViewState.reportTitle,
42
+ firstMonthOfFY: cashFlowProjectViewState.firstMonthOfFY,
43
+ dataAvailable: cashFlowProjectViewState.dataAvailable,
44
+ bookCloseDate: cashFlowProjectViewState.bookCloseDate,
45
+ version: cashFlowProjectViewState.version,
46
+ status: cashFlowProjectViewState.status,
47
+ idsInOrder: CASH_FLOW_GROUPED_IDS_IN_ORDER,
48
+ rootSectionsWithSubSectionIds: {
49
+ operatingActivities: CASH_FLOW_GROUPED_OPERATING_IDS_IN_ORDER,
50
+ investingActivities: CASH_FLOW_GROUPED_INVESTING_IDS_IN_ORDER,
51
+ financingActivities: CASH_FLOW_GROUPED_FINANCING_IDS_IN_ORDER,
52
+ },
53
+ };
54
+ };
@@ -9,6 +9,18 @@ import { clearAll } from '../../../../rootActions';
9
9
  import { date } from '../../../../zeniDayJS';
10
10
  import { SERVICE_MONTH_FORMAT, } from '../../payload/jeSchedulesPayload';
11
11
  import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData, } from '../../reducers/jeSchedulesViewReducer';
12
+ /**
13
+ * How far back to look for accrued schedules, matching the Vendors page
14
+ * (`getDefaultSelectedTimeframeForScheduleType`, 'accrued_expenses'), which queries the same
15
+ * start_date filter through /1.0/schedules.
16
+ */
17
+ const ACCRUED_LOOKBACK_MONTHS = 24;
18
+ /**
19
+ * One-time accruals keep their own, narrower lookback. Unlike an accrued schedule they belong to
20
+ * exactly one service month and never span months, so the reason the accrued window has to reach
21
+ * back does not apply to them -- widening it would only add older history to the Existing tab.
22
+ */
23
+ const ONE_TIME_ACCRUAL_LOOKBACK_MONTHS = 12;
12
24
  export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchJeSchedules.match), mergeMap((action) => {
13
25
  const state = state$.value;
14
26
  const { expenseAutomationViewState: { selectedPeriodByTenantId }, } = state;
@@ -30,15 +42,21 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
30
42
  const endDate = isClosePeriodTab || existingEndDate == null
31
43
  ? toString(period.end)
32
44
  : toString(existingEndDate);
33
- // Accrued rows are windowed on the schedule's own start_date rather than a transaction date,
34
- // so they get their own bounds. Review wants the month being closed; Existing wants the year
35
- // up to endDate, snapped to the 1st — the same window the server used to compute for itself.
36
- const accruedStartDate = isClosePeriodTab
37
- ? toString(period.start)
38
- : date(endDate)
39
- .subtract(1, 'year')
40
- .startOf('month')
41
- .format(DEFAULT_DATE_FORMAT);
45
+ // Accrued rows are windowed on the schedule's own start_date -- its FIRST posting date --
46
+ // rather than a transaction date, so the lower bound has to reach back past the start of
47
+ // every accrual still running in this period, not just the ones that began in it. Review
48
+ // used to send the close month itself, which returned only accruals whose first posting fell
49
+ // in that month and hid every longer-running one.
50
+ const parsedEndDate = date(endDate);
51
+ const accruedStartDate = parsedEndDate
52
+ .subtract(ACCRUED_LOOKBACK_MONTHS, 'month')
53
+ .startOf('month')
54
+ .format(DEFAULT_DATE_FORMAT);
55
+ // Formatted as a service month, not a date: that is the only thing it is sent as.
56
+ const oneTimeAccrualServiceMonthStart = parsedEndDate
57
+ .subtract(ONE_TIME_ACCRUAL_LOOKBACK_MONTHS, 'month')
58
+ .startOf('month')
59
+ .format(SERVICE_MONTH_FORMAT);
42
60
  const queryParam = {
43
61
  base_transaction_end_date: endDate,
44
62
  end_date: endDate,
@@ -59,8 +77,8 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
59
77
  filter_failed_je_postings_by_date: true,
60
78
  }
61
79
  : {
62
- one_time_accrual_service_month_start: date(accruedStartDate).format(SERVICE_MONTH_FORMAT),
63
- one_time_accrual_service_month_end: date(endDate).format(SERVICE_MONTH_FORMAT),
80
+ one_time_accrual_service_month_start: oneTimeAccrualServiceMonthStart,
81
+ one_time_accrual_service_month_end: parsedEndDate.format(SERVICE_MONTH_FORMAT),
64
82
  // Existing lists what actually reached the books.
65
83
  one_time_accrual_statuses: ['posted'],
66
84
  // A failed posting from an earlier month still needs to surface here, so this list
@@ -11,6 +11,8 @@ import { getBalanceSheet } from '../balanceSheet/balanceSheetSelector';
11
11
  import { getBalanceSheetClassesView } from '../balanceSheetClassesView/balanceSheetClassesViewSelector';
12
12
  import { getBalanceSheetProjectView } from '../balanceSheetProjectView/balanceSheetProjectViewSelector';
13
13
  import { getCashFlow } from '../cashFlow/cashFlowSelector';
14
+ import { getCashFlowClassesView } from '../cashFlowClassesView/cashFlowClassesViewSelector';
15
+ import { getCashFlowProjectView } from '../cashFlowProjectView/cashFlowProjectViewSelector';
14
16
  import { getProfitAndLossReport, } from '../profitAndLoss/profitAndLossSelector';
15
17
  import { getProfitAndLossClassesHorizontalView } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
16
18
  import { getProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewSelector';
@@ -39,7 +41,7 @@ function getFirstMonthOfFY(profitAndLossState, balanceSheetState, cashFlowState)
39
41
  cashFlowState.firstMonthOfFY ??
40
42
  1);
41
43
  }
42
- export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.balanceSheetClassesViewState, (state) => state.balanceSheetProjectViewState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, balanceSheetClassesViewState, balanceSheetProjectViewState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
44
+ export const getFinanceStatement = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.balanceSheetClassesViewState, (state) => state.balanceSheetProjectViewState, (state) => state.cashFlowState, (state) => state.cashFlowClassesViewState, (state) => state.cashFlowProjectViewState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, balanceSheetClassesViewState, balanceSheetProjectViewState, cashFlowState, cashFlowClassesViewState, cashFlowProjectViewState, financeStatementState, sectionAccountsViewState, forecastState) => {
43
45
  // to get min and max dates across three reports
44
46
  let allTimeframeTicks = [];
45
47
  let balancesInTimeframe = [];
@@ -81,6 +83,10 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
81
83
  const balanceSheetReport = getBalanceSheet(filter, accountState, accountGroupState, sectionAccountsViewState, balanceSheetState);
82
84
  const balanceSheetClassFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetClassesViewState.uiState.classesToFilterOut);
83
85
  const balanceSheetByClassReport = getBalanceSheetClassesView(balanceSheetClassFilter, accountState, classState, sectionsState, balanceSheetClassesViewState);
86
+ const cashFlowClassFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, cashFlowClassesViewState.uiState.classesToFilterOut);
87
+ const cashFlowByClassReport = getCashFlowClassesView(cashFlowClassFilter, accountState, classState, sectionsState, cashFlowClassesViewState);
88
+ const cashFlowProjectFilter = newBalancesFilterProjectView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, cashFlowProjectViewState.uiState.projectsToFilterOut);
89
+ const cashFlowByProjectReport = getCashFlowProjectView(cashFlowProjectFilter, accountState, projectState, sectionProjectViewState, cashFlowProjectViewState);
84
90
  const balanceSheetProjectFilter = newBalancesFilterProjectView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetProjectViewState.uiState.projectsToFilterOut);
85
91
  const balanceSheetByProjectReport = getBalanceSheetProjectView(balanceSheetProjectFilter, accountState, projectState, sectionProjectViewState, balanceSheetProjectViewState);
86
92
  const cashFlowReport = getCashFlow(filter, accountState, accountGroupState, sectionAccountsViewState, cashFlowState);
@@ -129,6 +135,18 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
129
135
  error: cashFlowReport.error,
130
136
  };
131
137
  break;
138
+ case 'cash_flow_by_classes':
139
+ selectedReportAndTimeframeFetchState = {
140
+ fetchState: cashFlowByClassReport.fetchState,
141
+ error: cashFlowByClassReport.error,
142
+ };
143
+ break;
144
+ case 'cash_flow_by_projects':
145
+ selectedReportAndTimeframeFetchState = {
146
+ fetchState: cashFlowByProjectReport.fetchState,
147
+ error: cashFlowByProjectReport.error,
148
+ };
149
+ break;
132
150
  default:
133
151
  break;
134
152
  }
@@ -151,6 +169,8 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
151
169
  profitAndLossByClassHorizontalReport,
152
170
  balanceSheetReport,
153
171
  balanceSheetByClassReport,
172
+ cashFlowByClassReport,
173
+ cashFlowByProjectReport,
154
174
  balanceSheetByProjectReport,
155
175
  cashFlowReport,
156
176
  filter,
@@ -1,7 +1,7 @@
1
1
  import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
3
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
- import { fetchInvoicingCustomerDetail } from '../invoicingCustomerDetailView/invoicingCustomerDetailViewReducer';
4
+ import { fetchInvoicingCustomerDetail } from '../invoicingCustomerRecordView/invoicingCustomerRecordViewReducer';
5
5
  import { createInvoicingSetupIntent, createInvoicingSetupIntentFailure, createInvoicingSetupIntentSuccess, fetchInvoicingPlaidLinkToken, fetchInvoicingPlaidLinkTokenFailure, fetchInvoicingPlaidLinkTokenSuccess, saveInvoicingPaymentMethod, saveInvoicingPaymentMethodFailure, saveInvoicingPaymentMethodSuccess, sendInvoicingPaymentLink, sendInvoicingPaymentLinkFailure, sendInvoicingPaymentLinkSuccess, } from './customerPaymentMethodReducer';
6
6
  export const createInvoicingSetupIntentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(createInvoicingSetupIntent.match), mergeMap((action) => {
7
7
  const { customerId } = action.payload;
@@ -92,7 +92,7 @@ const buildSubFamilyPayload = (localData, subFamily, clearEmptyValues, lookup) =
92
92
  const DEFAULT_CATALOG_ITEM_UNIT = 'USD';
93
93
  /**
94
94
  * Build the parent catalog-item request body from the form draft. Creates omit
95
- * both parent and sub-family IDs; edits retain returned sub-family IDs.
95
+ * both parent and price point IDs; edits retain returned price point IDs.
96
96
  */
97
97
  export const localDataToSaveInvoicingCatalogItemPayload = (localData, isCreate, lookup) => {
98
98
  const description = trimOrUndefined(localData.description);
@@ -4,7 +4,6 @@ import { initialInvoicingCatalogItemFormLocalData } from './invoicingCatalogItem
4
4
  export const initialState = {
5
5
  fetchState: 'Not-Started',
6
6
  error: undefined,
7
- detailEditDraftById: {},
8
7
  editDraftById: {},
9
8
  newItemDraft: { ...initialInvoicingCatalogItemFormLocalData },
10
9
  savedItemId: undefined,
@@ -26,10 +25,6 @@ const editInvoicingCatalogItemDetailView = createSlice({
26
25
  draft.newItemDraft = localData;
27
26
  }
28
27
  },
29
- updateInvoicingCatalogItemDetailEditDraft(draft, action) {
30
- const { id, localData } = action.payload;
31
- draft.detailEditDraftById[id] = localData;
32
- },
33
28
  submitInvoicingCatalogItemForm: {
34
29
  reducer(draft) {
35
30
  draft.fetchState = 'In-Progress';
@@ -40,22 +35,6 @@ const editInvoicingCatalogItemDetailView = createSlice({
40
35
  return { payload };
41
36
  },
42
37
  },
43
- saveInvoicingCatalogItem(draft, action) {
44
- draft.fetchState = 'In-Progress';
45
- draft.error = undefined;
46
- draft.savedItemId = undefined;
47
- draft.savedKind = action.payload.kind;
48
- },
49
- createInvoicingCatalogSubFamily: {
50
- reducer(draft) {
51
- draft.fetchState = 'In-Progress';
52
- draft.error = undefined;
53
- draft.savedItemId = undefined;
54
- },
55
- prepare(payload) {
56
- return { payload };
57
- },
58
- },
59
38
  archiveInvoicingCatalogSubFamily: {
60
39
  reducer(draft) {
61
40
  draft.fetchState = 'In-Progress';
@@ -71,7 +50,6 @@ const editInvoicingCatalogItemDetailView = createSlice({
71
50
  draft.error = undefined;
72
51
  draft.savedItemId = action.payload.itemId;
73
52
  draft.savedKind = action.payload.kind;
74
- delete draft.detailEditDraftById[action.payload.itemId];
75
53
  },
76
54
  submitInvoicingCatalogItemFormFailure(draft, action) {
77
55
  draft.fetchState = 'Error';
@@ -82,7 +60,6 @@ const editInvoicingCatalogItemDetailView = createSlice({
82
60
  draft.error = undefined;
83
61
  draft.savedItemId = undefined;
84
62
  draft.savedKind = undefined;
85
- draft.detailEditDraftById = {};
86
63
  draft.editDraftById = {};
87
64
  draft.newItemDraft = { ...initialInvoicingCatalogItemFormLocalData };
88
65
  },
@@ -93,5 +70,5 @@ const editInvoicingCatalogItemDetailView = createSlice({
93
70
  });
94
71
  },
95
72
  });
96
- export const { updateInvoicingCatalogItemDetailEditDraft, updateInvoicingCatalogItemFormDraft, submitInvoicingCatalogItemForm, saveInvoicingCatalogItem, createInvoicingCatalogSubFamily, archiveInvoicingCatalogSubFamily, submitInvoicingCatalogItemFormSuccess, submitInvoicingCatalogItemFormFailure, resetEditInvoicingCatalogItemDetailView, } = editInvoicingCatalogItemDetailView.actions;
73
+ export const { updateInvoicingCatalogItemFormDraft, submitInvoicingCatalogItemForm, archiveInvoicingCatalogSubFamily, submitInvoicingCatalogItemFormSuccess, submitInvoicingCatalogItemFormFailure, resetEditInvoicingCatalogItemDetailView, } = editInvoicingCatalogItemDetailView.actions;
97
74
  export default editInvoicingCatalogItemDetailView.reducer;
@@ -1,44 +1,9 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
  import { getInvoicingPlanById, getInvoicingPlansByIds, } from '../../../entity/invoicing/plan/planSelector';
3
+ import { getInvoicingCatalogItemRecord, } from '../invoicingCatalogItemRecordView/invoicingCatalogItemRecordViewSelector';
3
4
  import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
4
5
  import { getInvoicingQboView, isInvoicingAccountingPickerDataLoading, isInvoicingQboConnected, } from '../invoicingQboView/invoicingQboViewSelector';
5
- import { planToCatalogDetailEditValues } from './catalogDetailEditPayload';
6
6
  import { INVOICING_CATALOG_APPLICABILITY_VALUES, INVOICING_CATALOG_PRICING_MODEL_VALUES, INVOICING_CATALOG_PRORATION_VALUES, INVOICING_CATALOG_TIER_TYPE_VALUES, entityToInvoicingCatalogItemFormLocalData, } from './invoicingCatalogItemFormConfig';
7
- /** An unsaved item's inline-edit draft, before the record has loaded. */
8
- export const initialCatalogDetailEditValues = () => ({
9
- applicableItems: [],
10
- description: '',
11
- enabledForCheckout: true,
12
- enabledInPortal: true,
13
- giftClaimRedirectUrl: '',
14
- includedInMrr: true,
15
- isGiftable: false,
16
- isShippable: false,
17
- itemApplicability: 'all',
18
- metered: false,
19
- name: '',
20
- productCode: '',
21
- subFamilies: [],
22
- unit: '',
23
- usageCalculation: 'sum_of_usages',
24
- });
25
- /**
26
- * The detail page's inline-edit form data: the stored draft once the user has
27
- * touched the form, seeded from the loaded record until then. Memoized so the
28
- * page receives a stable value — recomputing it per store change would reseed
29
- * the form mid-edit and drop what the user had typed.
30
- */
31
- export const getInvoicingCatalogItemDetailEditLocalData = createSelector([
32
- (state, id) => id != null
33
- ? state.editInvoicingCatalogItemDetailViewState.detailEditDraftById[id]
34
- : undefined,
35
- (state, id) => id != null
36
- ? getInvoicingPlanById(state.invoicingPlanState, id)
37
- : undefined,
38
- ], (storedDraft, plan) => storedDraft ??
39
- (plan != null
40
- ? planToCatalogDetailEditValues(plan)
41
- : initialCatalogDetailEditValues()));
42
7
  export const getEditInvoicingCatalogItemDetailViewState = (state) => ({
43
8
  fetchState: state.editInvoicingCatalogItemDetailViewState.fetchState,
44
9
  error: state.editInvoicingCatalogItemDetailViewState.error,
@@ -89,7 +54,16 @@ export const getInvoicingCatalogItemFormView = (state, id) => {
89
54
  ? getInvoicingQboView(state)
90
55
  : undefined;
91
56
  const { billingPeriodUnitOptions, catalogItemTypeOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, } = getInvoicingConfigView(state);
57
+ // In create mode there is no record to load, so the record view is only
58
+ // consulted when editing an existing item.
59
+ const recordView = id != null ? getInvoicingCatalogItemRecord(state, 'plan', id) : undefined;
92
60
  return {
61
+ catalogItemLifecycleActionOptions: recordView?.catalogItemLifecycleActionOptions ?? [],
62
+ catalogProductLifecycleActionOptions: recordView?.catalogProductLifecycleActionOptions ?? [],
63
+ recordState: {
64
+ error: recordView?.error,
65
+ fetchState: recordView?.fetchState ?? 'Not-Started',
66
+ },
93
67
  fieldHelp: invoicingFieldHelpForGroup(state, 'catalog'),
94
68
  isQboPickerDataLoading: isInvoicingAccountingPickerDataLoading(state),
95
69
  qboAccountHierarchy: qboView?.nestedAccountHierarchy ?? [],
@@ -2,9 +2,7 @@ import { of } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
3
  import { mergeInvoicingPlanSubFamily } from '../../../entity/invoicing/plan/planReducer';
4
4
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../responsePayload';
5
- import { getInvoicingCatalogAccountingLookup } from '../invoicingQboView/invoicingQboViewSelector';
6
- import { createSubFamilyFormToPayload } from './catalogDetailEditPayload';
7
- import { archiveInvoicingCatalogSubFamily, createInvoicingCatalogSubFamily, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
5
+ import { archiveInvoicingCatalogSubFamily, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
8
6
  const subFamilySuccessActions = (parentItemId, subFamilyPayload) => [
9
7
  mergeInvoicingPlanSubFamily(parentItemId, subFamilyPayload),
10
8
  submitInvoicingCatalogItemFormSuccess({
@@ -12,23 +10,6 @@ const subFamilySuccessActions = (parentItemId, subFamilyPayload) => [
12
10
  kind: 'plan',
13
11
  }),
14
12
  ];
15
- export const createInvoicingCatalogSubFamilyEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(createInvoicingCatalogSubFamily.match), mergeMap((action) => {
16
- const { itemType, parentItemId, values } = action.payload;
17
- const state = state$.value;
18
- // Built here so the dialog can stay in picked ids: resolving one to the
19
- // account record the payload carries needs the shared account list.
20
- const data = createSubFamilyFormToPayload(parentItemId, itemType, values, getInvoicingCatalogAccountingLookup(state));
21
- const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
22
- return zeniAPI
23
- .postAndGetJSON(`${baseUrl}/catalog/products`, data)
24
- .pipe(mergeMap((response) => {
25
- if (isSuccessResponse(response) && response.data != null) {
26
- return subFamilySuccessActions(parentItemId, response.data);
27
- }
28
- return of(submitInvoicingCatalogItemFormFailure(response.status));
29
- }), catchError((error) => of(submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Create sub-family REST API call errored out ' +
30
- JSON.stringify(error))))));
31
- }));
32
13
  export const archiveInvoicingCatalogSubFamilyEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(archiveInvoicingCatalogSubFamily.match), mergeMap((action) => {
33
14
  const { parentItemId, subFamilyId } = action.payload;
34
15
  const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
@@ -40,6 +21,6 @@ export const archiveInvoicingCatalogSubFamilyEpic = (actions$, _state$, zeniAPI)
40
21
  return subFamilySuccessActions(parentItemId, response.data);
41
22
  }
42
23
  return of(submitInvoicingCatalogItemFormFailure(response.status));
43
- }), catchError((error) => of(submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Archive sub-family REST API call errored out ' +
24
+ }), catchError((error) => of(submitInvoicingCatalogItemFormFailure(createZeniAPIStatus('Unexpected Error', 'Archive price point REST API call errored out ' +
44
25
  JSON.stringify(error))))));
45
26
  }));
@@ -1,6 +1,5 @@
1
- import { forkJoin, from } from 'rxjs';
1
+ import { from } from 'rxjs';
2
2
  import { catchError, filter, mergeMap } from 'rxjs/operators';
3
- import { getInvoicingPlanById } from '../../../entity/invoicing/plan/planSelector';
4
3
  import { mergeInvoicingPlanSubFamily, updateInvoicingPlans, } from '../../../entity/invoicing/plan/planReducer';
5
4
  import { updateInvoicingProducts } from '../../../entity/invoicing/product/productReducer';
6
5
  import { apiErrorSnackbarVariables } from '../../../entity/snackbar/snackbarApiError';
@@ -8,34 +7,19 @@ import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
8
7
  import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
9
8
  import { addInvoicingCatalogItem } from '../invoicingCatalogListView/invoicingCatalogListViewReducer';
10
9
  import { getInvoicingCatalogAccountingLookup } from '../invoicingQboView/invoicingQboViewSelector';
11
- import { catalogDetailEditValuesToSavePayload, } from './catalogDetailEditPayload';
12
10
  import { localDataToSaveInvoicingCatalogItemPayload, } from './editInvoicingCatalogItemDetailViewPayload';
13
- import { getInvoicingCatalogItemDetailEditLocalData } from './editInvoicingCatalogItemDetailViewSelector';
14
- import { saveInvoicingCatalogItem, submitInvoicingCatalogItemForm, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
15
- export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter((action) => submitInvoicingCatalogItemForm.match(action) ||
16
- saveInvoicingCatalogItem.match(action)), mergeMap((action) => {
11
+ import { submitInvoicingCatalogItemForm, submitInvoicingCatalogItemFormFailure, submitInvoicingCatalogItemFormSuccess, } from './editInvoicingCatalogItemDetailViewReducer';
12
+ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter((action) => submitInvoicingCatalogItemForm.match(action)), mergeMap((action) => {
17
13
  const { id } = action.payload;
18
14
  const state = state$.value;
19
15
  const accountingLookup = getInvoicingCatalogAccountingLookup(state);
20
- // Both sources are form values, turned into request bodies here so the
21
- // picked account and class become the records the service stores: the
22
- // detail page's edit form, or the create/edit form's draft.
23
- let data;
24
- let editProductUpdates;
25
- if (saveInvoicingCatalogItem.match(action)) {
26
- const plan = id != null
27
- ? getInvoicingPlanById(state.invoicingPlanState, id)
28
- : undefined;
29
- const savePayload = catalogDetailEditValuesToSavePayload(getInvoicingCatalogItemDetailEditLocalData(state, id), accountingLookup, plan?.type ?? plan?.itemType, plan?.subFamilies);
30
- data = savePayload.planData;
31
- editProductUpdates = savePayload.productUpdates;
32
- }
33
- else {
34
- const viewState = state.editInvoicingCatalogItemDetailViewState;
35
- const localData = (id != null ? viewState.editDraftById[id] : viewState.newItemDraft) ??
36
- viewState.newItemDraft;
37
- data = localDataToSaveInvoicingCatalogItemPayload(localData, id == null, accountingLookup);
38
- }
16
+ // Form values, turned into a request body here so the picked account and
17
+ // class become the records the service stores. Price points ride along
18
+ // nested, so the detail page and the create/edit form share one request.
19
+ const viewState = state.editInvoicingCatalogItemDetailViewState;
20
+ const localData = (id != null ? viewState.editDraftById[id] : viewState.newItemDraft) ??
21
+ viewState.newItemDraft;
22
+ const data = localDataToSaveInvoicingCatalogItemPayload(localData, id == null, accountingLookup);
39
23
  const baseUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0`;
40
24
  const path = id != null
41
25
  ? `${baseUrl}/catalog/plans/${encodeURIComponent(id)}`
@@ -96,13 +80,7 @@ export const saveInvoicingCatalogItemEpic = (actions$, state$, zeniAPI) => actio
96
80
  }));
97
81
  return resultActions;
98
82
  };
99
- const productUpdates = saveInvoicingCatalogItem.match(action)
100
- ? (editProductUpdates ?? [])
101
- : [];
102
- if (productUpdates.length === 0) {
103
- return completeSave([]);
104
- }
105
- return forkJoin(productUpdates.map((productUpdate) => zeniAPI.putAndGetJSON(`${baseUrl}/catalog/products/${encodeURIComponent(productUpdate.id)}`, productUpdate.data))).pipe(mergeMap(completeSave));
83
+ return completeSave([]);
106
84
  }
107
85
  return from([
108
86
  submitInvoicingCatalogItemFormFailure(response.status),
@@ -1,6 +1,7 @@
1
1
  import { getInvoicingCouponById } from '../../../entity/invoicing/coupon/couponSelector';
2
2
  import { toInvoicingFormOption, } from '../../../entity/invoicing/invoicingCommonPayload';
3
3
  import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
4
+ import { getInvoicingCouponRecord } from '../invoicingCouponRecordView/invoicingCouponRecordViewSelector';
4
5
  import { entityToInvoicingCouponFormLocalData, } from './editInvoicingCouponDetailViewState';
5
6
  /**
6
7
  * Bundled view for the discount create/edit form: the save fetch state/error,
@@ -10,9 +11,17 @@ import { entityToInvoicingCouponFormLocalData, } from './editInvoicingCouponDeta
10
11
  export const getEditInvoicingCouponDetailViewState = (state, couponId) => {
11
12
  const { error, fetchState, savedCouponId } = state.editInvoicingCouponDetailViewState;
12
13
  const { discountLifecycleActionOptions, fetchState: configFetchState } = getInvoicingConfigView(state);
14
+ // In create mode there is no record to load, so the read view is only
15
+ // consulted when editing an existing coupon.
16
+ const readView = couponId != null ? getInvoicingCouponRecord(state, couponId) : undefined;
13
17
  return {
14
18
  configFetchState,
15
19
  discountLifecycleActionOptions,
20
+ fieldHelp: invoicingFieldHelpForGroup(state, 'discount'),
21
+ recordState: {
22
+ error: readView?.error,
23
+ fetchState: readView?.fetchState ?? 'Not-Started',
24
+ },
16
25
  coupon: couponId != null
17
26
  ? getInvoicingCouponById(state.invoicingCouponState, couponId)
18
27
  : undefined,
@@ -37,7 +46,6 @@ export const getInvoicingCouponFormView = (state, couponId) => {
37
46
  : newCouponDraft;
38
47
  const { billingPeriodUnitOptions, discountApplyOnOptions, discountDurationTypeOptions, discountTypeOptions, } = getInvoicingConfigView(state);
39
48
  return {
40
- fieldHelp: invoicingFieldHelpForGroup(state, 'discount'),
41
49
  ...base,
42
50
  applyOnOptions: discountApplyOnOptions.map(toInvoicingFormOption),
43
51
  discountTypeOptions: discountTypeOptions.map(toInvoicingFormOption),