IO-2240 Adjusted calculation for total efficiency
This commit is contained in:
@@ -224,17 +224,18 @@ export default function ScoreboardTimeTickets() {
|
||||
ret2.push(r);
|
||||
});
|
||||
|
||||
// Add total efficiency of employees
|
||||
ret.totalEffieciencyOverPeriod = Object.keys(ret.employees)
|
||||
.map((key) => {
|
||||
return { employee_number: key, ...ret.employees[key] };
|
||||
})
|
||||
.map((e) =>
|
||||
((e.totalOverPeriod / (e.actualTotalOverPeriod || 0.1)) * 100).toFixed(
|
||||
1
|
||||
)
|
||||
)
|
||||
.reduce((acc, prev) => acc + Number(prev), 0);
|
||||
// Add combined efficiency of employees // 454.7%
|
||||
ret.totalEffieciencyOverPeriod = (
|
||||
(Object.keys(ret.employees).reduce(
|
||||
(acc, key) => acc + ret.employees[key].totalOverPeriod,
|
||||
0
|
||||
) /
|
||||
(Object.keys(ret.employees).reduce(
|
||||
(acc, key) => acc + ret.employees[key].actualTotalOverPeriod,
|
||||
0
|
||||
) || 0.1)) *
|
||||
100
|
||||
).toFixed(1);
|
||||
|
||||
roundObject(ret);
|
||||
roundObject(totals);
|
||||
|
||||
Reference in New Issue
Block a user