Topic: Inventory cost/value

I see a number of messages questioning how the item cost is handled be it a fixed cost or an average cost.

I am honestly not sure which is right.

Nor how to correct it if it gets miss adjusted...

I am also interested in implementing a FIFO method where the cost is the cost of the item when it was purchased.
So if I bought 100 widgets at $4 each and later got 200 and paid $6 each as I sold them the price would follow the purchases
I could sell 90 and the cost would be $4 each and then if I sold 20 then 10 would be at cost $4 and 10 at cost $6

I guess if a transaction were voided and freed up some $4 units then a later sale would get some at $4

I am a php programmer so can do some of the work, but I could use some guidance as to WHERE to make the changes...

This might be usable for normal inventory, but it is also needed for handling of Crypto as a material asset


tom

Re: Inventory cost/value

Good morning Tom,

I'm very familiar with Inventory valuation using FIFO/LIFO/Average/Standard costing methods.  I worked with several accounting systems from Real World, MCBA, Maccola, and now Pass-Port Software.  I used to have the source code for the Inventory Control module from Real World.  This was coded using COBOL... yes, I know this is supposed to be a dead programming language.  But, it is still in use more than 40 years later.

I now own a brewery and have been utilizing Front Accounting since 2018.  Unfortunately, I haven't been using the Purchasing, Inventory and Manufacturing modules primarily because it doesn't support FIFO. 

I do know some PHP coding as well but the Object Oriented concepts are foreign to an old "Top Down", "Structured Design" COBOL programmer.  I would be willing to take this on if you are willing to help with the PHP coding.

Re: Inventory cost/value

I'd like to help, we might be able to translate COBOL into PHP without too much trouble

I am just not sure how to add an option within FA for handling that on a case by case basis (GL Code, Globally?)

But is it something that is needed

Re: Inventory cost/value

I think I may have figured out how to enter it is SQL... manually change the mb_flag for the Item from D to B.

Do you think this will cause any issues?

Re: Inventory cost/value

Average cost is simpler to implement, but FIFO is more accurate for tracking profit.  To do FIFO in FA, you'll likely need to modify the database to track the cost of each individual item received, not just an average.  Then, your sales processing would need to pull the oldest cost first.  That's a pretty big change, so start small.

Re: Inventory cost/value

Is there a list of the mb_flag values and their meanings?

I searched the code and found A B D F and M, but no comments listing the values and meanings

tom

Re: Inventory cost/value

There are 2 tables - stock_category and stock_master -  that have the field mb_flag in FA default installation. The former has it as dflt_mb_flag.

There are a total of 53 files with the field mb_flag in them in the core FA.

mb_flag values:
F => Fixed Asset
B =>Purchased -  Default in the tables, used only in reports rep3*.php as item.mb_flag='B' OR item.mb_flag='M'
M => Manufactured
D =>Service (S old flag)

Which file has mb_flag='A' ?

Re: Inventory cost/value

apmuthu wrote:

Which file has mb_flag='A' ?

Ha Ha... changelog

2014-09-12 08:15:34 +0200 Joe
Removed redundant mb_flag 'A'.
M    includes/db/manufacturing_db.inc

I saw it but did not realize it was a comment! (commit comment no less)

Re: Inventory cost/value

apmuthu wrote:

There are 2 tables - stock_category and stock_master -  that have the field mb_flag in FA default installation. The former has it as dflt_mb_flag.

There are a total of 53 files with the field mb_flag in them in the core FA.

mb_flag values:
F => Fixed Asset
B =>Purchased -  Default in the tables, used only in reports rep3*.php as item.mb_flag='B' OR item.mb_flag='M'
M => Manufactured
D =>Service (S old flag)

Which file has mb_flag='A' ?

Do any of these flags control/modify how the cost of an item is calculated?
Is average the only method that is currently supported?

Would the (majority) of the changes needed to support FIFO be localized into a few functions?

FIFO means the COGS is directly related to the exact cost of buying the oldest item being sold
So if the cost shot up the COGS would not change until all the existing inventory was sold.

Thanks
Tom