This commit is contained in:
bakhirev 2024-08-15 09:14:31 +03:00
parent 0674fbdc92
commit 780ff751df
3 changed files with 26 additions and 25 deletions

File diff suppressed because one or more lines are too long

View file

@ -79,7 +79,7 @@ export default class DataGripByTimestamp {
for (let author in this.commitsByAuthor) { for (let author in this.commitsByAuthor) {
const statistic = this.#getTotalInfo(this.commitsByAuthor[author]); const statistic = this.#getTotalInfo(this.commitsByAuthor[author]);
statistic.weekendPayment = this.#getWeekendPaymentByAuthor(statistic, dataGripByAuthor.statisticByName[author]); statistic.weekendPayment = this.#getWeekendPaymentByAuthor(statistic, dataGripByAuthor.statisticByName[author]);
this.statisticByAuthor[author] = statistic; this.statisticByAuthor[author] = statistic; // TODO: странный результат, неверный расчёт?
this.statistic.weekendPayment += statistic.weekendPayment; this.statistic.weekendPayment += statistic.weekendPayment;
} }
} }
@ -119,7 +119,8 @@ export default class DataGripByTimestamp {
#getWeekendPaymentByAuthor(statistic: any, dataGripByAuthor: any) { #getWeekendPaymentByAuthor(statistic: any, dataGripByAuthor: any) {
if (dataGripByAuthor.isStaff) return 0; if (dataGripByAuthor.isStaff) return 0;
const salaryInDay = userSettings.getCurrentSalaryInMonth(dataGripByAuthor.author); // TODO: need middle salary in month const salaryInMonth = userSettings.getCurrentSalaryInMonth(dataGripByAuthor.author);
const salaryInDay = (salaryInMonth / 22) * 2; // TODO: только по ТК РФ
const saturday = statistic.workByDay[5] * salaryInDay; const saturday = statistic.workByDay[5] * salaryInDay;
const sunday = statistic.workByDay[6] * salaryInDay; const sunday = statistic.workByDay[6] * salaryInDay;
return saturday + sunday; return saturday + sunday;

View file

@ -30,22 +30,10 @@ const Total = observer((): React.ReactElement => {
<Title title="page.team.total.titleA"/> <Title title="page.team.total.titleA"/>
<div> <div>
<CardWithIcon <CardWithIcon
value={statistic.daysWorked} value={workSpeed}
icon="./assets/cards/work_days.png" icon="./assets/cards/tasks_month.png"
title="page.team.total.daysWorked.title" title="page.team.total.workSpeed.title"
description="page.team.total.daysWorked.description" description="page.team.total.workSpeed.description"
/>
<CardWithIcon
value={statistic.commits}
icon="./assets/cards/commits.png"
title="page.team.total.commits.title"
description="page.team.total.commits.description"
/>
<CardWithIcon
value={statistic.daysLosses}
icon="./assets/cards/lazy.png"
title="page.team.total.daysLosses.title"
description="page.team.total.daysLosses.description"
/> />
<CardWithIcon <CardWithIcon
value={`${employment.active.length} / ${employment.dismissed.length}`} value={`${employment.active.length} / ${employment.dismissed.length}`}
@ -53,12 +41,24 @@ const Total = observer((): React.ReactElement => {
title="page.team.total.employment.title" title="page.team.total.employment.title"
description="page.team.total.employment.description" description="page.team.total.employment.description"
/> />
<CardWithIcon
value={statistic.daysWorked}
icon="./assets/cards/work_days.png"
title="page.team.total.daysWorked.title"
description="page.team.total.daysWorked.description"
/>
<CardWithIcon
value={statistic.daysLosses}
icon="./assets/cards/lazy.png"
title="page.team.total.daysLosses.title"
description="page.team.total.daysLosses.description"
/>
<CardWithIcon <CardWithIcon
size="l" size="l"
value={workSpeed} value={statistic.commits}
icon="./assets/cards/tasks_month.png" icon="./assets/cards/commits.png"
title="page.team.total.workSpeed.title" title="page.team.total.commits.title"
description="page.team.total.workSpeed.description" description="page.team.total.commits.description"
/> />
</div> </div>
<Description <Description