Linking orders to repairs
Create parts orders from a repair so statuses, totals, and ordered items stay connected to that job.
A linked order is just a normal order record that also carries a repair_id in the background. Linking is useful when the parts were ordered specifically for one repair and you want the repair screen and repair documents to reflect that.
Why link an order to a repair
- The repair detail screen shows related orders in its own orders section.
- Linked order totals are included in the repair cost/document flows, so part costs stay attached to the job they belong to.
- Waiting for Parts becomes more meaningful when there is a real order connected to that repair.
How linking works now
- 1Open the repair detail screenStart from the repair that needs parts.
- 2Use Add Part from the repair actionsThis opens the order form with the repair link already attached in the background and the customer preselected when available.
- 3Fill in the supplier, status, items, dates, and any depositThe save flow stores the order normally while keeping the repair link.
- 4Save the orderThe new order appears in the repair detail orders section automatically.
Where linked orders appear
- Repair detail: linked orders show in the related orders section with their own status badges.
- Repair invoice and receipt flows: linked order items contribute to the repair-side totals and parts breakdown.
- Order management: the order still behaves like any other order for payments, statuses, supplier info, and activity history.
Changing or removing a link
The current order form preserves an existing repair link, but it does not expose a dedicated repair-link field for changing it manually. In practice, the safest current workflow is to create the linked order from the correct repair in the first place. If you created the wrong linked order, delete it and recreate it from the right repair context.
What happens when records are deleted
- If you delete the order, the repair remains and simply loses that related order entry.
- If you delete the repair, the database clears repair_id on linked orders instead of deleting the orders themselves.
- Customer deletion is already blocked by linked-history rules, so linked repairs/orders keep the customer history intact.