@zeniai/client-epic-state 4.20.2 → 4.20.3-beta10ND

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
  2. package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
  3. package/lib/commonStateTypes/animations.d.ts +1 -1
  4. package/lib/commonStateTypes/animations.js +3 -0
  5. package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
  6. package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  9. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
  10. package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  11. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
  12. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  13. package/lib/entity/snackbar/snackbarTypes.js +5 -0
  14. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  15. package/lib/entity/tenant/tenantReducer.js +1 -0
  16. package/lib/entity/tenant/tenantSelector.d.ts +1 -0
  17. package/lib/entity/tenant/tenantSelector.js +9 -1
  18. package/lib/entity/tenant/tenantState.d.ts +1 -0
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
  20. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  21. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -0
  22. package/lib/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  23. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  24. package/lib/entity/transaction/stateTypes/transaction.d.ts +5 -0
  25. package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
  26. package/lib/epic.d.ts +8 -1
  27. package/lib/epic.js +8 -1
  28. package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
  29. package/lib/esm/commonStateTypes/animations.js +3 -0
  30. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
  31. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
  32. package/lib/esm/entity/snackbar/snackbarTypes.js +5 -0
  33. package/lib/esm/entity/tenant/tenantReducer.js +1 -0
  34. package/lib/esm/entity/tenant/tenantSelector.js +7 -0
  35. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  36. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +17 -1
  37. package/lib/esm/epic.js +8 -1
  38. package/lib/esm/index.js +10 -7
  39. package/lib/esm/reducer.js +3 -0
  40. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
  41. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
  42. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
  43. package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
  44. package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  45. package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  47. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
  48. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  49. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  50. package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  51. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  52. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +17 -1
  53. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  54. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  55. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  56. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  57. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +12 -6
  58. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +18 -1
  59. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +18 -1
  60. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +17 -14
  61. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
  62. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
  63. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
  64. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
  65. package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +99 -0
  66. package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
  67. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
  68. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
  69. package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
  70. package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
  71. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  72. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
  73. package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  74. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  75. package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  76. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  77. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  78. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  79. package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
  80. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  81. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  82. package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  83. package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  84. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  85. package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  86. package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  87. package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
  88. package/lib/index.d.ts +19 -12
  89. package/lib/index.js +54 -32
  90. package/lib/reducer.d.ts +3 -0
  91. package/lib/reducer.js +3 -0
  92. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  93. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
  94. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
  95. package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
  96. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
  97. package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
  98. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
  99. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
  100. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
  101. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  102. package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
  103. package/lib/view/classList/fetchClassListEpic.js +8 -1
  104. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
  105. package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
  106. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
  107. package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
  108. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
  109. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +1 -1
  110. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +4 -3
  111. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
  112. package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
  113. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  114. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  115. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
  116. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
  117. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +18 -2
  118. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  119. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
  120. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
  121. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +12 -4
  122. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +22 -9
  123. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -5
  124. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +5 -0
  125. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +20 -0
  126. package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
  127. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +2 -0
  128. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +19 -2
  129. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +17 -14
  130. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  131. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
  132. package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
  133. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
  134. package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
  135. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
  136. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
  137. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
  138. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
  139. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
  140. package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +105 -0
  141. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
  142. package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
  143. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
  144. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
  145. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
  146. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
  147. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
  148. package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
  149. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
  150. package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
  151. package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
  152. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  153. package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
  154. package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
  155. package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
  156. package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
  157. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
  158. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
  159. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  160. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  161. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
  162. package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
  163. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
  164. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
  165. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  166. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
  167. package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
  168. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
  169. package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
  170. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  171. package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
  172. package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
  173. package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
  174. package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
  175. package/package.json +1 -1
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
37
37
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
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
- 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";
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" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "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
41
  messageText: "notification" | "success" | "failed";
42
42
  type: "error" | "success" | "info";
43
43
  variables: {
@@ -241,7 +241,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
241
241
  isPreFilled: true,
242
242
  };
243
243
  }
