Hi @jameslusk,
I think you’re very close with a few adjustments needed to your data structure. Am I correct in assuming that Products are set items (like Inventory) that you offer as things available for applying a service (laundry, dry cleaning, etc.)? If so, you need to remove the quantity and total fields out of there. Please review the below data structure and let me know if I misunderstood something, but this should allow you to create the invoicing system you need:
Product
- Price (number)
- Name (text)
- Category (text)
Line Item
- Product (Product)
- Quantity (number)
- Total Cost (number)
Order
- Customer Name (text)
- Customer Phone (text)
- Line Items (List of Line Items)
- Total Cost (number… “This Order’s Line Items’ Total Cost :sum” )
Every time a customer fills out an order, they create a line item so that quantities and total costs can be associated independently for each Product. The Line Item itself should be a separate entity from the Product because different customers will have different quantities.
Add each Line Item to the Customer’s Order… to the Line Items list field.
This list can be displayed in a repeating group (type: Line Item, source: Order’s Line Items). Within each cell you can add text elements to display “Current Cell Line Item’s Quantity” and name, etc. Here you’ll be able to see the breakdown you’re asking for.
Let me know if you have any questions.
Gaby | Coaching Bubble