- add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $item_accounts["inventory_account"],
- 0, 0, null, -$total_cost);
+ $stockitem = get_item($stock_id);
+ $memo = _("Produced")." ".$units_reqd. " * ".$stockitem["description"];
+ if ($advanced)
+ $memo = $date_.": ".$memo;
+ add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $item_accounts["inventory_account"],
+ 0, 0, $memo, -$total_cost);
+
+ //Chaitanya : Update cost of the manufactured item in stock moves table
+ if (!$advanced)
+ {
+ $UnitWOCost = ($total_material_cost + $costs + $labour)/$units_reqd;
+ update_stock_move(ST_WORKORDER, $woid, $stock_id, $UnitWOCost);
+ }