244
- if (accountLine.class.classId === '' &&
244
+ if (Boolean(accountLine.class?.classId) === false &&
245
245
  higherPreferenceRecommendation?.class != null) {
246
246
  record.class = {
247
247
  ...higherPreferenceRecommendation.class,
@@ -472,7 +472,7 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
472
472
  }
473
473
  : accountLine.account;
474
474
  record.class =
475
- accountLine.class.classId !== ''
475
+ Boolean(accountLine.class?.classId) !== false
476
476
  ? accountLine.class
477
477
  : recommendations?.[0]?.class
478
478
  ? {
@@ -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 {
@@ -5,7 +5,7 @@ import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSch
5
5
  import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
6
  import { ZeniAPIStatus } from '../../../responsePayload';
7
7
  import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
8
- import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState } from '../types/jeSchedulesViewState';
8
+ import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
9
9
  export declare const accountSettingsInitialState: AccountSettingsState;
10
10
  export declare const initialState: JESchedulesViewState;
11
11
  export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
@@ -56,7 +56,7 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
56
56
  accountPayload: AccountMetadataPayload[];
57
57
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
58
  status: ZeniAPIStatus;
59
- }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
59
+ }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
60
  localData: Partial<JEScheduleLocalData>;
61
61
  scheduledJournalEntryID: ID;
62
62
  }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_bill_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[], selectedPeriod: MonthYearPeriod], {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
4
+ exports.updateRecommendationForAccountSettingsFailure = exports.updateRecommendationForAccountSettings = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateJESchedulesUIState = exports.updateAccountSettingsListForAccountTypesFailure = exports.updateAccountSettingsListForAccountTypes = exports.saveAccountSettingsSuccess = exports.saveAccountSettingsLocalData = exports.saveAccountSettingsFailure = exports.saveAccountSettings = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeAccountSettingsView = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchRecommendationForAccountSettings = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.fetchAccountSettingsListForAccountTypes = exports.clearJeScheduleLocalData = exports.clearJeAccountSettingsLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = exports.accountSettingsInitialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
7
7
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
@@ -48,6 +48,8 @@ exports.initialState = {
48
48
  uiState: {
49
49
  searchString: '',
50
50
  scrollPosition: { scrollTop: 0, scrollLeft: undefined },
51
+ sortKey: 'startMonth',
52
+ sortOrder: 'descending',
51
53
  totalCount: 0,
52
54
  limit: 10,
53
55
  },
@@ -369,12 +371,26 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
369
371
  clearJeAccountSettingsLocalData(draft) {
370
372
  draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
371
373
  },
374
+ updateJESchedulesUIState(draft, action) {
375
+ if (action.payload.sortKey != null) {
376
+ draft.uiState.sortKey = action.payload.sortKey;
377
+ }
378
+ if (action.payload.sortOrder != null) {
379
+ draft.uiState.sortOrder = action.payload.sortOrder;
380
+ }
381
+ if (action.payload.searchString != null) {
382
+ draft.uiState.searchString = action.payload.searchString;
383
+ }
384
+ if (action.payload.scrollPosition != null) {
385
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
386
+ }
387
+ },
372
388
  clearExpenseAutomationJESchedulesView(draft) {
373
389
  Object.assign(draft, exports.initialState);
374
390
  },
375
391
  },
376
392
  });
377
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
393
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeAccountSettingsLocalData = _a.clearJeAccountSettingsLocalData, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchAccountSettingsListForAccountTypes = _a.fetchAccountSettingsListForAccountTypes, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchRecommendationForAccountSettings = _a.fetchRecommendationForAccountSettings, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeAccountSettingsView = _a.initializeAccountSettingsView, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.saveAccountSettings = _a.saveAccountSettings, exports.saveAccountSettingsFailure = _a.saveAccountSettingsFailure, exports.saveAccountSettingsLocalData = _a.saveAccountSettingsLocalData, exports.saveAccountSettingsSuccess = _a.saveAccountSettingsSuccess, exports.updateAccountSettingsListForAccountTypes = _a.updateAccountSettingsListForAccountTypes, exports.updateAccountSettingsListForAccountTypesFailure = _a.updateAccountSettingsListForAccountTypesFailure, exports.updateJESchedulesUIState = _a.updateJESchedulesUIState, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys, exports.updateRecommendationForAccountSettings = _a.updateRecommendationForAccountSettings, exports.updateRecommendationForAccountSettingsFailure = _a.updateRecommendationForAccountSettingsFailure;
378
394
  exports.default = expenseAutomationJESchedulesView.reducer;
