diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs
index 1521fbb4..1109b485 100644
--- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs
+++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs
@@ -74,11 +74,6 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator
var underlying = Context.GetTradeUnderlying(flowEventGroup.UnderlyingCode);
var closeNotionalValue = unwindData?.CloseNotionalValue
?? flowEventGroup.Quantity * flowEventGroup.ContractSize * posi.PosiGrossPrice;
- var settlementDate = flowEventGroup.UnwindDate
- ?? throw new ServiceException($"平仓事件{flowEventGroup.id}缺少结算日");
- var currentDayFloatingDividend = Context.GetEodPositions(tradeId, settlementDate)
- .FirstOrDefault(x => x.PositionId == flowEventGroup.PositionId)
- ?.TdPosiDividend ?? 0m;
// 行构造器统一处理客户视角、结算公式、品种差异和模板展示精度。
var row = SwapSettlementBillRowBuilder.Build(new SwapSettlementBillRowInput
@@ -91,7 +86,6 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator
Positions = positions,
UnderlyingInstrumentType = underlying?.UnderlyingInstrumentType,
CloseNotionalValue = closeNotionalValue,
- CurrentDayFloatingDividend = currentDayFloatingDividend,
// 与提前终止详情页保持同一来源:读取 swap_flow_event 中的平仓浮动腿记录。
ExitYtm = flowEventGroup.ExitYtm,
IncludePeriodPaymentInNetting = (tradeExtend?.ExtendObj?.DividendPayDate ?? 1) == 0
diff --git a/YLErpDAL/Modules/TradeModule/DocGenerateModule/SwapSettlementBillRowBuilder.cs b/YLErpDAL/Modules/TradeModule/DocGenerateModule/SwapSettlementBillRowBuilder.cs
index d6063274..70e81e8a 100644
--- a/YLErpDAL/Modules/TradeModule/DocGenerateModule/SwapSettlementBillRowBuilder.cs
+++ b/YLErpDAL/Modules/TradeModule/DocGenerateModule/SwapSettlementBillRowBuilder.cs
@@ -9,7 +9,7 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule;
///
/// 构造普通收益互换结算单单行数据所需的业务输入。
-/// 数据来自平仓事件、关联交易及结算日日终持仓。
+/// 数据来自平仓事件及其关联交易。
///
public sealed class SwapSettlementBillRowInput
{
@@ -40,9 +40,6 @@ public sealed class SwapSettlementBillRowInput
/// 平仓事件浮动腿记录的期末结算收益率(展示态数值)。
public decimal? ExitYtm { get; set; }
- /// 结算日日终持仓中的当日浮动端分红,保留原始收付方向。
- public decimal CurrentDayFloatingDividend { get; set; }
-
/// 期间付息或分红是否计入本次净额结算。
public bool IncludePeriodPaymentInNetting { get; set; }
}
@@ -89,6 +86,7 @@ public static class SwapSettlementBillRowBuilder
var floatingAmount = -input.CloseFlow.MarkClosePnl;
var fee = -(input.CloseFlow.TradingFee + input.CloseFlow.TradingFeePending);
var marginInterest = -marginEvents.Sum(x => x.InterestClosePnL);
+ var periodAmount = -input.CloseFlow.DividendPending;
var initialMargin = SumMargin(effectiveMargins, InterestModeEnum.初始预付金);
var additionalMarginPositions = positions
@@ -106,6 +104,9 @@ public static class SwapSettlementBillRowBuilder
var isCashBond = ConsGlobal.InstrumentType.IsBond(input.UnderlyingInstrumentType);
+ var isEtf = ConsGlobal.InstrumentType.Fund.Equals(
+ input.UnderlyingInstrumentType,
+ StringComparison.OrdinalIgnoreCase);
return new ExcelReportModel
@@ -121,11 +122,11 @@ public static class SwapSettlementBillRowBuilder
PosiNotionalValue = input.CloseNotionalValue.ToString("0.00"),
Quantity = input.CloseFlow.Quantity.ToString("0.00"),
DividendIn = isCashBond
- ? input.CurrentDayFloatingDividend.ToString("0.00")
+ ? periodAmount.ToString("0.00")
+ : string.Empty,
+ PeriodDividend = isEtf
+ ? periodAmount.ToString("0.00")
: string.Empty,
- PeriodDividend = isCashBond
- ? string.Empty
- : input.CurrentDayFloatingDividend.ToString("0.00"),
PosiNetPrice = ((settlementPosition?.PosiGrossPrice ?? 0m) * 100m).ToString("0.00000000"),
InitYtm = isCashBond && input.Trade.InitYtm.HasValue
? input.Trade.InitYtm.Value.ToString("0.####%")