Add database fields.

This commit is contained in:
Patrick Fic
2025-08-12 08:56:58 -07:00
parent d8124495e2
commit 09ddb85b8b
11 changed files with 61 additions and 20 deletions

View File

@@ -44,7 +44,7 @@ export default function JobLinesTableMolecule({ loading, job }) {
<Space wrap size={"small"}>
{record.line_desc}
{record.part_qty > 1 && <Tag color="orange">Quantity {">"} 1</Tag>}
{record.price_diff < 0 && record.db_ref?.startsWith("9005") && <Tag color="orange">Negative Savings</Tag>}
{record.price_diff < 0 && !record.db_ref?.startsWith("9005") && <Tag color="orange">Negative Savings</Tag>}
{/* {record.alerts &&
record.alerts.length > 0 &&
record.alerts.map((alert) => (

View File

@@ -236,13 +236,13 @@ export function ReportingJobsListMolecule({
size="small"
pagination={false}
dataSource={data}
// expandable={{
// expandedRowRender: (record) => <JobsClaimsClerkMolecule job={record} />,
// rowExpandable: (record) => record.alerts && record.alerts.length > 0
// }}
// scroll={{
// x: true
// }}
expandable={{
expandedRowRender: (record) => <JobsClaimsClerkMolecule job={record} />,
rowExpandable: (record) => record.alerts && record.alerts.length > 0
}}
scroll={{
x: true
}}
summary={() => (
<Table.Summary.Row>
<Table.Summary.Cell index={0}>

View File

@@ -236,6 +236,11 @@ export const QUERY_JOB_ESTIMATE_SCRUBBER = gql`
v_stage
supp_amt
g_bett_amt
bodyshop {
id
post_zip
phone
}
joblines(order_by: {line_no: asc}) {
line_no
line_ind

View File

@@ -183,7 +183,30 @@ export function* handleCalculateScoreCard({ payload: queriedJobs }) {
});
}
const jobAlerts = job.joblines
const simpleJobAlerts = [];
job.joblines.forEach((jobline) => {
if (jobline.part_qty > 1) {
simpleJobAlerts.push({
key: `line-${jobline.id}`,
alert: `Line ${jobline.line_no} has a quantity greater than 1 (${jobline.part_qty})`,
line_no: jobline.line_no,
line_desc: jobline.line_desc,
id: jobline.id
});
}
if (jobline.price_diff < 0 && !jobline.db_ref?.startsWith("9005")) {
simpleJobAlerts.push({
key: `line-${jobline.id}`,
alert: `Line ${jobline.line_no} has negative savings (${jobline.price_diff})`,
line_no: jobline.line_no,
line_desc: jobline.line_desc,
id: jobline.id
});
}
});
const jobAlerts = [...simpleJobAlerts, ...job.joblines
.map((jobline) =>
jobline.alerts?.map((alert, idx) => ({
key: idx,
@@ -194,7 +217,7 @@ export function* handleCalculateScoreCard({ payload: queriedJobs }) {
// }
}))
)
.flat();
.flat()];
//sum db price * percentage expected.
return {