@zeniai/client-epic-state 5.2.10 → 5.2.11-betaRD1

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 (145) hide show
  1. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.d.ts +0 -0
  2. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
  3. package/lib/entity/invoicing/coupon/couponConstants.d.ts +11 -0
  4. package/lib/entity/invoicing/coupon/couponConstants.js +29 -0
  5. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  6. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +66 -1
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +135 -0
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  10. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  12. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  13. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +79 -1
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  15. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  21. package/lib/epic.d.ts +9 -1
  22. package/lib/epic.js +16 -0
  23. package/lib/esm/commonStateTypes/selectorTypes/pickAndMergeForecastSection.js +1 -0
  24. package/lib/esm/entity/invoicing/coupon/couponConstants.js +26 -0
  25. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +135 -1
  27. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  28. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  29. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  30. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  31. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  32. package/lib/esm/epic.js +16 -0
  33. package/lib/esm/index.js +14 -8
  34. package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
  35. package/lib/esm/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
  36. package/lib/esm/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
  37. package/lib/esm/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
  38. package/lib/esm/view/companyMonthEndReportView/monthEndTemplateData.js +32 -0
  39. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  40. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  41. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +99 -0
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +110 -0
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +139 -0
  48. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +106 -0
  49. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +22 -0
  50. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  51. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  52. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +306 -29
  53. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  54. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  55. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +294 -22
  56. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +5 -6
  57. package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +25 -0
  58. package/lib/esm/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +15 -0
  59. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  60. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  61. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  62. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +18 -0
  63. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +18 -0
  64. package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +18 -0
  65. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +16 -0
  66. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +1 -0
  67. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +60 -0
  68. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +12 -0
  69. package/lib/esm/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +1 -0
  70. package/lib/index.d.ts +19 -13
  71. package/lib/index.js +91 -47
  72. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewPayload.d.ts +8 -0
  73. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +6 -2
  74. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +6 -2
  75. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.d.ts +2 -0
  76. package/lib/view/companyMonthEndReportView/companyMonthEndReportViewState.js +4 -0
  77. package/lib/view/companyMonthEndReportView/epics/saveCompanyMonthEndReportEpic.js +10 -6
  78. package/lib/view/companyMonthEndReportView/epics/sendCompanyMonthEndReportEpic.js +9 -5
  79. package/lib/view/companyMonthEndReportView/monthEndTemplateData.d.ts +16 -0
  80. package/lib/view/companyMonthEndReportView/monthEndTemplateData.js +36 -0
  81. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +6 -3
  82. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  83. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  84. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +20 -0
  85. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  86. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  87. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +8 -0
  88. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +103 -0
  89. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  90. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  91. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +45 -0
  92. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +114 -0
  93. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  94. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  95. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +12 -0
  96. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +146 -0
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +64 -0
  98. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +110 -0
  99. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +6 -0
  100. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +26 -0
  101. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  102. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  103. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  104. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
  105. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  106. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
  107. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +308 -29
  108. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  109. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  110. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  111. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  112. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
  113. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  114. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  115. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  116. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +302 -21
  117. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  118. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +82 -8
  119. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  120. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
  121. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.d.ts +6 -0
  122. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboAccountsEpic.js +29 -0
  123. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.d.ts +6 -0
  124. package/lib/view/invoicing/invoicingQboView/epics/fetchInvoicingQboClassesEpic.js +19 -0
  125. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  126. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  127. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  128. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  129. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +8 -0
  130. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +22 -0
  131. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +8 -0
  132. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +22 -0
  133. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +8 -0
  134. package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +22 -0
  135. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.d.ts +13 -0
  136. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardEpic.js +20 -0
  137. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.d.ts +11 -0
  138. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardPayload.js +2 -0
  139. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.d.ts +7 -0
  140. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +64 -0
  141. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +12 -0
  142. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.js +15 -0
  143. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.d.ts +9 -0
  144. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardState.js +2 -0
  145. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ import { Amount } from '../../../commonStateTypes/amount';
