From dd085be5c7d9bd93677b57844f6b7c94a6ebf082 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 13 Jul 2023 09:13:45 -0700 Subject: [PATCH] Updated pay all calculations and introduction of split. --- .../job-detail-lines/job-lines.component.jsx | 40 ++- .../jobs-detail-labor.component.jsx | 48 ++- ...or-allocations-table.payroll.component.jsx | 31 +- package.json | 1 + server/payroll/pay-all.js | 316 +++++++++++------- yarn.lock | 5 + 6 files changed, 278 insertions(+), 163 deletions(-) diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index 468abb236..e34d6a446 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -48,6 +48,7 @@ import JobLinesPartPriceChange from "./job-lines-part-price-change.component"; import JoblineTeamAssignment from "../job-line-team-assignment/job-line-team-assignmnent.component"; import JobLineDispatchButton from "../job-line-dispatch-button/job-line-dispatch-button.component"; import JobLineBulkAssignComponent from "../job-line-bulk-assign/job-line-bulk-assign.component"; +import { useTreatments } from "@splitsoftware/splitio-react"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -79,7 +80,11 @@ export function JobLinesComponent({ setBillEnterContext, }) { const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK); - + const { Enhanced_Payroll } = useTreatments( + ["Enhanced_Payroll"], + {}, + bodyshop.imexshopid + ); const [selectedLines, setSelectedLines] = useState([]); const [state, setState] = useState({ sortedInfo: {}, @@ -289,14 +294,19 @@ export function JobLinesComponent({ state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order, responsive: ["md"], }, - { - title: t("joblines.fields.assigned_team"), - dataIndex: "assigned_team", - key: "assigned_team", - render: (text, record) => ( - - ), - }, + ...(Enhanced_Payroll.treatment === "on" + ? [ + { + title: t("joblines.fields.assigned_team"), + dataIndex: "assigned_team", + key: "assigned_team", + render: (text, record) => ( + + ), + }, + ] + : []), + { title: t("joblines.fields.notes"), dataIndex: "notes", @@ -464,11 +474,13 @@ export function JobLinesComponent({ setSelectedLines={setSelectedLines} job={job} /> - + {Enhanced_Payroll.treatment === "on" && ( + + )}