This commit is contained in:
bakhirev 2024-10-01 10:20:38 +03:00
parent b5c0fd7167
commit 6f6ac5a749
2 changed files with 5 additions and 1 deletions

View file

@ -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 };
}

View file

@ -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,