Show relationship data from multiple relations
I want to show related records when editing a resource.
I have 3 resources
1. Product
2. Order
3. Dispatch
When creating an Order we can attach multiple Products to it. When creating a Dispatch we have a select field to choose Order to dispatch. Upon selection of an appropriate order we should have option to add Quantity for each Product added to the selected Order.
When user creating another Dispatch for the same Order, previous dispatch details should be showing with Product quantities.
1 Reply
Table structures are as:
products: id, name
orders: id, customer_id
order_product: order_id, product_id, quantity
dispatches: id, order_id
order_dispatch_product: dispatch_id, order_id, product_id, dispatched_quantity