@zeniai/client-epic-state 4.8.86 → 4.8.87

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 (132) hide show
  1. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -1
  2. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +4 -3
  3. package/lib/entity/account/accountSelector.d.ts +6 -6
  4. package/lib/entity/account/accountState.d.ts +3 -3
  5. package/lib/entity/account/accountState.js +1 -0
  6. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +2 -2
  7. package/lib/entity/accountGroup/accountGroupSelector.d.ts +44 -44
  8. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  9. package/lib/entity/class/classReducer.d.ts +4 -4
  10. package/lib/entity/class/classState.d.ts +1 -1
  11. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  12. package/lib/entity/forecast/forecastState.d.ts +1 -1
  13. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +6 -1
  14. package/lib/entity/jeSchedules/jeSchedulesPayload.js +11 -1
  15. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  16. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  17. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +5 -1
  18. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +4 -4
  19. package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -1
  20. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  21. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  22. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  23. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  24. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  25. package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
  26. package/lib/entity/tenant/clearAllEpic.js +2 -0
  27. package/lib/entity/tenant/tenantSelector.d.ts +12 -4
  28. package/lib/entity/tenant/tenantSelector.js +95 -31
  29. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +1 -0
  30. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
  31. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
  32. package/lib/epic.d.ts +7 -1
  33. package/lib/epic.js +7 -1
  34. package/lib/index.d.ts +21 -13
  35. package/lib/index.js +48 -20
  36. package/lib/init.js +1 -1
  37. package/lib/reducer.d.ts +6 -0
  38. package/lib/reducer.js +6 -0
  39. package/lib/view/accountList/accountListReducer.d.ts +2 -2
  40. package/lib/view/accountList/accountListReducer.js +2 -1
  41. package/lib/view/accountList/accountListState.d.ts +1 -1
  42. package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.d.ts +1 -1
  43. package/lib/view/auditReportView/auditReportViewHelper.d.ts +12 -0
  44. package/lib/view/auditReportView/auditReportViewHelper.js +79 -0
  45. package/lib/view/auditReportView/auditReportViewPayload.d.ts +53 -0
  46. package/lib/view/auditReportView/auditReportViewPayload.js +2 -0
  47. package/lib/view/auditReportView/auditReportViewReducer.d.ts +27 -0
  48. package/lib/view/auditReportView/auditReportViewReducer.js +121 -0
  49. package/lib/view/auditReportView/auditReportViewSelector.d.ts +22 -0
  50. package/lib/view/auditReportView/auditReportViewSelector.js +34 -0
  51. package/lib/view/auditReportView/auditReportViewState.d.ts +71 -0
  52. package/lib/view/auditReportView/auditReportViewState.js +22 -0
  53. package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.d.ts +7 -0
  54. package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.js +54 -0
  55. package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.d.ts +7 -0
  56. package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.js +39 -0
  57. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  58. package/lib/view/cardBalance/cardBalanceSelector.d.ts +3 -3
  59. package/lib/view/cashBalance/cashBalanceSelector.d.ts +3 -3
  60. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  61. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  62. package/lib/view/companyView/types/cockpitTypes.d.ts +4 -2
  63. package/lib/view/companyView/types/cockpitTypes.js +10 -1
  64. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  65. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  66. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  67. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  68. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  69. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  70. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  71. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  72. package/lib/view/referralView/epics/fetchReferralsEpic.d.ts +7 -0
  73. package/lib/view/referralView/epics/fetchReferralsEpic.js +36 -0
  74. package/lib/view/referralView/epics/fetchRewardsPlanEpic.d.ts +7 -0
  75. package/lib/view/referralView/epics/fetchRewardsPlanEpic.js +41 -0
  76. package/lib/view/referralView/epics/resendReferralInviteEpic.d.ts +8 -0
  77. package/lib/view/referralView/epics/resendReferralInviteEpic.js +39 -0
  78. package/lib/view/referralView/epics/sendReferralInviteEpic.d.ts +8 -0
  79. package/lib/view/referralView/epics/sendReferralInviteEpic.js +44 -0
  80. package/lib/view/referralView/referralPayload.d.ts +43 -0
  81. package/lib/view/referralView/referralPayload.js +33 -0
  82. package/lib/view/referralView/referralReducer.d.ts +23 -0
  83. package/lib/view/referralView/referralReducer.js +167 -0
  84. package/lib/view/referralView/referralSelector.d.ts +23 -0
  85. package/lib/view/referralView/referralSelector.js +88 -0
  86. package/lib/view/referralView/referralState.d.ts +55 -0
  87. package/lib/view/referralView/referralState.js +40 -0
  88. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  89. package/lib/view/reviewCompanyView/fetchReviewCompanyViewEpic.js +1 -1
  90. package/lib/view/reviewCompanyView/reviewCompanyPayload.d.ts +25 -1
  91. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +1 -0
  92. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +31 -8
  93. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +12 -4
  94. package/lib/view/reviewCompanyView/reviewCompanyViewState.js +15 -5
  95. package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +9 -2
  96. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +6 -6
  97. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +3 -2
  98. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +13 -5
  99. package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.js +11 -8
  100. package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +4 -4
  101. package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.js +8 -6
  102. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.d.ts +7 -5
  103. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +37 -6
  104. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +8 -4
  105. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +53 -4
  106. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +21 -11
  107. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +66 -35
  108. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +12 -3
  109. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +31 -14
  110. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +19 -5
  111. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.js +0 -3
  112. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +4 -3
  113. package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.d.ts +0 -10
  114. package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +7 -24
  115. package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.js +2 -5
  116. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +7 -5
  117. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +37 -28
  118. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +27 -18
  119. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +109 -76
  120. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +4 -8
  121. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +42 -40
  122. package/lib/view/scheduleView/scheduleListView/scheduleListState.d.ts +16 -13
  123. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +5 -5
  124. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.js +3 -1
  125. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  126. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  127. package/lib/view/topEx/topExSelector.d.ts +2 -2
  128. package/lib/view/transactionList/transactionListReducer.d.ts +12 -12
  129. package/lib/view/vendorList/vendorListSelector.d.ts +2 -2
  130. package/lib/view/vendorList/vendorListSelector.js +1 -0
  131. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector.d.ts +1 -1
  132. package/package.json +2 -2
