- $line->price = get_purchase_price ($order->supplier_id, $_POST['stock_id']);
- $line->quantity = get_purchase_conversion_factor ($order->supplier_id, $_POST['stock_id']);
+ $line->price = get_purchase_price ($order->supplier_id, $line->stock_id);
+ $line->quantity =
+ $line->quantity/get_purchase_conversion_factor ($old_supp, $line->stock_id)
+ *get_purchase_conversion_factor ($order->supplier_id, $line->stock_id);