IO-2162 Resolve smart scheduling issues.
This commit is contained in:
@@ -15,6 +15,7 @@ import React, { useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { calculateScheduleLoad } from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
@@ -28,6 +29,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
calculateScheduleLoad: (endDate) => dispatch(calculateScheduleLoad(endDate)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ScheduleJobModalComponent({
|
export function ScheduleJobModalComponent({
|
||||||
@@ -36,6 +38,7 @@ export function ScheduleJobModalComponent({
|
|||||||
existingAppointments,
|
existingAppointments,
|
||||||
lbrHrsData,
|
lbrHrsData,
|
||||||
jobId,
|
jobId,
|
||||||
|
calculateScheduleLoad,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -57,6 +60,9 @@ export function ScheduleJobModalComponent({
|
|||||||
|
|
||||||
const handleDateBlur = () => {
|
const handleDateBlur = () => {
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
|
if (values.start) {
|
||||||
|
calculateScheduleLoad(values.start);
|
||||||
|
}
|
||||||
if (lbrHrsData) {
|
if (lbrHrsData) {
|
||||||
const totalHours =
|
const totalHours =
|
||||||
lbrHrsData.jobs_by_pk.labhrs.aggregate.sum.mod_lb_hrs +
|
lbrHrsData.jobs_by_pk.labhrs.aggregate.sum.mod_lb_hrs +
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.schedule-job-modal {
|
.schedule-job-modal {
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
|
overflow-y: auto;
|
||||||
.rbc-calendar {
|
.rbc-calendar {
|
||||||
.rbc-toolbar {
|
.rbc-toolbar {
|
||||||
.rbc-btn-group {
|
.rbc-btn-group {
|
||||||
|
|||||||
@@ -92,6 +92,18 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
code: "Job has no scheduled in date",
|
code: "Job has no scheduled in date",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if(!item.actual_completion && item.actual_in && !item.inproduction){
|
||||||
|
problemJobs.push({
|
||||||
|
...item,
|
||||||
|
code: "Job has an actual in date, but no actual completion date and is not marked as in production",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (item.actual_in && moment(item.actual_in).isAfter(moment())) {
|
||||||
|
problemJobs.push({
|
||||||
|
...item,
|
||||||
|
code: "Job has an actual in date set in the future",
|
||||||
|
});
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
item.actual_completion &&
|
item.actual_completion &&
|
||||||
moment(item.actual_completion).isAfter(moment())
|
moment(item.actual_completion).isAfter(moment())
|
||||||
|
|||||||
Reference in New Issue
Block a user