- 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)
+ {
+ if ($loc_notification == 1 && count($st_ids) > 0)
+ send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
+ $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);
+ }