@zeniai/client-epic-state 4.14.9 → 4.14.11

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.
@@ -2,9 +2,9 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ZeniAPI } from '../../../../zeniAPI';
4
4
  import { RootState } from '../../../../reducer';
5
- import { updateJeScheduleTransactionKeys, removeFailedJeScheduleTransactionKey, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess } from '../../reducers/jeSchedulesViewReducer';
5
+ import { removeFailedJeScheduleTransactionKey, removeJeScheduleLocalDataById, retryJeSchedule, retryJeScheduleFailure, retryJeScheduleSuccess, updateJeScheduleTransactionKeys } from '../../reducers/jeSchedulesViewReducer';
6
6
  import { updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
7
7
  import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
8
8
  import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
9
- export declare type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateJeScheduleTransactionKeys>;
9
+ export declare type ActionType = ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof openSnackbar> | ReturnType<typeof removeFailedJeScheduleTransactionKey> | ReturnType<typeof removeJeScheduleLocalDataById> | ReturnType<typeof retryJeSchedule> | ReturnType<typeof retryJeScheduleFailure> | ReturnType<typeof retryJeScheduleSuccess> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails> | ReturnType<typeof updateJeScheduleTransactionKeys>;
10
10
  export declare const retryJeScheduleEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -27,7 +27,8 @@ const retryJeScheduleEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
27
27
  const updateActions = [];
28
28
  updateActions.push((0, jeSchedulesViewReducer_1.retryJeScheduleSuccess)({
29
29
  scheduledJournalEntryID,
30
- }), (0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod), (0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
30
+ }), (0, jeSchedulesViewReducer_1.removeFailedJeScheduleTransactionKey)(jeScheduleTransactionKey, selectedPeriod), (0, jeSchedulesViewReducer_1.removeJeScheduleLocalDataById)({ scheduledJournalEntryID }), // Important to remove localdata after success.
31
+ (0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
31
32
  tenantId: currentTenant.tenantId,
32
33
  period: selectedPeriod,
33
34
  refreshViewInBackground: true,
@@ -5,36 +5,38 @@ import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedule
5
5
  import { ZeniAPIStatus } from '../../../responsePayload';
6
6
  import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
7
7
  export declare const initialState: JESchedulesViewState;
8
- export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
8
+ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, fetchJeSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
9
9
  period: TimePeriod;
10
10
  refreshViewInBackground: any;
11
11
  }, string, never, never>, fetchJeSchedulesFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
12
12
  selectedPeriod: MonthYearPeriod;
13
13
  status: ZeniAPIStatus;
14
- }, string>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
14
+ }, string>, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
15
+ period: TimePeriod;
16
+ refreshViewInBackground: any;
17
+ }, string, never, never>, fetchJeSchedulesSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
18
  jeSchedules: JEScheduledTransactionPayload[];
16
19
  failedJeSchedules: JEScheduledTransactionPayload[];
17
20
  selectedPeriod: MonthYearPeriod;
18
21
  refreshViewInBackground: boolean;
19
- }, string>, fetchJeSchedulesPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
20
- period: TimePeriod;
21
- refreshViewInBackground: any;
22
- }, string, never, never>, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue"], {
22
+ }, string>, ignoreRecommendedJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue"], {
23
23
  jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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
24
  scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
25
25
  }, string, never, never>, ignoreRecommendedJeScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
26
  jeScheduleTransactionKey: JEScheduleTransactionKey;
27
27
  status: ZeniAPIStatus;
