CodeIgniter Forums
FIFO / LIFO method in Inventory System - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: FIFO / LIFO method in Inventory System (/showthread.php?tid=81926)

Pages: 1 2


RE: FIFO / LIFO method in Inventory System - InsiteFX - 05-30-2022

Basics of LIFO and FIFO Inventory Accounting Methods
I just found this may also help you.


RE: FIFO / LIFO method in Inventory System - paulbalandan - 06-02-2022

If you are developing only an Inventory System, you cannot derive the profit or loss from that. That is because profit or loss means your Sales less Cost of Sales less Operating Expenses add Other Income equals Net Income. This is the job of an accounting system.

Your inventory system can only assist you in tracking the number of units of the inventories from the point of purchase up to the point of sale, which is where the FIFO/LIFO method comes into play. Also, your inventory system needs also to track every cost of purchase because that would be crucial in the costing method using either FIFO/LIFO.

I will explain further in layman's terms:
1. Suppose you have four purchases throughout the month. 1 pc for $10, 2pcs for $15 each, 1pc for $12, 3pcs for $11 each.
2. Suppose at the end of the month you made a sale of 3pcs.
3. In terms of ending number of pieces, regardless of FIFO/LIFO, I have remaining of 4 pcs.
4. In terms of costing, under the FIFO method, my cost of sales would be $40. This is computed as the cost of 1pc purchased 1st, then the cost of 2pcs purchased 2nd. That is, 1pc x $10 + 2pcs x $15 = $40.
5. Under the LIFO method, it is a different thing. You'll be pulling the cost first from the last purchased. So that would be $33 (which is 3pcs x $11).

Now, it will be up to you to do the code that will implement the business logic I described above. The readings on stacks will be helpful.