Graphic Interface
In the Graphical Interface you can make a Customer Table , with columns such as "Customer Name", "Order Quantity", etc. That is, each Line with a different Client.
When you click on a Line in this Customer Table you open another Screen with another Table; this second screen will have Customer information and will also have a Order Table from this Customer, with Columns such as "Order Quantity", "Order Date" etc. All Orders made by this Client will be in this Table.
When you click on a line in the Order Table you can open a Screen with the Items that are displayed in another Screen (or open in a "Call Box" [floating or not] below the Line) in this Order, where the Columns would be "Product Name", "Quantity", "Unit Value", "Total Value", etc.
Here is an example I created here from the Client Data Screen:
Notethatyouwillneedalotmorethings,suchaspaymentmethods,installments,etc.Thisisjustanideaoflayou.
ClassDesign(applicationlogic):
Youcancreatea"Customer" Class that will have a "Request" List of Objects, each "Order" Object will have List of Objects "Ordered Item", and each "Ordered Item"
- ONE (Exactly ONE) Item "Item" (the Product) that already has "Code" his and his name;
- The Amount (% with% of units purchased in this Order);
- The "Unit Value", the "Total Value" (which is "amount * Unit Value"), and the "Paid Value".
Remember to use " Money and Currency API " or at least int
to deal with money, do not use BigDecimal
for this (see here because using BigDecimal instead of Double to deal with money).