379
395
  const doUpdateRecommendationForAccountSettings = (draft, payload) => {
380
396
  const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
@@ -18,10 +18,12 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
18
  allDepreciationAccountList: AccountBase[];
19
19
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
20
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
+ completedSchedules: JEScheduledTransaction[];
21
22
  completionStatus: CompletionStatusType;
22
23
  draftSchedules: JEScheduledTransaction[];
23
24
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
24
25
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
+ ongoingSchedules: JEScheduledTransaction[];
25
27
  postStatusById: Record<ID, FetchStateAndError>;
26
28
  refreshStatus: FetchStateAndError;
27
29
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpenseAutomationFluxAnalysisView = getExpenseAutomationFluxAnalysisView;
4
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
4
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
6
  const accountSelector_1 = require("../../../entity/account/accountSelector");
6
7
  const classSelector_1 = require("../../../entity/class/classSelector");
@@ -9,7 +10,7 @@ const userSelector_1 = require("../../../entity/user/userSelector");
9
10
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
10
11
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
11
12
  function getExpenseAutomationFluxAnalysisView(state) {
12
- const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
13
+ const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
13
14
  const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
14
15
  const fetchStateAndError = {
15
16
  fetchState,
@@ -94,10 +95,17 @@ function getExpenseAutomationFluxAnalysisView(state) {
94
95
  },
95
96
  };
96
97
  const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
98
+ const monthEndFetchState = monthYearPeriodId != null
99
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
100
+ : { fetchState: 'Not-Started', error: undefined };
101
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
102
+ fetchStateAndError,
103
+ monthEndFetchState,
104
+ ]);
97
105
  return {
98
106
  sections,
99
107
  totalBalancesAndVariance,
100
- fetchStatus: fetchStateAndError,
108
+ fetchStatus: reducedFetchStatus,
101
109
  bulkReviewStatus,
102
110
  reviewOperatingExpensesIds,
103
111
  selectedSectionIds,
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationJESchedulesView = getExpenseAutomationJESchedulesView;
7
7
  const omit_1 = __importDefault(require("lodash/omit"));
8
+ const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
10
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
11
  const accountSelector_1 = require("../../../entity/account/accountSelector");
10
12
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
@@ -16,10 +18,48 @@ const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/
16
18
  const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
17
19
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
18
20
  const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
21
+ function getJEScheduleSortAccessor(sortKey) {
22
+ switch (sortKey) {
23
+ case 'vendor':
24
+ return (s) => s.vendor.name?.toLowerCase();
25
+ case 'category':
26
+ return (s) => s.jeDebit.account?.accountName?.toLowerCase();
27
+ case 'class':
28
+ return (s) => s.jeDebit.accountingClass?.className?.toLowerCase();
29
+ case 'depCategory':
30
+ return (s) => s.jeCredit.account?.accountName?.toLowerCase();
31
+ case 'scheduleCategory':
32
+ return (s) => s.jeScheduleType;
33
+ case 'startMonth':
34
+ return (s) => s.startDate?.valueOf();
35
+ case 'type':
36
+ return (s) => s.baseTransaction.typeOfTransaction;
37
+ case 'amortizationPeriod':
38
+ return (s) => s.period;
39
+ case 'jePostingDate':
40
+ return (s) => s.dayOfPostingDate;
41
+ case 'remainingMonths':
42
+ return (s) => s.period;
43
+ case 'runningBalance':
44
+ return (s) => s.balanceAsOfToday?.amount;
45
+ case 'totalAmount':
46
+ return (s) => s.baseTransaction.amount.amount;
47
+ case 'transactionDate':
48
+ return (s) => s.baseTransaction.date.valueOf();
49
+ case 'memo':
50
+ return (s) => s.baseTransaction.memo?.toLowerCase();
51
+ default:
52
+ return (s) => s.startDate?.valueOf();
53
+ }
54
+ }
55
+ function sortJEScheduledTransactions(transactions, sortKey, sortOrder) {
56
+ const accessor = getJEScheduleSortAccessor(sortKey);
57
+ return (0, orderBy_1.default)(transactions, [accessor], [sortOrder === 'ascending' ? 'asc' : 'desc']);
58
+ }
19
59
  function getExpenseAutomationJESchedulesView(state) {
20
60
  const jeScheduledTransaction = [];
21
61
  const failedJeScheduledTransaction = [];
22
- const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
62
+ const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
23
63
  const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
24
64
  const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
25
65
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
@@ -65,18 +105,33 @@ function getExpenseAutomationJESchedulesView(state) {
65
105
  const jeScheduleDetails = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleTransactionKey)(jeScheduleKey, state);
66
106
  failedJeScheduledTransaction.push(jeScheduleDetails);
67
107
  });
