Did you see the
sample function at the Allen Browne link?
What is the business process by which your Inventory is reduced? Do you sell to Customers? If so, that should be in your model.
According to your model ( to me anyway), you only receive Products, so Inventory is always increasing.
A "
typical inventory management system" is often more complex than expected.
In many Inventory management systems, there is a Transaction table. Acquisitions from Supplier(s) is considered a positive(+) transaction, and each Sale is considered a negative(-) transaction. There are incidents of theft, misplacement, breakage/damage to Items in Inventory, so from time to time there is a manual Stock Taking of each Item in Inventory.
The current Inventory(per Item) is calculated using:
Code:
Current Quantity for each Item = Latest StockTaking Count + Acquistions since last StockTaking - Sales since last StockTaking
or said slightly differently
Current Inventory (Item X) = LatestStockOnHandCount(Item X)
+Incoming TransactionCount (Item X)
- Outgoing TransactionCount (Item X)
These are often concerns with Inventory Management.
How do you record Prices? How do you change Prices?
Do you ever Request X of Product and Receive only a Partial Order? (BackOrders)
Do you ever get some sort of substitution Product because the supplier does not have sufficient Product on hand?
Good luck.