Design – Inventory Management System Design Problem: ‘Items Packages’

database-designdesign

I am developing a retail management system with inventory management module, I am facing a logic design problem and I don't really know how to address the problem in an easy way, so I wrote an example which illustrates that problem:

Let's say I have an item (e.g. Cola Can), this item have a Barcode (11…1), this is so good until now and we can sell the item smoothly using the Cola Can barcode(11…1). However, when the warehouse buys cola can they buy with larger package for simplicity 6 cans packages which have different barcode(11…2), after that the 6 packages is braked down into 1-1 cans and sold per item of barcode (11…1).

The problem is that you buy with package and sell per item which will make the reports for the inventory incorrect, and the inventory stock will never match.

How to control this packages problem or should the system deals with the smallest package only (e.g. when I buy 6 cans package, the warehouse should enter 6 items of single can barcode)?

Best Answer

You're going to need to bust the assembly when an item within it is sold. Add the remaining items from the assembly to inventory and subtract the case. This will effectively balance out your inventory.

As per request via comments, I will adjust my answer accordingly.

We can use your 'Cola Can' example to help us visualize. We all know that you can buy 12 can cases of Cola 'Case Upc (11..2)', but lets say we want to sell them individually 'Unit Upc (11..1)'. In addition for clarification, let's say that your physical and logical inventory match in that all Single Cans have been sold. The process would go something along the lines of this.

if (inventory of single cola == 0) and (inventory of case cola > 0) then
    subtract 1 case from inventory of case cola.
    add the number of cola in 1 case of cola to single cola inventory
    subtract 1 single cola from single cola inventory

While the code is a bit rough, the example should show you how to effectively get your result.

Related Topic