2
+ import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
3
+ import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction';
4
+ import { JESchedulePayload, SaveJESchedulePayload } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload';
5
+ import { NewJeDetailLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState';
6
+ /**
7
+ * Computes the month-by-month JE schedule breakdown for a brand-new schedule
8
+ * (no linked transaction yet) — replicates createNewSchedulesHelper's math
9
+ * (scheduleDetailLocalDataHelper.ts) exactly: lump-sum total split evenly
10
+ * across months with the rounding remainder absorbed by the last month, and a
11
+ * running balance that decrements each month and is forced to exactly 0 on
12
+ * the last row.
13
+ */
14
+ export declare const computeNewScheduleJeDetails: (localData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets, totalAmount: Amount, vendorName: string) => NewJeDetailLocalData[];
15
+ export interface NewSchedulePayload {
16
+ je_schedules: JESchedulePayload[];
17
+ scheduled_journal_entries: SaveJESchedulePayload[];
18
+ }
19
+ export type PrepareNewSchedulePayloadFailureReason = 'missing_third_party_id' | 'missing_vendor';
20
+ export type PrepareNewSchedulePayloadResult = {
21
+ ok: true;
22
+ payload: NewSchedulePayload;
23
+ } | {
24
+ ok: false;
25
+ reason: PrepareNewSchedulePayloadFailureReason;
26
+ };
27
+ /**
28
+ * Builds a savable schedule payload directly from a Base Transaction search
29
+ * result and the New Schedule form's local data — bypassing the legacy
30
+ * getJEScheduledTransactionByJEScheduleTransactionKey selector entirely,
31
+ * since that selector throws unless the entity has already round-tripped
32
+ * through a real GET /1.0/schedules/:id. A brand-new schedule has no such
33
+ * history, so this reads only from data already in hand (the selected
34
+ * transaction/line plus what the user filled into the form).
35
+ */
36
+ export declare const prepareNewSchedulePayload: (transaction: ScheduleTransaction, localData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets, scheduleType: ScheduleTypes) => PrepareNewSchedulePayloadResult;
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepareNewSchedulePayload = exports.computeNewScheduleJeDetails = void 0;
4
+ const amount_1 = require("../../../commonStateTypes/amount");
5
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
6
+ const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
7
+ const timePeriod_2 = require("../../../commonStateTypes/timePeriod");
8
+ const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper");
9
+ const scheduleDetailPayload_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailPayload");
10
+ const getNewScheduleMemo = (vendorName, schedulePostingDate, currentPeriod, totalPeriod, assetId) => {
11
+ const addAsset = assetId != null && assetId !== '' ? ` - ${assetId}` : '';
12
+ return `${vendorName} - ${schedulePostingDate.format(formatZeniDateFY_1.MONTH_YEAR_FORMAT)} (${currentPeriod} of ${totalPeriod})${addAsset}`;
13
+ };
14
+ /**
15
+ * Computes the month-by-month JE schedule breakdown for a brand-new schedule
16
+ * (no linked transaction yet) — replicates createNewSchedulesHelper's math
17
+ * (scheduleDetailLocalDataHelper.ts) exactly: lump-sum total split evenly
18
+ * across months with the rounding remainder absorbed by the last month, and a
19
+ * running balance that decrements each month and is forced to exactly 0 on
20
+ * the last row.
21
+ */
22
+ const computeNewScheduleJeDetails = (localData, totalAmount, vendorName) => {
23
+ const period = localData.selectedMonths;
24
+ const startingMonth = localData.selectedDate;
25
+ if (startingMonth == null || period == null) {
26
+ return [];
27
+ }
28
+ const assetId = 'assetId' in localData ? localData.assetId : undefined;
29
+ const averageAmount = Math.abs(Math.round((totalAmount.amount / period) * 100) / 100);
30
+ const lastMonthAmount = Math.abs(Math.round((Math.abs(totalAmount.amount) - averageAmount * (period - 1)) * 100) / 100);
31
+ let runningBalance = Math.abs(totalAmount.amount);
32
+ const negativeNumbers = totalAmount.amount < 0 || runningBalance < 0;
33
+ const newJeDetails = [];
34
+ for (let index = 0; index < period; index++) {
35
+ if (runningBalance > averageAmount) {
36
+ runningBalance = Math.round((runningBalance - averageAmount) * 100) / 100;
37
+ }
38
+ else {
39
+ runningBalance = 0;
40
+ }
41
+ const amount = index === period - 1 ? lastMonthAmount : averageAmount;
42
+ runningBalance = index === period - 1 ? 0 : runningBalance;
43
+ const schedulePostingDate = startingMonth.add(index, 'month');
44
+ const { postingDate, postingStatus } = (0, scheduleDetailLocalDataHelper_1.getPostingDateAndStatusForIndex)(schedulePostingDate.month(), schedulePostingDate.year(), localData.lastDayOfMonth === true
45
+ ? undefined
46
+ : localData.selectedDayOfMonth);
47
+ newJeDetails.push({
48
+ postingDate,
49
+ amount: (0, amount_1.toAmount)(negativeNumbers ? -amount : amount, totalAmount.currencyCode, totalAmount.currencySymbol),
50
+ runningBalance: (0, amount_1.toAmount)(negativeNumbers ? -runningBalance : runningBalance, totalAmount.currencyCode, totalAmount.currencySymbol),
51
+ postingStatus,
52
+ memo: getNewScheduleMemo(vendorName, schedulePostingDate, index + 1, period, assetId),
53
+ jeLink: { type: 'unknown' },
54
+ });
55
+ }
56
+ return newJeDetails;
57
+ };
58
+ exports.computeNewScheduleJeDetails = computeNewScheduleJeDetails;
59
+ const mapNewJeDetailsToScheduledJournalEntryPayload = (jeScheduleDetails) => jeScheduleDetails.map((journalEntry) => ({
60
+ status: {
61
+ code: journalEntry.postingStatus,
62
+ label: journalEntry.postingStatus,
63
+ },
64
+ transaction_memo: journalEntry.memo,
65
+ third_party_id: journalEntry.jeLink.thirdPartyTransactionId ?? null,
66
+ expected_post_date: journalEntry.postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT),
67
+ amount: journalEntry.amount.amount,
68
+ balance: journalEntry.runningBalance.amount,
69
+ // Brand-new schedule — there is no prior scheduled-journal-entry history
70
+ // to cross-reference (unlike the legacy edit flow's equivalent mapper).
71
+ scheduled_journal_entry_id: null,
72
+ actual_post_date: null,
73
+ is_platform_generated: null,
74
+ je_schedule_id: null,
75
+ update_time: null,
76
+ create_time: null,
77
+ }));
78
+ /**
79
+ * Builds a savable schedule payload directly from a Base Transaction search
80
+ * result and the New Schedule form's local data — bypassing the legacy
81
+ * getJEScheduledTransactionByJEScheduleTransactionKey selector entirely,
82
+ * since that selector throws unless the entity has already round-tripped
83
+ * through a real GET /1.0/schedules/:id. A brand-new schedule has no such
84
+ * history, so this reads only from data already in hand (the selected
85
+ * transaction/line plus what the user filled into the form).
86
+ */
87
+ const prepareNewSchedulePayload = (transaction, localData, scheduleType) => {
88
+ if (transaction.thirdPartyTransactionId == null ||
89
+ transaction.thirdPartyTransactionId === '') {
90
+ return { ok: false, reason: 'missing_third_party_id' };
91
+ }
92
+ const scheduleTransaction = transaction;
93
+ const vendorId = localData.selectedVendor?.id ?? transaction.vendorId ?? '';
94
+ const vendorName = localData.selectedVendor?.name ?? transaction.vendorName ?? '';
95
+ if (vendorId === '' || vendorName === '') {
96
+ return { ok: false, reason: 'missing_vendor' };
97
+ }
98
+ const vendor = {
99
+ vendor_id: vendorId,
100
+ vendor_name: vendorName,
101
+ };
102
+ const jeScheduleDetails = (0, exports.computeNewScheduleJeDetails)(localData, scheduleTransaction.amount, vendorName);
103
+ const postingDate = localData.selectedDayOfMonth ??
104
+ (localData.lastDayOfMonth === true ? timePeriod_2.LAST_SCHEDULE_DAY_OF_MONTH : null);
105
+ const firstJEScheduleDate = jeScheduleDetails.length > 0
106
+ ? jeScheduleDetails[0].postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT)
107
+ : null;
108
+ const lastJEScheduleDate = jeScheduleDetails.length > 0
109
+ ? jeScheduleDetails[jeScheduleDetails.length - 1].postingDate.format(timePeriod_1.DEFAULT_DATE_FORMAT)
110
+ : null;
111
+ const isFixedAssets = scheduleType === 'fixed_assets';
112
+ const assetId = 'assetId' in localData ? localData.assetId : undefined;
113
+ const selectedAccumulatedDepreciationCategory = 'selectedAccumulatedDepreciationCategory' in localData
114
+ ? localData.selectedAccumulatedDepreciationCategory
115
+ : undefined;
116
+ const status = { code: 'new', label: 'New' };
117
+ const jeSchedulePayload = {
118
+ status,
119
+ vendor,
120
+ currency_code: scheduleTransaction.currency.currencyCode,
121
+ currency_symbol: scheduleTransaction.currency.currencySymbol,
122
+ period: localData.selectedMonths ?? null,
123
+ je_schedule_type: scheduleType,
124
+ posting_date: postingDate,
125
+ balance: scheduleTransaction.amount.amount,
126
+ start_date: firstJEScheduleDate,
127
+ end_date: lastJEScheduleDate,
128
+ je_credit_accounting_class_id: scheduleTransaction.classBase?.classId ?? null,
129
+ je_credit_account_id: isFixedAssets
130
+ ? (selectedAccumulatedDepreciationCategory ?? null)
131
+ : scheduleTransaction.account.accountId,
132
+ je_debit_account_id: localData.selectedAccount ?? null,
133
+ je_debit_accounting_class_id: localData.selectedClass ?? null,
134
+ other_attributes: assetId != null ? { asset_id: assetId } : {},
135
+ base_transaction: (0, scheduleDetailPayload_1.mapScheduleTransactionToBaseScheduleTransactionPayload)(scheduleTransaction),
136
+ };
137
+ return {
138
+ ok: true,
139
+ payload: {
140
+ je_schedules: [jeSchedulePayload],
141
+ scheduled_journal_entries: mapNewJeDetailsToScheduledJournalEntryPayload(jeScheduleDetails),
142
+ },
143
+ };
144
+ };
145
+ exports.prepareNewSchedulePayload = prepareNewSchedulePayload;
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
39
39
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
40
40
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
41
41
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
42
- 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_approval_reorder" | "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_approval_reorder" | "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" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "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" | "snooze_task" | "unsnooze_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" | "receipts_bulk_match" | "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" | "create_transfer_entry" | "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" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
42
+ 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_approval_reorder" | "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_approval_reorder" | "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" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "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" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_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" | "receipts_bulk_match" | "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" | "create_transfer_entry" | "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" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
43
43
  messageText: "notification" | "failed" | "success";
