Hi everyone, I am having trouble figuring how to to implement this into my app. Right now I have an ordering app where people from various departments can order items for their department. I want to make it between different orders, if the departments match and if the items match that it will add up the total items bought into one transaction. For example:
Person a is from department a and orders 5 black pens.
Person b is from department b and orders 5 black pens.
Person c is from department a and orders 5 black pens.
So I would want to figure out how to combine Person a's order and Person c's order to combine the 5 black pens from both their orders into 1 line that says 10 black pens, but not Person b's order as they are part of a different department.
Right now I have all the information saved into two collections
This is the collection that contains all the information about the order: (Name of person, which department, the date and any comments/concerns)
'Cart Orders', Defaults('Cart Orders'), {Title: Name_TInt.Text, Department: Department_Dropdown.SelectedText, Date: Date_TInt.Text, Comment: Comment_Box.Text})
And this is the collection with all the items ordered: (Name of item, how many pieces and bundles they want and the total amount of pieces they are ordering).
(cart, {Title: ThisItem.Description, Qty: ThisItem.'Qty per Bundle', Pieces: Value(Pcs_Nd_TInt.Text), Bundles: Value(Bndl_Nd_TInt.Text), Total: ((Bndl_Nd_TInt) * ThisItem.'Qty per Bundle' + Pcs_Nd_TInt)});