68
- const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
69
- const resolveSchedules = [];
108
+ const { sortKey, sortOrder } = uiState;
109
+ const draftSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft'), sortKey, sortOrder);
110
+ const ongoingSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing'), sortKey, sortOrder);
111
+ const completedSchedules = sortJEScheduledTransactions(jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
112
+ schedule.status.code === 'marked_as_completed'), sortKey, sortOrder);
113
+ const unsortedResolveSchedules = [];
70
114
  failedJeScheduledTransaction.forEach((schedule) => {
71
115
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
72
- resolveSchedules.push({ ...schedule, scheduledJournalEntry: journalEntry });
116
+ unsortedResolveSchedules.push({
117
+ ...schedule,
118
+ scheduledJournalEntry: journalEntry,
119
+ });
73
120
  });
74
121
  });
122
+ const resolveSchedules = sortJEScheduledTransactions(unsortedResolveSchedules, sortKey, sortOrder);
75
123
  const allSteps = monthYearPeriodId != null
76
124
  ? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
77
125
  : [];
78
126
  const jeCompletionStatus = allSteps.find((step) => step.step === 'je_schedules')?.completionStatus;
79
127
  const completionStatus = jeCompletionStatus != null ? jeCompletionStatus : 'incomplete';
128
+ const monthEndFetchState = monthYearPeriodId != null
129
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
130
+ : { fetchState: 'Not-Started', error: undefined };
131
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
132
+ { fetchState, error },
133
+ monthEndFetchState,
134
+ ]);
80
135
  return {
81
136
  uncategorizedAccounts,
82
137
  allDepreciationAccountList: filteredDepAccounts,
@@ -85,15 +140,17 @@ function getExpenseAutomationJESchedulesView(state) {
85
140
  allAccountList: filteredAccounts,
86
141
  accountListNestedAccountHierarchy,
87
142
  allClassList: allClasses,
143
+ completedSchedules,
88
144
  draftSchedules,
145
+ ongoingSchedules,
89
146
  resolveSchedules: resolveSchedules,
90
147
  accountSettingsView,
91
148
  postStatusById: postStatusById,
92
149
  ignoreStatusById: ignoreStatusById,
93
- fetchState: fetchState,
150
+ fetchState: reducedFetchStatus.fetchState,
94
151
  jeScheduleLocalDataById: jeScheduleLocalDataById,
95
152
  uiState: uiState,
96
- error: error,
153
+ error: reducedFetchStatus.error,
97
154
  refreshStatus,
98
155
  completionStatus,
99
156
  };
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getExpenseAutomationMissingReceiptsView = getExpenseAutomationMissingReceiptsView;
7
7
  const orderBy_1 = __importDefault(require("lodash/orderBy"));
8
+ const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
9
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
9
10
  const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
10
11
  const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
@@ -13,7 +14,7 @@ const missingReceiptsViewReducer_1 = require("../reducers/missingReceiptsViewRed
13
14
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
14
15
  const missingReceiptsViewState_1 = require("../types/missingReceiptsViewState");
15
16
  function getExpenseAutomationMissingReceiptsView(state) {
16
- const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { expenseAutomationMissingReceiptsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
17
18
  const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
18
19
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
19
20
  const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
@@ -42,7 +43,7 @@ function getExpenseAutomationMissingReceiptsView(state) {
42
43
  transaction.lines.length > 0 &&
43
44
  transaction.lines[0]
44
45
  ?.class != null
45
- ? transaction.lines[0].class.className.toLowerCase()
46
+ ? transaction.lines[0].class?.className.toLowerCase()
46
47
  : null;
47
48
  case 'vendor':
48
49
  default:
@@ -181,9 +182,16 @@ function getExpenseAutomationMissingReceiptsView(state) {
181
182
  vendorLogo: result.vendorLogo ?? transaction?.logo?.href,
182
183
  };
183
184
  });
185
+ const monthEndFetchState = monthYearPeriodId != null
186
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
187
+ : { fetchState: 'Not-Started', error: undefined };
188
+ const reducedFetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
189
+ { fetchState, error },
190
+ monthEndFetchState,
191
+ ]);
184
192
  return {
185
- fetchState,
186
- error,
193
+ fetchState: reducedFetchStatus.fetchState,
194
+ error: reducedFetchStatus.error,
187
195
  uploadReceiptStatusById,
188
196
  uiState,
189
197
  refreshStatus,
@@ -19,7 +19,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
19
19
  const classListSelector_1 = require("../../classList/classListSelector");
20
20
  const reconciliationViewReducer_1 = require("../reducers/reconciliationViewReducer");
21
21
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
22
- exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState) => {
22
+ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((state) => state, (state) => (0, tenantSelector_1.getCurrentTenant)(state), (state) => state.expenseAutomationReconciliationViewState, (state) => state.expenseAutomationViewState, (state) => state.plaidAccountViewState, (state) => state.accountListState, (state) => state.accountState, (state) => state.classListState, (state) => state.classState, (state) => state.monthEndCloseChecksState, (state) => state.vendorState, (state) => state.monthEndCloseChecksViewState, (state, currentTenant, reconciliationViewState, expenseAutomationViewState, plaidAccountViewState, accountListState, accountState, classListState, classState, monthEndCloseChecksState, vendorState, monthEndCloseChecksViewState) => {
23
23
  const { selectedPeriodByTenantId } = expenseAutomationViewState;
24
24
  const reconcileTabUiState = reconciliationViewState.reconTabsState.reconcile.uiState;
25
25
  const reviewTabUiState = reconciliationViewState.reconTabsState.review.uiState;
@@ -41,6 +41,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
41
41
  }
42
42
  return acc;
43
43
  }, []);
44
+ const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
45
+ const monthEndFetchState = monthYearPeriodId != null
46
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? {
47
+ fetchState: 'Not-Started',
48
+ error: undefined,
49
+ })
50
+ : { fetchState: 'Not-Started', error: undefined };
44
51
  if (accountReconForMonthYearPeriod == null) {
45
52
  return {
46
53
  bankAccounts: [],
@@ -50,10 +57,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
50
57
  classListNestedAccountHierarchy: [],
51
58
  allAccountList: [],
52
59
  allClassList: [],
53
- fetchStatus: {
54
- fetchState: reconciliationViewState.fetchState,
55
- error: reconciliationViewState.error,
56
- },
60
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
61
+ {
62
+ fetchState: reconciliationViewState.fetchState,
63
+ error: reconciliationViewState.error,
64
+ },
65
+ monthEndFetchState,
66
+ ]),
57
67
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
58
68
  .plaidConnectionDetails,