44
44
  type: "error" | "success" | "info";
45
45
  variables: {
@@ -1,13 +1,17 @@
1
- import { JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
1
+ import { ID } from '../../../commonStateTypes/common';
2
+ import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
2
3
  import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
3
- import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
+ import { OneTimeAccrualIgnoreReasonType, OneTimeAccrualRevertReasonType, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
5
  import { ZeniAPIResponse } from '../../../responsePayload';
5
6
  import { RootState } from '../../../rootStateTypes';
7
+ import { ZeniDate } from '../../../zeniDayJS';
6
8
  import { JESchedulePayload, SaveJESchedulePayload } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload';
7
- import { JEScheduleLocalData } from '../types/jeSchedulesViewState';
9
+ import { JEScheduleLocalData, NewOneTimeAccrualLocalData } from '../types/jeSchedulesViewState';
8
10
  export interface ExpenseAutomationJESchedulesQueryPayload {
9
11
  end_date: string;
12
+ include_accrued: boolean;
10
13
  start_date: string;
14
+ close_period_start_date?: string;
11
15
  }
12
16
  interface ExpenseAutomationJESchedulesPayload {
13
17
  failed_je_postings: {
@@ -15,8 +19,73 @@ interface ExpenseAutomationJESchedulesPayload {
15
19
  scheduled_journal_entries: ScheduledJournalEntryPayload[];
16
20
  };
17
21
  je_schedules: JEScheduledTransactionPayload[];
22
+ accrued_je_schedules?: {
23
+ je_schedules: JEAccruedScheduledTransactionPayload[];
24
+ scheduled_journal_entries?: ScheduledJournalEntryPayload[];
25
+ };
26
+ one_time_accruals?: JEOneTimeAccrualPayload[];
18
27
  }
19
28
  export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
29
+ export interface CreateOneTimeAccrualPayload {
30
+ amount: number;
31
+ je_credit_account_id: ID;
32
+ je_debit_account_id: ID;
33
+ memo: string;
34
+ service_month: string;
35
+ vendor_id: ID;
36
+ vendor_name: string;
37
+ expected_reversal_date?: string;
38
+ je_credit_account_name?: string;
39
+ je_credit_accounting_class_id?: ID;
40
+ je_credit_accounting_class_name?: string;
41
+ je_debit_account_name?: string;
42
+ je_debit_accounting_class_id?: ID;
43
+ je_debit_accounting_class_name?: string;
44
+ reversal_policy?: string;
45
+ reverse_next_month?: boolean;
46
+ }
47
+ export type CreateOneTimeAccrualResponse = ZeniAPIResponse<{
48
+ accrual: JEOneTimeAccrualPayload;
49
+ }>;
50
+ /**
51
+ * Promote body. `vendor_id`, `vendor_name` and `service_month` are deliberately absent: promote
52
+ * treats them as immutable and takes them from the existing draft, so sending them would imply a
53
+ * reassignment the API silently ignores.
54
+ */
55
+ export interface PromoteOneTimeAccrualPayload {
56
+ amount: number;
57
+ je_credit_account_id: ID;
58
+ je_debit_account_id: ID;
59
+ memo: string;
60
+ }
61
+ /**
62
+ * Ignore body. `scope` is deliberately absent — the API returns 400 if it is sent, which is why the
63
+ * design's "Apply to" selector cannot be built yet.
64
+ */
65
+ /**
66
+ * Revert deletes the accrual's journal entry in QBO and soft-deletes the row. `scope` is rejected
67
+ * with a 400, exactly as on ignore.
68
+ */
69
+ export interface RevertOneTimeAccrualPayload {
70
+ reason: OneTimeAccrualRevertReasonType;
71
+ note?: string;
72
+ }
73
+ export interface IgnoreOneTimeAccrualPayload {
74
+ reason: OneTimeAccrualIgnoreReasonType;
75
+ note?: string;
76
+ }
77
+ /**
78
+ * The credit line is the accrued liability, which always sits on the balance sheet — the
79
+ * recurring accrued path resolves the same class the same way (see
80
+ * prepareNewScheduleAccruedDetailPayload). Omitted rather than sent empty when the tenant has
81
+ * no balance_sheet class, since the API treats the field as optional.
82
+ */
83
+ export declare const prepareCreateOneTimeAccrualPayload: (state: RootState, localData: NewOneTimeAccrualLocalData) => CreateOneTimeAccrualPayload;
84
+ /**
85
+ * The API defaults this to the 1st of the month after service_month. We send it explicitly so the
86
+ * date the form promised the user is the date that gets stored.
87
+ */
88
+ export declare const getExpectedReversalDate: (serviceMonth: ZeniDate) => ZeniDate;
20
89
  export interface IgnoreDraftJESchedulePayload {
21
90
  je_schedules: JEScheduledTransactionPayload[];
22
91
  scheduled_journal_entries: SaveJESchedulePayload[];
@@ -1,8 +1,65 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = void 0;
3
+ exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = exports.getExpectedReversalDate = exports.prepareCreateOneTimeAccrualPayload = void 0;
4
4
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
+ const classListSelector_1 = require("../../classList/classListSelector");
5
6
  const scheduleDetailPayload_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailPayload");
7
+ const BALANCE_SHEET_CLASS_LABEL = 'balance_sheet';
8
+ const SERVICE_MONTH_FORMAT = 'YYYY-MM';
9
+ /**
10
+ * The credit line is the accrued liability, which always sits on the balance sheet — the
11
+ * recurring accrued path resolves the same class the same way (see
12
+ * prepareNewScheduleAccruedDetailPayload). Omitted rather than sent empty when the tenant has
13
+ * no balance_sheet class, since the API treats the field as optional.
14
+ */
15
+ const prepareCreateOneTimeAccrualPayload = (state, localData) => {
16
+ const { classListState, classState } = state;
17
+ const balanceSheetClass = (0, classListSelector_1.getClassList)(classState, classListState).classes.find((accountingClass) => accountingClass.labels?.includes(BALANCE_SHEET_CLASS_LABEL) === true);
18
+ // reverse_next_month alone decides reversal_policy server-side, so reversal_policy is
19
+ // deliberately not sent — the API documents it only as an alternate way to say on_bill_match,
20
+ // and sending both would be two sources of truth for one toggle.
21
+ const reversalFields = localData.reverseNextMonth
22
+ ? {
23
+ reverse_next_month: true,
24
+ expected_reversal_date: (0, exports.getExpectedReversalDate)(localData.serviceMonth).format(timePeriod_1.DEFAULT_DATE_FORMAT),
25
+ }
26
+ : { reverse_next_month: false };
27
+ return {
28
+ vendor_id: localData.vendorId,
29
+ vendor_name: localData.vendorName,
30
+ service_month: localData.serviceMonth.format(SERVICE_MONTH_FORMAT),
31
+ amount: localData.amount,
32
+ memo: localData.memo,
33
+ je_debit_account_id: localData.debitAccountId,
34
+ je_credit_account_id: localData.creditAccountId,
35
+ ...(localData.debitAccountName != null
36
+ ? { je_debit_account_name: localData.debitAccountName }
37
+ : {}),
38
+ ...(localData.creditAccountName != null
39
+ ? { je_credit_account_name: localData.creditAccountName }
40
+ : {}),
41
+ ...(localData.debitClassId != null
42
+ ? { je_debit_accounting_class_id: localData.debitClassId }
43
+ : {}),
44
+ ...(localData.debitClassName != null
45
+ ? { je_debit_accounting_class_name: localData.debitClassName }
46
+ : {}),
47
+ ...(balanceSheetClass != null
48
+ ? {
49
+ je_credit_accounting_class_id: balanceSheetClass.classId,
50
+ je_credit_accounting_class_name: balanceSheetClass.className,
51
+ }
52
+ : {}),
53
+ ...reversalFields,
54
+ };
55
+ };
56
+ exports.prepareCreateOneTimeAccrualPayload = prepareCreateOneTimeAccrualPayload;
57
+ /**
58
+ * The API defaults this to the 1st of the month after service_month. We send it explicitly so the
59
+ * date the form promised the user is the date that gets stored.
60
+ */
61
+ const getExpectedReversalDate = (serviceMonth) => serviceMonth.add(1, 'month').startOf('month');
62
+ exports.getExpectedReversalDate = getExpectedReversalDate;
6
63
  const prepareIgnoreSchedulePayload = (scheduleType, jeScheduleTransaction, state) => {
7
64
  const { vendorState } = state;
8
65
  const { vendor, currencyCode, currencySymbol, baseTransaction, status, balanceAsOfToday, period, startDate, endDate, jeCredit, jeDebit, } = jeScheduleTransaction;
@@ -1,30 +1,77 @@
1
1
  import { ID } from '../../../commonStateTypes/common';
2
2
  import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
3
3
  import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
4
- import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
5
- import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
+ import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
5
+ import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
6
  import { ZeniAPIStatus } from '../../../responsePayload';
7
7
  import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
8
- import { AccountSettingsLocalData, AccountSettingsState, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
8
+ import { AccountSettingsLocalData, AccountSettingsState, JEPageTab, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState, NewOneTimeAccrualLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets, SearchTransactionsState } from '../types/jeSchedulesViewState';
9
9
  export declare const accountSettingsInitialState: AccountSettingsState;
10
+ export declare const getBaseNewScheduleLocalData: (scheduleType: ScheduleTypes) => NewScheduleLocalData;
11
+ export declare const newScheduleInitialState: JESchedulesViewState['newSchedule']['newScheduleState'];
12
+ export declare const searchTransactionsInitialState: SearchTransactionsState;
10
13
  export declare const initialState: JESchedulesViewState;
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], {
14
+ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearExpenseAutomationJESchedulesView">, clearJeAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeAccountSettingsLocalData">, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearJeScheduleLocalData">, clearSearchTransactionsForNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/clearSearchTransactionsForNewSchedule">, createOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[localData: NewOneTimeAccrualLocalData], {
15
+ localData: NewOneTimeAccrualLocalData;
16
+ }, "expenseAutomationJESchedulesView/createOneTimeAccrual", never, never>, createOneTimeAccrualFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
17
+ status: ZeniAPIStatus;
18
+ }, "expenseAutomationJESchedulesView/createOneTimeAccrualFailure">, createOneTimeAccrualSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/createOneTimeAccrualSuccess">, ignoreOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, reason: "paused" | "no_activity" | "too_small" | "need_invoice" | "other_ignore", note?: string | undefined], {
19
+ accrualId: string;
20
+ reason: "paused" | "no_activity" | "too_small" | "need_invoice" | "other_ignore";
21
+ note: string | undefined;
22
+ }, "expenseAutomationJESchedulesView/ignoreOneTimeAccrual", never, never>, oneTimeAccrualActionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
23
+ accrualId: ID;
24
+ status: ZeniAPIStatus;
25
+ }, "expenseAutomationJESchedulesView/oneTimeAccrualActionFailure">, oneTimeAccrualActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
+ accrualId: ID;
27
+ }, "expenseAutomationJESchedulesView/oneTimeAccrualActionSuccess">, promoteOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, amount: number], {
28
+ accrualId: string;
29
+ amount: number;
30
+ }, "expenseAutomationJESchedulesView/promoteOneTimeAccrual", never, never>, revertJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleId: string, jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", reason: "duplicate" | "amount_off" | "wrong_period" | "created_by_mistake" | "other_revert", note?: string | undefined], {
31
+ jeScheduleId: string;
32
+ jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
33
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
34
+ reason: "duplicate" | "amount_off" | "wrong_period" | "created_by_mistake" | "other_revert";
35
+ note: string | undefined;
36
+ }, "expenseAutomationJESchedulesView/revertJeSchedule", never, never>, revertJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
37
+ jeScheduleTransactionKey: JEScheduleKey | JEScheduleTransactionKey;
38
+ status: ZeniAPIStatus;
39
+ }, "expenseAutomationJESchedulesView/revertJeScheduleFailure">, revertJeScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
40
+ jeScheduleTransactionKey: JEScheduleKey | JEScheduleTransactionKey;
41
+ }, "expenseAutomationJESchedulesView/revertJeScheduleSuccess">, revertOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, reason: "duplicate" | "amount_off" | "wrong_period" | "other_revert" | "not_accrual", note?: string | undefined], {
42
+ accrualId: string;
43
+ reason: "duplicate" | "amount_off" | "wrong_period" | "other_revert" | "not_accrual";
44
+ note: string | undefined;
45
+ }, "expenseAutomationJESchedulesView/revertOneTimeAccrual", never, never>, fetchAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchAccountSettingsListForAccountTypes">, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
12
46
  period: TimePeriod;
