From b08435607ea001b718661ecf7bb1a934c9507b36 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Sat, 31 Jan 2026 17:43:16 -0800 Subject: [PATCH] IO-3529 CM Recieved Fix Signed-off-by: Allan Carr --- .../parts-order-modal/parts-order-modal.container.jsx | 3 ++- client/src/graphql/parts-orders.queries.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx index b909209f5..1d68645be 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx @@ -89,7 +89,8 @@ export function PartsOrderModalContainer({ return { ...p, - job_line_id: jobLineId + job_line_id: jobLineId, + ...(isReturn && { cm_received: false }) }; }); diff --git a/client/src/graphql/parts-orders.queries.js b/client/src/graphql/parts-orders.queries.js index 264e7d7a5..b3de911a2 100644 --- a/client/src/graphql/parts-orders.queries.js +++ b/client/src/graphql/parts-orders.queries.js @@ -356,7 +356,10 @@ export const MUTATION_BACKORDER_PART_LINE = gql` export const QUERY_UNRECEIVED_LINES = gql` query QUERY_UNRECEIVED_LINES($jobId: uuid!, $vendorId: uuid!) { parts_order_lines( - where: { parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId } }, cm_received: { _neq: true } } + where: { + parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId }, return: { _eq: true } } + _or: [{ cm_received: { _neq: true } }, { cm_received: { _is_null: true } }] + } ) { cm_received id