From ea9e4ffcad5a6300221f72cbce5f4e04900849c7 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Sat, 31 Jan 2026 16:59:17 -0800 Subject: [PATCH 1/2] IO-3529 Fix for Parts Return Signed-off-by: Allan Carr --- .../bill-detail-edit-return.component.jsx | 6 +++++- .../parts-order-modal.component.jsx | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx index 775f4d32b..ed9743c2d 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx @@ -48,7 +48,7 @@ export function BillDetailEditReturn({ setPartsOrderContext, data, disabled }) { // db_price: i.actual_price, act_price: i.actual_price, cost: i.actual_cost, - quantity: i.quantity, + part_qty: i.quantity, joblineid: i.joblineid, oem_partno: i.jobline && i.jobline.oem_partno, part_type: i.jobline && i.jobline.part_type @@ -104,6 +104,10 @@ export function BillDetailEditReturn({ setPartsOrderContext, data, disabled }) { {fields.map((field, index) => ( + {/* Hidden field to preserve the id */} + ( + + + + +); + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, isPartsEntry: selectIsPartsEntry @@ -199,10 +206,7 @@ export function PartsOrderModalComponent({ key={`${index}act_price`} name={[field.name, "act_price"]} > - - - - + {isReturn && ( Date: Sat, 31 Jan 2026 17:43:16 -0800 Subject: [PATCH 2/2] 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