@zeniai/client-epic-state 4.19.99-betaRD2 → 4.19.99-betaRD21

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 (107) hide show
  1. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  2. package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
  3. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  4. package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
  5. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +9 -6
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.js +36 -2
  7. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -2
  8. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -2
  9. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +26 -2
  10. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
  11. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  12. package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
  13. package/lib/entity/tenant/clearAllEpic.js +0 -4
  14. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  15. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  16. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  17. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  18. package/lib/epic.d.ts +1 -5
  19. package/lib/epic.js +1 -5
  20. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +36 -2
  21. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -2
  22. package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
  23. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  24. package/lib/esm/epic.js +1 -5
  25. package/lib/esm/index.js +0 -7
  26. package/lib/esm/reducer.js +0 -6
  27. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  28. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  29. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  30. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  31. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  32. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +13 -3
  33. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +11 -3
  34. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  35. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
  36. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -0
  37. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -8
  38. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +144 -63
  39. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  40. package/lib/index.d.ts +2 -10
  41. package/lib/index.js +2 -30
  42. package/lib/reducer.d.ts +0 -6
  43. package/lib/reducer.js +0 -6
  44. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  45. package/lib/view/companyView/types/cockpitTypes.d.ts +5 -6
  46. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  47. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  48. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  49. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  50. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  51. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  52. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  53. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +13 -3
  54. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +11 -3
  55. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  56. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
  57. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
  58. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +1 -0
  59. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
  60. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -8
  61. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +144 -63
  62. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  63. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  64. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  65. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
  66. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  67. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
  68. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  69. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  70. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  71. package/package.json +1 -1
  72. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +0 -44
  73. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +0 -53
  74. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +0 -9
  75. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +0 -40
  76. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +0 -47
  77. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +0 -54
  78. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +0 -52
  79. package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +0 -36
  80. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +0 -47
  81. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +0 -36
  82. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +0 -50
  83. package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +0 -30
  84. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +0 -2
  85. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +0 -145
  86. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +0 -72
  87. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +0 -11
  88. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -26
  89. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -27
  90. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -37
  91. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -39
  92. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +0 -31
  93. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +0 -8
  94. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +0 -27
  95. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +0 -149
  96. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +0 -13
  97. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +0 -78
  98. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +0 -26
  99. package/lib/view/aiAccountantView/aiAccountantViewState.js +0 -13
  100. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +0 -20
  101. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -30
  102. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +0 -23
  103. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -31
  104. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +0 -26
  105. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -41
  106. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +0 -15
  107. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -43
@@ -1,13 +1,12 @@
1
1
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
2
2
  import { ZeniDate } from '../../../zeniDayJS';
3
- import { AiAccountantFilterCategoryField } from '../../aiAccountantView/aiAccountantViewState';
4
3
  import { SubscriptionViewSortKey } from '../../subscriptionView/types/subscriptionTypes';
5
4
  import { FilterCategoryValueType } from '../helpers/cockpitHelpers';
6
5
  import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
7
- export declare const toPortfolioSortKeyType: (v: string) => "companyName" | "expenses" | "runway" | "cashBalance" | "revenues" | "netIncome";
8
- export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "controller" | "plans" | "monthlyRecurringRevenue" | "notes" | "taxStatus" | "preparer" | "reviewer" | "annualRecurringRevenue" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
9
- export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "enroller" | "invite" | "latestCreated";
10
- export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "monthlyRecurringRevenue" | "runway" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "customerSuccessManager" | "issues" | "productVerticals" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
6
+ export declare const toPortfolioSortKeyType: (v: string) => "expenses" | "runway" | "companyName" | "cashBalance" | "revenues" | "netIncome";
7
+ export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "group" | "taxStatus" | "controller" | "preparer" | "reviewer" | "annualRecurringRevenue" | "companyName" | "monthlyRecurringRevenue" | "task" | "notes" | "plans" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
8
+ export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "notes" | "enroller" | "invite" | "latestCreated";
9
+ export declare const toHealthSortKeyType: (v: string) => "group" | "runway" | "controller" | "companyName" | "monthlyRecurringRevenue" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "customerSuccessManager" | "lastReportSent" | "issues" | "productVerticals" | "churnProbability" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
11
10
  export declare const toTaskManagerSortKeyType: (v: string) => "status" | "name" | "tags" | "createdBy" | "dueDate" | "priority" | "assignee" | "taskName";