13
47
  refreshViewInBackground: any;
14
48
  }, "expenseAutomationJESchedulesView/fetchJeSchedules", never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
49
+ selectedPageTab: JEPageTab;
15
50
  selectedPeriod: MonthYearPeriod;
16
51
  status: ZeniAPIStatus;
17
52
  }, "expenseAutomationJESchedulesView/fetchJeSchedulesFailure">, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
18
53
  period: TimePeriod;
19
54
  refreshViewInBackground: any;
20
55
  }, "expenseAutomationJESchedulesView/fetchJeSchedulesPage", never, never>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
56
+ accruedJeSchedules: JEAccruedScheduledTransactionPayload[];
21
57
  failedJeSchedules: JEScheduledTransactionPayload[];
22
58
  jeSchedules: JEScheduledTransactionPayload[];
59
+ oneTimeAccruals: JEOneTimeAccrualPayload[];
23
60
  refreshViewInBackground: boolean;
61
+ selectedPageTab: JEPageTab;
24
62
  selectedPeriod: MonthYearPeriod;
25
- }, "expenseAutomationJESchedulesView/fetchJeSchedulesSuccess">, fetchRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchRecommendationForAccountSettings">, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue"], {
63
+ }, "expenseAutomationJESchedulesView/fetchJeSchedulesSuccess">, fetchOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string], {
64
+ accrualId: string;
65
+ }, "expenseAutomationJESchedulesView/fetchOneTimeAccrual", never, never>, fetchOneTimeAccrualFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
66
+ accrualId: ID;
67
+ status: ZeniAPIStatus;
68
+ }, "expenseAutomationJESchedulesView/fetchOneTimeAccrualFailure">, fetchOneTimeAccrualSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
69
+ accrualId: ID;
70
+ }, "expenseAutomationJESchedulesView/fetchOneTimeAccrualSuccess">, fetchRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/fetchRecommendationForAccountSettings">, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", reason: "other_ignore" | "not_needed" | "wrong_account" | "duplicate" | "already_handled", note?: string | undefined], {
26
71
  jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
27
72
  scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
73
+ reason: "other_ignore" | "not_needed" | "wrong_account" | "duplicate" | "already_handled";
74
+ note: string | undefined;
28
75
  }, "expenseAutomationJESchedulesView/ignoreRecommendedJeSchedule", never, never>, ignoreRecommendedJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
