Hi there,
I’d really appreciate some advice on the following if anyone has time. I’m designing an inventory control system. At present my ‘inventory’ table structure is as follows:
id
, item_id
, supplier_id
, quantity
, unit_price
, buy_price
, creation_date
This will allow for multiple entries for the same Item from the same Supplier at a different buy_price. The store owner wants to set a standard mark-up (e.g. $10) on each product. The store owner would also like to display the items ordered by most profitable first and then sell them them in this order.
Ok, ordering the products most profitable first is not a problem, however, I’m having trouble deciding how to decrease the stock levels.
Should I allow the inventory to be sold this way? In other words, does the principal of First-In First-Out (FIFO) apply to the order in which items are sold, or is this only applied to the accounting side of things?
I’ve been doing some calculations and the profit reports differ greatly depending on which order the items are sold.
e.g.
Lets say I have the following item in stock at the following two different prices (only relevant columns are shown for clarity):
item_id | quantity | unit_price | buy_price | Date
1234 | 4 | $25 | $10 | 2006-08-28
1234 | 2 | $30 | $20 | 2006-08-21
If the customer sells the cheapest (yet most profitable) one here and I use FIFO then the bottom quantity will be decremented first. This means 2 of Item 1234 will be sold for $25 but cost $20, making a total of 2 x $5 = $10 profit.
The Inventory table will then look like this:
item_id | quantity | unit_price | buy_price | Date
1234 | 4 | $25 | $10 | 2006-08-28
1234 | 0 | $30 | $20 | 2006-08-21
Due to the FIFO the inventory still shows 4 of Item 1234 at $25 because the first to be put in inventory (last weeks intake) are to be sold first. When the remaining four are sold they will make $15 each giving a total profit of $15 x 4 = $60 +$10 (from the first two) = $70
If FIFO is ignored the profit will be (4 X $15) + (2 x $10) = $80
What if the bottom quantity was larger than the top?
e.g.
item_id | quantity | unit_price | buy_price | Date
1234 | 2 | $25 | $10 | 2006-08-28
1234 | 8 | $30 | $20 | 2006-08-21
If the 2 for $25 were snapped up by some bargain hunting customer, then if FIFO is applied, the bottom quantity will decrement. Leaving the following:
item_id | quantity | unit_price | buy_price | Date
1234 | 2 | $25 | $10 | 2006-08-28
1234 | 6 | $30 | $20 | 2006-08-21
Now there are still 2 bargains even though these are supposed to be bought.
Please tell me if going way off track here. Something has to be wrong with this but I’m suffering from the old “paralysis by analysis”.
I also heard a suggestion that inventory should never be decremented, rather the difference between stock in and stock out should be taken as the current stock levels. I’m concerned that this will slow down the system when listing out the stock levels for all products as this difference will have to be calculated for each item. Any thoughts on this?
Any help will be greatly appreciated.
Cheers,
Psychie