28
- }, string>, clearJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, ignoreRecommendedJeScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`], {
28
+ }, string>, ignoreRecommendedJeScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`], {
29
29
  jeScheduleTransactionKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`;
30
30
  }, string, never, never>, initializeJeScheduleLocalData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedules: JEScheduledTransactionPayload[]], {
31
31
  jeScheduleTransactionKeys: (`${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`)[];
32
- }, string, never, never>, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`, selectedPeriod: MonthYearPeriod], {
33
- jeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`;
34
- selectedPeriod: MonthYearPeriod;
35
32
  }, string, never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`, selectedPeriod: MonthYearPeriod], {
36
33
  failedJeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`;
37
34
  selectedPeriod: MonthYearPeriod;
35
+ }, string, never, never>, removeJeScheduleLocalDataById: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
36
+ scheduledJournalEntryID: ID;
37
+ }, string>, removeJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`, selectedPeriod: MonthYearPeriod], {
38
+ jeScheduleKey: `${string}_invoice` | `${string}_payment` | `${string}_credit_memo` | `${string}_sales_receipt` | `${string}_delayed_credit` | `${string}_delayed_charge` | `${string}_refund` | `${string}_expense` | `${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`;
39
+ selectedPeriod: MonthYearPeriod;
38
40
  }, string, never, never>, retryJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
41
  scheduledJournalEntryID: ID;
40
42
  jeScheduleTransactionKey: JEScheduleTransactionKey;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeFailedJeScheduleTransactionKey = exports.removeJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.ignoreRecommendedJeScheduleSuccess = exports.clearJeScheduleLocalData = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.clearExpenseAutomationJESchedulesView = exports.initialState = void 0;
4
+ exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.clearJeScheduleLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
7
  const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
@@ -252,10 +252,14 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
252
252
  const prevLocalDataById = draft.jeScheduleLocalDataById[scheduledJournalEntryID];
253
253
  draft.jeScheduleLocalDataById = Object.assign(Object.assign({}, prevData), { [scheduledJournalEntryID]: Object.assign(Object.assign({}, prevLocalDataById), localData) });
254
254
  },
255
+ removeJeScheduleLocalDataById(draft, action) {
256
+ const { scheduledJournalEntryID } = action.payload;
257
+ delete draft.jeScheduleLocalDataById[scheduledJournalEntryID];
258
+ },
255
259
  clearExpenseAutomationJESchedulesView(draft) {
256
260
  Object.assign(draft, exports.initialState);
257
261
  },
258
262
  },
259
263
  });
260
- _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys;
264
+ _a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys;
261
265
  exports.default = expenseAutomationJESchedulesView.reducer;
@@ -80,5 +80,8 @@ export interface BillActivity {
80
80
  }
81
81
  export declare const getBillActivities: (state: RootState, billId: ID, billStageCode?: "paid" | "pending_approval" | "scheduled" | "draft" | undefined) => BillActivity[];
82
82
  export declare const getBillDetailView: (state: RootState, billId: ID) => BillDetailViewSelector;
83
- export declare const checkApproveRejectBtnShow: (billActivities: BillActivity[], isUserAdmin: boolean, signedInUser?: LoggedInUser | undefined) => boolean;
83
+ export declare const checkApproveRejectBtnShow: (billActivities: BillActivity[], isUserAdmin: boolean, signedInUser?: LoggedInUser | undefined) => {
84
+ isApprovalorRejectBtnVisible: boolean;
85
+ isMarkAsPaidBtnVisible: boolean;
86
+ };
84
87
  export declare const checkShowMarkAsPaidButton: (bill: BillTransaction, isAdmin: boolean, loggedInUser?: LoggedInUser | undefined) => boolean;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.checkShowMarkAsPaidButton = exports.checkApproveRejectBtnShow = exports.getBillDetailView = exports.getBillActivities = void 0;
7
7
  const get_1 = __importDefault(require("lodash/get"));
8
+ const findLastIndex_1 = __importDefault(require("lodash/findLastIndex"));
8
9
  const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
9
10
  const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
10
11
  const approvalRuleSelector_1 = require("../../../../entity/approvalRule/approvalRuleSelector");
@@ -236,6 +237,7 @@ exports.getBillDetailView = getBillDetailView;
236
237
  const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) => {
237
238
  var _a, _b;
238
239
  let isApprovalorRejectBtnVisible = false;
240
+ let isMarkAsPaidBtnVisible = false;
239
241
  let rejectedId = -1;
240
242
  const stepsWithStatusData = billActivities[0].stepsWithStatus;
241
243
  const { areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, } = billActivities[0];
@@ -259,13 +261,18 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
259
261
  stepsWithStatusData[rejectedId],
260
262
  ];
261
263
  }
