IO-2118 Add expected production hours to scheduling.
This commit is contained in:
@@ -736,6 +736,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>expectedprodhrs</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>history</name>
|
<name>history</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Popover } from "antd";
|
import { Popover, Space } from "antd";
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import {
|
import {
|
||||||
@@ -13,7 +13,8 @@ import {
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { RadarChartOutlined } from "@ant-design/icons";
|
import { RadarChartOutlined } from "@ant-design/icons";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { load } from "@fingerprintjs/fingerprintjs";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
@@ -23,7 +24,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
||||||
const { ssbuckets } = bodyshop;
|
const { ssbuckets } = bodyshop;
|
||||||
|
const { t } = useTranslation();
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
(loadData &&
|
(loadData &&
|
||||||
@@ -43,6 +44,10 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
|
|||||||
|
|
||||||
const popContent = (
|
const popContent = (
|
||||||
<div>
|
<div>
|
||||||
|
<Space>
|
||||||
|
{t("appointments.labels.expectedprodhrs")}
|
||||||
|
<strong>{loadData.expectedHours.toFixed(1)}</strong>
|
||||||
|
</Space>
|
||||||
<RadarChart
|
<RadarChart
|
||||||
// cx={300}
|
// cx={300}
|
||||||
// cy={250}
|
// cy={250}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
|
|
||||||
const load = {
|
const load = {
|
||||||
productionTotal: {},
|
productionTotal: {},
|
||||||
|
productionHours: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
//Set the current load.
|
//Set the current load.
|
||||||
@@ -45,6 +46,10 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
prodJobs.forEach((item) => {
|
prodJobs.forEach((item) => {
|
||||||
//Add all of the jobs currently in production to the buckets so that we have a starting point.
|
//Add all of the jobs currently in production to the buckets so that we have a starting point.
|
||||||
const bucketId = CheckJobBucket(buckets, item);
|
const bucketId = CheckJobBucket(buckets, item);
|
||||||
|
load.productionHours =
|
||||||
|
load.productionHours +
|
||||||
|
item.labhrs.aggregate.sum.mod_lb_hrs +
|
||||||
|
item.larhrs.aggregate.sum.mod_lb_hrs;
|
||||||
if (bucketId) {
|
if (bucketId) {
|
||||||
load.productionTotal[bucketId].count =
|
load.productionTotal[bucketId].count =
|
||||||
load.productionTotal[bucketId].count + 1;
|
load.productionTotal[bucketId].count + 1;
|
||||||
@@ -131,6 +136,10 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"🚀 ~ file: application.sagas.js:160 ~ function*calculateScheduleLoad ~ load.productionTotal",
|
||||||
|
load.productionTotal
|
||||||
|
);
|
||||||
//Propagate the expected load to each day.
|
//Propagate the expected load to each day.
|
||||||
const range = Math.round(moment.duration(end.diff(today)).asDays());
|
const range = Math.round(moment.duration(end.diff(today)).asDays());
|
||||||
for (var day = 0; day < range; day++) {
|
for (var day = 0; day < range; day++) {
|
||||||
@@ -149,6 +158,10 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
load[current].jobsIn || [],
|
load[current].jobsIn || [],
|
||||||
load[current].jobsOut || []
|
load[current].jobsOut || []
|
||||||
);
|
);
|
||||||
|
load[current].expectedHours =
|
||||||
|
load.productionHours +
|
||||||
|
(load[current].hoursIn || 0) -
|
||||||
|
(load[current].hoursOut || 0);
|
||||||
} else {
|
} else {
|
||||||
load[current].expectedLoad = CalculateLoad(
|
load[current].expectedLoad = CalculateLoad(
|
||||||
load[prev].expectedLoad,
|
load[prev].expectedLoad,
|
||||||
@@ -156,6 +169,10 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
load[current].jobsIn || [],
|
load[current].jobsIn || [],
|
||||||
load[current].jobsOut || []
|
load[current].jobsOut || []
|
||||||
);
|
);
|
||||||
|
load[current].expectedHours =
|
||||||
|
load[prev].expectedHours +
|
||||||
|
(load[current].hoursIn || 0) -
|
||||||
|
(load[current].hoursOut || 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yield put(setProblemJobs(problemJobs));
|
yield put(setProblemJobs(problemJobs));
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
"cancelledappointment": "Canceled appointment for: ",
|
"cancelledappointment": "Canceled appointment for: ",
|
||||||
"completingjobs": "Completing Jobs",
|
"completingjobs": "Completing Jobs",
|
||||||
"dataconsistency": "{{ro_number}} has a data consistency issue. It has been excluded for scheduling purposes. CODE: {{code}}.",
|
"dataconsistency": "{{ro_number}} has a data consistency issue. It has been excluded for scheduling purposes. CODE: {{code}}.",
|
||||||
|
"expectedprodhrs": "Expected Production Hours:",
|
||||||
"history": "History",
|
"history": "History",
|
||||||
"inproduction": "Jobs In Production",
|
"inproduction": "Jobs In Production",
|
||||||
"manualevent": "Add Manual Appointment",
|
"manualevent": "Add Manual Appointment",
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
"cancelledappointment": "Cita cancelada para:",
|
"cancelledappointment": "Cita cancelada para:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
"dataconsistency": "",
|
"dataconsistency": "",
|
||||||
|
"expectedprodhrs": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
"manualevent": "",
|
"manualevent": "",
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
"cancelledappointment": "Rendez-vous annulé pour:",
|
"cancelledappointment": "Rendez-vous annulé pour:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
"dataconsistency": "",
|
"dataconsistency": "",
|
||||||
|
"expectedprodhrs": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
"manualevent": "",
|
"manualevent": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user