59
69
  completionStatus: 'incomplete',
@@ -276,10 +286,13 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
276
286
  bankAccounts: uniqueBankAccounts,
277
287
  creditCards: uniqueCreditCards,
278
288
  accountReconciliationsByAccountID: reconList,
279
- fetchStatus: {
280
- fetchState: reconciliationViewState.fetchState,
281
- error: reconciliationViewState.error,
282
- },
289
+ fetchStatus: (0, reduceFetchState_1.reduceAnyFetchState)([
290
+ {
291
+ fetchState: reconciliationViewState.fetchState,
292
+ error: reconciliationViewState.error,
293
+ },
294
+ monthEndFetchState,
295
+ ]),
283
296
  plaidConnectionDetails: plaidAccountViewState['expense_automation_reconcile']
284
297
  .plaidConnectionDetails,
285
298
  reconciliationTabsState: reconciliationViewState.reconTabsState,
@@ -14,7 +14,7 @@ const accountListSelector_1 = require("../../accountList/accountListSelector");
14
14
  const classListSelector_1 = require("../../classList/classListSelector");
15
15
  const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
16
16
  function getExpenseAutomationTransactionView(state) {
17
- const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
17
+ const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, monthEndCloseChecksViewState, } = state;
18
18
  const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
19
19
  const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
