diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs
index 28689a31..19775965 100644
--- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs
+++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs
@@ -71,6 +71,7 @@ namespace YLErp.Modules.SwapModule
}
else
{
+ unwindData.TradeStartDate = td.StartDate;
unwindData.CloseType = commodity ? 1 : 2;
unwindData.StartDate = td.TradeDate.Value;
if (preDealDate.HasValue)
@@ -880,13 +881,15 @@ namespace YLErp.Modules.SwapModule
floatEvent.TradingFeePending = position.PosiTradingFeePending * unwindData.ClosePercent;
floatEvent.TradingFeePending = Math.Round(floatEvent.TradingFeePending, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
floatEvent.TradingFee = closeFee;
+
BondPaymentService bondPaymentService = new BondPaymentService(UserInfo);
var tax = GetUnderlyingTax(floatEvent.UnderlyingCode);
- var payments = bondPaymentService.GetBondPayments(floatEvent.UnderlyingCode, td.StartDate.Value, floatEvent.UnwindDate.Value);
- var payment = bondPaymentService.CalcPayment(payments, unwindQty, longRatio, floatRatio);
- floatEvent.DividendIn = payment / (1 + tax) * (1 - tax);
+ // 只计算事件日期当天的分红收益
+ var payments = bondPaymentService.GetTargetDatePayments(floatEvent.UnderlyingCode, floatEvent.EventDate);
+ floatEvent.DividendIn = bondPaymentService.CalcPayment(payments, unwindQty, longRatio, floatRatio) / (1 + tax) * (1 - tax);
floatEvent.DividendIn = Math.Round(floatEvent.DividendIn, 2, MidpointRounding.AwayFromZero);
- floatEvent.DividendPending = bondPaymentService.CalcPayment(payments, floatEvent.PositionQty ?? 0, longRatio, floatRatio);
+ floatEvent.DividendPending = bondPaymentService.CalcPayment(payments, floatEvent.PositionQty ?? 0, longRatio, floatRatio) / (1 + tax) * (1 - tax);
+
floatEvent.MarkClosePnl = (unwindPrice - position.PosiGrossPrice) * unwindQty * floatRatio * longRatio;
floatEvent.MarkClosePnl = Math.Round(floatEvent.MarkClosePnl + ((floatEvent.TradingFeePending+ closeFee) * floatRatio * -1) + floatEvent.DividendIn, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
diff --git a/YLErpWeb/Views/underlying_manager/underlying_managerEdit.cshtml b/YLErpWeb/Views/underlying_manager/underlying_managerEdit.cshtml
index e1280475..db4e13a7 100644
--- a/YLErpWeb/Views/underlying_manager/underlying_managerEdit.cshtml
+++ b/YLErpWeb/Views/underlying_manager/underlying_managerEdit.cshtml
@@ -308,6 +308,10 @@
+
+
+
+
diff --git a/YLErpWeb/Views/underlying_manager/underlying_managerView.cshtml b/YLErpWeb/Views/underlying_manager/underlying_managerView.cshtml
index 07953c86..f22e7837 100644
--- a/YLErpWeb/Views/underlying_manager/underlying_managerView.cshtml
+++ b/YLErpWeb/Views/underlying_manager/underlying_managerView.cshtml
@@ -170,6 +170,11 @@
@Html.MyDisplayFor(m => m.Price)
}
+
+
+ | 增值税率 |
+ @(Model.ValueAddedTax.OtcFormatPercent()) |
+
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
index 1eff09c5..fe235911 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
@@ -51,6 +51,7 @@ const vue = new Vue({
});
this.ratio = this.floatPosition.PayDirection == 1 ? -1 : 1;
this.shortRatio = this.floatPosition.PositionType == 1 ? 1 : -1;
+ this.TradeStartDate = model.TradeStartDate;
},
IsBond(instType) {
return tradeHelper.IsBond(instType);
@@ -269,7 +270,7 @@ const vue = new Vue({
var thisObj = this;
let ratio = this.floatPosition.PositionType == 1 ? 1 : -1;
let floatRatio = this.floatPosition.PayDirection == 1 ? 1 : -1;
- var postData = { startDate: thisObj.floatPosition.PosiStartDate, endDate: thisObj.deal.UnwindDate, underlyingCode: thisObj.floatPosition.UnderlyingCode }
+ var postData = { startDate: thisObj.TradeStartDate, endDate: thisObj.deal.UnwindDate, underlyingCode: thisObj.floatPosition.UnderlyingCode }
main.post("/BondPayment/GetBondPayMentInterest", postData, { async: false }).done(function (resp) {
thisObj.floatPosition.DividendIn = parseFloat(thisObj.deal.CloseQty) * resp.obj * ratio * floatRatio;
var posiQty = parseFloat(thisObj.floatPosition.Quantity) - parseFloat(thisObj.deal.CloseQty);