Quantity Calculation
You already have a carton specification table that lists how many dozens make up a carton.
You know that a dozen is 12 items.
The mechanism is pretty straightforward.
Carton Specification Table
Let's define your carton specification table.
Carton Specification
--------------------
Carton Specification ID
SKU
Carton quantity (in dozens)
Stock Quantity Table
Let's assume we have a stock quantity table like this.
Stock Quantity
--------------
Stock Quantity ID
SKU
Quantity (in units)
Calculations
From one of your examples, we read a row in the stock quantity table for SKU 4545, and we get the quantity. 99 units.
Now, we read the row of your carton specification table for SKU 4545, and we get the carton quantity. 7 dozen. (7 * 12) = 84. Therefore, we have 84 units in a carton.
Divide 84 into 99 (99 / 84). The answer is 1. We have one carton of units.
Now, multiply 1 times 84 and subtract that amount from 99 (99 - (84 * 1)). The answer is 15.
Divide 12 into 15 (15 / 12). The answer is 1. We have one dozen units.
Nove, multiply 1 times 12 and subtract that amount from 15 (15 - (12 * 1)). The answer is 3.
Therefore, we have 1 carton, 1 dozen, and 3 units of SKU 4545, which is what you would display.