Add SUV and quantity check.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
import { PageHeader } from "@ant-design/pro-layout";
|
||||
import { Alert, Descriptions, Skeleton, Space, Tooltip } from "antd";
|
||||
import React from "react";
|
||||
import React, { useMemo } from "react";
|
||||
import { DateFormat, WhichRulesetToApply } from "../../../util/constants";
|
||||
import dayjs from "../../../util/day.js";
|
||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||
@@ -13,13 +13,16 @@ import CloseDateDisplayMolecule from "../close-date-display/close-date-display.m
|
||||
import JobGroupMolecule from "../job-group/job-group.molecule";
|
||||
|
||||
export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
const hasQuantityGreaterThan1 = useMemo(() => {
|
||||
return job?.joblines?.find((jl) => !jl.ignore && jl.quantity > 1);
|
||||
}, [job]);
|
||||
if (loading) return <Skeleton active />;
|
||||
|
||||
if (!job)
|
||||
return (
|
||||
<ErrorResultAtom title="Error displaying job header data." errorMessage="It looks like this job doesn't exist." />
|
||||
);
|
||||
const ruleSetToApply = WhichRulesetToApply(job.close_date);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
@@ -83,6 +86,14 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
</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>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -355,5 +355,6 @@
|
||||
"EQUINOX EV",
|
||||
"NAUTILUS HYBRID",
|
||||
"TRAVERSE LIMITED",
|
||||
"CX-70"
|
||||
"CX-70",
|
||||
"SANTA FE XL"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user