76
  jeScheduleTransactionKey: JEScheduleTransactionKey;
30
77
  status: ZeniAPIStatus;
@@ -32,15 +79,27 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
32
79
  jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
33
80
  }, "expenseAutomationJESchedulesView/ignoreRecommendedJeScheduleSuccess", never, never>, initializeAccountSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/initializeAccountSettingsView">, initializeJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedules: JEScheduledTransactionPayload[]], {
34
81
  jeScheduleTransactionKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`)[];
35
- }, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
82
+ }, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, initializeNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
83
+ scheduleType: "fixed_assets" | "prepaid_expenses";
84
+ shouldResetEnteredData?: boolean;
85
+ }], {
86
+ scheduleType: "prepaid_expenses" | "fixed_assets";
87
+ shouldResetEnteredData: boolean;
88
+ }, "expenseAutomationJESchedulesView/initializeNewSchedule", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
36
89
  failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
37
90
  selectedPeriod: MonthYearPeriod;
38
91
  }, "expenseAutomationJESchedulesView/removeFailedJeScheduleTransactionKey", never, never>, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
92
  scheduledJournalEntryID: ID;
40
- }, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
93
+ }, "expenseAutomationJESchedulesView/removeJeScheduleLocalDataById">, removeJeAccruedScheduleKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeAccruedScheduleKey: `${string}_${string}`], {
94
+ jeAccruedScheduleKey: `${string}_${string}`;
95
+ }, "expenseAutomationJESchedulesView/removeJeAccruedScheduleKey", never, never>, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
41
96
  jeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`;
