//otcformat禁止千分位分组 window.otcformat.options.disableGrouping = true; const inputFormatSwapRate = Object.freeze({ precision: otcformat.trading.premiumRateP.precision, append: '%' }); const inputFormatTradePrice = Object.freeze({ precision: otcformat.trading.tradePrice.precision, append: '' }); const inputFormatTradeAmount = Object.freeze({ precision: otcformat.trading.notional.precision, append: '' }); const inputFormatEqvNotional = Object.freeze({ precision: otcformat.trading.StockEqvNotional.precision, append: '', negative: true }); const inputFormatMarginRate = Object.freeze({ precision: otcformat.trading.marginRateP.precision, append: '%' }); const inputFormatMarginRateNoPercent = Object.freeze({ precision: otcformat.trading.umpriceP.precision, append: '', percent: true }); const inputFormatSwapDeliveryPrice = Object.freeze({ precision: 9, append: '', negative: true }); const consPosiFeeType = Object.freeze({ Percent: 0, Unit: 1 }); const swapPosiFeeCalc = { normalizeFeeType(feeType) { return Number(feeType) === consPosiFeeType.Unit ? consPosiFeeType.Unit : consPosiFeeType.Percent; }, calcTradingFee(feeType, feeUnit, closeNotionalValue, closeQty) { const normalizedFeeType = this.normalizeFeeType(feeType); const normalizedFeeUnit = Number(feeUnit) || 0; const normalizedCloseNotionalValue = Number(closeNotionalValue) || 0; const normalizedCloseQty = Number(closeQty) || 0; const tradingFee = normalizedFeeType === consPosiFeeType.Unit ? normalizedFeeUnit * normalizedCloseQty : normalizedFeeUnit / 100 * normalizedCloseNotionalValue; return otcformat.trading.StockEqvNotional(_.round(tradingFee, 2)); }, calcAllocatedTradingFee(totalFee, feeType, feeUnit, closeNotionalValue, closeQty, notionalValue, notionalQty) { const normalizedFeeUnit = Number(feeUnit) || 0; if (normalizedFeeUnit === 0) { return null; } const normalizedFeeType = this.normalizeFeeType(feeType); const closeBase = normalizedFeeType === consPosiFeeType.Unit ? Number(closeQty) || 0 : Number(closeNotionalValue) || 0; const originalBase = normalizedFeeType === consPosiFeeType.Unit ? Number(notionalQty) || 0 : Number(notionalValue) || 0; if (originalBase <= 0) { return null; } return otcformat.trading.StockEqvNotional(_.round((Number(totalFee) || 0) * closeBase / originalBase, 2)); }, calcTradingFeePending(beforeCloseFee, feeType, feeUnit, closeNotionalValue, closeQty, notionalValue, notionalQty, closePercent) { const allocatedFee = this.calcAllocatedTradingFee( beforeCloseFee, feeType, feeUnit, closeNotionalValue, closeQty, notionalValue, notionalQty); if (allocatedFee !== null) { return allocatedFee; } return (Number(beforeCloseFee) || 0) * (Number(closePercent) || 0); } }; let ValueDate = model.ValueDate; const vue = new Vue({ el: '#vueDiv', data: { deal: model, floatPosition: null, interestList: [], marginList: [], initPosiNetPrice: 0, multiplier: 1, // 平仓比例展示/输入均为"占期初(original)"语义(A):默认与每次重开都基于原始名义本金。 // oriClosePercent = 剩余名义本金/期初名义本金 = 最多可平比例(不能平超过剩余持仓)。 oriClosePercent: 1, ratio: 1, shortRatio: 1, }, computed: { maxUnwindDate() { return ValueDate; }, minStartDate() { return this.deal.StartDate; } }, created() { this.multiplier = this.deal.StructureType == '普通债券类收益互换' ? 100 : 1; this.initDeal(); this.setUnwindDate(); }, methods: { getPriceScale() { return this.multiplier == 100 ? 0.01 : 1; }, getStorageDeliveryPrice() { const precision = inputFormatSwapDeliveryPrice.precision + (this.multiplier === 100 ? 2 : 0); return SwapCalc.roundHalfAwayFromZero(Number(this.floatPosition.TradingAmountAvg) * this.getPriceScale(), precision); }, initDeal() { var positions = model.FlowEvents.filter((item) => { return item.UnderlyingCode; }); this.floatPosition = positions[0]; this.initPosiNetPrice = this.floatPosition.PosiGrossPrice; 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.ratio = this.floatPosition.PayDirection == 1 ? -1 : 1; this.shortRatio = this.floatPosition.PositionType == 1 ? 1 : -1; this.TradeStartDate = model.TradeStartDate; // 最多可平比例(占期初口径) = 剩余名义本金 / 期初名义本金;分母为 0 时兜底为 1 this.oriClosePercent = (this.deal.NotionalValue && this.deal.PosiNotionalValue) ? this.deal.PosiNotionalValue / this.deal.NotionalValue : 1; // 转换期末标的价格为百分比形式 if (this.floatPosition.TradingAmountAvg) { this.floatPosition.TradingAmountAvg = this.floatPosition.TradingAmountAvg * this.multiplier; } }, IsBond(instType) { return tradeHelper.IsBond(instType); }, priceFormat(price) { price = price * this.multiplier; var pricef = otcformat.trading.umprice(price); return pricef; }, dataFormat() { this.deal.NotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.NotionalValue)); this.deal.PosiNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue)); this.deal.CloseNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.CloseNotionalValue)); this.deal.NotionalQty = otcformat.trading.notional(this.deal.NotionalQty); this.deal.PositionQty2 = otcformat.trading.notional(this.deal.PositionQty); this.floatPosition.Quantity = otcformat.trading.notional(this.floatPosition.Quantity); this.floatPosition.PositionQty = otcformat.trading.notional(this.floatPosition.PositionQty); this.deal.CloseQty = otcformat.trading.notional(this.deal.CloseQty); this.deal.ClosePercent = otcformat.fixed6(this.deal.ClosePercent); this.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(this.deal.SwapCloseAmount); //this.floatPosition.PosiNetPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiNetPrice); //this.floatPosition.PosiGrossPrice = otcformat.trading.tradeSinglePrice(this.floatPosition.PosiGrossPrice); this.floatPosition.TradingAmountAvg = _.round(Number(this.floatPosition.TradingAmountAvg), 9); this.floatPosition.TradingFee = otcformat.trading.StockEqvNotional(this.floatPosition.TradingFee); this.floatPosition.TradingFeePending = otcformat.trading.StockEqvNotional(this.floatPosition.TradingFeePending); this.floatPosition.DividendIn = parseFloat(this.floatPosition.DividendIn).toFixed(2); this.floatPosition.MarkClosePnl = otcformat.trading.StockEqvNotional(this.floatPosition.MarkClosePnl); this.interestList.forEach(x => { //x.Principal = otcformat.trading.StockEqvNotional(x.Principal); //x.Rate = otcformat.fixed6(x.Rate); x.InterestAmount = otcformat.trading.StockEqvNotional(x.InterestAmount); x.InterestClosePnL = otcformat.trading.StockEqvNotional(x.InterestClosePnL); //x.InterestStartDate = x.InterestStartDate ? x.InterestStartDate.substr(0, 10) : ""; //x.InterestEndDate = x.InterestEndDate ? x.InterestEndDate.substr(0, 10) : ""; }); this.marginList.forEach(x => { x.InterestAmount = otcformat.trading.StockEqvNotional(x.InterestAmount); x.InterestClosePnL = otcformat.trading.StockEqvNotional(x.InterestClosePnL); }); }, setValueDate(e) {//修改平仓日期 if (e) { this.deal.ValueDate = e; } //if (!isUseApproval) { // this.getInterestList(); // this.refreshUnderlyingPrice(); //} else { // this.dataFormat(); //} }, setUnwindDate(e) {//修改平仓日期 if (e) { this.deal.UnwindDate = e; this.floatPosition.UnwindDate = e; } if (!isUseApproval) { this.getInterestList(); //this.refreshUnderlyingPrice(); } else { this.dataFormat(); } }, changeCloseMethod() {//修改平仓类型 if (this.deal.CloseMethod == 1) { this.deal.ClosePercent = this.oriClosePercent; this.deal.CloseNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.PosiNotionalValue)); this.deal.CloseQty = this.deal.PositionQty; } else { // ClosePercent 是占期初口径(A),需除以 oriClosePercent 转占剩余(B) 再乘剩余数量 this.deal.CloseQty = this.calcCloseQtyByPercent(this.deal.ClosePercent); } this.calcTradingFeePending(); this.refreshTradingFeeByUnit(); this.getInterestList(); this.calcFloatClosePnl(); }, // 按"占期初口径(A)"的 ClosePercent 反算平仓数量:CloseQty = PositionQty × (ClosePercent / oriClosePercent) // 多次部分平仓后必须这样转换,否则全部↔部分切换时 ClosePercent 没变但 CloseQty 会变(不自洽) // 使用 swapCalc.calcCloseQtyByOriginalPercent 的 roundHalfAwayFromZero 避免 JS 浮点精度偏差 // (如 32500000*(0.5/0.65)=24999999.999999996 而非 25000000) calcCloseQtyByPercent(closePercent) { return SwapCalc.calcCloseQtyByOriginalPercent(closePercent, this.oriClosePercent, this.deal.PositionQty); }, calcTradingFeePending() { this.floatPosition.TradingFeePending = swapPosiFeeCalc.calcTradingFeePending( this.floatPosition.BeforeCloseFee, this.floatPosition.PosiFeeType, this.floatPosition.PosiTradingFeeUnit, this.deal.CloseNotionalValue, this.deal.CloseQty, this.deal.NotionalValue, this.deal.NotionalQty, this.deal.ClosePercent); }, refreshTradingFeeByUnit() { const allocatedFee = swapPosiFeeCalc.calcAllocatedTradingFee( this.floatPosition.BeforeCloseFee, this.floatPosition.PosiFeeType, this.floatPosition.PosiTradingFeeUnit, this.deal.CloseNotionalValue, this.deal.CloseQty, this.deal.NotionalValue, this.deal.NotionalQty); this.floatPosition.TradingFee = allocatedFee !== null ? allocatedFee : swapPosiFeeCalc.calcTradingFee( this.floatPosition.PosiFeeType, this.floatPosition.PosiTradingFeeUnit, this.deal.CloseNotionalValue, this.deal.CloseQty); }, changeCloseQty() {//修改平仓数量 if (parseFloat(this.deal.CloseQty) > parseFloat(this.deal.PositionQty)) { main.message("平仓数量不能超过持仓数量"); return; } // CloseQty/PositionQty 得占剩余(B),× oriClosePercent 转回占期初(A) var ori = parseFloat(this.oriClosePercent) || 0; this.deal.ClosePercent = otcformat.fixed6((parseFloat(this.deal.CloseQty) / parseFloat(this.deal.PositionQty)) * ori); if (parseFloat(this.deal.CloseQty) == parseFloat(this.deal.PositionQty)) { this.deal.CloseMethod = 1; } else { this.deal.CloseMethod = 2; } // 占期初口径:平仓名义本金 = 平仓比例 × 期初名义本金(NotionalValue) this.deal.CloseNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.ClosePercent) * parseFloat(this.deal.NotionalValue)); this.calcTradingFeePending(); this.refreshTradingFeeByUnit(); this.getInterestList(); this.calcFloatClosePnl(); }, changeClosePercent() {//修改平仓比例 if (parseFloat(this.deal.ClosePercent) > this.oriClosePercent) { main.message("平仓比例不能超过" + this.oriClosePercent * 100 + "%"); this.deal.ClosePercent = this.oriClosePercent; return; } this.deal.CloseQty = this.calcCloseQtyByPercent(this.deal.ClosePercent); // 占期初口径:平仓名义本金 = 平仓比例 × 期初名义本金(NotionalValue) this.deal.CloseNotionalValue = otcformat.trading.StockEqvNotional(parseFloat(this.deal.ClosePercent) * parseFloat(this.deal.NotionalValue)); if (parseFloat(this.deal.ClosePercent) == parseFloat(this.oriClosePercent)) { this.deal.CloseMethod = 1; } else { this.deal.CloseMethod = 2; } this.calcTradingFeePending(); this.refreshTradingFeeByUnit(); this.getInterestList(); this.calcFloatClosePnl(); }, changeCloseNotionalValue() {//修改平仓名义本金 if (parseFloat(this.deal.CloseNotionalValue) > parseFloat(this.deal.PosiNotionalValue)) { main.message("平仓名义本金不能超过持仓名义本金"); this.deal.CloseNotionalValue = this.deal.PosiNotionalValue; return; } // 占期初口径:平仓比例 = 平仓名义本金 / 期初名义本金(NotionalValue) this.deal.ClosePercent = otcformat.fixed6(parseFloat(this.deal.CloseNotionalValue) / parseFloat(this.deal.NotionalValue)); this.deal.CloseQty = this.calcCloseQtyByPercent(this.deal.ClosePercent); if (parseFloat(this.deal.ClosePercent) == parseFloat(this.oriClosePercent)) { this.deal.CloseMethod = 1; } else { this.deal.CloseMethod = 2; } this.calcTradingFeePending(); this.refreshTradingFeeByUnit(); this.getInterestList(); this.calcFloatClosePnl(); }, 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 * thisObj.multiplier; thisObj.floatPosition.TradingAmountAvg = _.round(Number(res.obj), 9); thisObj.calcFloatClosePnl(); }); }, calcFloatClosePnl() {//计算浮动端平仓盈亏 var thisObj = this; let floatRatio = thisObj.floatPosition.PayDirection == 1 ? 1 : -1; let longRatio = thisObj.floatPosition.PositionType == 1 ? 1 : -1; let TradingFee = thisObj.floatPosition.TradingFee == "" ? 0 : parseFloat(thisObj.floatPosition.TradingFee); let TradingFeePending = thisObj.floatPosition.TradingFeePending == "" ? 0 : parseFloat(thisObj.floatPosition.TradingFeePending); let deliveryPrice = thisObj.getStorageDeliveryPrice(); thisObj.floatPosition.MarkClosePnl = Math.round(thisObj.deal.CloseQty * (deliveryPrice - thisObj.initPosiNetPrice) * floatRatio * longRatio * 10000) / 10000; thisObj.floatPosition.MarkClosePnl = Number(thisObj.floatPosition.MarkClosePnl.toFixed(2));//MarkClosePnl 纯盯市不要计算交易费用和分红 thisObj.floatPosition.MarkClosePnl = otcformat.trading.StockEqvNotional(thisObj.floatPosition.MarkClosePnl); thisObj.floatPosition.FloatPnlSum = (parseFloat(thisObj.floatPosition.MarkClosePnl) + TradingFee + TradingFeePending + parseFloat(thisObj.floatPosition.DividendIn)).toFixed(2); thisObj.calcCloseAmount(); }, changeTradingFee() {//修改交易费用 this.calcFloatClosePnl(); }, changeInterestAmount(item) {//修改利息金额 let interestRatio = item.InterestDirection == 1 ? 1 : -1; item.InterestClosePnL = otcformat.trading.StockEqvNotional(parseFloat(item.InterestAmount) * interestRatio + parseFloat(item.InterestFee) * interestRatio); this.calcCloseAmount(); }, //calcClosePnL() {//计算浮动端平仓盈亏 // let pnl = parseFloat(this.floatPosition.ClosePnL) - parseFloat(this.floatPosition.TradingFee); // this.floatPosition.ClosePnL = otcformat.trading.StockEqvNotional(pnl); // this.calcCloseAmount(); //}, calcCloseAmount() {//计算平仓总额=浮动收取+利息收取-浮动支付-利息支付 let floatRatio = this.floatPosition.PayDirection == 1 ? 1 : -1; let ratio = this.floatPosition.PositionType == 1 ? 1 : -1; let thisObj = this; let pnl = parseFloat(this.floatPosition.FloatPnlSum); let TradingFee = thisObj.floatPosition.TradingFee == "" ? 0 : parseFloat(thisObj.floatPosition.TradingFee); thisObj.deal.SwapCloseAmount = pnl; thisObj.deal.SwapRealizedPnL = pnl; thisObj.deal.SwapMarginRebatePnl = 0; thisObj.deal.SwapMarginAmount = 0; let deliveryPrice = thisObj.getStorageDeliveryPrice(); thisObj.floatPosition.TradingAmount = deliveryPrice * parseFloat(thisObj.deal.CloseQty); thisObj.floatPosition.CloseFee = TradingFee; if (thisObj.deal.CloseQty == 0) { thisObj.floatPosition.TradingAmountFeeAvg = 0; } else { thisObj.floatPosition.TradingAmountFeeAvg = deliveryPrice + (TradingFee / thisObj.deal.CloseQty) * ratio; } this.interestList.forEach(x => { /*let interestRatio = x.InterestDirection == 1 ? 1 : -1;*/ let interestAmount = parseFloat(x.InterestClosePnL); thisObj.deal.SwapCloseAmount = parseFloat(thisObj.deal.SwapCloseAmount) + interestAmount; thisObj.deal.SwapRealizedPnL = parseFloat(thisObj.deal.SwapRealizedPnL) + interestAmount; }); this.marginList.forEach(x => { let interestAmount = parseFloat(x.InterestClosePnL); let interestRatio = x.InterestDirection == 1 ? -1 : 1; thisObj.deal.SwapCloseAmount = parseFloat(thisObj.deal.SwapCloseAmount) + interestAmount; thisObj.deal.SwapMarginRebatePnl = parseFloat(thisObj.deal.SwapMarginRebatePnl) + interestAmount; thisObj.deal.SwapRealizedPnL = parseFloat(thisObj.deal.SwapRealizedPnL) + interestAmount; thisObj.deal.SwapMarginAmount = parseFloat(thisObj.deal.SwapMarginAmount) + parseFloat(x.InterestPrincipal) * interestRatio; }); thisObj.deal.SwapRealizedPnL = Number(thisObj.deal.SwapRealizedPnL.toFixed(2)); thisObj.deal.SwapCloseAmount = Number(thisObj.deal.SwapCloseAmount.toFixed(2)); thisObj.deal.SwapCloseAmount = otcformat.trading.StockEqvNotional(thisObj.deal.SwapCloseAmount); thisObj.deal.SwapRealizedPnL = otcformat.trading.StockEqvNotional(thisObj.deal.SwapRealizedPnL); thisObj.deal.SwapMarginRebatePnl = otcformat.trading.StockEqvNotional(thisObj.deal.SwapMarginRebatePnl); thisObj.deal.SwapMarginAmount = otcformat.trading.StockEqvNotional(thisObj.deal.SwapMarginAmount); }, getInterestList() {//根据平仓日期获取利息腿信息 var thisObj = this; // closePercent 按"占期初(original)"语义(A)传给后端,由 GetUnwindInterestList 转为"占剩余(B)"计算 var postData = { valueDate: thisObj.deal.ValueDate, unwindDate: thisObj.deal.UnwindDate, tradeId: thisObj.deal.SwapTradeId, closePercent: thisObj.deal.ClosePercent, eventType: 2, notionalValue: thisObj.deal.NotionalValue, posiNotionalValue: thisObj.deal.PosiNotionalValue } main.post("/swaptrade2/GetUnwindInterestList", postData, { async: true }).done(function (resp) { thisObj.interestList = resp.obj.filter((item) => { return item.InterestMode == 1 || item.InterestMode == 2 || item.InterestMode == 7 || item.InterestMode == 8 || item.InterestMode == 9; }); thisObj.marginList = resp.obj.filter((item) => { return item.InterestMode == 5 || item.InterestMode == 6; }); 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 consumedDividend = Math.abs(parseFloat(resp.obj.consumedDividend ?? 0)) * ratio * floatRatio;//已实现的 let totalDividend = parseFloat(thisObj.deal.NotionalQty) * resp.obj.totalInterest * ratio * floatRatio; let remainDividend = totalDividend - consumedDividend; let dividendIn = 0; if (remainDividend != 0) { dividendIn = parseFloat(thisObj.deal.CloseQty) / parseFloat(thisObj.floatPosition.Quantity) * remainDividend } // 这里计算已经分红的利息,从totalInterest里扣除 // 互换是全量消费,consumedDividend>0 表示分红已被当天互换消费,归0 // 现在可能做了纯分红的互换结算,所以不能直接归0 thisObj.floatPosition.DividendIn = parseFloat(dividendIn.toFixed(2)); var posiQty = parseFloat(thisObj.floatPosition.Quantity) - parseFloat(thisObj.deal.CloseQty); thisObj.floatPosition.DividendPending = parseFloat((posiQty * resp.obj.totalInterest * ratio * floatRatio).toFixed(2)); thisObj.calcFloatClosePnl(); thisObj.dataFormat(); }); }, closeTrade() {//平仓 var thisObj = this; if (main.isEmpty(thisObj.deal.ValueDate)) { main.message("请输入平仓日期"); return; } if (thisObj.deal.CloseType == 1) {//数量平仓方式 if (parseFloat(thisObj.deal.CloseQty) > parseFloat(thisObj.deal.PositionQty)) { main.message("平仓数量不能持仓数量"); return; } if (parseFloat(this.deal.CloseQty) <= 0) { main.message("平仓数量不能小于或等于0"); return; } } else { if (parseFloat(this.deal.ClosePercent) > 1) { main.message("平仓比例不能超过100%"); return; } if (parseFloat(this.deal.CloseNotionalValue) > parseFloat(this.deal.PosiNotionalValue)) { main.message("平仓名义本金不能超过持仓名义本金"); return; } } if (thisObj.deal.ValueDate > thisObj.deal.UnwindDate) { main.message("事件日期不能大于平仓日期"); return; } let reqObj = _.cloneDeep(thisObj.deal); let marginCloneList = _.cloneDeep(thisObj.marginList); reqObj.FlowEvents = _.cloneDeep(thisObj.interestList); marginCloneList.forEach((item) => { reqObj.FlowEvents.push(item); }) thisObj.floatPosition.EventDate = thisObj.deal.ValueDate; let floatPosition = _.cloneDeep(thisObj.floatPosition); floatPosition.Quantity = reqObj.CloseQty; floatPosition.TradingAmountAvg = thisObj.getStorageDeliveryPrice(); reqObj.FlowEvents.push(floatPosition); var postData = { unwindData: reqObj }; var msg = "确认提交平仓?"; var postUrl = "/swaptrade2/SwapUnwindJson"; if (g_isShowReCheckClose) { msg = "确认提交平仓审核?"; postUrl = "/swaptrade2/ApplyUnwind"; postData.eventType = 2;//互换3,平仓2 } main.confirm(msg, function () { //重新计算百分比 var thisObj2 = thisObj; main.post(postUrl, postData).done(function (res) { if (res.success) { thisObj2.closetrade_cashWindow(); } else { try { thisObj2.closetrade_cashWindow(); } catch (e) { } } }); }); }, getSumbitText: function () { return g_isShowReCheckClose ? "审核提交" : "保存"; }, submitApproval(status) { var pop = ''; if (status === 'pass') { pop = "确认通过审批?"; } if (status === 'reject') { pop = "确认拒绝?"; } let thisObj = this; var confirmFunc = function (additionalProcessing) { var pData = { tradeId: thisObj.deal.SwapTradeId, status: status, text: "" }; if (!main.isEmpty(additionalProcessing)) { pData.additionalProcessing = additionalProcessing; } var thisObj2 = thisObj; main.post("/processtradelog/UpdateTradeProcessLog", pData).done( function (data) { if (data.obj && data.obj.proccessType == "AdditionalProcessing") { if (data.obj.type == "LackOfMoney") { var htmlContent = `