12
11
  export type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
13
12
  export type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
@@ -22,7 +21,7 @@ export interface CockpitFilterCategory {
22
21
  matchingOperator: 'equal' | 'not-equal';
23
22
  values: FilterCategoryValueType[];
24
23
  valuesCombinationOperator: 'ANY' | 'ALL';
25
- field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
24
+ field?: ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
26
25
  }
27
26
  export interface CockpitFilters {
28
27
  categories?: CockpitFilterCategory[];
@@ -24,13 +24,13 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
24
24
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
25
25
  const updateActions = [];
26
26
  updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)([
27
- ...response.data.draft_je_schedules,
27
+ ...response.data.je_schedules,
28
28
  ...response.data.failed_je_postings.je_schedules,
29
29
  ]), (0, jeSchedulesReducer_1.updateJESchedulesDetails)([...response.data.failed_je_postings.je_schedules], response.data.failed_je_postings.scheduled_journal_entries), (0, jeSchedulesViewReducer_1.initializeJeScheduleLocalData)([
30
30
  ...response.data.failed_je_postings.je_schedules,
31
31
  ]));
32
32
  updateActions.push((0, jeSchedulesViewReducer_1.fetchJeSchedulesSuccess)({
33
- jeSchedules: [...response.data.draft_je_schedules],
33
+ jeSchedules: [...response.data.je_schedules],
34
34
  failedJeSchedules: [
35
35
  ...response.data.failed_je_postings.je_schedules,
36
36
  ],
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const responsePayload_1 = require("../../../../responsePayload");
7
7
  const bulkUploadTiming_1 = require("../../bulkUploadTiming");
8
8
  const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
9
- const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.mergeMap)((action) => {
9
+ const bulkUploadReceiptsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceipts.match), (0, operators_1.switchMap)((action) => {
10
10
  const { files } = action.payload;
11
11
  const formData = new FormData();
12
12
  for (const file of files) {
@@ -29,7 +29,7 @@ exports.pusherBatchStatusCompletionEpic = pusherBatchStatusCompletionEpic;
29
29
  * force `phase` to `completed` (dismiss automatching banner) and refresh the batch list.
30
30
  * Cancels when the batch completes normally, bulk state is cleared, or another upload supersedes.
31
31
  */
32
- const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
32
+ const bulkUploadAutomatchingTimeoutEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.switchMap)((action) => {
33
33
  const { batchId } = action.payload;
34
34
  return (0, rxjs_1.timer)(bulkUploadTiming_1.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS).pipe((0, operators_1.mergeMap)(() => {
35
35
  const bulk = state$.value.expenseAutomationMissingReceiptsViewState.bulkUpload;
@@ -49,10 +49,11 @@ exports.bulkUploadAutomatchingTimeoutEpic = bulkUploadAutomatchingTimeoutEpic;
49
49
  * error snackbar per upload session (first failure only) so the user is not spammed every
50
50
  * interval; Pusher or a later successful poll still completes the flow.
51
51
  */
52
- const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.mergeMap)((action) => {
52
+ const pollBulkUploadBatchStatusEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadReceiptsSuccess.match), (0, operators_1.switchMap)((action) => {
53
53
  const { batchId } = action.payload;
54
54
  let pollErrorNotified = false;
55
- return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
55
+ return (0, rxjs_1.timer)(FALLBACK_FIRST_DELAY_MS, FALLBACK_POLL_INTERVAL_MS).pipe((0, operators_1.takeUntil)((0, rxjs_1.merge)(actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.clearBulkUpload.match)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.pusherBatchStatusUpdate.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId &&
56
+ action.payload.status === 'completed')), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchDetailsSuccess.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)), actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.bulkUploadAutomatchingTimedOut.match), (0, operators_1.filter)((action) => action.payload.batchId === batchId)))), (0, operators_1.switchMap)(() => zeniAPI
56
57
  .getJSON(`${zeniAPI.apiEndPoints.communicationAgentMicroServiceBaseUrl}/1.0/batches/${batchId}`)
57
58
  .pipe((0, operators_1.mergeMap)((response) => {
58
59
  /** Same batch-details URL; polls until `status` is completed (Pusher may win first). */
@@ -94,7 +94,6 @@ function getExpenseAutomationView(state) {
94
94
  const fetchStateVariables = [
95
95
  expenseAutomationMissingReceiptsViewState,
96
96
  expenseAutomationJESchedulesViewState,
97
- monthEndCloseChecksView,
98
97
  expenseAutomationTransactionsView,
99
98
  expenseAutomationReconciliationViewState,
100
99
  ];
@@ -38,7 +38,7 @@ export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLoca
38
38
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
39
39
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
40
40
  messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
41
- messageText: "notification" | "failed" | "success";
41
+ messageText: "notification" | "success" | "failed";
42
42
  type: "error" | "success" | "info";
43
43
  variables: {
44
44
  variableName: string;
@@ -10,11 +10,11 @@ export interface ExpenseAutomationJESchedulesQueryPayload {
10
10
  start_date: string;
11
11
  }
12
12
  interface ExpenseAutomationJESchedulesPayload {
13
- draft_je_schedules: JEScheduledTransactionPayload[];
14
13
  failed_je_postings: {
15
14
  je_schedules: JEScheduledTransactionPayload[];
16
15
  scheduled_journal_entries: ScheduledJournalEntryPayload[];
17
16
  };
17
+ je_schedules: JEScheduledTransactionPayload[];
18
18
  }
19
19
  export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
20
20
  export interface IgnoreDraftJESchedulePayload {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpenseAutomationFluxAnalysisView = getExpenseAutomationFluxAnalysisView;
4
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
4
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
6
  const accountSelector_1 = require("../../../entity/account/accountSelector");
6
7
  const classSelector_1 = require("../../../entity/class/classSelector");
@@ -9,7 +10,7 @@ const userSelector_1 = require("../../../entity/user/userSelector");
9
10
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
10
11
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
11
12
  function getExpenseAutomationFluxAnalysisView(state) {
12
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
13
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
13
14
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
14
15
  const fetchStateAndError = {
15
16
  fetchState,
@@ -94,10 +95,17 @@ function getExpenseAutomationFluxAnalysisView(state) {
94
95
  },
95
96
  };
96
97
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
98
+ const monthEndFetchState = monthYearPeriodId != null
99
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
100
+ : { fetchState: 'Not-Started', error: undefined };
101
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
102
+ fetchStateAndError,
103
+ monthEndFetchState,
104
+ ]);
97
105
  return {
98
106
  sections,
99
107
  totalBalancesAndVariance,
100
- fetchStatus: fetchStateAndError,
108
+ fetchStatus: reducedFetchStatus,
101
109
  bulkReviewStatus,
102
110
  reviewOperatingExpensesIds,
103
111
  selectedSectionIds,
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
8
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
9
10
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
10
11
  const accountSelector_1 = require("../../../entity/account/accountSelector");
11
12
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -25,6 +26,8 @@ function getJEScheduleSortAccessor(sortKey) {
25
26
  return (s) => s.jeDebit.account?.accountName?.toLowerCase();
26
27
  case 'class':
27
28
  return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
29
+ case 'depCategory':
30
+ return (s) => s.jeCredit.account?.accountName?.toLowerCase();
28
31
  case 'scheduleCategory':
29
32
  return (s) => s.jeScheduleType;
30
33
  case 'startMonth':
@@ -56,7 +59,7 @@ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
56
59
  function getExpenseAutomationJESchedulesView(state) {
57
60
  const jeScheduledTransaction = [];
58
61
  const failedJeScheduledTransaction = [];
59
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
62
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
60
63
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
61
64
  const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
62
65
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -122,6 +125,13 @@ function getExpenseAutomationJESchedulesView(state) {
122
125
  : [];
123
126
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
124
127
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
128
+ const monthEndFetchState = monthYearPeriodId != null
129
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
130
+ : { fetchState: 'Not-Started', error: undefined };
131
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
132
+ { fetchState, error },
133
+ monthEndFetchState,
134
+ ]);
125
135
  return {
126
136
  uncategorizedAccounts,
127
137
  allDepreciationAccountList: filteredDepAccounts,
@@ -137,10 +147,10 @@ function getExpenseAutomationJESchedulesView(state) {
137
147
  accountSettingsView,
138
148
  postStatusById: postStatusById,
139
149
  ignoreStatusById: ignoreStatusById,
140
- fetchState: fetchState,
150
+ fetchState: reducedFetchStatus.fetchState,
141
151
  jeScheduleLocalDataById: jeScheduleLocalDataById,
142
152
  uiState: uiState,
143
- error: error,
153
+ error: reducedFetchStatus.error,
144
154
  refreshStatus,
145
155
  completionStatus,
146
156
  };
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationMissingReceiptsView = getExpenseAutomationMissingReceiptsView;
7
7
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
9
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
10
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
11
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
@@ -13,7 +14,7 @@ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewRed
13
14
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
14
15
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
15
16
  function getExpenseAutomationMissingReceiptsView(state) {
16
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
18
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
19
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
19
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -181,9 +182,16 @@ function getExpenseAutomationMissingReceiptsView(state) {
181
182
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
182
183
  };
183
184
  });
185
+ const monthEndFetchState = monthYearPeriodId != null
186
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
187
+ : { fetchState: 'Not-Started', error: undefined };
188
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
189
+ { fetchState, error },
190
+ monthEndFetchState,
191
+ ]);
184
192
  return {
185
- fetchState,
186
- error,
193
+ fetchState: reducedFetchStatus.fetchState,
194
+ error: reducedFetchStatus.error,
187
195
  uploadReceiptStatusById,
188
196
  uiState,
189
197
  refreshStatus,
@@ -19,7 +19,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
19
19
  const classListSelector_1 = require("../../classList/classListSelector");
20
20
  const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
21
21
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
22
- exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
22
+ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
23
23
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
24
24
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
25
25
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -41,6 +41,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
41
41
  }
42
42
  return acc;
43
43
  }, []);
44
+ const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
45
+ const monthEndFetchState = monthYearPeriodId != null
46
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
47
+ fetchState: 'Not-Started',
48
+ error: undefined,
49
+ })
50
+ : { fetchState: 'Not-Started', error: undefined };
44
51
  if (accountReconForMonthYearPeriod == null) {
45
52
  return {
46
53
  bankAccounts: [],
@@ -50,10 +57,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
50
57
  classListNestedAccountHierarchy: [],
51
58
  allAccountList: [],
52
59
  allClassList: [],
53
- fetchStatus: {
54
- fetchState: reconciliationViewState.fetchState,
55
- error: reconciliationViewState.error,
56
- },
60
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
61
+ {
62
+ fetchState: reconciliationViewState.fetchState,
63
+ error: reconciliationViewState.error,
64
+ },
65
+ monthEndFetchState,
66
+ ]),
57
67
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
58
68
  .plaidConnectionDetails,
59
69
  completionStatus: 'incomplete',
@@ -276,10 +286,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
276
286
  bankAccounts: uniqueBankAccounts,
277
287
  creditCards: uniqueCreditCards,
278
288
  accountReconciliationsByAccountID: reconList,
279
- fetchStatus: {
280
- fetchState: reconciliationViewState.fetchState,
281
- error: reconciliationViewState.error,
282
- },
289
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
290
+ {
291
+ fetchState: reconciliationViewState.fetchState,
292
+ error: reconciliationViewState.error,
293
+ },
294
+ monthEndFetchState,
295
+ ]),
283
296
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
284
297
  .plaidConnectionDetails,
285
298
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -14,7 +14,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
14
14
  const classListSelector_1 = require("../../classList/classListSelector");
15
15
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
16
16
  function getExpenseAutomationTransactionView(state) {
17
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
19
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
@@ -47,10 +47,16 @@ function getExpenseAutomationTransactionView(state) {
47
47
  .filter((transaction) => transaction != null);
48
48
  const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
49
49
  const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
50
- const fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)([
51
- accountList,
52
- classList,
53
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
50
+ const monthEndFetchState = monthYearPeriodId != null
51
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
52
+ : { fetchState: 'Not-Started', error: undefined };
53
+ const fetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
54
+ (0, reduceFetchState_1.reduceAllFetchState)([
55
+ accountList,
56
+ classList,
57
+ expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
58
+ ]),
59
+ monthEndFetchState,
54
60
  ]);
55
61
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
56
62
  .uiState.totalCount;
@@ -6,7 +6,7 @@ import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
6
6
  import { AccountBase } from '../../../entity/account/accountState';
7
7
  import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
8
8
  import { VendorBase } from '../../../entity/vendor/vendorState';
9
- export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
9
+ export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
10
10
  export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
11
11
  export interface JESchedulesViewUIState {
12
12
  scrollPosition: {
@@ -6,6 +6,7 @@ const JE_SCHEDULE_SORT_KEYS = [
6
6
  'vendor',
7
7
  'category',
8
8
  'class',
9
+ 'depCategory',
9
10
  'scheduleCategory',
10
11
  'startMonth',
11
12
  'type',
@@ -17,7 +17,7 @@ export interface MissingReceiptsViewUIState {
17
17
  * Kept in sync with `ManualSearchInput` in web-components (fires search only when length ≥ this).
18
18
  */
19
19
  export declare const MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = 2;
20
- export declare const toBatchStatusValue: (v: string) => "pending" | "completed" | "processing";
20
+ export declare const toBatchStatusValue: (v: string) => "pending" | "processing" | "completed";
21
21
  export type BatchStatusValue = ReturnType<typeof toBatchStatusValue>;
22
22
  /** Canonical batch file statuses (API ingress may use aliases; see `parseBatchFileStatus`). */
23
23
  export declare const BATCH_FILE_STATUSES: readonly ["exact_match", "possible_matches", "no_match", "failed"];
@@ -52,16 +52,11 @@ const getProfitAndLossClassesHorizontalView = (filter, accountState, classState,
52
52
  const calculatedSections = {};
53
53
  let reportCurrency = currencyHelper_1.defaultCustomerCurrency;
54
54
  if (fetchState.fetchState === 'Completed' && selectedPeriod != null) {
55
- // Get section reports using existing selector infrastructure
56
- const sectionReports = {};
57
- HORIZONTAL_PANDL_SECTION_IDS.forEach((sectionId) => {
58
- sectionReports[sectionId] = (0, sectionClassesViewSelector_1.getSectionClassesViewReport)(accountState, classState, sectionsState, { reportId, sectionId }, filter);
59
- });
60
55
  reportCurrency =
61
56
  profitAndLossClassesViewState.currency ?? currencyHelper_1.defaultCustomerCurrency;
62
- // Pivot each section from class→account to account→class
57
+ // Fetch each section and pivot class→account to account→class in one pass
63
58
  HORIZONTAL_PANDL_SECTION_IDS.forEach((sectionId) => {
64
- const sectionReport = sectionReports[sectionId];
59
+ const sectionReport = (0, sectionClassesViewSelector_1.getSectionClassesViewReport)(accountState, classState, sectionsState, { reportId, sectionId }, filter);
65
60
  if (sectionReport != null) {
66
61
  sections[sectionId] = pivotSectionToHorizontal(sectionReport, classColumns, SECTION_TITLES[sectionId] ?? sectionId, reportCurrency);
67
62
  }
@@ -265,7 +260,7 @@ function sumBalancesInSlice(balances) {
265
260
  if (balances.length === 0) {
266
261
  return 0;
267
262
  }
268
- const summed = (0, getSummationBalance_1.getSummationFreeRangeTotalBalance)([...balances]);
263
+ const summed = (0, getSummationBalance_1.getSummationFreeRangeTotalBalance)(balances);
269
264
  return summed?.balance.amount ?? 0;
270
265
  }
271
266
  /**