Topic: Stock Valuation Report

Hi

There is a bug in Inventory valuation report. My Balance report is showing stock of 142,175 but the inventory valuation report is showing total value of 150,685.

Re: Stock Valuation Report

More details needed to fix the problem. Please try recognise were the the difference appears.
Janusz

Re: Stock Valuation Report

Hi

As reported in Inventory forum, there is something wrong in cost update script. I am setting up new system for my friend. We are currently running system with allow negative inventory option check so that we can do live sales invoices. I have no clue how this has happened. The stock value has completely wrong as system has posted wrong COGS. We started creating BoM on 18 March 13 for all the sales done from 1 April 2012 till 18 March 13. I have tried to look in to entries in database but can find anything. I can email you entries on excel spreadsheet of Stock and COGS. Please let me know your email.

stock_id                    mb_flag     material_cost
DalMuth-150Gms          M        -6,260.86
DalMuth-150Gmsx12     M    -75,130.00
DalMuth-250Gms         M           -10,434.79
DalMuth-300Gms         M          -12,521.75
DalMuth-325Gms         M          -13,565.24
DalMuth-550Gms         M          -22,956.58
PunjabMix-150Gms         M          -1,845.84
PunjabMix-150Gmsx12    M    -22,149.86
PunjabMix-250Gms         M          -6,153.17



Thanks

Re: Stock Valuation Report

If negative inventory is used, then the quantity that is negative should not be used to update the standard cost - this will most probably be the source of the error.

Re: Stock Valuation Report

That is what I think. Only quantity should be negative. There are other 60+ BoM items which are fine. Other items where quantity is negative, material cost is positive and is what it should be. There seems to be some bug in script which updates costs either when negative intenvory option is active or under both cases.

6 (edited by apmuthu 04/20/2013 09:12:35 am)

Re: Stock Valuation Report

Informed Janusz/Joe to decide on policy and code accordingly:

As a policy, please see that negative quantity either does not affect standard costing or make sure it does it positively!

Info for investigation:

function handle_negative_inventory($stock_id, $quantity, $standard_cost, $date_)
is defined in includes/db/inventory_db.inc

function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $adj_only=false)
is defined in purchasing/includes/db/grn_db.inc