@zeniai/client-epic-state 4.8.2 → 4.8.3
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.
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +6 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +18 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +1 -0
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
- package/package.json +1 -1
|
@@ -68,3 +68,9 @@ export declare const mapScheduleJournalToCOABalance: (scheduleJournal: Scheduled
|
|
|
68
68
|
* @returns
|
|
69
69
|
*/
|
|
70
70
|
export declare const calculateCOABalanceGroupedByPeriod: (jeSchedule: JEScheduledTransaction) => COABalanceGroupedByPeriod;
|
|
71
|
+
/**
|
|
72
|
+
* Function to get Duration of months out total months Eg 5/12 or 9/12
|
|
73
|
+
* @param jeSchedule
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
export declare const getDurationOfMonthOutTotalMonth: (jeSchedule: JEScheduledTransaction) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateCOABalanceGroupedByPeriod = exports.mapScheduleJournalToCOABalance = exports.calculateTotalBalanceTimeframeTick = exports.setDefaultTotalBalanceTimeframeTicks = exports.mapTotalBalanceTimeframeTickToCOAGroupedBalance = exports.getAllTimeframeTicks = exports.getAllAccountNested = exports.getAllAccountBase = exports.getAccountListKeyForSchedulesTab = exports.getCalculatedScheduleTotals = void 0;
|
|
3
|
+
exports.getDurationOfMonthOutTotalMonth = exports.calculateCOABalanceGroupedByPeriod = exports.mapScheduleJournalToCOABalance = exports.calculateTotalBalanceTimeframeTick = exports.setDefaultTotalBalanceTimeframeTicks = exports.mapTotalBalanceTimeframeTickToCOAGroupedBalance = exports.getAllTimeframeTicks = exports.getAllAccountNested = exports.getAllAccountBase = exports.getAccountListKeyForSchedulesTab = exports.getCalculatedScheduleTotals = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
5
|
const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
6
6
|
const getFYMonths_1 = require("../../../commonStateTypes/fiscalYearHelpers/getFYMonths");
|
|
@@ -185,3 +185,20 @@ const calculateCOABalanceGroupedByPeriod = (jeSchedule) => {
|
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
187
|
exports.calculateCOABalanceGroupedByPeriod = calculateCOABalanceGroupedByPeriod;
|
|
188
|
+
const countStatusForDuration = (statusCode) => {
|
|
189
|
+
return ['unknown', 'posted'].includes(statusCode);
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Function to get Duration of months out total months Eg 5/12 or 9/12
|
|
193
|
+
* @param jeSchedule
|
|
194
|
+
* @returns
|
|
195
|
+
*/
|
|
196
|
+
const getDurationOfMonthOutTotalMonth = (jeSchedule) => {
|
|
197
|
+
let totalDurationCompleted = 0;
|
|
198
|
+
const scheduledEntries = jeSchedule.scheduledJournalEntry;
|
|
199
|
+
if (jeSchedule.status.code === 'ongoing' && scheduledEntries.length > 0) {
|
|
200
|
+
totalDurationCompleted = scheduledEntries.filter((scheduledEntry) => countStatusForDuration(scheduledEntry.status.code)).length;
|
|
201
|
+
}
|
|
202
|
+
return totalDurationCompleted;
|
|
203
|
+
};
|
|
204
|
+
exports.getDurationOfMonthOutTotalMonth = getDurationOfMonthOutTotalMonth;
|
|
@@ -13,6 +13,7 @@ import { Amount } from '../../../commonStateTypes/amount';
|
|
|
13
13
|
import { COABalanceGroupedByPeriod } from '../../../commonStateTypes/coaBalance/coaBalance';
|
|
14
14
|
export interface JEScheduledTransactionWithBalance extends JEScheduledTransaction {
|
|
15
15
|
coaBalanceByPeriod: COABalanceGroupedByPeriod;
|
|
16
|
+
durationOfMonths: number;
|
|
16
17
|
}
|
|
17
18
|
export interface ScheduleListReport extends SelectorView {
|
|
18
19
|
allSubTabs: ScheduleSubTabType[];
|
|
@@ -153,7 +153,7 @@ const getScheduleListReport = (state) => {
|
|
|
153
153
|
const allTimeframeTicks = (0, scheduleListHelper_1.getAllTimeframeTicks)(sortedJETransactionView, 2);
|
|
154
154
|
const jeScheduledTransactionWithBalance = [];
|
|
155
155
|
sortedJETransactionView.forEach((jeSchedule) => {
|
|
156
|
-
jeScheduledTransactionWithBalance.push(Object.assign(Object.assign({}, jeSchedule), { coaBalanceByPeriod: (0, scheduleListHelper_1.calculateCOABalanceGroupedByPeriod)(jeSchedule) }));
|
|
156
|
+
jeScheduledTransactionWithBalance.push(Object.assign(Object.assign({}, jeSchedule), { coaBalanceByPeriod: (0, scheduleListHelper_1.calculateCOABalanceGroupedByPeriod)(jeSchedule), durationOfMonths: (0, scheduleListHelper_1.getDurationOfMonthOutTotalMonth)(jeSchedule) }));
|
|
157
157
|
});
|
|
158
158
|
const totalBalanceTimeframeTicks = (0, scheduleListHelper_1.calculateTotalBalanceTimeframeTick)(jeScheduledTransactionWithBalance, allTimeframeTicks, 'months');
|
|
159
159
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3",
|
|
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",
|