A musing on the how to deal with product stock when one-in - one-out doesn't quite fit
So, in a simple universe, your clever widgets web-shop e-commerce platform would have a stock system where you would add a record showing 2 cases of 24 items in, then each order would reduce the stock count. 48 items in, less 10 sold, less a couple pilfered, broken, sampled by management or whatever, 36 left in stock - simple. Another delivery of 24 and another sale of 6 = 54 in stock. No problem.
Opening stock: 0
Goods inward 24 x 2: 48
Sales 10: 38
Snaffled: 2: 36
Goods inward 24 x 2: 60
Sales 6: 54
So, what if you're pub and you've decided to start selling beer as take out? First, let's consider what a stack system would have to deal with under normal pub operating conditions.
Real ale is commonly received by pubs in 9 gallon firkins, which should contain 72 pints. So we could use our simple system above to register 72 pints as goods inward, and reduce the stock count for each pint sold. The first problem with this is allowing for half pints. Ok, so we could use 'half pint' as the stock unit and add 144 when a cask is delivered, and reduce the stock count by 2 for each pint. Ah, but as a few beer nerds will know, 'third of a pint' is also a legal dispensable measure. Setting the stock unit as 1/3 pint would work for sales of pints, but not for half a pint.
The are ways to solve the specific issue of buying in firkins and selling in 1/3 pints, but I'd like to explore the issue more broadly.
Sticking with the pub model, (yes, I had my own pub once), another product with awkward measures is wine. Case sizes vary, but most wine is bought in 75cl bottles and can be sold in multiples of 125ml and 175ml. A 75cl bottle is exactly 6 of the smaller 125ml measure, but the more common 'medium glass' 175ml measure causes problems. Serving 4 medium glasses leaves you with 50ml which you have to drink yourself, no? Ending up with not quite empty bottles isn't really the problem though, it's choosing a practical base stock control unit.
Some POS systems I've used in that past used 'variants' of a product to process the sale of different versions of a product at different prices, but the stock for each variant was counted separately. For example, you could add a product '1 pint of Fine Ale at £3.00', and then add 1/2 and 1/3 options at £1.50 and £1.00 respectively, but without a shared lowest common denominator stock counting failed.
When taking a firkin into stock you could tell the POS system you have 72 pints, 144 1/2 pints, and 216 half pints, but that would mean the total stock would be 216 pints, and the only way round the problem would be to have one firkin for each measure, or one bottle of gin for singles and another for doubles. Or constantly count and adjust, or just not bother using the stock control feature of the POS, which is what I tended to choose.
Discussing the problem seems to have highlighted a potential solution. The UK Gov 'Weights and measures' guidance is also useful.
In metric terms the lowest common denominator unit size for alcohol is millilitres. So, a firkin would be 40,896ml in, and a pint would be 568ml out and a 1/2 pint 284ml. Ok, so 1/3 of a pint is 189.333333333333333 but 189 would be more than close enough in a real world setting.
All I need to do now is to think through the 'add to basket' implications for online sales. I don't want a different product listed for each size.