I am creating a MySQL Database with PHP front-end to keep track of an inventory. This is how it works:
When the supplies come in, it is weighed and dated and goes into the Raw Materials bin. Now for the tricky part and where I need help to figure out. Next it is processed and the available weight is calculated. This processing can occur several different ways (i.e. type 1 - one weight, type 2 - one weight, etc. How and where would I do this calculation and have the available weight calculated each time it is processed. Then when it is finished, it goes to deliverables and any excess goes to the excess weight bin. How would it be best to do this? 😕
Should I create different tables for the inventory steps or one table? Should I use a primary key or not?
The supplies are bulk goods that will be recycled. They come in by truckload and are weighed. For example, steel, comes in with a weight of 21450 pounds on 9/8/08 with a shipment record of abc123 from ussteel with a type of cans- that is the raw weight, date received, reference number, origin and type is how it is received. Next it is processed and the status would change from raw to processed and then there would be a processed weight and a processed date. The processing can occur multiple times while the incoming raw materials is once per material reference. Also, the available weight should decrease after each processed weight occurs. When it is done processing, you are left with out processed weight, out date and waste weight.