20
20
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
@@ -47,10 +47,16 @@ function getExpenseAutomationTransactionView(state) {
47
47
  .filter((transaction) => transaction != null);
48
48
  const transactions = (0, transactionSelector_1.getSupportedTransactionsByIds)(transactionState, transactionIds);
49
49
  const transactionsWithCOT = transactions.map((transaction) => (0, transactionHelper_1.getTransactionWithCOT)(transaction));
50
- const fetchStatus = (0, reduceFetchState_1.reduceAllFetchState)([
51
- accountList,
52
- classList,
53
- expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
50
+ const monthEndFetchState = monthYearPeriodId != null
51
+ ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
52
+ : { fetchState: 'Not-Started', error: undefined };
53
+ const fetchStatus = (0, reduceFetchState_1.reduceAnyFetchState)([
54
+ (0, reduceFetchState_1.reduceAllFetchState)([
55
+ accountList,
56
+ classList,
57
+ expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab],
58
+ ]),
59
+ monthEndFetchState,
54
60
  ]);
55
61
  const totalCountByReview = expenseAutomationTransactionsViewState.transactionCategorizationView.review
56
62
  .uiState.totalCount;
@@ -1,16 +1,21 @@
1
1
  import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation } from '../../../commonStateTypes/recommendationBase';
4
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
4
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
5
6
  import { AccountBase } from '../../../entity/account/accountState';
6
7
  import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
7
8
  import { VendorBase } from '../../../entity/vendor/vendorState';
9
+ export declare const toJEScheduleSortKey: (v: string) => "vendor" | "type" | "category" | "class" | "memo" | "transactionDate" | "totalAmount" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "jePostingDate" | "remainingMonths";
10
+ export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
8
11
  export interface JESchedulesViewUIState {
9
12
  scrollPosition: {
10
13
  scrollTop: number;
11
14
  scrollLeft?: number;
12
15
  } | undefined;
13
16
  searchString: string;
17
+ sortKey: JEScheduleSortKey;
18
+ sortOrder: SortOrder;
14
19
  totalCount: number;
15
20
  limit?: number;
16
21
  }
@@ -1,2 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJEScheduleSortKey = void 0;
4
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
5
+ const JE_SCHEDULE_SORT_KEYS = [
6
+ 'vendor',
7
+ 'category',
8
+ 'class',
9
+ 'depCategory',
10
+ 'scheduleCategory',
11
+ 'startMonth',
12
+ 'type',
13
+ 'amortizationPeriod',
14
+ 'jePostingDate',
15
+ 'remainingMonths',
16
+ 'runningBalance',
17
+ 'totalAmount',
18
+ 'transactionDate',
19
+ 'memo',
20
+ ];
21
+ const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
22
+ exports.toJEScheduleSortKey = toJEScheduleSortKey;
@@ -3,7 +3,7 @@ import { CompanyWithSchema } from '../../../../entity/company/companySelector';
3
3
  import { OnboardingCustomerInfo } from '../../../../entity/onboardingCustomer/onboardingCustomerState';
4
4
  import { Tenant } from '../../../../entity/tenant/tenantState';
5
5
  import { CompanyDetailsLocalData, PrimaryContactLocalData } from '../../../spendManagement/commonSetup/setupViewState';
6
- declare const toProductGroupType: (v: string) => "other" | "bookkeeping" | "banking" | "spend_management" | "cards";
6
+ declare const toProductGroupType: (v: string) => "cards" | "other" | "bookkeeping" | "banking" | "spend_management";
7
7
  export type ProductGroupType = ReturnType<typeof toProductGroupType>;
8
8
  export declare const toProductType: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax";
9
9
  export declare const toProductTypeStrict: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax" | undefined;
@@ -6,6 +6,8 @@ import { ZeniDate } from '../../zeniDayJS';
6
6
  import { ProfitAndLossByClassHorizontalReport } from './profitAndLossClassesByClassHorizontalSelectorTypes';
7
7
  import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID } from './profitAndLossClassesViewSelectorTypes';
