fix(lastleg): allow edits with historical procurement warehouse

This commit is contained in:
2026-09-12 16:14:50 +08:00
parent d33922ad35
commit e467d60e8f
2 changed files with 24 additions and 0 deletions
@@ -417,6 +417,9 @@ public class OverseasProcurementService implements WalletResultHandler {
} catch (NumberFormatException exception) {
throw badRequest("purchaseWarehouseId must be a numeric overseas partner warehouse ID");
}
// Keep the warehouse snapshot already frozen on a historical order. A later master-data
// deactivation must not block unrelated edits such as recording outbound details.
if (Long.toString(numericId).equals(order.getPurchaseWarehouseId())) return;
var option = warehouseDirectory.required(numericId);
order.setPurchaseWarehouseId(option.warehouseId());
order.setPurchaseWarehouseName(option.warehouseName());