@@ -11,17 +11,17 @@ const transactionDetailState_1 = require("../../../transactionDetail/transaction
11
11
  const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetails.match), (0, operators_1.mergeMap)((action) => {
12
12
  var _a;
13
13
  const updateActions = [];
14
- const { tab, selectedJeScheduleDetailId } = action.payload;
14
+ const { scheduleType, selectedJeScheduleDetailId } = action.payload;
15
15
  const { scheduleDetailState } = state$.value;
16
16
  if (selectedJeScheduleDetailId != null) {
17
- if (((_a = scheduleDetailState.editScheduleStateById[selectedJeScheduleDetailId]) === null || _a === void 0 ? void 0 : _a.jeScheduleDetails.length) > 0 &&
17
+ if (((_a = scheduleDetailState.editScheduleStateByDetailId[scheduleType][selectedJeScheduleDetailId]) === null || _a === void 0 ? void 0 : _a.jeScheduleDetails.length) > 0 &&
18
18
  scheduleDetailState.selectedJEScheduleKey != null) {
19
- updateActions.push((0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleDetailState.selectedJEScheduleKey, selectedJeScheduleDetailId));
19
+ updateActions.push((0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleType, scheduleDetailState.selectedJEScheduleKey, selectedJeScheduleDetailId));
20
20
  updateActions.push((0, scheduleDetailReducer_1.updateScheduleDetailsSuccess)());
21
21
  return (0, rxjs_1.from)(updateActions);
22
22
  }
23
23
  const queryParam = {
24
- je_schedule_type: tab,
24
+ je_schedule_type: scheduleType,
25
25
  };
26
26
  return zeniAPI
27
27
  .getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${selectedJeScheduleDetailId}?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
@@ -32,7 +32,7 @@ const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
32
32
  id: transactionData.transaction_id,
33
33
  type: (0, transactionType_1.toTransactionType)(transactionData.transaction_type),
34
34
  });
35
- updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, scheduleDetailReducer_1.updateSelectedJEScheduleKey)({ selectedJEScheduleKey }), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleDetailReducer_1.saveScheduleDetailsSuccessOrFailure)('Not-Started'), (0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(selectedJEScheduleKey, selectedJeScheduleDetailId), (0, scheduleDetailReducer_1.updateScheduleDetailsSuccess)());
35
+ updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, scheduleDetailReducer_1.updateSelectedJEScheduleKey)({ selectedJEScheduleKey }), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleDetailReducer_1.saveScheduleDetailsSuccessOrFailure)('Not-Started'), (0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleType, selectedJEScheduleKey, selectedJeScheduleDetailId), (0, scheduleDetailReducer_1.updateScheduleDetailsSuccess)());
36
36
  return (0, rxjs_1.from)(updateActions);
37
37
  }
38
38
  else {
@@ -45,7 +45,7 @@ const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
45
45
  // Initialize localData
46
46
  }
47
47
  else if (scheduleDetailState.selectedJEScheduleKey != null) {
48
- updateActions.push((0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleDetailState.selectedJEScheduleKey));
48
+ updateActions.push((0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleType, scheduleDetailState.selectedJEScheduleKey));
49
49
  updateActions.push((0, scheduleDetailReducer_1.updateScheduleDetailsSuccess)());
50
50
  }
51
51
  else {
@@ -1,7 +1,8 @@
1
- import { ActionsObservable } from 'redux-observable';
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { fetchAccountList } from '../../../accountList/accountListReducer';
4
4
  import { fetchClassList } from '../../../classList/classListReducer';
5
5
  import { fetchScheduleDetails } from '../scheduleDetailReducer';
6
+ import { RootState } from '../../../../reducer';
6
7
  export declare type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList>;
7
- export declare const fetchScheduleDetailsPageEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
8
+ export declare const fetchScheduleDetailsPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -7,12 +7,20 @@ const accountListReducer_1 = require("../../../accountList/accountListReducer");
7
7
  const classListReducer_1 = require("../../../classList/classListReducer");
8
8
  const scheduleDetailReducer_1 = require("../scheduleDetailReducer");
9
9
  const scheduleListHelper_1 = require("../../scheduleListView/scheduleListHelper");
10
- const fetchScheduleDetailsPageEpic = (actions$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetailsPage.match), (0, operators_1.mergeMap)((action) => {
10
+ const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetailsPage.match), (0, operators_1.mergeMap)((action) => {
11
11
  const scheduleDetailsActions = [];
12
- const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)('prepaid_expenses');
13
- scheduleDetailsActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
14
- scheduleDetailsActions.push((0, classListReducer_1.fetchClassList)());
15
- scheduleDetailsActions.push((0, scheduleDetailReducer_1.fetchScheduleDetails)(action.payload.tab, action.payload.selectedJeScheduleDetailId));
12
+ const accountType = (0, scheduleListHelper_1.getAccountsTypesForScheduleEpics)();
13
+ const accountListState = state$.value.accountListState;
14
+ const classListState = state$.value.classListState;
15
+ if (accountListState.byReportId[accountType.accountListKey].fetchState ===
16
+ 'Not-Started') {
17
+ // call this only if the account list for schedules is not fetched already
18
+ scheduleDetailsActions.push((0, accountListReducer_1.fetchAccountList)(accountType.accountListKey, true, false, false, false, accountType.allowedAccountList));
19
+ }
20
+ if (classListState.fetchState === 'Not-Started') {
21
+ scheduleDetailsActions.push((0, classListReducer_1.fetchClassList)());
22
+ }
23
+ scheduleDetailsActions.push((0, scheduleDetailReducer_1.fetchScheduleDetails)(action.payload.scheduleType, action.payload.selectedJeScheduleDetailId));
16
24
  return (0, rxjs_1.concat)((0, rxjs_1.from)(scheduleDetailsActions));
17
25
  }));
