fix(stock-pool): reconcile completed entry quantities before repricing

This commit is contained in:
boris
2026-09-12 04:29:40 +08:00
parent 6ffa0346aa
commit 9804851133
3 changed files with 92 additions and 4 deletions
+4 -2
View File
@@ -1856,8 +1856,10 @@ pub fn build_stock_pool_target_plan_with_fee_model(
if max_quantity < row.delta_quantity {
row.delta_quantity = max_quantity;
row.target_quantity = row.current_quantity + max_quantity;
row.status = "REDUCE_TO_ALLOWED_QUANTITY".to_string();
row.reason = "按当前可用资金缩量;卖出资金确认后需重新预览".to_string();
if max_quantity < allocation_quantity {
row.status = "REDUCE_TO_ALLOWED_QUANTITY".to_string();
row.reason = "按当前可用资金缩量;卖出资金确认后需重新预览".to_string();
}
}
remaining_cash -= cost(row.delta_quantity)?;
position_budget -= cost(row.delta_quantity)?;