Compare commits

..

2 Commits

Author SHA1 Message Date
Allan Carr
1dd74bf029 Merged in feature/IO-3578-Fortellis-Regex-Fix (pull request #3042)
IO-3578 Fortellis Regex Fix
2026-02-25 00:31:14 +00:00
Allan Carr
e90e0b9be9 IO-3578 Fortellis Regex Fix
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-02-24 16:32:40 -08:00
2 changed files with 10 additions and 43 deletions

View File

@@ -21,7 +21,6 @@ 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 JobEmployeeAssignmentsContainer from "./../job-employee-assignments/job-employee-assignments.container";
import { PayrollLaborAllocationsTable } from "../labor-allocations-table/labor-allocations-table.payroll.component.jsx";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -50,7 +49,7 @@ export function TimeTicketModalComponent({
splitKey: bodyshop.imexshopid
});
const [loadLineTicketData, { loading, data: lineTicketData, refetch }] = useLazyQuery(GET_LINE_TICKET_BY_PK, {
const [loadLineTicketData, { loading, data: lineTicketData }] = useLazyQuery(GET_LINE_TICKET_BY_PK, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only"
});
@@ -321,34 +320,13 @@ export function TimeTicketModalComponent({
</Form.Item>
</LayoutFormRow>
<LaborAllocationContainer
jobid={watchedJobId || null}
loading={loading}
lineTicketData={lineTicketData}
bodyshop={bodyshop}
refetch={refetch}
/>
<LaborAllocationContainer jobid={watchedJobId || null} loading={loading} lineTicketData={lineTicketData} />
</div>
);
}
export function LaborAllocationContainer({
jobid,
loading,
lineTicketData,
hideTimeTickets = false,
bodyshop,
refetch
}) {
export function LaborAllocationContainer({ jobid, loading, lineTicketData, hideTimeTickets = false }) {
const { t } = useTranslation();
const {
treatments: { Enhanced_Payroll }
} = useTreatmentsWithConfig({
attributes: {},
names: ["Enhanced_Payroll"],
splitKey: bodyshop.imexshopid
});
if (loading) return <LoadingSkeleton />;
if (!lineTicketData) return null;
if (!jobid) return null;
@@ -359,23 +337,12 @@ export function LaborAllocationContainer({
<JobEmployeeAssignmentsContainer job={lineTicketData.jobs_by_pk} />
</Card>
{Enhanced_Payroll.treatment === "on" ? (
<PayrollLaborAllocationsTable
jobId={jobid}
joblines={lineTicketData.joblines}
timetickets={lineTicketData.timetickets}
adjustments={lineTicketData.jobs_by_pk.lbr_adjustments}
refetch={refetch}
bodyshop={bodyshop}
/>
) : (
<LaborAllocationsTable
jobId={jobid}
joblines={lineTicketData.joblines}
timetickets={lineTicketData.timetickets}
adjustments={lineTicketData.jobs_by_pk.lbr_adjustments}
/>
)}
<LaborAllocationsTable
jobId={jobid}
joblines={lineTicketData.joblines}
timetickets={lineTicketData.timetickets}
adjustments={lineTicketData.jobs_by_pk.lbr_adjustments}
/>
{!hideTimeTickets && (
<TimeTicketList loading={loading} timetickets={jobid ? lineTicketData.timetickets : []} techConsole />

View File

@@ -14,7 +14,7 @@ const {
const _ = require("lodash");
const moment = require("moment-timezone");
const replaceSpecialRegex = /[^a-zA-Z0-9 .,\n #]+/g;
const replaceSpecialRegex = /[^a-zA-Z0-9 ]+/g;
// Helper function to handle FortellisApiError logging
function handleFortellisApiError(socket, error, functionName, additionalDetails = {}) {