18
26
  exports.fetchScheduleDetailsPageEpic = fetchScheduleDetailsPageEpic;
@@ -10,20 +10,23 @@ const initializeScheduleDetailLocalDataEpic = (actions$, state$) => actions$.pip
10
10
  const state = state$.value;
11
11
  const { scheduleDetailState } = state;
12
12
  const actions = [];
13
- const { selectedJeScheduleDetailId, selectedJEScheduleKey } = action.payload;
13
+ const { selectedJeScheduleDetailId, selectedJEScheduleKey, scheduleType } = action.payload;
14
14
  const jeScheduleTransactionState = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleKey)(selectedJEScheduleKey, state);
15
15
  if (selectedJeScheduleDetailId != null) {
16
16
  const scheduledJournalEntry = jeScheduleTransactionState.scheduledJournalEntry;
17
- if (selectedJEScheduleKey != null) {
18
- actions.push((0, scheduleDetailReducer_1.updateScheduleDetailsLocalData)({
19
- selectedJeScheduleDetailId,
20
- localData: Object.assign(Object.assign({}, scheduleDetailReducer_1.initialScheduleDetailsLocalData), (0, scheduleDetailLocalDataHelper_1.getInitializedJEScheduleDetailsLocalData)(jeScheduleTransactionState, scheduledJournalEntry)),
21
- }));
22
- }
17
+ const initLocalData = scheduleType !== 'fixed_assets'
18
+ ? (0, scheduleDetailLocalDataHelper_1.getInitializedJEScheduleDetailsLocalData)(scheduleType, jeScheduleTransactionState, scheduledJournalEntry)
19
+ : (0, scheduleDetailLocalDataHelper_1.getInitializedFixedAssetsJEScheduleDetailsLocalData)(jeScheduleTransactionState, scheduledJournalEntry);
20
+ actions.push((0, scheduleDetailReducer_1.updateScheduleDetailsLocalData)({
21
+ scheduleType,
22
+ selectedJeScheduleDetailId,
23
+ localData: Object.assign(Object.assign({}, scheduleDetailReducer_1.initialScheduleDetailsLocalData[scheduleType]), initLocalData),
24
+ }));
23
25
  }
24
26
  else {
25
27
  actions.push((0, scheduleDetailReducer_1.updateScheduleDetailsLocalData)({
26
- localData: Object.assign({}, scheduleDetailState.newScheduleState),
28
+ scheduleType,
29
+ localData: Object.assign({}, scheduleDetailState.newScheduleState[scheduleType]),
27
30
  selectedJeScheduleDetailId: undefined,
28
31
  }));
29
32
  }
@@ -13,7 +13,7 @@ const saveScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
13
13
  var _a;
14
14
  const state = state$.value;
15
15
  const { scheduleDetailState, scheduleListState } = state;
16
- const { selectedJeScheduleDetailId } = action.payload;
16
+ const { selectedJeScheduleDetailId, scheduleType } = action.payload;
17
17
  const selectedJEScheduleKey = scheduleDetailState.selectedJEScheduleKey;
18
18
  const actions = [];
19
19
  if (selectedJEScheduleKey == null) {
@@ -23,8 +23,8 @@ const saveScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
23
23
  const vendorName = jeScheduleTransactionState.vendor.name;
24
24
  const scheduleDetailId = (_a = jeScheduleTransactionState.jeScheduleId) !== null && _a !== void 0 ? _a : selectedJeScheduleDetailId;
25
25
  const scheduleDetailsUpdated = scheduleDetailId != null
26
- ? state.scheduleDetailState.editScheduleStateById[scheduleDetailId]
27
- : state.scheduleDetailState.newScheduleState;
26
+ ? state.scheduleDetailState.editScheduleStateByDetailId[scheduleType][scheduleDetailId]
27
+ : state.scheduleDetailState.newScheduleState[scheduleType];
28
28
  const currentTab = scheduleListState.currentTab;
29
29
  const payload = Object.assign({}, (0, scheduleDetailPayload_1.prepareScheduleDetailPayload)(state, scheduleDetailsUpdated, selectedJEScheduleKey, currentTab));
30
30
  const queryParam = {
@@ -52,7 +52,7 @@ const saveScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
52
52
  }));
53
53
  return (0, rxjs_1.from)(actions);
54
54
  }