262
- return false;
264
+ return {
265
+ isApprovalorRejectBtnVisible: false,
266
+ isMarkAsPaidBtnVisible: false,
267
+ };
263
268
  }
264
269
  if (areApprovalsSerialized === true) {
265
270
  if (currentPendingStepIndex != null &&
266
271
  currentPendingStepIndex > -1 &&
267
272
  stepsWithStatusData.length > 0) {
268
273
  const pendingStep = stepsWithStatusData[currentPendingStepIndex];
274
+ const lastApprovalStepIndex = (0, findLastIndex_1.default)(stepsWithStatusData, (step) => step.action === 'require_approval');
275
+ const isLastApprovalStep = lastApprovalStepIndex === currentPendingStepIndex;
269
276
  if (pendingStep.action === 'require_approval') {
270
277
  let isAllActivitiesPending = true;
271
278
  for (const actorActivity of pendingStep.actorsActivity) {
@@ -278,6 +285,7 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
278
285
  if (((_a = actorActivity.actor) === null || _a === void 0 ? void 0 : _a.userId) === (signedInUser === null || signedInUser === void 0 ? void 0 : signedInUser.userId) &&
279
286
  isAllActivitiesPending) {
280
287
  isApprovalorRejectBtnVisible = true;
288
+ isMarkAsPaidBtnVisible = isLastApprovalStep;
281
289
  }
282
290
  // admin will be fallback approver if vendor-owner/manager are not assigned any user id
283
291
  if (actorActivity.type === 'attribute' &&
@@ -287,6 +295,7 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
287
295
  isAdminFallbackApprover === true &&
288
296
  isUserAdmin === true) {
289
297
  isApprovalorRejectBtnVisible = true;
298
+ isMarkAsPaidBtnVisible = isLastApprovalStep;
290
299
  }
291
300
  }
292
301
  }
@@ -306,6 +315,7 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
306
315
  if (((_b = actorActivity.actor) === null || _b === void 0 ? void 0 : _b.userId) === (signedInUser === null || signedInUser === void 0 ? void 0 : signedInUser.userId) &&
307
316
  isAllActivitiesPending) {
308
317
  isApprovalorRejectBtnVisible = true;
318
+ isMarkAsPaidBtnVisible = true;
309
319
  }
310
320
  // admin will be fallback approver if vendor-owner/manager are not assigned any user id
311
321
  else if (actorActivity.type === 'attribute' &&
@@ -315,6 +325,7 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
315
325
  isAdminFallbackApprover === true &&
316
326
  isUserAdmin === true) {
317
327
  isApprovalorRejectBtnVisible = true;
328
+ isMarkAsPaidBtnVisible = true;
318
329
  }
319
330
  }
320
331
  }
@@ -323,7 +334,7 @@ const checkApproveRejectBtnShow = (billActivities, isUserAdmin, signedInUser) =>
323
334
  }
324
335
  }
325
336
  }
326
- return isApprovalorRejectBtnVisible;
337
+ return { isApprovalorRejectBtnVisible, isMarkAsPaidBtnVisible };
327
338
  };
328
339
  exports.checkApproveRejectBtnShow = checkApproveRejectBtnShow;
329
340
  const checkShowMarkAsPaidButton = (bill, isAdmin, loggedInUser) => {
@@ -89,8 +89,14 @@ const getBillList = (state, currentTimePeriod, isBulkActionFeatureEnabled, logge
89
89
  case 'deleted':
90
90
  transactions = currentTabTransactions.filter((tran) => tran.isDeleted);
91
91
  break;
92
- default:
93
- transactions = nonDeletedCurrentTabTransactions;
92
+ default: {
93
+ if (billsToBeMarkedAsPaid.length > 0) {
94
+ transactions = (0, orderBy_1.default)([...billsToBeMarkedAsPaid, ...nonDeletedCurrentTabTransactions], (value) => value.date.valueOf(), 'desc');
95
+ }
96
+ else {
97
+ transactions = nonDeletedCurrentTabTransactions;
98
+ }
99
+ }
94
100
  }
95
101
  break;
96
102
  case 'scheduled':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.14.9",
3
+ "version": "4.14.11",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",