IO-2438 All Employee Scoreboard
A-G Autobody request
This commit is contained in:
@@ -8,18 +8,45 @@ export const CalculateWorkingDaysThisMonth = () => {
|
||||
return moment().endOf("month").businessDaysIntoMonth();
|
||||
};
|
||||
|
||||
export const CalculateWorkingDaysInPeriod = (start, end) => {
|
||||
return moment(start).businessDiff(moment(end));
|
||||
};
|
||||
|
||||
export const CalculateWorkingDaysAsOfToday = () => {
|
||||
return moment().businessDaysIntoMonth();
|
||||
};
|
||||
|
||||
export const CalculateWorkingDaysLastMonth = () => {
|
||||
return moment().subtract(1, "month").endOf("month").businessDaysIntoMonth();
|
||||
};
|
||||
|
||||
export const WeeklyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||
return dailyTargetHrs * 5;
|
||||
return (
|
||||
dailyTargetHrs *
|
||||
CalculateWorkingDaysInPeriod(
|
||||
moment().startOf("week"),
|
||||
moment().endOf("week")
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export const WeeklyTargetHrsInPeriod = (
|
||||
dailyTargetHrs,
|
||||
start,
|
||||
end,
|
||||
bodyshop
|
||||
) => {
|
||||
return dailyTargetHrs * CalculateWorkingDaysInPeriod(start, end);
|
||||
};
|
||||
|
||||
export const MonthlyTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||
return dailyTargetHrs * CalculateWorkingDaysThisMonth();
|
||||
};
|
||||
|
||||
export const LastMonthTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||
return dailyTargetHrs * CalculateWorkingDaysLastMonth();
|
||||
};
|
||||
|
||||
export const AsOfTodayTargetHrs = (dailyTargetHrs, bodyshop) => {
|
||||
return dailyTargetHrs * CalculateWorkingDaysAsOfToday();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user