Fixed bug introduced by removing productionview table in scheduling BOD-243
This commit is contained in:
@@ -113,14 +113,32 @@ export const QUERY_APPOINTMENTS_BY_JOBID = gql`
|
||||
`;
|
||||
export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
||||
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
|
||||
productionview_aggregate {
|
||||
labhrs: joblines_aggregate(
|
||||
where: {
|
||||
mod_lbr_ty: { _eq: "LAB" }
|
||||
job: { inproduction: { _eq: true } }
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
larhrs
|
||||
labhrs
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
larhrs: joblines_aggregate(
|
||||
where: {
|
||||
mod_lbr_ty: { _eq: "LAR" }
|
||||
job: { inproduction: { _eq: true } }
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compJobs: jobs(
|
||||
where: { scheduled_completion: { _gte: $start, _lte: $end } }
|
||||
) {
|
||||
|
||||
@@ -28,8 +28,8 @@ export function* calculateScheduleLoad({ payload: end }) {
|
||||
|
||||
let load = {
|
||||
productionHoursTotal:
|
||||
result.data.productionview_aggregate.aggregate.sum.larhrs +
|
||||
result.data.productionview_aggregate.aggregate.sum.labhrs,
|
||||
result.data.larhrs.aggregate.sum.mod_lb_hrs +
|
||||
result.data.labhrs.aggregate.sum.mod_lb_hrs,
|
||||
};
|
||||
|
||||
const { arrJobs, compJobs } = result.data;
|
||||
|
||||
Reference in New Issue
Block a user