@zeniai/client-epic-state 4.13.63 → 4.13.64

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.
@@ -44,8 +44,8 @@ const refreshExpenseAutomationCurrentTabEpic = (actions$, state$) => actions$.pi
44
44
  ]);
45
45
  case 'month_end_insights':
46
46
  return (0, rxjs_1.from)([
47
- (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId),
48
- (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId),
47
+ (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportView)(true, companyId, currentTenant.tenantId),
48
+ (0, companyMonthEndReportViewReducer_1.fetchCompanyMonthEndReportTemplates)(companyId, currentTenant.tenantId),
49
49
  ]);
50
50
  case 'transaction_categorization':
51
51
  default:
@@ -1,33 +1,28 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getMonthEndCloseChecksViewByTenantId = exports.isMonthEndInsightDisabled = void 0;
7
- const isEqual_1 = __importDefault(require("lodash/isEqual"));
8
4
  const toolkit_1 = require("@reduxjs/toolkit");
9
5
  const monthEndCloseChecksSelector_1 = require("../../entity/monthEndCloseChecks/monthEndCloseChecksSelector");
10
6
  const timePeriod_1 = require("../../commonStateTypes/timePeriod");
11
7
  const zeniDayJS_1 = require("../../zeniDayJS");
12
8
  const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
9
+ const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
13
10
  const isMonthEndInsightDisabled = (currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, auditSummary) => {
14
11
  if (auditSummary != null) {
15
12
  if (auditSummary.auditScorePercentage < 75 &&
16
13
  userAllowedToAccessMonthEndInsights === false) {
17
14
  return true;
18
15
  }
19
- const lastReportSentMonthYearPeriod = currentTenant.zeniBookCloseMonthAndYear;
20
- if (lastReportSentMonthYearPeriod == null) {
21
- return (selectedPeriod.month === (0, zeniDayJS_1.dateNow)().get('month') &&
22
- selectedPeriod.year === (0, zeniDayJS_1.dateNow)().get('year'));
16
+ // if the selected period is November 2024, then book close date should not be null and book close date should be 30th November 2024
17
+ const { bookCloseDate } = currentTenant;
18
+ const selectedPeriodFirstDay = (0, zeniDayJS_1.date)(`${selectedPeriod.year}-${selectedPeriod.month}-01`);
19
+ const selectedPeriodLastDay = selectedPeriodFirstDay.endOf('month');
20
+ if (bookCloseDate == null ||
21
+ bookCloseDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) !==
22
+ selectedPeriodLastDay.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) {
23
+ return true;
23
24
  }
24
- const currentDate = (0, zeniDayJS_1.date)(`${lastReportSentMonthYearPeriod.year}-${lastReportSentMonthYearPeriod.month}-01`);
25
- const nextMonthDate = currentDate.add(1, 'month');
26
- const nextMonthPeriod = {
27
- month: (0, timePeriod_1.toMonth)(nextMonthDate.month() + 1),
28
- year: nextMonthDate.year(),
29
- };
30
- return !(0, isEqual_1.default)(selectedPeriod, nextMonthPeriod);
25
+ return false;
31
26
  }
32
27
  return true;
33
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.13.63",
3
+ "version": "4.13.64",
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",