Move changes from incorrectly committed to branch.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"productName": "ImEX RPS",
|
"productName": "ImEX RPS",
|
||||||
"author": "ImEX Systems Inc. <support@thinkimex.com>",
|
"author": "ImEX Systems Inc. <support@thinkimex.com>",
|
||||||
"description": "ImEX RPS",
|
"description": "ImEX RPS",
|
||||||
"version": "1.4.2-alpha.2",
|
"version": "1.4.2-alpha.3",
|
||||||
"main": "electron/main.js",
|
"main": "electron/main.js",
|
||||||
"homepage": "./",
|
"homepage": "./",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { PrinterFilled, WarningOutlined } from "@ant-design/icons";
|
import { PrinterFilled, WarningOutlined } from "@ant-design/icons";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
import { Alert, Button, Descriptions, Skeleton, Space, Tooltip } from "antd";
|
import { Alert, Button, Descriptions, Skeleton, Space, Tooltip } from "antd";
|
||||||
import React, { useMemo, useRef } from "react";
|
import moment from "moment";
|
||||||
|
import { useMemo, useRef } from "react";
|
||||||
|
import { useReactToPrint } from "react-to-print";
|
||||||
import { DateFormat, WhichRulesetToApply } from "../../../util/constants";
|
import { DateFormat, WhichRulesetToApply } from "../../../util/constants";
|
||||||
import dayjs from "../../../util/day.js";
|
import dayjs from "../../../util/day.js";
|
||||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||||
@@ -11,14 +13,8 @@ import TimeAgoFormatter from "../../atoms/time-ago-formatter/time-ago-formatter.
|
|||||||
import VehicleGroupAlertAtom from "../../atoms/vehicle-group-alert/vehicle-group-alert.atom";
|
import VehicleGroupAlertAtom from "../../atoms/vehicle-group-alert/vehicle-group-alert.atom";
|
||||||
import CloseDateDisplayMolecule from "../close-date-display/close-date-display.molecule";
|
import CloseDateDisplayMolecule from "../close-date-display/close-date-display.molecule";
|
||||||
import JobGroupMolecule from "../job-group/job-group.molecule";
|
import JobGroupMolecule from "../job-group/job-group.molecule";
|
||||||
import moment from "moment";
|
|
||||||
import { useReactToPrint } from "react-to-print";
|
|
||||||
|
|
||||||
export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailRef }) {
|
export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailRef }) {
|
||||||
const hasQuantityGreaterThan1 = useMemo(() => {
|
|
||||||
return job?.joblines?.find((jl) => !jl.ignore && jl.quantity > 1);
|
|
||||||
}, [job]);
|
|
||||||
|
|
||||||
// Store original theme state
|
// Store original theme state
|
||||||
const originalThemeRef = useRef(null);
|
const originalThemeRef = useRef(null);
|
||||||
|
|
||||||
@@ -28,21 +24,21 @@ export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailR
|
|||||||
onBeforeGetContent: () => {
|
onBeforeGetContent: () => {
|
||||||
// Store original theme state
|
// Store original theme state
|
||||||
originalThemeRef.current = {
|
originalThemeRef.current = {
|
||||||
dataTheme: document.documentElement.getAttribute('data-theme'),
|
dataTheme: document.documentElement.getAttribute("data-theme"),
|
||||||
bodyClasses: Array.from(document.body.classList),
|
bodyClasses: Array.from(document.body.classList),
|
||||||
htmlClasses: Array.from(document.documentElement.classList),
|
htmlClasses: Array.from(document.documentElement.classList)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Force light mode for printing
|
// Force light mode for printing
|
||||||
document.documentElement.setAttribute('data-theme', 'light');
|
document.documentElement.setAttribute("data-theme", "light");
|
||||||
document.body.classList.remove('dark', 'ant-dark');
|
document.body.classList.remove("dark", "ant-dark");
|
||||||
document.documentElement.classList.remove('dark', 'ant-dark');
|
document.documentElement.classList.remove("dark", "ant-dark");
|
||||||
|
|
||||||
// Set light mode CSS variables for Ant Design
|
// Set light mode CSS variables for Ant Design
|
||||||
document.documentElement.style.setProperty('--ant-color-bg-base', '#ffffff');
|
document.documentElement.style.setProperty("--ant-color-bg-base", "#ffffff");
|
||||||
document.documentElement.style.setProperty('--ant-color-text', '#000000');
|
document.documentElement.style.setProperty("--ant-color-text", "#000000");
|
||||||
document.documentElement.style.setProperty('--ant-color-text-secondary', 'rgba(0, 0, 0, 0.65)');
|
document.documentElement.style.setProperty("--ant-color-text-secondary", "rgba(0, 0, 0, 0.65)");
|
||||||
document.documentElement.style.setProperty('--ant-color-border', '#d9d9d9');
|
document.documentElement.style.setProperty("--ant-color-border", "#d9d9d9");
|
||||||
},
|
},
|
||||||
onAfterPrint: () => {
|
onAfterPrint: () => {
|
||||||
// Restore original theme after printing
|
// Restore original theme after printing
|
||||||
@@ -50,21 +46,21 @@ export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailR
|
|||||||
const { dataTheme, bodyClasses, htmlClasses } = originalThemeRef.current;
|
const { dataTheme, bodyClasses, htmlClasses } = originalThemeRef.current;
|
||||||
|
|
||||||
if (dataTheme) {
|
if (dataTheme) {
|
||||||
document.documentElement.setAttribute('data-theme', dataTheme);
|
document.documentElement.setAttribute("data-theme", dataTheme);
|
||||||
} else {
|
} else {
|
||||||
document.documentElement.removeAttribute('data-theme');
|
document.documentElement.removeAttribute("data-theme");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore original classes
|
// Restore original classes
|
||||||
document.body.className = bodyClasses.join(' ');
|
document.body.className = bodyClasses.join(" ");
|
||||||
document.documentElement.className = htmlClasses.join(' ');
|
document.documentElement.className = htmlClasses.join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset CSS variables
|
// Reset CSS variables
|
||||||
document.documentElement.style.removeProperty('--ant-color-bg-base');
|
document.documentElement.style.removeProperty("--ant-color-bg-base");
|
||||||
document.documentElement.style.removeProperty('--ant-color-text');
|
document.documentElement.style.removeProperty("--ant-color-text");
|
||||||
document.documentElement.style.removeProperty('--ant-color-text-secondary');
|
document.documentElement.style.removeProperty("--ant-color-text-secondary");
|
||||||
document.documentElement.style.removeProperty('--ant-color-border');
|
document.documentElement.style.removeProperty("--ant-color-border");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -141,14 +137,6 @@ export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailR
|
|||||||
</Space>
|
</Space>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
|
|
||||||
{hasQuantityGreaterThan1 && (
|
|
||||||
<Alert
|
|
||||||
type="warning"
|
|
||||||
showIcon
|
|
||||||
message="At least one estimate line has multiple quantities. MPI best practices for RPS recognition is to create multiple lines rather than increase quantity."
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CalculatorOutlined } from "@ant-design/icons";
|
import { CalculatorOutlined } from "@ant-design/icons";
|
||||||
import { Input, Space, Table, Tag } from "antd";
|
import { Input, Space, Table, Tag } from "antd";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import ipcTypes from "../../../ipc.types";
|
import ipcTypes from "../../../ipc.types";
|
||||||
import { alphaSort } from "../../../util/sorters";
|
import { alphaSort } from "../../../util/sorters";
|
||||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||||
@@ -40,19 +40,20 @@ export default function JobLinesTableMolecule({ loading, job }) {
|
|||||||
key: "line_desc",
|
key: "line_desc",
|
||||||
width: "25%",
|
width: "25%",
|
||||||
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
//2025-05-27 Removing CC AI
|
render: (text, record) => (
|
||||||
// render: (text, record) => (
|
<Space wrap size={"small"}>
|
||||||
// <Space wrap size={"small"}>
|
{record.line_desc}
|
||||||
// {record.line_desc}
|
{record.part_qty > 1 && <Tag color="orange">Quantity {">"} 1</Tag>}
|
||||||
// {record.alerts &&
|
{record.price_diff < 0 && record.db_ref?.startsWith("9005") && <Tag color="orange">Negative Savings</Tag>}
|
||||||
// record.alerts.length > 0 &&
|
{/* {record.alerts &&
|
||||||
// record.alerts.map((alert) => (
|
record.alerts.length > 0 &&
|
||||||
// <Tag key={`${record.id}-${alert.key}`} color="red">
|
record.alerts.map((alert) => (
|
||||||
// {alert.key}
|
<Tag key={`${record.id}-${alert.key}`} color="red">
|
||||||
// </Tag>
|
{alert.key}
|
||||||
// ))}
|
</Tag>
|
||||||
// </Space>
|
))} */}
|
||||||
// )
|
</Space>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Part Type",
|
title: "Part Type",
|
||||||
@@ -116,8 +117,8 @@ export default function JobLinesTableMolecule({ loading, job }) {
|
|||||||
key: "ignore",
|
key: "ignore",
|
||||||
filters: [
|
filters: [
|
||||||
{ text: "Eligible for RPS Calculation", value: false },
|
{ text: "Eligible for RPS Calculation", value: false },
|
||||||
{ text: "Ineligible for RPS Calculation", value: true },
|
{ text: "Ineligible for RPS Calculation", value: true }
|
||||||
// { text: "Lines with identified issues", value: "ai" }
|
// { text: "Lines with identified issues", value: "ai" }
|
||||||
],
|
],
|
||||||
width: "5%",
|
width: "5%",
|
||||||
filteredValue: filters.ignore || null,
|
filteredValue: filters.ignore || null,
|
||||||
@@ -134,7 +135,7 @@ export default function JobLinesTableMolecule({ loading, job }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
<Input.Search
|
<Input.Search
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
onSearch={(val) => {
|
onSearch={(val) => {
|
||||||
@@ -160,6 +161,6 @@ export default function JobLinesTableMolecule({ loading, job }) {
|
|||||||
// y: "20rem"
|
// y: "20rem"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user