diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.utility.js b/client/src/components/labor-allocations-table/labor-allocations-table.utility.js
index 2ce5b4a0b..d236de913 100644
--- a/client/src/components/labor-allocations-table/labor-allocations-table.utility.js
+++ b/client/src/components/labor-allocations-table/labor-allocations-table.utility.js
@@ -6,10 +6,6 @@ export const CalculateAllocationsTotals = (
timetickets,
adjustments = []
) => {
- console.log(
- "🚀 ~ file: labor-allocations-table.utility.js ~ line 9 ~ adjustments",
- adjustments
- );
const responsibilitycenters = bodyshop.md_responsibility_centers;
const jobCodes = joblines.map((item) => item.mod_lbr_ty);
//.filter((value, index, self) => self.indexOf(value) === index && !!value);
diff --git a/client/src/components/time-ticket-calculator/time-ticket-calculator.component.jsx b/client/src/components/time-ticket-calculator/time-ticket-calculator.component.jsx
new file mode 100644
index 000000000..a36f1dd49
--- /dev/null
+++ b/client/src/components/time-ticket-calculator/time-ticket-calculator.component.jsx
@@ -0,0 +1,142 @@
+import { DownOutlined } from "@ant-design/icons";
+import {
+ Button,
+ Checkbox,
+ Col,
+ Form,
+ InputNumber,
+ Popover,
+ Radio,
+ Row,
+ Space,
+ Spin,
+} from "antd";
+import React, { useState } from "react";
+import { GET_JOB_INFO_DRAW_CALCULATIONS } from "../../graphql/jobs-lines.queries";
+import { useQuery } from "@apollo/client";
+
+export default function TimeTicketCalculatorComponent({
+ setProductiveHours,
+
+ jobid,
+}) {
+ const { loading, data: lineTicketData } = useQuery(GET_JOB_INFO_DRAW_CALCULATIONS, {
+ variables: { id: jobid },
+ skip: !jobid,
+ fetchPolicy: "network-only",
+ nextFetchPolicy: "network-only",
+ });
+
+ const [visible, setVisible] = useState(false);
+ const handleOpenChange = (flag) => setVisible(flag);
+ const handleFinish = ({ type, hourstype, percent }) => {
+ //setProductiveHours(values);
+ //setVisible(false);
+ const eligibleHours = Array.isArray(hourstype)
+ ? lineTicketData.joblines.reduce(
+ (acc, val) =>
+ acc + (hourstype.includes(val.mod_lbr_ty) ? val.mod_lb_hrs : 0),
+ 0
+ )
+ : lineTicketData.joblines.reduce(
+ (acc, val) =>
+ acc + (hourstype === val.mod_lbr_ty ? val.mod_lb_hrs : 0),
+ 0
+ );
+ if (type === "draw") {
+ setProductiveHours(eligibleHours * (percent / 100));
+ } else if (type === "cut") {
+ setProductiveHours(eligibleHours * (percent / 100));
+ console.log(
+ "Cut selected, rate set to: ",
+ lineTicketData.jobs_by_pk[`rate_${hourstype.toLowerCase()}`]
+ );
+ }
+ };
+
+ const popContent = (
+
+
+
+ Draw
+ Cut of Sale
+
+
+
+
+ {({ getFieldValue }) => (
+
+ {getFieldValue("type") === "draw" ? (
+
+
+
+
+ Body
+
+
+
+
+ Refinish
+
+
+
+
+ Mechanical
+
+
+
+
+ Frame
+
+
+
+
+ Glass
+
+
+
+
+ ) : (
+
+ Body
+
+ Refinish
+
+ Mechanical
+
+ Frame
+
+ Glass
+
+ )}
+
+ )}
+
+
+
+
+
+
+
+
+ );
+
+ return (
+
+
+
+ );
+}
diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
index 6f61fccf0..d74069cd9 100644
--- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
+++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx
@@ -18,6 +18,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
+import TimeTicketCalculatorComponent from "../time-ticket-calculator/time-ticket-calculator.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -172,20 +173,28 @@ export function TimeTicketModalComponent({
{() => (
-
-
-
+ <>
+
+
+
+
+ form.setFieldsValue({ productivehrs })
+ }
+ />
+ >
)}