diff --git a/UnitTestProject/Modules/CalcModules/CalculationTest.cs b/UnitTestProject/Modules/CalcModules/CalculationTest.cs index 5a153d49..013454d1 100644 --- a/UnitTestProject/Modules/CalcModules/CalculationTest.cs +++ b/UnitTestProject/Modules/CalcModules/CalculationTest.cs @@ -135,7 +135,16 @@ namespace YLErp.Modules.CalcModules Assert.AreEqual(date20190708, QdpCalendarHelper.GetNonHolidayDefore(date20190708)); #endregion } - + [TestMethod] + public void CalendarBLLGetNonHolidayDeforeTest() + { + var date20250421 = new DateTime(2025, 04, 21); + var date20250418 = new DateTime(2025, 04, 18); + var cudate = QdpCalendarHelper.GetNonHolidayDefore(date20250421.AddDays(0)); + var preDate = QdpCalendarHelper.GetNonHolidayDefore(date20250421.AddDays(-1)); + Assert.AreEqual(date20250421, cudate); + Assert.AreEqual(date20250418, preDate); + } [TestMethod] public void GetObservationDateStringTest() { diff --git a/YLErpDAL/BLL/EodSettlement/ClientBalanceUtility.cs b/YLErpDAL/BLL/EodSettlement/ClientBalanceUtility.cs index 87f8f5ef..f224b024 100644 --- a/YLErpDAL/BLL/EodSettlement/ClientBalanceUtility.cs +++ b/YLErpDAL/BLL/EodSettlement/ClientBalanceUtility.cs @@ -582,14 +582,7 @@ namespace YLErp.BLL.EodSettlement DicTotal.TotalMarginTotal = DicTotal.TotalMargin; DicTotal.RoundedTotalAmountTotal = DicTotal.RoundedTotalAmount; DicTotal.TotalAmountTotal = DicTotal.TotalAmount; - if (PS.Config.Is湘财) - { - DicTotal.MarginByPayableMarginTotal = Math.Max(-DicTotal.AvailableAmount, 0); - } - else - { - DicTotal.MarginByPayableMarginTotal = DicTotal.MarginByPayableMargin; - } + DicTotal.MarginByPayableMarginTotal = DicTotal.MarginByPayableMarginTotal; //if (PS.Config.Is广期资本) //{ // DicTotal.MarginByPayableMarginTotal = Math.Max(-DicTotal.AvailableAmount, 0); @@ -637,18 +630,7 @@ namespace YLErp.BLL.EodSettlement DicTotal.RoundedTotalAmountTotal += dc.Value.RoundedTotalAmount; DicTotal.TotalAmountTotal += dc.Value.TotalAmount; - if (PS.Config.Is湘财) - { - DicTotal.MarginByPayableMarginTotal += Math.Max(-dc.Value.AvailableAmount, 0); - } - else - { - DicTotal.MarginByPayableMarginTotal += dc.Value.MarginByPayableMargin; - } - //if (PS.Config.Is广期资本) - //{ - // DicTotal.MarginByPayableMarginTotal = Math.Max(-DicTotal.AvailableAmount, 0); - //} + DicTotal.MarginByPayableMarginTotal += dc.Value.MarginByPayableMarginTotal; DicTotal.ClosedTradePayableFundTotal += dc.Value.ClosedTradePayableFund; DicTotal.PositionTradePayableFundTotal += dc.Value.PositionTradePayableFund; diff --git a/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs b/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs index 4e13fb6b..be1ac174 100644 --- a/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs +++ b/YLErpDAL/BLL/EodSettlement/RealTimeClientBanlanceService.cs @@ -280,7 +280,7 @@ namespace YLErp.BLL.Eod // 追保金额=初始保证金金额-盯市金额 item.MarginByPayableMarginTotal = item.NeedAddMargin ? (item.MySideMargin - item.SwapMarketAmount) : 0; // 可取资金=max(期末结存+min(持仓盈亏,0)-初始保证金,0) - item.DesirableFund =Math.Max( item.MarginBalance + Math.Min(item.RoundedPositionPnl, 0),0); + item.DesirableFund =Math.Max( item.MarginBalance - item.FrozenMarginMoney + Math.Min(item.RoundedPositionPnl, 0),0); } return _clientBalanceDic.Values; @@ -1314,8 +1314,8 @@ namespace YLErp.BLL.Eod balance.UpdateDate = balance.UpdateDate > lastEodSwap.OptTime ? balance.UpdateDate : lastEodSwap.OptTime; } balance.WinLoss += Convert.ToDouble(tdRealizedPnL) * -1; - balance.PositionPnl += Convert.ToDouble(pnl); - balance.RoundedPositionPnl += Math.Round(Convert.ToDouble(pnl), 2); + balance.PositionPnl += Convert.ToDouble(pnl) * -1; + balance.RoundedPositionPnl += Math.Round(Convert.ToDouble(pnl), 2) * -1; //期权空头浮动盈利=∑max(期权空头持仓*(期权合约成本价-期权合约现价), 0) 从客户角度看的 balance.ClientSellPositionPnl += Convert.ToDouble(lastEodSwap.FloatingPnL) * -1; } diff --git a/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs b/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs index 5946909d..2298e3fb 100644 --- a/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs +++ b/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs @@ -317,7 +317,7 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule WinLoss = clientBalance?.WinLoss ?? 0, ClosedTradeFundGap = clientBalance?.ClosedTradeFundGap ?? 0, ClosedTradePayableFund = clientBalance?.ClosedTradePayableFundTotal ?? 0, - PositionTradePayableFund = clientBalance?.PositionTradePayableFundTotal ?? 0, + PositionTradePayableFund = clientBalance?.MarginByPayableMarginTotal ?? 0, DesirableFund = clientBalance?.DesirableFundTotal ?? 0, PayableFund = emailData.PayableFund >= 0 ? emailData.PayableFund : (clientBalance?.PayableFundTotal ?? 0), PositionPv = PS.Config.IsPVRounded ? (clientBalance?.RoundedPositionPv ?? 0) : (clientBalance?.PositionPv ?? 0), diff --git a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs index 10845c4e..51f308c6 100644 --- a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs @@ -1350,8 +1350,11 @@ namespace YLErp.Modules.SwapModule position.UnderlyingInstrumentType = swap.UnderlyingInstrumentType; position.PosiDirection = swap.PosiDirection; position.PosiGrossPrice = swap.PosiGrossPrice; - position.PosiNetPrice = swap.PosiQuantity == 0 ? 0 : (swap.PosiGrossPrice + (position.PosiTradingFee / swap.PosiQuantity) * ratio); + position.PosiNetPrice = swap.PosiQuantity == 0 ? 0 : (swap.PosiGrossPrice + (position.PosiTradingFeePending / swap.PosiQuantity) * ratio); position.PosiNetPrice = Math.Round(position.PosiNetPrice, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); + position.PosiNetNoFeePrice = swap.PosiNetNoFeePrice; + position.PosiNetFeePrice = swap.PosiQuantity == 0 ? 0 : (swap.PosiNetNoFeePrice + (position.PosiTradingFeePending / swap.PosiQuantity) * ratio); + position.PosiNetFeePrice = Math.Round(position.PosiNetFeePrice??0, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero); position.PosiNotionalValue = position.PosiGrossPrice * swap.PosiQuantity * swap.ContractSize; position.PosiQuantity = swap.PosiQuantity; position.InterestDirection = swap.InterestDirection; diff --git a/YLErpWeb/Controllers/clientController.cs b/YLErpWeb/Controllers/clientController.cs index 85a8f946..c770f1d9 100644 --- a/YLErpWeb/Controllers/clientController.cs +++ b/YLErpWeb/Controllers/clientController.cs @@ -625,7 +625,7 @@ namespace YLErp.Web.Controllers x.HoldingDepositB = -clientBalance.PayableMarginB; x.SwapPayableMargin = -clientBalance.SwapPayableMargin; x.AvailableAmount = clientBalance.AvailableAmount; - x.InsuredAmount = clientBalance.PositionTradePayableFundTotal; + x.InsuredAmount = clientBalance.MarginByPayableMarginTotal; x.MarginMonitoringTime = clientBalance.UpdateDate ?? DateTime.Now; x.FreezePremium = clientBalance.FreezePremium; x.ReceivablesPremium = clientBalance.ReceivablesPremium; diff --git a/YLErpWeb/Views/clientbalance/TradeMarketReport.cshtml b/YLErpWeb/Views/clientbalance/TradeMarketReport.cshtml index b7b6b937..7778d0b9 100644 --- a/YLErpWeb/Views/clientbalance/TradeMarketReport.cshtml +++ b/YLErpWeb/Views/clientbalance/TradeMarketReport.cshtml @@ -130,7 +130,7 @@ 其他收支 追保金额 - + diff --git a/YLErpWeb/Views/entryexit/entryexitList.cshtml b/YLErpWeb/Views/entryexit/entryexitList.cshtml index 1f2c7aff..d34f3ac2 100644 --- a/YLErpWeb/Views/entryexit/entryexitList.cshtml +++ b/YLErpWeb/Views/entryexit/entryexitList.cshtml @@ -675,28 +675,14 @@ } -
+@*
-
+
*@
@Html.SearchDateRange("HappenDate", "发生时间") @@ -743,10 +729,6 @@ @MyControls.Btn("拒绝", "setReject()") } } - @if (PS.Config.Company == CompanyEnum.中金) - { - @MyControls.Btn("南向资金全量", "downloadCashInfo()") - }
diff --git a/YLErpWeb/Views/variety/varietyList.cshtml b/YLErpWeb/Views/variety/varietyList.cshtml index db3a086e..d74c4da7 100644 --- a/YLErpWeb/Views/variety/varietyList.cshtml +++ b/YLErpWeb/Views/variety/varietyList.cshtml @@ -18,11 +18,6 @@ @MyControls.Btn("导入", "importVariety()") } @MyControls.Btn("导出", "downloadExcel()") - @if (CurUser.基础参数管理.标的品种编辑) - { - @MyControls.Btn("预付金参数导入", "importMarginParams()") - } - 预付金参数导出 @Html.Raw(JqGridSimple.OutTable()) diff --git a/YLErpWeb/wwwroot/Scripts/app/client/tradeMarketReport.js b/YLErpWeb/wwwroot/Scripts/app/client/tradeMarketReport.js index 78a069af..4a910002 100644 --- a/YLErpWeb/wwwroot/Scripts/app/client/tradeMarketReport.js +++ b/YLErpWeb/wwwroot/Scripts/app/client/tradeMarketReport.js @@ -312,7 +312,7 @@ function SearchClientBalance() { $("#VmFundSum").text(numFormart(data.VmFundSum)); $("#AvailableFund").text(numFormart(data.AvailableAmount)); $("#OtherFund").text(numFormart(data.OtherFund)); - $("#PositionTradePayableFund").text(numFormart(data.PositionTradePayableFundTotal)); + $("#MarginByPayableMargin").text(numFormart(data.MarginByPayableMarginTotal)); $("#ToDayRemainFund").text(numFormart(data.AmountFund)); $("#DesirableFund").text(numFormart(data.DesirableFundTotal)); }); diff --git a/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js b/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js index 5daabaef..3beb5396 100644 --- a/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js +++ b/YLErpWeb/wwwroot/Scripts/app/risk/quotaMonitor.js @@ -1537,16 +1537,6 @@ var colModel_client = [ formatter: function (cellvalue, options, rowObject) { return !cellvalue || cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); } - }, { - name: 'Credit', - label: '授信额度', - index: 'Credit', - width: 120, - align: 'right', - sortable: false, - formatter: function (cellvalue, options, rowObject) { - return !cellvalue || cellvalue == "NaN" ? "" : cellvalue.toLocaleString(); - } } ]; diff --git a/YLErpWeb/wwwroot/Scripts/app/system/Approvalprocess.js b/YLErpWeb/wwwroot/Scripts/app/system/Approvalprocess.js index d53a8933..3b34f24d 100644 --- a/YLErpWeb/wwwroot/Scripts/app/system/Approvalprocess.js +++ b/YLErpWeb/wwwroot/Scripts/app/system/Approvalprocess.js @@ -47,7 +47,7 @@ var app = new Vue({ { text: '客户开户', value: '1' }, { text: '客户信息修改', value: '5' }, { text: '交易', value: '2' }, - { text: '资信与授信', value: '3' }, + /* { text: '资信与授信', value: '3' },*/ { text: '出金', value: '4' } ],