42
97
  selectedPeriod: MonthYearPeriod;
43
- }, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
98
+ }, "expenseAutomationJESchedulesView/removeJeScheduleTransactionKey", never, never>, resetNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
99
+ scheduleType: "fixed_assets" | "prepaid_expenses";
100
+ }], {
101
+ scheduleType: "prepaid_expenses" | "fixed_assets";
102
+ }, "expenseAutomationJESchedulesView/resetNewScheduleLocalData", never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
44
103
  jeScheduleTransactionKey: JEScheduleTransactionKey;
45
104
  scheduledJournalEntryID: ID;
46
105
  }, "expenseAutomationJESchedulesView/retryJeSchedule">, retryJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
@@ -52,17 +111,37 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
52
111
  status: ZeniAPIStatus;
53
112
  }, "expenseAutomationJESchedulesView/saveAccountSettingsFailure">, saveAccountSettingsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
54
113
  data: Partial<AccountSettingsLocalData>;
55
- }, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
114
+ }, "expenseAutomationJESchedulesView/saveAccountSettingsLocalData">, saveAccountSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveAccountSettingsSuccess">, saveNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
115
+ scheduleType: "fixed_assets" | "prepaid_expenses";
116
+ }], {
117
+ scheduleType: "prepaid_expenses" | "fixed_assets";
118
+ }, "expenseAutomationJESchedulesView/saveNewSchedule", never, never>, saveNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
119
+ status: ZeniAPIStatus;
120
+ }, "expenseAutomationJESchedulesView/saveNewScheduleFailure">, saveNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/saveNewScheduleSuccess">, searchTransactionsForNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
121
+ query: string;
122
+ scheduleType: "fixed_assets" | "prepaid_expenses";
123
+ }], {
124
+ query: string;
125
+ scheduleType: "prepaid_expenses" | "fixed_assets";
126
+ }, "expenseAutomationJESchedulesView/searchTransactionsForNewSchedule", never, never>, searchTransactionsForNewScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
127
+ status: ZeniAPIStatus;
128
+ }, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleFailure">, searchTransactionsForNewScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
129
+ searchResults: JEScheduleTransactionKey[];
130
+ }, "expenseAutomationJESchedulesView/searchTransactionsForNewScheduleSuccess">, toggleJECreatedGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJECreatedGroupCollapsed">, toggleJEPendingGroupCollapsed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationJESchedulesView/toggleJEPendingGroupCollapsed">, updateAccountSettingsListForAccountTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
56
131
  accountPayload: AccountMetadataPayload[];