55
- actions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(selectedJEScheduleKey, jeScheduleDetailID), (0, scheduleDetailReducer_1.saveScheduleDetailsSuccessOrFailure)('Completed'), (0, snackbarReducer_1.openSnackbar)({
55
+ actions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleType, selectedJEScheduleKey, jeScheduleDetailID), (0, scheduleDetailReducer_1.saveScheduleDetailsSuccessOrFailure)('Completed'), (0, snackbarReducer_1.openSnackbar)({
56
56
  messageSection: scheduleDetailId != null
57
57
  ? 'save_schedule'
58
58
  : 'create_schedule',
@@ -12,19 +12,21 @@ const updateAmountsInScheduleDetailEpic = (actions$, state$) => actions$.pipe((0
12
12
  const state = state$.value;
13
13
  const { scheduleDetailState } = state;
14
14
  const selectedJEScheduleKey = scheduleDetailState.selectedJEScheduleKey;
15
+ const scheduleType = action.payload.scheduleType;
15
16
  if (selectedJEScheduleKey != null) {
16
17
  const jeScheduleTransactionState = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleKey)(selectedJEScheduleKey, state);
17
18
  const jeScheduleDetailId = action.payload.jeScheduleDetailId;
18
19
  const totalAmount = jeScheduleTransactionState.baseTransaction.amount.amount;
19
20
  const jeScheduleLocalDataUpdated = jeScheduleDetailId != null
20
- ? (0, scheduleDetailLocalDataHelper_1.updateAmountsInScheduleDetails)(scheduleDetailState.editScheduleStateById[jeScheduleDetailId]
21
- .jeScheduleDetails, (_a = scheduleDetailState.editScheduleStateById[jeScheduleDetailId]
22
- .selectedMonths) !== null && _a !== void 0 ? _a : 0, action.payload.rowId, totalAmount)
23
- : (0, scheduleDetailLocalDataHelper_1.updateAmountsInScheduleDetails)(scheduleDetailState.newScheduleState.jeScheduleDetails, (_b = scheduleDetailState.newScheduleState.selectedMonths) !== null && _b !== void 0 ? _b : 0, action.payload.rowId, totalAmount);
21
+ ? (0, scheduleDetailLocalDataHelper_1.updateAmountsInScheduleDetails)(scheduleDetailState.editScheduleStateByDetailId[scheduleType][jeScheduleDetailId].jeScheduleDetails, (_a = scheduleDetailState.editScheduleStateByDetailId[scheduleType][jeScheduleDetailId].selectedMonths) !== null && _a !== void 0 ? _a : 0, action.payload.rowId, totalAmount)
22
+ : (0, scheduleDetailLocalDataHelper_1.updateAmountsInScheduleDetails)(scheduleDetailState.newScheduleState[scheduleType]
23
+ .jeScheduleDetails, (_b = scheduleDetailState.newScheduleState[scheduleType]
24
+ .selectedMonths) !== null && _b !== void 0 ? _b : 0, action.payload.rowId, totalAmount);
24
25
  const originalLocalData = jeScheduleDetailId != null
25
- ? scheduleDetailState.editScheduleStateById[jeScheduleDetailId]
26
- : scheduleDetailState.newScheduleState;
26
+ ? scheduleDetailState.editScheduleStateByDetailId[scheduleType][jeScheduleDetailId]
27
+ : scheduleDetailState.newScheduleState[scheduleType];
27
28
  actions.push((0, scheduleDetailReducer_1.updateScheduleDetailsLocalData)({
29
+ scheduleType,
28
30
  selectedJeScheduleDetailId: jeScheduleDetailId,
29
31
  localData: Object.assign(Object.assign({}, originalLocalData), { jeScheduleDetails: jeScheduleLocalDataUpdated }),
30
32
  }));
@@ -1,18 +1,20 @@
1
1
  import { Amount } from '../../../commonStateTypes/amount';
2
2
  import { JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
3
- import { JEScheduleDetailsLocalData, JETransactionLink, ScheduleDetailsLocalData } from './scheduleDetailState';
3
+ import { JEScheduleDetailsLocalData, JETransactionLink, ScheduleDetailsLocalData, ScheduleDetailsLocalDataFixedAssets } from './scheduleDetailState';
4
4
  import ZeniUrl from '../../../zeniUrl';
5
5
  import { ZeniDate } from '../../../zeniDayJS';
6
- import { ScheduleJournalEntryStatusCodeType, SchedulesTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
+ import { ScheduleJournalEntryStatusCodeType, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
7
7
  import { TransactionID } from '../../../entity/transaction/stateTypes/transaction';
8
8
  import { AccountType } from '../../../entity/account/accountState';
9
+ import { JEScheduleOtherAttributes } from '../../../entity/jeSchedules/jeSchedulesState';
9
10
  export declare const DUMMY_TRANSACTION_ID = "dummyid";
10
11
  export declare const getPostingDateAndStatusForIndex: (schedulePostingMonth: number, schedulePostingYear: number, postingDay?: 2 | 1 | 22 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | undefined) => {
11
12
  postingDate: ZeniDate;
12
13
  postingStatus: ScheduleJournalEntryStatusCodeType;
13
14
  };
14
- export declare const createNewSchedulesHelper: (localData: ScheduleDetailsLocalData, totalAmount: Amount, vendorName: string) => JEScheduleDetailsLocalData[];
15
- export declare const getInitializedJEScheduleDetailsLocalData: (jeScheduleTransactionState: JEScheduledTransaction, scheduleJournalEntryData: ScheduledJournalEntry[]) => ScheduleDetailsLocalData;
15
+ export declare const createNewSchedulesHelper: (localData: ScheduleDetailsLocalData, totalAmount: Amount, vendorName: string, otherAttributes?: JEScheduleOtherAttributes | undefined) => JEScheduleDetailsLocalData[];
16
+ export declare const getInitializedJEScheduleDetailsLocalData: (scheduleType: ScheduleTypes, jeScheduleTransactionState: JEScheduledTransaction, scheduleJournalEntryData: ScheduledJournalEntry[]) => ScheduleDetailsLocalData;
17
+ export declare const getInitializedFixedAssetsJEScheduleDetailsLocalData: (jeScheduleTransactionState: JEScheduledTransaction, scheduleJournalEntryData: ScheduledJournalEntry[]) => ScheduleDetailsLocalDataFixedAssets;
16
18
  export declare const updateAmountsInScheduleDetails: (jeSchedulesLocalData: JEScheduleDetailsLocalData[], actualPeriod: number, rowId: number, totalAmount: number) => JEScheduleDetailsLocalData[];
17
19
  export declare const getQBOUrlForLink: (qboAppUrl: string, jeLink?: JETransactionLink | undefined) => ZeniUrl | undefined;
18
20
  export declare const getThirdPartyIDFromQBOURL: (jeLinkURL: ZeniUrl) => JETransactionLink;
@@ -22,4 +24,4 @@ export declare const getJETransactionLinkFromThirdPartyId: (thirdPartyID?: strin
22
24
  * @param scheduleType
23
25
  * @returns
24
26
  */
25
- export declare const getAccountsTypesForScheduleDetails: (scheduleType: SchedulesTypes) => AccountType[];
27
+ export declare const getAccountsTypesForScheduleDetails: (scheduleType: ScheduleTypes) => AccountType[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAccountsTypesForScheduleDetails = exports.getJETransactionLinkFromThirdPartyId = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updateAmountsInScheduleDetails = exports.getInitializedJEScheduleDetailsLocalData = exports.createNewSchedulesHelper = exports.getPostingDateAndStatusForIndex = exports.DUMMY_TRANSACTION_ID = void 0;
3
+ exports.getAccountsTypesForScheduleDetails = exports.getJETransactionLinkFromThirdPartyId = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updateAmountsInScheduleDetails = exports.getInitializedFixedAssetsJEScheduleDetailsLocalData = exports.getInitializedJEScheduleDetailsLocalData = exports.createNewSchedulesHelper = exports.getPostingDateAndStatusForIndex = exports.DUMMY_TRANSACTION_ID = void 0;
4
4
  const amount_1 = require("../../../commonStateTypes/amount");
5
5
  const zeniUrl_1 = require("../../../zeniUrl");
6
6
  const zeniDayJS_1 = require("../../../zeniDayJS");
@@ -23,10 +23,11 @@ const getPostingDateAndStatusForIndex = function (schedulePostingMonth, schedule
23
23
  };
24
24
  };
25
25
  exports.getPostingDateAndStatusForIndex = getPostingDateAndStatusForIndex;
26
- const getScheduleMemo = (vendorName, schedulePostingDate, currentPeriod, totalPeriod) => {
27
- return `${vendorName} - ${schedulePostingDate.format(formatZeniDateFY_1.MONTH_YEAR_FORMAT)} (${currentPeriod} of ${totalPeriod})`;
26
+ const getScheduleMemo = (vendorName, schedulePostingDate, currentPeriod, totalPeriod, otherAttributes) => {
27
+ const addAsset = (otherAttributes === null || otherAttributes === void 0 ? void 0 : otherAttributes.assetId) != null ? ` - ${otherAttributes.assetId}` : '';
28
+ return `${vendorName} - ${schedulePostingDate.format(formatZeniDateFY_1.MONTH_YEAR_FORMAT)} (${currentPeriod} of ${totalPeriod})${addAsset}`;
28
29
  };
29
- const createNewSchedulesHelper = (localData, totalAmount, vendorName) => {
30
+ const createNewSchedulesHelper = (localData, totalAmount, vendorName, otherAttributes) => {
30
31
  const period = localData.selectedMonths;
31
32
  const startingMonth = localData.selectedDate;
32
33
  if (startingMonth == null) {
@@ -58,7 +59,7 @@ const createNewSchedulesHelper = (localData, totalAmount, vendorName) => {
58
59
  amount: (0, amount_1.toAmount)(negativeNumbers ? -amount : amount, totalAmount.currencyCode, totalAmount.currencySymbol),
59
60
  runningBalance: (0, amount_1.toAmount)(negativeNumbers ? -runningBalance : runningBalance, totalAmount.currencyCode, totalAmount.currencySymbol),
60
61
  postingStatus,
61
- memo: getScheduleMemo(vendorName, schedulePostingDate, index + 1, period),
62
+ memo: getScheduleMemo(vendorName, schedulePostingDate, index + 1, period, otherAttributes),
62
63
  jeLink: {
63
64
  type: 'unknown',
64
65
  },
@@ -67,7 +68,7 @@ const createNewSchedulesHelper = (localData, totalAmount, vendorName) => {
67
68
  return newSchedulesData;
68
69
  };
69
70
  exports.createNewSchedulesHelper = createNewSchedulesHelper;
70
- const getInitializedJEScheduleDetailsLocalData = (jeScheduleTransactionState, scheduleJournalEntryData) => {
71
+ const getInitializedJEScheduleDetailsLocalData = (scheduleType, jeScheduleTransactionState, scheduleJournalEntryData) => {
71
72
  var _a, _b;
72
73
  const jeScheduleDetailsLocalData = scheduleJournalEntryData.map((schedule) => {
73
74
  var _a, _b, _c, _d;
@@ -82,6 +83,7 @@ const getInitializedJEScheduleDetailsLocalData = (jeScheduleTransactionState, sc
82
83
  });
83
84
  const { startDate, period, jeDebit, dayOfPostingDate, lastDayOfMonth } = jeScheduleTransactionState;
84
85
  return {
86
+ scheduleType,
85
87
  jeScheduleDetails: jeScheduleDetailsLocalData,
86
88
  selectedDate: startDate,
87
89
  selectedMonths: period,
@@ -92,6 +94,34 @@ const getInitializedJEScheduleDetailsLocalData = (jeScheduleTransactionState, sc
92
94
  };
93
95
  };
94
96
  exports.getInitializedJEScheduleDetailsLocalData = getInitializedJEScheduleDetailsLocalData;
97
+ const getInitializedFixedAssetsJEScheduleDetailsLocalData = (jeScheduleTransactionState, scheduleJournalEntryData) => {
98
+ var _a, _b, _c, _d;
99
+ const jeScheduleDetailsLocalData = scheduleJournalEntryData.map((schedule) => {
100
+ var _a, _b, _c, _d;
101
+ return {
102
+ postingDate: schedule.expectedPostDate,
103
+ amount: (0, amount_1.toAmount)(schedule.amount ? schedule.amount.amount : 0, (_a = schedule.currencyCode) !== null && _a !== void 0 ? _a : 'USD', (_b = schedule.currencySymbol) !== null && _b !== void 0 ? _b : '$'),
104
+ runningBalance: (0, amount_1.toAmount)(schedule.runningBalance ? schedule.runningBalance.amount : 0, (_c = schedule.currencyCode) !== null && _c !== void 0 ? _c : 'USD', (_d = schedule.currencySymbol) !== null && _d !== void 0 ? _d : '$'),
105
+ postingStatus: schedule.status.code,
106
+ memo: schedule.memo,
107
+ jeLink: (0, exports.getJETransactionLinkFromThirdPartyId)(schedule.thirdPartyID, schedule.transactionID, schedule.recommendedTransactionID),
108
+ };
109
+ });
110
+ const { startDate, period, jeDebit, dayOfPostingDate, lastDayOfMonth, jeCredit, otherAttributes, } = jeScheduleTransactionState;
111
+ return {
112
+ scheduleType: 'fixed_assets',
113
+ jeScheduleDetails: jeScheduleDetailsLocalData,
114
+ selectedDate: startDate,
115
+ selectedMonths: period,
116
+ selectedAccount: (_a = jeDebit.account) === null || _a === void 0 ? void 0 : _a.accountId,
117
+ selectedClass: (_b = jeDebit.accountingClass) === null || _b === void 0 ? void 0 : _b.classId,
118
+ selectedAccumulatedDepreciationCategory: (_c = jeCredit.account) === null || _c === void 0 ? void 0 : _c.accountId,
119
+ selectedDayOfMonth: dayOfPostingDate,
120
+ assetId: (_d = otherAttributes.assetId) !== null && _d !== void 0 ? _d : undefined,
121
+ lastDayOfMonth: lastDayOfMonth,
122
+ };
123
+ };
124
+ exports.getInitializedFixedAssetsJEScheduleDetailsLocalData = getInitializedFixedAssetsJEScheduleDetailsLocalData;
95
125
  const updateAmountsInScheduleDetails = (jeSchedulesLocalData, actualPeriod, rowId, totalAmount) => {
96
126
  const updatedAmount = Math.abs(jeSchedulesLocalData[rowId].amount.amount);
97
127
  const absTotalAmount = Math.abs(totalAmount);
@@ -196,6 +226,7 @@ exports.getJETransactionLinkFromThirdPartyId = getJETransactionLinkFromThirdPart
196
226
  const getAccountsTypesForScheduleDetails = (scheduleType) => {
197
227
  switch (scheduleType) {
198
228
  case 'prepaid_expenses':
229
+ case 'fixed_assets':
199
230
  return ['cogs', 'expenses', 'other_expense'];
200
231
  default:
201
232
  return [];
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../../reducer';
2
- import { JEScheduleDetailsLocalData, ScheduleDetailsLocalData } from './scheduleDetailState';
3
- import { JEScheduleKey, SchedulesTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
2
+ import { JEScheduleDetailsLocalData, ScheduleDetailsLocalData, ScheduleDetailsLocalDataFixedAssets } from './scheduleDetailState';
3
+ import { JEScheduleKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
4
  import { VendorBasePayload } from '../../../entity/vendor/vendorPayload';
5
5
  import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
6
6
  import { Vendor, VendorState } from '../../../entity/vendor/vendorState';
@@ -9,6 +9,7 @@ import { AccountBasePayload } from '../../../entity/account/accountPayload';
9
9
  import { ClassBasePayload } from '../../../entity/class/classPayload';
10
10
  import { TransactionIDPayload } from '../../../entity/transaction/payloadTypes/transactionIDPayload';
11
11
  import { StatusCodeWithLabelPayload } from '../../../commonPayloadTypes/statusPayload';
12
+ import { JEScheduleOtherAttributesPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
12
13
  export declare type BaseScheduleTransactionPayload = SaveScheduleTransactionPayload;
13
14
  export interface JESchedulePayload {
14
15
  status: StatusCodeWithLabelPayload;
@@ -26,6 +27,7 @@ export interface JESchedulePayload {
26
27
  je_credit_account_id: string | null;
27
28
  je_debit_account_id: string | null;
28
29
  je_debit_accounting_class_id: string | null;
30
+ other_attributes: JEScheduleOtherAttributesPayload;
29
31
  }
30
32
  export interface SaveJESchedulePayload {
31
33
  status: StatusCodeWithLabelPayload;
@@ -46,6 +48,7 @@ export interface SaveScheduleTransactionPayload extends TransactionIDPayload, Om
46
48
  transaction_date: string | null;
47
49
  total_amount: number | null;
48
50
  transaction_memo: string | null;
51
+ line_id: string | null;
49
52
  }
50
53
  export interface SaveScheduleDetailPayload {
51
54
  je_schedules: JESchedulePayload[];
@@ -54,5 +57,6 @@ export interface SaveScheduleDetailPayload {
54
57
  export declare const mapVendorToVendorPayload: (payload: Vendor) => VendorBasePayload;
55
58
  export declare const mapScheduleTransactionToBaseScheduleTransactionPayload: (payload: ScheduleTransaction) => BaseScheduleTransactionPayload;
56
59
  export declare const mapJEScheduleLocalDataToScheduleDetailPayload: (jeScheduleDetails: JEScheduleDetailsLocalData[], jeScheduleTransactionState: JEScheduledTransaction) => SaveJESchedulePayload[];
57
- export declare const mapJEScheduleTransactionToPayload: (jeScheduleTransactionState: JEScheduledTransaction, vendorState: VendorState, scheduleDetailsLocalData: ScheduleDetailsLocalData, jeScheduleType: SchedulesTypes) => JESchedulePayload;
58
- export declare const prepareScheduleDetailPayload: (state: RootState, scheduleDetailsLocalData: ScheduleDetailsLocalData, selectedJEScheduleKey: JEScheduleKey, jeScheduleType: SchedulesTypes) => SaveScheduleDetailPayload;
60
+ export declare const mapJEScheduleTransactionToPayload: (jeScheduleTransactionState: JEScheduledTransaction, vendorState: VendorState, scheduleDetailsLocalData: ScheduleDetailsLocalData, jeScheduleType: ScheduleTypes) => JESchedulePayload;
61
+ export declare const mapFixedAssetJEScheduleTransactionToPayload: (jeScheduleTransactionState: JEScheduledTransaction, vendorState: VendorState, scheduleDetailsLocalData: ScheduleDetailsLocalDataFixedAssets) => JESchedulePayload;
62
+ export declare const prepareScheduleDetailPayload: (state: RootState, scheduleDetailsLocalData: ScheduleDetailsLocalData, selectedJEScheduleKey: JEScheduleKey, jeScheduleType: ScheduleTypes) => SaveScheduleDetailPayload;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prepareScheduleDetailPayload = exports.mapJEScheduleTransactionToPayload = exports.mapJEScheduleLocalDataToScheduleDetailPayload = exports.mapScheduleTransactionToBaseScheduleTransactionPayload = exports.mapVendorToVendorPayload = void 0;
3
+ exports.prepareScheduleDetailPayload = exports.mapFixedAssetJEScheduleTransactionToPayload = exports.mapJEScheduleTransactionToPayload = exports.mapJEScheduleLocalDataToScheduleDetailPayload = exports.mapScheduleTransactionToBaseScheduleTransactionPayload = exports.mapVendorToVendorPayload = void 0;
4
4
  const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
5
5
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
6
6
  const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
@@ -17,6 +17,7 @@ const mapScheduleTransactionToBaseScheduleTransactionPayload = (payload) => {
17
17
  transaction_date: payload.date.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT),
18
18
  total_amount: payload.amount.amount,
19
19
  third_party_transaction_id: payload.thirdPartyTransactionId,
20
+ line_id: payload.lineId,
20
21
  transaction_memo: payload.memo,
21
22
  account_id: payload.account.accountId,
22
23
  accounting_class_id: payload.classBase != null ? payload.classBase.classId : '',
@@ -98,10 +99,53 @@ const mapJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorSta
98
99
  je_credit_account_id: baseTransaction.account.accountId,
99
100
  je_debit_account_id: selectedAccount !== null && selectedAccount !== void 0 ? selectedAccount : null,
100
101
  je_debit_accounting_class_id: selectedClass !== null && selectedClass !== void 0 ? selectedClass : null,
102
+ other_attributes: {},
101
103
  base_transaction: (0, exports.mapScheduleTransactionToBaseScheduleTransactionPayload)(baseTransaction),
102
104
  };
103
105
  };
104
106
  exports.mapJEScheduleTransactionToPayload = mapJEScheduleTransactionToPayload;
107
+ const mapFixedAssetJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorState, scheduleDetailsLocalData) => {
108
+ var _a, _b;
109
+ const { vendor, currencyCode, currencySymbol, baseTransaction, status, startDate, endDate, balanceAsOfToday, } = jeScheduleTransactionState;
110
+ const { selectedMonths, selectedAccount, selectedClass, selectedDayOfMonth, lastDayOfMonth, selectedAccumulatedDepreciationCategory, assetId, } = scheduleDetailsLocalData;
111
+ const postingDate = selectedDayOfMonth !== null && selectedDayOfMonth !== void 0 ? selectedDayOfMonth : (lastDayOfMonth != null ? timePeriod_1.LAST_SCHEDULE_DAY_OF_MONTH : null);
112
+ const scheduleLength = scheduleDetailsLocalData.jeScheduleDetails.length;
113
+ const firstJEScheduleDate = scheduleLength > 0
114
+ ? scheduleDetailsLocalData.jeScheduleDetails[0].postingDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)
115
+ : null;
116
+ const lastJEScheduleDate = scheduleLength > 0
117
+ ? scheduleDetailsLocalData.jeScheduleDetails[scheduleLength - 1].postingDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)
118
+ : null;
119
+ const vendorID = vendor.id;
120
+ const vendorDetails = vendorState.vendorByID[vendorID];
121
+ return {
122
+ status,
123
+ vendor: (0, exports.mapVendorToVendorPayload)(vendorDetails),
124
+ currency_code: currencyCode,
125
+ currency_symbol: currencySymbol,
126
+ period: selectedMonths !== null && selectedMonths !== void 0 ? selectedMonths : null,
127
+ je_schedule_type: 'fixed_assets',
128
+ posting_date: postingDate,
129
+ balance: balanceAsOfToday != null
130
+ ? balanceAsOfToday.amount
131
+ : baseTransaction.amount.amount,
132
+ start_date: (_a = startDate === null || startDate === void 0 ? void 0 : startDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _a !== void 0 ? _a : firstJEScheduleDate,
133
+ end_date: (_b = endDate === null || endDate === void 0 ? void 0 : endDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _b !== void 0 ? _b : lastJEScheduleDate,
134
+ je_credit_accounting_class_id: baseTransaction.classBase
135
+ ? baseTransaction.classBase.classId
136
+ : null,
137
+ je_credit_account_id: selectedAccumulatedDepreciationCategory !== null && selectedAccumulatedDepreciationCategory !== void 0 ? selectedAccumulatedDepreciationCategory : null,
138
+ je_debit_account_id: selectedAccount !== null && selectedAccount !== void 0 ? selectedAccount : null,
139
+ je_debit_accounting_class_id: selectedClass !== null && selectedClass !== void 0 ? selectedClass : null,
140
+ other_attributes: assetId != null
141
+ ? {
142
+ asset_id: assetId,
143
+ }
144
+ : {},
145
+ base_transaction: (0, exports.mapScheduleTransactionToBaseScheduleTransactionPayload)(baseTransaction),
146
+ };
147
+ };
148
+ exports.mapFixedAssetJEScheduleTransactionToPayload = mapFixedAssetJEScheduleTransactionToPayload;
105
149
  const prepareScheduleDetailPayload = (state, scheduleDetailsLocalData, selectedJEScheduleKey, jeScheduleType) => {
106
150
  const payload = {
107
151
  je_schedules: [],
@@ -110,9 +154,14 @@ const prepareScheduleDetailPayload = (state, scheduleDetailsLocalData, selectedJ
110
154
  const jeScheduleTransactionState = (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleKey)(selectedJEScheduleKey, state);
111
155
  const { vendorState } = state;
112
156
  const jeScheduleDetailsLocalData = scheduleDetailsLocalData.jeScheduleDetails;
113
- payload.je_schedules = [
114
- (0, exports.mapJEScheduleTransactionToPayload)(jeScheduleTransactionState, vendorState, scheduleDetailsLocalData, jeScheduleType),
115
- ];
157
+ payload.je_schedules =
158
+ jeScheduleType !== 'fixed_assets'
159
+ ? [
160
+ (0, exports.mapJEScheduleTransactionToPayload)(jeScheduleTransactionState, vendorState, scheduleDetailsLocalData, jeScheduleType),
161
+ ]
162
+ : [
163
+ (0, exports.mapFixedAssetJEScheduleTransactionToPayload)(jeScheduleTransactionState, vendorState, scheduleDetailsLocalData),
164
+ ];
116
165
  payload.scheduled_journal_entries =
117
166
  (0, exports.mapJEScheduleLocalDataToScheduleDetailPayload)(jeScheduleDetailsLocalData, jeScheduleTransactionState);
118
167
  return payload;
@@ -1,47 +1,57 @@
1
- import { ScheduleDetailsLocalData, ScheduleDetailViewState } from './scheduleDetailState';
2
- import { JEScheduleKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
1
+ import { ScheduleDetailsLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailViewState } from './scheduleDetailState';
2
+ import { JEScheduleKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
3
3
  import { FetchState, ID } from '../../../commonStateTypes/common';
4
4
  import { ZeniAPIStatus } from '../../../responsePayload';
5
5
  import ZeniUrl from '../../../zeniUrl';
6
6
  import { ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
7
- export declare const initialScheduleDetailsLocalData: ScheduleDetailsLocalData;
7
+ export declare const initialScheduleDetailsLocalData: Record<ScheduleTypes, ScheduleDetailsLocalData | ScheduleDetailsLocalDataFixedAssets>;
8
8
  export declare const initialState: ScheduleDetailViewState;
9
- export declare const createNewSchedules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchScheduleDetailsPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tab: "prepaid_expenses" | "fixed_assets" | "accured_expenses" | "deferred_revenue", selectedJeScheduleDetailId?: string | undefined], {
10
- tab: "prepaid_expenses" | "fixed_assets" | "accured_expenses" | "deferred_revenue";
9
+ export declare const createNewSchedules: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
+ scheduleType: ScheduleTypes;
11
+ }, string>, fetchScheduleDetailsPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedJeScheduleDetailId?: string | undefined], {
12
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
11
13
  selectedJeScheduleDetailId: string | undefined;
12
- }, string, never, never>, fetchScheduleDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tab: "prepaid_expenses" | "fixed_assets" | "accured_expenses" | "deferred_revenue", selectedJeScheduleDetailId?: string | undefined], {
13
- tab: "prepaid_expenses" | "fixed_assets" | "accured_expenses" | "deferred_revenue";
14
+ }, string, never, never>, fetchScheduleDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedJeScheduleDetailId?: string | undefined], {
15
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
14
16
  selectedJeScheduleDetailId: string | undefined;
15
17
  }, string, never, never>, updateScheduleDetailsSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateScheduleDetailsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
18
  error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
17
- }, string>, saveScheduleDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedJeScheduleDetailId?: string | undefined], {
19
+ }, string>, saveScheduleDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedJeScheduleDetailId?: string | undefined], {
20
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
18
21
  selectedJeScheduleDetailId: string | undefined;
19
22
  }, string, never, never>, saveScheduleDetailsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
20
23
  fetchState: FetchState;
21
24
  error: ZeniAPIStatus<Record<string, unknown>> | undefined;
22
- }, string, never, never>, initializeScheduleDetailLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedJEScheduleKey: `${string}_expense` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`, selectedJeScheduleDetailId?: string | undefined], {
25
+ }, string, never, never>, initializeScheduleDetailLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedJEScheduleKey: `${string}_expense` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`, selectedJeScheduleDetailId?: string | undefined], {
26
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
23
27
  selectedJEScheduleKey: `${string}_expense` | `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_check` | `${string}_bill` | `${string}_bill_payment` | `${string}_bill_payment_check` | `${string}_bill_payment_credit_card` | `${string}_vendor_credit` | `${string}_credit_card_credit` | `${string}_transfer` | `${string}_credit_card_payment` | `${string}_deposit` | `${string}_journal_entry`;
24
28
  selectedJeScheduleDetailId: string | undefined;
25
29
  }, string, never, never>, updateScheduleDetailsLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
30
+ scheduleType: ScheduleTypes;
26
31
  selectedJeScheduleDetailId?: string | undefined;
27
32
  localData: Partial<ScheduleDetailsLocalData>;
28
33
  }, string>, updatedJELinkInLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
34
+ scheduleType: ScheduleTypes;
29
35
  jeScheduleDetailId: ID;
30
36
  rowId: number;
31
37
  jeLink: ZeniUrl;
32
- }, string>, updateAmountsInScheduleDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[rowId: number, jeScheduleDetailId?: string | undefined], {
38
+ }, string>, updateAmountsInScheduleDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", rowId: number, jeScheduleDetailId?: string | undefined], {
39
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
33
40
  rowId: number;
34
41
  jeScheduleDetailId: string | undefined;
35
- }, string, never, never>, updateScheduleDetailNewStateLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedJeScheduleDetailId: string], {
42
+ }, string, never, never>, updateScheduleDetailNewStateLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedJeScheduleDetailId: string], {
43
+ scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
36
44
  selectedJeScheduleDetailId: string;
37
45
  }, string, never, never>, updateSelectedJEScheduleKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
38
46
  selectedJEScheduleKey: JEScheduleKey;
39
47
  }, string>, updatedSelectedJELinkRowIndex: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
40
48
  selectedJELinkRowIndex: number;
41
49
  }, string>, updatedJELinkWithRecommendedLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
50
+ scheduleType: ScheduleTypes;
42
51
  jeScheduleDetailId: ID;
43
52
  rowId: number;
44
53
  }, string>, resetJELinkInLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
54
+ scheduleType: ScheduleTypes;
45
55
  jeScheduleDetailId: ID;
46
56
  rowId: number;
47
57
  originalScheduledJE: ScheduledJournalEntry;