FIFO Costing Method Is Functional?

637 views
Skip to first unread message

Jorge Colmenarez

unread,
Jul 11, 2017, 12:11:18 AM7/11/17
to iDempiere
Hello community, I'm trying to set up a company with the FIFO cost method, however, I applied what I found in forums without success.

For example, I saw that to use this method must be parameterized:

The costing method to FIFO (obviously)
The level of cost per Lots.
The product must handle product instance.
Generate a Purchase Order and complete it.
Generate a Receipt of Materials from the Purchase Order. (Here is the problem does not count, says that does not get cost for the item)

I do not know if I missed something, or this method is not supported.

If someone knows the case, you can guide me.

Greetings.

Orlando Curieles

unread,
Jul 11, 2017, 12:18:11 AM7/11/17
to idem...@googlegroups.com
Hi Jorge, of course yes is supported, i use that everiday, tell me what costing method are you using on Accounting Shchema?

Regards

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/0ad2d2a5-4e68-4779-8b97-f84949b1ac36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jorge Colmenarez

unread,
Jul 11, 2017, 12:26:20 AM7/11/17
to iDempiere
Hello Orlando, thanks for replying, the costing method that I have set up in the accounting scheme is PePs (Fifo) and Costing Level (Batch / Lot) 

Regards 

El martes, 11 de julio de 2017, 0:18:11 (UTC-4), Orlando Curieles escribió:
Hi Jorge, of course yes is supported, i use that everiday, tell me what costing method are you using on Accounting Shchema?

Regards
2017-07-10 23:11 GMT-05:00 Jorge Colmenarez <jlct....@gmail.com>:
Hello community, I'm trying to set up a company with the FIFO cost method, however, I applied what I found in forums without success.

For example, I saw that to use this method must be parameterized:

The costing method to FIFO (obviously)
The level of cost per Lots.
The product must handle product instance.
Generate a Purchase Order and complete it.
Generate a Receipt of Materials from the Purchase Order. (Here is the problem does not count, says that does not get cost for the item)

I do not know if I missed something, or this method is not supported.

If someone knows the case, you can guide me.

Greetings.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Orlando Curieles

unread,
Jul 11, 2017, 12:41:24 AM7/11/17
to iDempiere
what are you traying with this ? can you explain your requeriment ?

 Are you read the MCost.java ?

Regards

Jorge Colmenarez

unread,
Jul 11, 2017, 12:50:02 AM7/11/17
to iDempiere
Could you tell me How do you have the parameterization in the system for you to work?

Jorge Colmenarez

unread,
Jul 11, 2017, 10:12:24 AM7/11/17
to iDempiere
Hello Orlando, I have reviewed and debugged the MCost.java class with a new product that I have created for testing and I can observe that the system first checks if there is already any cost for the product, as it is obvious new does not exist, then asks if The method of cost is FIFO or LIFO looks for if it has some cost in queue, as it has not been created none returns 0, later it looks for the seed cost, but in the source this conditioned that when is FIFO returne null.

I would like to understand a little more the operation of the same, maybe it is that I am ovbiando some parameterization.

I hope you can guide me.

Greetings.

El martes, 11 de julio de 2017, 0:41:24 (UTC-4), Orlando Curieles escribió:

Jorge Colmenarez

unread,
Jul 12, 2017, 11:32:57 AM7/12/17
to iDempiere
Hello everyone, I have been studying the MCost.java class to understand the FIFO cost calculation in the system, and I see for example the method calculateFiFo looks for the transactions until the billing, I have also reviewed the MCostDetail.java class and note that in the method process creates the cost queue only when the invoice line is not empty.

My question is: the orientation of the process to calculate the cost using the FIFO costing method must be the order first, then the invoice and last the reception of mareriales?

PD: I have performed a test with the indicated order and the result is the same, it does not generate cost for the product using the FIFO costing method

My parameterization is as follows:

Accounting Scheme:

Costing Method: FIFO
Cost Level: Batch
Product: Test 01
Set of Attributes: Batch

If someone can guide me I would appreciate it.

Greetings.

Jorge Colmenarez

unread,
Jul 12, 2017, 12:05:43 PM7/12/17
to iDempiere
I have been able to solve the problem with the cost, however, I had to apply some corrections / improvements to the class MCost.java and MCostDetail.java, how can I do to have it evaluated and checked if it seems correct?

Gaurav dilip sontakke

unread,
Jul 12, 2017, 12:36:51 PM7/12/17
to iDempiere
Hello Jorge, 

We are also trying to use the FIFO but we can see the same problem system is not able to create costing for fifo. I have also confirmed that if costing is fifo/lifo system goes and tries to find cost queue if the queue is empty it goes into getSeedCosts method in MCost but the method return null. 

Can you please let me know what fixes you have applied .

Thank you.

Carlos Collazos

unread,
Jul 12, 2017, 12:42:37 PM7/12/17
to idem...@googlegroups.com
Would you mind to share what is the problem? Maybe that way someone could give you a hint on how to improve the code without touching the core or if it's a bug it could be fixed by the core maintainers.

Regards,

---------------------------------
Carlos Collazos
coll...@gmail.com
----------------------------------

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/f4edd033-dc12-4807-bd11-1745ec281a22%40googlegroups.com.

Gaurav dilip sontakke