57
132
  }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypes">, updateAccountSettingsListForAccountTypesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
58
133
  status: ZeniAPIStatus;
59
- }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
134
+ }, "expenseAutomationJESchedulesView/updateAccountSettingsListForAccountTypesFailure">, updateJESchedulesUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<JESchedulesViewUIState>, "expenseAutomationJESchedulesView/updateJESchedulesUIState">, updateJEScheduleTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<"prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue" | null, "expenseAutomationJESchedulesView/updateJEScheduleTypeFilter">, updateJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
135
  localData: Partial<JEScheduleLocalData>;
61
136
  scheduledJournalEntryID: ID;
62
- }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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], {
137
+ }, "expenseAutomationJESchedulesView/updateJeScheduleLocalDataById">, updateJeScheduleTransactionKeys: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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, selectedPageTab: "schedules" | "existing_schedules"], {
63
138
  jeScheduleKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${string}` | `${string}_bill_${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}`)[];
64
139
  selectedPeriod: MonthYearPeriod;
65
- }, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
140
+ selectedPageTab: "schedules" | "existing_schedules";
141
+ }, "expenseAutomationJESchedulesView/updateJeScheduleTransactionKeys", never, never>, updateNewScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
142
+ localData: Partial<NewScheduleLocalDataFixedAssets>;
143
+ scheduleType: "fixed_assets" | "prepaid_expenses";
144
+ }, "expenseAutomationJESchedulesView/updateNewScheduleLocalData">, updateRecommendationForAccountSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<AccountTypeRecommendationPayload, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettings">, updateRecommendationForAccountSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
66
145
  status: ZeniAPIStatus;
67
146
  }, "expenseAutomationJESchedulesView/updateRecommendationForAccountSettingsFailure">;
68
147
  declare const _default: import("redux").Reducer<JESchedulesViewState>;