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,