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


FIFO / LIFO method in Inventory System - lazyme114 - 05-23-2022

I have an inventory system with sales, purchase, purchase return , sales return and purchase addition. But I have to add FIFO / LIFO method in this system. What is the best way to do it. I haven't done this kind of thing so I am new to it. If anyone has experience in this type of project please help. Thanks.


RE: FIFO / LIFO method in Inventory System - ignitedcms - 05-23-2022

I'm not sure if you actually need FIFO for this, but PHP has native helper functions to achieve this. You can quickly create your own library for such a task such as ->

https://www.ignitedcms.com/documentation/list


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

I found this may help.

PHP stack with SplStack - FIFO LIFO


RE: FIFO / LIFO method in Inventory System - lazyme114 - 05-26-2022

Thanks for the reply, but I am looking for something that helps in valuation of product, cost of good of product and at the end profit / loss from that product. It needs some accounting concepts.


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

Not much on it I did find this one also is this what your looking for?

Inventory Valuation — LIFO vs. FIFO


RE: FIFO / LIFO method in Inventory System - lazyme114 - 05-27-2022

(05-27-2022, 12:22 AM)InsiteFX Wrote: Not much on it I did find this one also is this what your looking for?

Inventory Valuation — LIFO vs. FIFO

Yes something like that.


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

Here are a couple more links.

LIFO (Last-In-First-Out) approach in Programming

FIFO vs LIFO approach in Programming


RE: FIFO / LIFO method in Inventory System - lazyme114 - 05-28-2022

Thanks for the reply. I read through the links and it helped me a lot. But my problem is a little bit different from them. I have to manage Purchase, Purchase Return, Sales and Sales Return in fifo methodology and calculate inventory valuation. My scenario is something like this.
1. When purchase, it creates a stack with quantity. if it is the first stack then it will be open stack
2. Sales reduces quantity from the open stack.
3. Purchase Return reduces quantity from the open stack.
4. Sales Return creates a new stack.
5. When the stack is empty it gets closed and the second stack gets open from fifo logic.

Well thats the basic logic and then I have to calculate the profit / loss from them.


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

Sorry but I cannot find anything on the way you are describing, you will need to break the problem
down into smaller problems and solve them one by one.

First off I would break it down into what type of data you will need to work with and store.
Then work on your seperate methods.


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

(05-30-2022, 12:58 AM)InsiteFX Wrote: Sorry but I cannot find anything on the way you are describing, you will need to break the problem
down into smaller problems and solve them one by one.

First off I would break it down into what type of data you will need to work with and store.
Then work on your seperate methods.

Thanks I will try out that way. hope I will be able to complete this.