Topic: Work order give me a error in my Standard cost

Hi All

I'm having some issues with my Work Order updating my standard cost with some random number.  Can someone identify what I am doing wrong.

I have a BOM with only 2 item in it.
1x Chain
1x Pendant
Result: 1 x Necklace

I am adding no Labour or Overhead cost.

My costed BOM says.   
1x Chain @ 39.1249
1x Pendant @ 44.3617
Result: 1 x Necklace @ 83.4866

I run the Work Order. All correct amounts are removed on the GL Side

However when I go to the Necklace in Invertory/Items it gives me a Standard cost, Unit Cost of :44.198770588336

It does this for all my work orders

HELP

Re: Work order give me a error in my Standard cost

It appears that your email id is not available and your credentials are wrong. Kindly contact the board admin (@joe) for account validation.

Sell the Necklace as a Kit of 2 items - a sort of package.

Re: Work order give me a error in my Standard cost

Hello, Yes I posted as a guest, but all registered now.

Thank you for the reply.  I'm not/can't use sales kits because once the the item is complete it must be placed in stock. And then it gets transferred to a consignment location.

Any idea why i get this random number showing in my Unit cost?   I can send you some screen shots.

Re: Work order give me a error in my Standard cost

There is certainly no decimals issue in using all hard currencies and the SA Rand.

Posting as Guest has been hopefully disabled by now.

The kit is formed in Assembly like a bunch of items sold together as a pack. It will have another Stock ID as well and hence placing them in stock should be no issue.

Items and Inventory => Sales Kits

@joe: Does this warrant a check? Assign the first post in this thread to user: @karl1234. (done)

Post's attachments

Items_SalesKits.png 16.3 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Work order give me a error in my Standard cost

I will do, but we have never had any troubles with these costs, have we?

Joe

Re: Work order give me a error in my Standard cost

Yes, this is a bug. I will have Janusz to look at this. He rewrote a lot of routines in the Manufacturing for 2.4.

Joe

Re: Work order give me a error in my Standard cost

I think I have solved the problem.

In function work_order_produce() in file  manufacturing/includes/db/work_order_produce_items_db.inc, change lines 84-87:

add_stock_move(ST_WORKORDER, $product["stock_id"], $woid,
    $product["loc_code"], $date_, $ref, $product['units_issued']+$quantity, $unit_cost); 

update_material_cost($product['stock_id'], $product['units_issued']+$quantity, $unit_cost, $date_);

to

update_material_cost($product['stock_id'], $product['units_issued']+$quantity, $unit_cost, $date_);
        
add_stock_move(ST_WORKORDER, $product["stock_id"], $woid,
    $product["loc_code"], $date_, $ref, $product['units_issued']+$quantity, $unit_cost); 

You need to do this because the $qoh in the function update_material_cost() is required to be the original qoh before the stock move in add_stock_move().

Hope this helps.

Re: Work order give me a error in my Standard cost

@karl1234: good work!

Committed.

FA 2.3.x not affected.

Re: Work order give me a error in my Standard cost

Works ok now. Thanks @karl1234 for detecting this bug. And also thanks for your suggestion.

Janusz has updated the Official 2.4 repo.

/Joe