Merged in release/2025-01-17 (pull request #2063)
Release/2025 01 17 into test-AIO - IO-2951 IO-999 IO-3096
This commit is contained in:
@@ -982,7 +982,7 @@ export function JobsDetailRatesParts({ jobRO, expanded, required = true, form })
|
|||||||
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow>
|
<LayoutFormRow header={t("jobs.labels.cieca_pfo")}>
|
||||||
<Form.Item label={t("jobs.fields.tax_tow_rt")} name="tax_tow_rt">
|
<Form.Item label={t("jobs.fields.tax_tow_rt")} name="tax_tow_rt">
|
||||||
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { EditFilled } from "@ant-design/icons";
|
import { EditFilled } from "@ant-design/icons";
|
||||||
import { Alert, Card, Col, Row, Space, Table, Typography } from "antd";
|
import { Alert, Card, Col, Row, Space, Table, Typography } from "antd";
|
||||||
import _ from "lodash";
|
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -9,11 +8,11 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
|
|||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component";
|
import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component";
|
||||||
|
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
||||||
import "./labor-allocations-table.styles.scss";
|
import "./labor-allocations-table.styles.scss";
|
||||||
import { CalculateAllocationsTotals } from "./labor-allocations-table.utility";
|
import { CalculateAllocationsTotals } from "./labor-allocations-table.utility";
|
||||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
|
||||||
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
technician: selectTechnician
|
technician: selectTechnician
|
||||||
@@ -65,6 +64,7 @@ export function LaborAllocationsTable({
|
|||||||
key: "total",
|
key: "total",
|
||||||
sorter: (a, b) => a.total - b.total,
|
sorter: (a, b) => a.total - b.total,
|
||||||
sortOrder: state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
render: (text, record) => record.total.toFixed(1)
|
render: (text, record) => record.total.toFixed(1)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -73,6 +73,7 @@ export function LaborAllocationsTable({
|
|||||||
key: "hrs_claimed",
|
key: "hrs_claimed",
|
||||||
sorter: (a, b) => a.claimed - b.claimed,
|
sorter: (a, b) => a.claimed - b.claimed,
|
||||||
sortOrder: state.sortedInfo.columnKey === "claimed" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "claimed" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
render: (text, record) => record.claimed && record.claimed.toFixed(1)
|
render: (text, record) => record.claimed && record.claimed.toFixed(1)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -81,6 +82,7 @@ export function LaborAllocationsTable({
|
|||||||
key: "adjustments",
|
key: "adjustments",
|
||||||
sorter: (a, b) => a.adjustments - b.adjustments,
|
sorter: (a, b) => a.adjustments - b.adjustments,
|
||||||
sortOrder: state.sortedInfo.columnKey === "adjustments" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "adjustments" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{record.adjustments.toFixed(1)}
|
{record.adjustments.toFixed(1)}
|
||||||
@@ -100,17 +102,17 @@ export function LaborAllocationsTable({
|
|||||||
{
|
{
|
||||||
title: t("jobs.labels.difference"),
|
title: t("jobs.labels.difference"),
|
||||||
dataIndex: "difference",
|
dataIndex: "difference",
|
||||||
|
|
||||||
key: "difference",
|
key: "difference",
|
||||||
sorter: (a, b) => a.difference - b.difference,
|
sorter: (a, b) => a.difference - b.difference,
|
||||||
sortOrder: state.sortedInfo.columnKey === "difference" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "difference" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<strong
|
<strong
|
||||||
style={{
|
style={{
|
||||||
color: record.difference >= 0 ? "green" : "red"
|
color: record.difference.toFixed(1) >= 0 ? "green" : "red"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{_.round(record.difference, 1)}
|
{(Math.abs(record.difference) < 0.05 ? 0 : record.difference).toFixed(1)}
|
||||||
</strong>
|
</strong>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -129,7 +131,6 @@ export function LaborAllocationsTable({
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => `${record.op_code_desc || ""}${record.alt_partm ? ` ${record.alt_partm}` : ""}`
|
render: (text, record) => `${record.op_code_desc || ""}${record.alt_partm ? ` ${record.alt_partm}` : ""}`
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.act_price"),
|
title: t("joblines.fields.act_price"),
|
||||||
dataIndex: "act_price",
|
dataIndex: "act_price",
|
||||||
@@ -187,7 +188,7 @@ export function LaborAllocationsTable({
|
|||||||
{ hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0 }
|
{ hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0 }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (summary.difference !== 0 && typeof warningCallback === "function") {
|
if (Math.abs(summary.difference.toFixed(1)) !== 0 && typeof warningCallback === "function") {
|
||||||
warningCallback({ key: "labor", warning: t("jobs.labels.outstandinghours") });
|
warningCallback({ key: "labor", warning: t("jobs.labels.outstandinghours") });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,19 +218,21 @@ export function LaborAllocationsTable({
|
|||||||
summary={() => (
|
summary={() => (
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
|
<Typography.Title level={4} style={{ margin: 0, lineHeight: 1 }}>
|
||||||
|
{t("general.labels.totals")}
|
||||||
|
</Typography.Title>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>{summary.hrs_total.toFixed(1)}</Table.Summary.Cell>
|
<Table.Summary.Cell align="right">{summary.hrs_total.toFixed(1)}</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>{summary.hrs_claimed.toFixed(1)}</Table.Summary.Cell>
|
<Table.Summary.Cell align="right">{summary.hrs_claimed.toFixed(1)}</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>{summary.adjustments.toFixed(1)}</Table.Summary.Cell>
|
<Table.Summary.Cell align="right">{summary.adjustments.toFixed(1)}</Table.Summary.Cell>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell align="right">
|
||||||
<Typography.Text
|
<Typography.Text
|
||||||
style={{
|
style={{
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
color: summary.difference >= 0 ? "green" : "red"
|
color: summary.difference.toFixed(1) >= 0 ? "green" : "red"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{summary.difference.toFixed(1)}
|
{(Math.abs(summary.difference) < 0.05 ? 0 : summary.difference).toFixed(1)}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
@@ -261,11 +264,10 @@ export function LaborAllocationsTable({
|
|||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
{showWarning && summary.difference !== 0 && (
|
{showWarning && Math.abs(summary.difference.toFixed(1)) !== 0 && (
|
||||||
<Alert style={{ margin: "8px 0px" }} type="warning" message={t("jobs.labels.outstandinghours")} />
|
<Alert style={{ margin: "8px 0px" }} type="warning" message={t("jobs.labels.outstandinghours")} />
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(LaborAllocationsTable);
|
export default connect(mapStateToProps, null)(LaborAllocationsTable);
|
||||||
|
|||||||
@@ -2056,7 +2056,7 @@
|
|||||||
"parts": "Parts",
|
"parts": "Parts",
|
||||||
"parts_lines": "Parts Lines",
|
"parts_lines": "Parts Lines",
|
||||||
"parts_received": "Parts Rec.",
|
"parts_received": "Parts Rec.",
|
||||||
"parts_tax_rates": "Parts Tax rates",
|
"parts_tax_rates": "Profile - Parts",
|
||||||
"partsfilter": "Parts Only",
|
"partsfilter": "Parts Only",
|
||||||
"partssubletstotal": "Parts & Sublets Total",
|
"partssubletstotal": "Parts & Sublets Total",
|
||||||
"partstotal": "Parts Total (ex. Taxes)",
|
"partstotal": "Parts Total (ex. Taxes)",
|
||||||
|
|||||||
Reference in New Issue
Block a user