8
8
  import { ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
9
+ /** Standard class ID returned by the accounting platform for transactions without an assigned class. */
10
+ export declare const NOT_SPECIFIED_CLASS_ID = "not_specified";
9
11
  export declare const profitAndLossHorizontalIdsInOrder: (PandLReportViewSectionID | PandLReportViewCalculatedSectionID)[];
10
12
  export declare const getProfitAndLossClassesHorizontalView: (filter: COABalancesFilterClassesView, accountState: AccountState, classState: ClassState, sectionsState: SectionClassesViewStateV2, profitAndLossClassesViewState: ProfitAndLossClassesViewState, selectedPeriod: {
11
13
  endDate: ZeniDate;
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProfitAndLossClassesHorizontalView = exports.profitAndLossHorizontalIdsInOrder = void 0;
3
+ exports.getProfitAndLossClassesHorizontalView = exports.profitAndLossHorizontalIdsInOrder = exports.NOT_SPECIFIED_CLASS_ID = void 0;
4
4
  const amount_1 = require("../../commonStateTypes/amount");
5
5
  const getSummationBalance_1 = require("../../commonStateTypes/coaBalance/additionalBalances/getSummationBalance");
6
6
  const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
7
7
  const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
8
8
  const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
9
+ const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
9
10
  const profitAndLossHorizontalEnrichment_1 = require("./profitAndLossHorizontalEnrichment");
11
+ /** Standard class ID returned by the accounting platform for transactions without an assigned class. */
12
+ exports.NOT_SPECIFIED_CLASS_ID = 'not_specified';
10
13
  exports.profitAndLossHorizontalIdsInOrder = [
11
14
  'income',
12
15
  'cogs',
@@ -122,7 +125,19 @@ function buildClassColumns(classHierarchy, classesToFilterOut) {
122
125
  nestedClassId: c.classId,
123
126
  qboId: c.qboId,
124
127
  }))
125
- .sort((a, b) => a.className.localeCompare(b.className, [], { sensitivity: 'base' }));
128
+ .sort((a, b) => {
129
+ const aIsNotSpecified = a.classId === exports.NOT_SPECIFIED_CLASS_ID;
130
+ const bIsNotSpecified = b.classId === exports.NOT_SPECIFIED_CLASS_ID;
131
+ if (aIsNotSpecified && !bIsNotSpecified) {
132
+ return 1;
133
+ }
134
+ if (!aIsNotSpecified && bIsNotSpecified) {
135
+ return -1;
136
+ }
137
+ return a.className.localeCompare(b.className, [], {
138
+ sensitivity: 'base',
139
+ });
140
+ });
126
141
  }
127
142
  /**
128
143
  * Pivot a section from class→account→balances to account→class→balance (single period).
@@ -307,6 +322,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
307
322
  startDate,
308
323
  type: 'default',
309
324
  label: col.className,
325
+ id: col.classId,
310
326
  }));
311
327
  // Add a "Total" column
312
328
  balances.push({
@@ -316,6 +332,7 @@ function buildHeaderBalances(classColumns, timeframe, selectedPeriod, currency)
316
332
  startDate,
317
333
  type: 'default',
318
334
  label: 'Total',
335
+ id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
319
336
  });
320
337
  return balances;
321
338
  }