From 6f6ac5a7491b5a747a04840222397a864b35dbbd Mon Sep 17 00:00:00 2001 From: bakhirev Date: Tue, 1 Oct 2024 10:20:38 +0300 Subject: [PATCH] update --- src/ts/helpers/DataGrip/components/scope.ts | 2 +- src/ts/store/UserSettings.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ts/helpers/DataGrip/components/scope.ts b/src/ts/helpers/DataGrip/components/scope.ts index 6f5aa02..bb5fbf5 100644 --- a/src/ts/helpers/DataGrip/components/scope.ts +++ b/src/ts/helpers/DataGrip/components/scope.ts @@ -86,7 +86,7 @@ export default class DataGripByScope { const user = dot.authors[name]; const days: number = Object.keys(user.days).length; // TODO: need middle salary in month; - salaryCache[name] = salaryCache[name] || userSettings.getCurrentSalaryInMonth(name); + salaryCache[name] = salaryCache[name] || userSettings.getCurrentSalaryInDay(name); cost += days * salaryCache[name]; dot.authors[name] = { ...user, days }; } diff --git a/src/ts/store/UserSettings.ts b/src/ts/store/UserSettings.ts index 9a9604b..ee5e298 100644 --- a/src/ts/store/UserSettings.ts +++ b/src/ts/store/UserSettings.ts @@ -68,6 +68,10 @@ class UserSettings implements IUserSettingsStore { return this.getEmploymentContract(name).value; } + getCurrentSalaryInDay(name: string) { + return this.getCurrentSalaryInMonth(name) / 30; + } + getMiddleSalaryInMonth( name: string, firstCommitTime: number,