From d8d7dee5628901ee4986151aa55893035dda5997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AC=B4=E6=94=BF=20=E6=97=B6?= Date: Fri, 24 Oct 2025 14:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B9=B3=E4=BB=93=E4=B8=BA?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=A8=8E=E7=9A=84=E9=97=AE=E9=A2=98,=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E7=BB=88=E7=BB=93=E7=AE=97=E6=9C=AA?= =?UTF-8?q?=E8=80=83=E8=99=91=E8=B5=B7=E7=AE=97=E6=97=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 4 ++++ .../SwapModule/SwapEodPositionService.cs | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 5e799b66..80d0f28f 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -922,6 +922,10 @@ namespace YLErp.Modules.SwapModule int directionRatio = flowEvent.PayDirection == (int)SwapDirectionEnum.收取 ? 1 : -1; // + 付息日>上日日终且小于等于平仓日期的分红数据 var dividendIn = servie.CalcPayment(payments, unwindQty, shortRatio, directionRatio); + var um = DataCacheProvider.GetUnderlyingDataSource().GetData(flowEvent.UnderlyingCode); + decimal tax = um.ValueAddedTax ?? 0; + dividendIn = dividendIn / (1 + tax) * (1 - tax); + flowEvent.DividendIn = Math.Round(dividendIn, 2, MidpointRounding.AwayFromZero); } diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index 09ba627a..14f0af82 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -1144,7 +1144,7 @@ namespace YLErp.Modules.SwapModule var price = UnderlyingCodePrice(eod.UnderlyingCode, dealDate, out decimal vobp); decimal tax = um.ValueAddedTax ?? 0; BondPaymentService bondPaymentService = new BondPaymentService(UserInfo); - if (valueDate > td.StartDate.Value && (curretEod.PosiQuantity > 0 || valueDate == td.UnWindDate)) + if (valueDate > td.StartDate.Value && curretEod.PosiQuantity > 0) { decimal payment = bondPaymentService.CalcPayment(curretEod.UnderlyingCode, eod.ValueDate, valueDate, curretEod.PosiQuantity, shortRatio, directionRatio); // 考虑增值税 @@ -1226,12 +1226,15 @@ namespace YLErp.Modules.SwapModule curretEod.UnderlyingPrice = price; curretEod.UnderlyingMarketValue = curretEod.UnderlyingPrice * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio; curretEod.PosiMtmPnL = (curretEod.UnderlyingPrice - curretEod.PosiGrossPrice) * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio * directionRatio; - - decimal tax = um.ValueAddedTax ?? 0; - BondPaymentService bondPaymentService = new BondPaymentService(UserInfo); - decimal payment = bondPaymentService.CalcPayment(curretEod.UnderlyingCode, eod.ValueDate, valueDate, curretEod.PosiQuantity, shortRatio, directionRatio); - // 考虑增值税 - curretEod.TdPosiDividend = payment / (1 + tax) * (1 - tax); + curretEod.TdPosiDividend = 0; + if (valueDate > td.StartDate.Value && (curretEod.PosiQuantity > 0)) + { + decimal tax = um.ValueAddedTax ?? 0; + BondPaymentService bondPaymentService = new BondPaymentService(UserInfo); + decimal payment = bondPaymentService.CalcPayment(curretEod.UnderlyingCode, eod.ValueDate, valueDate, curretEod.PosiQuantity, shortRatio, directionRatio); + // 考虑增值税 + curretEod.TdPosiDividend = payment / (1 + tax) * (1 - tax); + } curretEod.RealizedMtmPnL = eod.RealizedMtmPnL + curretEod.TdCloseMtmPnl; curretEod.RealizedFee = eod.RealizedFee + curretEod.TdCloseFee;