db_query($sql, "The work order requirements could not be added");
// insert a -ve stock move for each item
+ $UnitCost = get_standard_cost($bom_item["component"]);
add_stock_move(ST_WORKORDER, $bom_item["component"], $woid,
$bom_item["loc_code"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, 1, $UnitCost);
}
}
+ //Negative Stock Handling First; Prior to add_stock_move
+ if ($cost_adjust)
+ adjust_deliveries($stock_id, get_standard_cost($stock_id), $date_);
+
// -------------------------------------------------------------------------
// insert a +ve stock move for the item being manufactured
//--------------------------------------------------------------------------------------
-?>
\ No newline at end of file