unread,
Jul 12, 2017, 1:01:31 PM7/12/17
to iDempiere
Hi , 

Material receipt throws null pointer exception when using costing method fifo/lifo.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Jorge Colmenarez

unread,
Jul 14, 2017, 10:12:05 AM7/14/17
to iDempiere
Hi Carlos, where should I report the error? Here in this forum?
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Carlos Collazos

unread,
Jul 14, 2017, 10:17:30 AM7/14/17
to idem...@googlegroups.com
Yes, this is the right place to report bugs. If Carlos Ruiz or some of the other idempiere gurus can replicate it probably you will be asked to open a jira case. But most of the time they are very supportive and fix the bug immediatly.

---------------------------------
Carlos Collazos
coll...@gmail.com
----------------------------------

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/1984d49a-dfd5-403f-86be-7b417eb33053%40googlegroups.com.

Jorge Colmenarez

unread,
Jul 14, 2017, 10:30:10 AM7/14/17
to iDempiere
Ok, the error is as follows:

When you set up the costing method FIFO and cost level Batch in the accounting scheme, when generating the receipt of the product generates the accounting error, being the error reported that does not get cost for the item in question.

Now, by examining the code, at the time of accounting the system tries to find the current cost of the product and in case it does not exist enter the method getSeedCost of class MCost.java which is fixed that when costing method is FIFO returns null.

I could solved the case by applying it in that section of the code that instead of return null look for the amount of the line of the associated purchase order, however, I did in the core since I am still starting to work with IDempiere.

PS: I have developed for ADempiere, where I can patch the class.

Pritesh Shah

unread,
Jul 17, 2017, 1:08:53 PM7/17/17
to iDempiere
I am facing the same problem. I did set FIFO costing method in accounting schema. However, cost record is not created with cost price. We can create cost adjustment for Standard, Average Invoice and Average PO. There is no way i found to create initial cost for FIFO. System throws error when MR or shipment is completed about No cost. How to create cost for Fifo?

Pritesh Shah

unread,
Jul 26, 2017, 10:24:22 PM7/26/17
to iDempiere
Does anyone know to get initial cost for product in case of FIFO costing method? 

Jorge Colmenarez

unread,
Jul 26, 2017, 10:28:38 PM7/26/17
to iDempiere
Hello, in the current version (release 4.1) is not supported, I had to make a small modification in the MCost.java class to obtain as initial cost the price of the Purchase Order to which the receipt is associated, however, This is because I had already loaded the inventory and opening cost through a physical inventory.

Anh Hàn

unread,
Jul 26, 2017, 11:00:28 PM7/26/17
to idem...@googlegroups.com
Let's say you have opening stock of Product A = 10 items. The first 6 items bought at $1.5, the last 4 items bought at $1.3. If you strictly following FIFO rule, then opening cost adjustment won't help.

You can always create dummy business partner, make opening purchase order from that partner (with your desired opening costing), and make material receipt for the products. In above example, you need to create one PO of 6 items @ 1.5, make material receipt. Then create another PO of 4 items @1.3, make material receipt.

Then FIFO costing works perfectly.

Anh Han

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/c124d291-45be-44d2-b794-6f44d5715916%40googlegroups.com.

Jorge Colmenarez

unread,
Jul 26, 2017, 11:06:44 PM7/26/17
to iDempiere
That is the procedure applied, but when it is going to receive the merchandise generates an accounting error because it does not get cost for the product, I review the class MCost.java and in the method getSeedCost has fixed that when the costing method of the accounting scheme is FIFO or LIFO returns null. I already mentioned that mistake, but I do not know if they have taken it into account to correct it.

Chuck Boecking

unread,
Jul 27, 2017, 12:46:14 PM7/27/17
to iDempiere
Hi Team,

By using Cost Level = "Batch/Lot", the system will track costs at the ASI level. If you create a new ASI every time product is received, then each receipt will get its own cost. If you set the Material Policy = "FIFO", the system will choose the correct ASI (and associated cost) at the time of transaction. One can derive that the costing method does not really matter at this point, because the material policy is drive the cost selection process.

Short answer:
  • Costing Method = "Average PO"
  • Costing Level = "Batch/Lot"
  • Material Policy = "FIFO"
Historically, the big challenge with Costing Level = "Batch/Lot" is that the user experience is quite terrible. Users were required to know way to much about lot/serial data during order and shipment/receipt entry. This is where Heng Sin Low and Andy Conn really helped the community by helping iDempiere auto-create batch/lot number behind the scenes.

Now iDempiere users get the benefit of 'ease of use' and the quality of FIFO material management and costing.

What I am really saying is: you should not use the FIFO costing method. It is not officially supported, and there is a better way to accomplish the goal. Since most will not receive the same lot in twice, Average PO (which is well supported), approximates the actual lot cost in a FIFO environment.

I hope this helps!

David Podhola

unread,
Jan 5, 2018, 3:21:07 PM1/5/18
to iDempiere
Hi Chuck, thanks a lot for the post, Google search for "Posting Error (Resubmit - No Costs for" brought me here. It really helped me to understand how to setup the costs. I tried to put it together in a few lines on our wiki, maybe it will be useful for other beginners too. Best, David

Dne čtvrtek 27. července 2017 18:46:14 UTC+2 Chuck Boecking napsal(a):
Reply all
Reply to author
Forward
0 new messages