>This question is more about how inventory is handled in actual practice - not about how to program it in a specific language.
>
>Items may be available in larger and smaller groups. To give an example, a shop may sell a kg. of a certain type of screws, but it may also sell individual screws. Of course, this is just an example. The shop may decide to sell screws only one package at a time - but there may still be a similar situation in the case of other products.
>
>How is this handled for the sale, and updating the inventory, in the computer system? I would imagine that there would have to be a special process where the user must register the "unpacking" of a package, converting, e.g., one kg. of screws into 150 individual screws - or whatever the average number determined for this kind of screw. Then, 1 unit (1 kg. in this case) of one item (the package) would have to be discounted from the inventory, while on the other hand, 150 units (individual screws) would have to be added to another inventory item.
>
>This is the general idea I have, but I have never seen it done in practice, and would be grateful for any advice on how this is usually managed.
You could consider using SKUs or some equivalent scheme:
http://en.wikipedia.org/wiki/Stock-keeping_unitThe basic idea is that a single part can have multiple SKUs:
Parts table:
PartID: 1234 PartNumber: 4321 Description: Screw
SKUs table:
SKUID: 5678 PartID: 1234 Qty: 1 Units of Measure: Each
SKUID: 5679 PartID: 1234 Qty: 150 Units of Measure: Each
Items such as screws usually aren't counted individually (unless they are large), in many cases a Unit of Measure such as weight may be more appropriate.
Since the part IDs (and related Part Numbers) remain the same across multiple SKUs holding various quantities, when a manager asks "How many Part Number 4321 do we have?", you can answer.
As you point out, you can enable inventory transactions to break down or consolidate related SKUs into one another.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up