Compare commits

..

1 Commits

Author SHA1 Message Date
Allan Carr
6e6304124b IO-3575 Extend Audit Trail for Tax Rates and Flat ATS
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-02-23 17:59:39 -08:00
2 changed files with 16 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

@@ -237,7 +237,13 @@ export function JobsDetailPage({
"rate_mapa",
"rate_mahw",
"rate_mash",
"rate_matd"
"rate_matd",
"flat_rate_ats",
"state_tax_rate",
"tax_lbr_rt",
"tax_shop_mat_rt",
"tax_paint_mat_rt",
"tax_sub_rt"
],
(meta) => meta && meta.touched
);