() { (int)SwapEventTypeEnum.互换, (int)SwapEventTypeEnum.自动互换 };
+ consumedDividend = yldb.swap_flow_event
+ .Where(x => x.SwapTradeId == tradeId.Value
+ && swapEventTypes.Contains(x.EventType)
+ && x.DataState == (int)SwapFlowDateStateEnum.完成)
+ .Sum(s => s.DividendIn);
+ }
+
+ return JsonSuccess("", new { totalInterest, consumedDividend });
}
}
}
diff --git a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml
index 14e12e6b..6142bde6 100644
--- a/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml
+++ b/YLErpWeb/Views/SwapTrade2/SwapIncome.cshtml
@@ -48,10 +48,16 @@
| |
+ | 支付日期 |
+ |
年化天数 |
{{deal.AnnualDays}} |
+
+
| 平仓总额 |
{{deal.SwapCloseAmount}} |
+ |
+ |
@@ -146,11 +152,7 @@
{{priceFormat(floatPosition.PosiGrossPrice)}} |
{{priceFormat(floatPosition.TradingAmountNetAvg)}} |
-
-
-
-
-
+ {{floatPosition.TradingAmountAvg}}
|
{{floatPosition.Quantity}} |
diff --git a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml
index 4133bbc4..7ad772a2 100644
--- a/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml
+++ b/YLErpWeb/Views/SwapTrade2/TradeEdit.cshtml
@@ -236,6 +236,15 @@
+
+
+
+
diff --git a/YLErpWeb/Views/SwapTrade2/TradeView.cshtml b/YLErpWeb/Views/SwapTrade2/TradeView.cshtml
index 093dd18f..c1d42011 100644
--- a/YLErpWeb/Views/SwapTrade2/TradeView.cshtml
+++ b/YLErpWeb/Views/SwapTrade2/TradeView.cshtml
@@ -228,6 +228,10 @@
| 结算规则 |
@(trade.trade_extend.ExtendObj.SettlementRules == 0 ? "T+0" : "T+1") |
+
+ | 派息金额支付日 |
+ @(trade.trade_extend.ExtendObj.DividendPayDate == 0 ? "到期结算日" : "派息日+" + (trade.trade_extend.ExtendObj.DividendPayDate - 1)) |
+
@@ -840,6 +844,12 @@
互换日期 |
@(tc.ValueDate.OtcFormatDate()) |
+
+ | 支付日期 |
+ @(tc.PayDate?.OtcFormatDate() ?? tc.ValueDate.OtcFormatDate()) |
+ |
+ |
+
| 平仓总额 |
@(tc.SwapCloseAmount.OtcFormat(OtcFormatFlag.StockEqvNotional)) |
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js
index 9846f8f8..358338b5 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/incomeSwapTrade.js
@@ -40,12 +40,15 @@ const vue = new Vue({
});
this.floatPosition = positions[0];
this.initPosiNetPrice = this.floatPosition.PosiNetPrice;
+ // 互换标的价格固定为期初净价,与平仓不同不需要用户填写
+ this.floatPosition.TradingAmountAvg = this.initPosiNetPrice * 100;
this.interestList = model.FlowEvents.filter((item) => {
return item.InterestMode == 1 || item.InterestMode == 2 || item.InterestMode == 7 || item.InterestMode == 8 || item.InterestMode == 9;
});
this.marginList = model.FlowEvents.filter((item) => {
return item.InterestMode == 5 || item.InterestMode == 6;
});
+ this.TradeStartDate = model.TradeStartDate;
},
IsBond(instType) {
return tradeHelper.IsBond(instType);
@@ -96,19 +99,6 @@ const vue = new Vue({
this.dataFormat();
}
},
- changeUnderlyingPrice() {//修改标的价格
- this.calcFloatClosePnl();
- },
- refreshUnderlyingPrice() {//刷新标的价格
- var thisObj = this;
- main.post("/underlying_manager/GetUnderlyingPriceByCode",
- { code: thisObj.floatPosition.UnderlyingCode, ValueDate: thisObj.deal.ValueDate })
- .done(function (res) {
- res.obj = res.obj * 100;
- thisObj.floatPosition.TradingAmountAvg = otcformat.trading.umprice(res.obj);
- thisObj.calcFloatClosePnl();
- });
- },
changeTradingFee() {//修改交易费用
this.calcFloatClosePnl();
},
@@ -178,6 +168,22 @@ const vue = new Vue({
});
thisObj.calcCloseAmount();
thisObj.dataFormat();
+ thisObj.getDivindIn();
+ });
+ },
+ getDivindIn() {
+ var thisObj = this;
+ let ratio = this.floatPosition.PositionType == 1 ? 1 : -1;
+ let floatRatio = this.floatPosition.PayDirection == 1 ? 1 : -1;
+ var postData = { startDate: thisObj.TradeStartDate, endDate: thisObj.deal.UnwindDate, underlyingCode: thisObj.floatPosition.UnderlyingCode, tradeId: thisObj.deal.SwapTradeId, unwindDate: thisObj.deal.UnwindDate }
+ main.post("/BondPayment/GetBondPayMentInterest", postData, { async: false }).done(function (resp) {
+ let totalDividend = parseFloat(thisObj.deal.PositionQty) * resp.obj.totalInterest * ratio * floatRatio;
+ let consumedDividend = parseFloat(resp.obj.consumedDividend ?? 0);
+ // 互换是全量消费,consumedDividend>0 表示分红已被当天互换消费,归0
+ thisObj.floatPosition.DividendIn = Math.abs(consumedDividend) > 0 ? 0 : totalDividend;
+ thisObj.floatPosition.DividendPending = 0;
+ thisObj.calcFloatClosePnl();
+ thisObj.dataFormat();
});
},
incomeTrade() {//互换
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js
index 87c0cbce..ed73c2b1 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/swapTradeView.js
@@ -197,7 +197,7 @@ function unWindSwap(id) {
main.open(title,
srcurl,
{
- area: ["90%", "780px"],
+ area: ["90%", "800px"],
end: function () {
if (window.parent && window.parent.reloadtrade) {
window.parent.reloadtrade();
diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
index eb16694c..c880359d 100644
--- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
+++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js
@@ -275,11 +275,14 @@ 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.TradeStartDate, endDate: thisObj.deal.UnwindDate, underlyingCode: thisObj.floatPosition.UnderlyingCode }
+ var postData = { startDate: thisObj.TradeStartDate, endDate: thisObj.deal.UnwindDate, underlyingCode: thisObj.floatPosition.UnderlyingCode, tradeId: thisObj.deal.SwapTradeId, unwindDate: thisObj.deal.UnwindDate }
main.post("/BondPayment/GetBondPayMentInterest", postData, { async: false }).done(function (resp) {
- thisObj.floatPosition.DividendIn = parseFloat(thisObj.deal.CloseQty) * resp.obj * ratio * floatRatio;
+ let totalDividend = parseFloat(thisObj.deal.CloseQty) * resp.obj.totalInterest * ratio * floatRatio;
+ let consumedDividend = parseFloat(resp.obj.consumedDividend ?? 0);
+ // 互换是全量消费,consumedDividend>0 表示分红已被当天互换消费,归0
+ thisObj.floatPosition.DividendIn = Math.abs(consumedDividend) > 0 ? 0 : totalDividend;
var posiQty = parseFloat(thisObj.floatPosition.Quantity) - parseFloat(thisObj.deal.CloseQty);
- thisObj.floatPosition.DividendPending = posiQty * resp.obj * ratio * floatRatio;
+ thisObj.floatPosition.DividendPending = posiQty * resp.obj.totalInterest * ratio * floatRatio;
thisObj.calcFloatClosePnl();
thisObj.dataFormat();
});
diff --git a/YLErpWeb/wwwroot/Scripts/app/trade/tradeApproval.js b/YLErpWeb/wwwroot/Scripts/app/trade/tradeApproval.js
index 51dd8d14..ecbd7a7d 100644
--- a/YLErpWeb/wwwroot/Scripts/app/trade/tradeApproval.js
+++ b/YLErpWeb/wwwroot/Scripts/app/trade/tradeApproval.js
@@ -747,7 +747,7 @@ function passorreinfo(eid, tradeType, status, isGroup, StructureType) {
if (StructureType == "多空组合") {
url = "/swaptrade2/SwapLongShortSwap/?enid=" + eid + "&isUseApproval=" + true;
}
- height = "720px";
+ height = "800px";
}
else if (status === "行权待复核") {
title = "行权审批";