bug修复
This commit is contained in:
@@ -228,7 +228,9 @@ namespace YLErp.DBModels
|
||||
public static string 应收 = "应收";
|
||||
public static List<string> 到账类型 = new List<string> { 已到帐, 应到帐 };
|
||||
|
||||
public static List<string> outCashCals= new List<string> { 未确认, 同意 };
|
||||
public static List<string> outCashCals = new List<string> { 未确认, 同意, 已确认, 已结算 };
|
||||
public static List<string> calcCashs = new List<string> { 未确认, 同意 };
|
||||
public static List<string> cashStateChecks = new List<string> { "出金", "入金" };
|
||||
|
||||
public const string 系统操作_期权费 = "系统操作-期权费";
|
||||
public const string 系统操作_行权费 = "系统操作-行权费";
|
||||
|
||||
@@ -353,12 +353,12 @@ namespace YLErp.BLL.EodSettlement
|
||||
balance.MarginBalance = balance.AmountFund - balance.MySideMargin;
|
||||
// 可用资金 = 期末结存 - 追保账户余额 - 初始保证金
|
||||
balance.AvailableAmount = balance.MarginBalance - (balance.VmInFundSum - balance.VmOutFundSum);
|
||||
// 是否追保=履约保证金比例<维持保证金率
|
||||
balance.NeedAddMargin = balance.SwapMarketAmountPercent < (decimal)marginRate.MaintenanceRate;
|
||||
// 是否追保=盯市金额小于维持保证金额
|
||||
balance.NeedAddMargin = balance.SwapMarketAmount < balance.MaintenanceMargin;
|
||||
// 追保金额=初始保证金金额-盯市金额
|
||||
balance.MarginByPayableMarginTotal = balance.NeedAddMargin ? (balance.MySideMargin - balance.SwapMarketAmount):0;
|
||||
// 可取资金=期末结存-min(持仓盈亏,0)-初始保证金
|
||||
balance.DesirableFund = balance.MarginBalance - Math.Min(balance.RoundedPositionPnl, 0);
|
||||
balance.DesirableFund = balance.MarginBalance + Math.Min(balance.RoundedPositionPnl, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,12 +275,12 @@ namespace YLErp.BLL.Eod
|
||||
item.MarginBalance = item.AmountFund - item.MySideMargin;
|
||||
// 可用资金 = 期末结存 - 追保账户余额 - 初始保证金
|
||||
item.AvailableAmount = item.MarginBalance - (item.VmInFundSum - item.VmOutFundSum) - item.FrozenMarginMoney;
|
||||
// 是否追保=履约保证金比例<维持保证金率
|
||||
item.NeedAddMargin = item.SwapMarketAmountPercent < (decimal)marginRate.MaintenanceRate;
|
||||
// 是否追保=盯市金额小于维持保证金额
|
||||
item.NeedAddMargin = item.SwapMarketAmount < item.MaintenanceMargin;
|
||||
// 追保金额=初始保证金金额-盯市金额
|
||||
item.MarginByPayableMarginTotal = item.NeedAddMargin ? (item.MySideMargin - item.SwapMarketAmount) : 0;
|
||||
// 可取资金=期末结存-min(持仓盈亏,0)-初始保证金
|
||||
item.DesirableFund = item.MarginBalance - Math.Min(item.RoundedPositionPnl, 0);
|
||||
item.DesirableFund = item.MarginBalance + Math.Min(item.RoundedPositionPnl, 0);
|
||||
}
|
||||
|
||||
return _clientBalanceDic.Values;
|
||||
@@ -1071,8 +1071,7 @@ namespace YLErp.BLL.Eod
|
||||
from td in trade.DefaultIfEmpty()
|
||||
where t.HappenDate >= lastSettletDateAddOne && t.HappenDate < newValuedate
|
||||
&& t.ValidState != "InValid"
|
||||
//&& (t.State == ClientCashInCashOut.已结算 || t.State == ClientCashInCashOut.已确认||(t.Direction=="出金"&& ClientCashInCashOut.outCashCals.Contains(t.State)))
|
||||
&& (t.State == ClientCashInCashOut.已结算 || t.State == ClientCashInCashOut.已确认)
|
||||
&& (t.State == ClientCashInCashOut.已结算 || t.State == ClientCashInCashOut.已确认 || (t.Direction == "出金" && ClientCashInCashOut.outCashCals.Contains(t.State)))
|
||||
&& clientIds.Contains(t.ClientId.Value)
|
||||
&& t.Money != null
|
||||
&& td.TradeType != "收益互换"
|
||||
|
||||
@@ -589,5 +589,9 @@ namespace YLErp.Model
|
||||
/// 是否需要追保
|
||||
/// </summary>
|
||||
public bool NeedAddMargin { get; set; }
|
||||
/// <summary>
|
||||
/// 期初结存
|
||||
/// </summary>
|
||||
public double LastDayRemainFund { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using YLErp.BLL.EodSettlement;
|
||||
using YLErp.Commons;
|
||||
using YLErp.Configuration;
|
||||
using YLErp.Core.Helpers;
|
||||
using YLErp.DBModels.Enums;
|
||||
using YLErp.Helpers;
|
||||
using YLErp.Model;
|
||||
using YLErp.Model.Enum;
|
||||
@@ -648,12 +649,17 @@ namespace YLErp.Modules.ClientModule
|
||||
|
||||
#region 出金申请时进行验资
|
||||
|
||||
if ((("出金".Equals(r.Direction) && PS.Config.Company != Configuration.CompanyEnum.中金) || ("应付".Equals(r.Direction) && ClientCashInCashOut.人工操作_预付金.Equals(r.Action))) && valuedateBLL.SystemDate.SpecialOperateForCashOut != 1 && PS.Config.Company != Configuration.CompanyEnum.中金)
|
||||
if ("出金".Equals(r.Direction) && valuedateBLL.SystemDate.SpecialOperateForCashOut != 1)
|
||||
{
|
||||
//查看当前客户可用资金是否符合出金条件
|
||||
var clientbalance = ClientBalanceUtility.GetClientBanlances(new List<int> { r.ClientId.Value }, DateTime.MinValue, DateTime.Now.Date).FirstOrDefault();
|
||||
// 如果余额为 null,则视为无可用资金
|
||||
if (clientbalance == null)
|
||||
{
|
||||
clientbalance = new YLErp.Models.ClientSettleBalance();
|
||||
}
|
||||
//当日可取现金
|
||||
var availableFund = clientbalance == null ? 0 : clientbalance.DesirableFund;
|
||||
var availableFund = clientbalance.DesirableFund;
|
||||
|
||||
//对于0.999999999情况的数据做下处理
|
||||
var realAvailableFund = Math.Round((availableFund + (originalMoney ?? 0.0)) * Math.Pow(10, 8)) / Math.Pow(10, 8);
|
||||
@@ -664,6 +670,24 @@ namespace YLErp.Modules.ClientModule
|
||||
(Math.Floor(realAvailableFund * 100) / 100).ToString("0.00") + ";";
|
||||
throw new ServiceException(msg);
|
||||
}
|
||||
if (r.Money <= clientbalance.VmFundSum)
|
||||
{
|
||||
// 出金金额小于等于 追保账户金额
|
||||
r.cash_type = CashTypeEnum.追保账户.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 出金金额大于 追保账户金额,首先处理 VM 部分
|
||||
r.cash_type = CashTypeEnum.追保账户.ToString();
|
||||
var newMoney = r.Money - clientbalance.VmFundSum;
|
||||
r.Money = clientbalance.VmFundSum;
|
||||
|
||||
var newR = r.Clone();
|
||||
newR.id = 0;
|
||||
newR.Money = newMoney;
|
||||
newR.cash_type = CashTypeEnum.初保账户.ToString();
|
||||
DbContext.ClientCashInCashOut.Add(newR);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -679,29 +703,7 @@ namespace YLErp.Modules.ClientModule
|
||||
|
||||
if (r.State != "未确认" && changecashs.Count > 0 && !(changecashs.Count == 1 && changecashs[0][0] == "Comments"))
|
||||
{
|
||||
//功能先禁掉了
|
||||
//if (DbContext.clientcashincashout_update.Where(x => x.ClientcashincashoutId == r.id && x.State == "修改待确认" && x.ValidState != "InValid").Any())
|
||||
//{
|
||||
// var updateInValid = DbContext.clientcashincashout_update.Where(x => x.ClientcashincashoutId == r.id && x.State == "修改待确认" && x.ValidState != "InValid").ToList();
|
||||
// updateInValid.ForEach(x => x.ValidState = "InValid");
|
||||
//}
|
||||
//var clientcashincashout_Update = new clientcashincashout_update
|
||||
//{
|
||||
// OptId = UserId,
|
||||
// OptName = UserName,
|
||||
// OptDate = DateTime.Now,
|
||||
// ClientcashincashoutId = r.id,
|
||||
// OldMoney = r.Money ?? 0,
|
||||
// NewMoney = req.Money ?? 0,
|
||||
// OldDirection = r.Direction,
|
||||
// NewDirection = req.Direction ?? r.Direction,
|
||||
// OldHappenDate = r.HappenDate,
|
||||
// NewHappenDate = req.HappenDate ?? r.HappenDate,
|
||||
// ValidState = "Valid",
|
||||
// State = "修改待确认"
|
||||
//};
|
||||
//DbContext.clientcashincashout_update.Add(clientcashincashout_Update);
|
||||
//ClientCashLog(r.id, "修改资金", comment, req.Explain);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -912,35 +914,26 @@ namespace YLErp.Modules.ClientModule
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((("出金".Equals(e.Direction) && PS.Config.Company != Configuration.CompanyEnum.中金) || ("应付".Equals(e.Direction) && ClientCashInCashOut.人工操作_预付金.Equals(e.Action))) && valuedateBLL.SystemDate.SpecialOperateForCashOut != 1 && PS.Config.Company != Configuration.CompanyEnum.中金)
|
||||
{
|
||||
//查看当前客户可用资金是否符合出金条件
|
||||
var clientbalance = ClientBalanceUtility.GetClientBanlances(new List<int> { e.ClientId.Value }, DateTime.MinValue, DateTime.Now.Date).FirstOrDefault();
|
||||
//当日可取现金
|
||||
var availableFund = clientbalance == null ? 0 : clientbalance.DesirableFund;
|
||||
//else if ((("出金".Equals(e.Direction) && PS.Config.Company != Configuration.CompanyEnum.中金) || ("应付".Equals(e.Direction) && ClientCashInCashOut.人工操作_预付金.Equals(e.Action))) && valuedateBLL.SystemDate.SpecialOperateForCashOut != 1 && PS.Config.Company != Configuration.CompanyEnum.中金)
|
||||
//{
|
||||
// //查看当前客户可用资金是否符合出金条件
|
||||
// var clientbalance = ClientBalanceUtility.GetClientBanlances(new List<int> { e.ClientId.Value }, DateTime.MinValue, DateTime.Now.Date).FirstOrDefault();
|
||||
// //当日可取现金
|
||||
// var availableFund = clientbalance == null ? 0 : clientbalance.DesirableFund;
|
||||
|
||||
//对于0.999999999情况的数据做下处理
|
||||
var realAvailableFund = Math.Round((availableFund + (e.Money??0)) * Math.Pow(10, 8)) / Math.Pow(10, 8);
|
||||
//如果当前出金金额大于可用资金(不扣除冻结出金部分)则抛出错误
|
||||
if (Math.Abs(e.Money ?? 0) > realAvailableFund)
|
||||
{
|
||||
if ("出金".Equals(e.Direction))
|
||||
{
|
||||
throw new ServiceException($"部分确认错误 客户:{e.ClientName},出金:{e.Money},实际可取出资金:{realAvailableFund:0.00};");
|
||||
}
|
||||
throw new ServiceException($"部分确认错误,客户:{e.ClientName},应付预付金:{Math.Abs(e.Money ?? 0)},实际可取出资金:{realAvailableFund:0.00};");
|
||||
}
|
||||
// //对于0.999999999情况的数据做下处理
|
||||
// var realAvailableFund = Math.Round((availableFund + (e.Money??0)) * Math.Pow(10, 8)) / Math.Pow(10, 8);
|
||||
// //如果当前出金金额大于可用资金(不扣除冻结出金部分)则抛出错误
|
||||
// if (Math.Abs(e.Money ?? 0) > realAvailableFund)
|
||||
// {
|
||||
// if ("出金".Equals(e.Direction))
|
||||
// {
|
||||
// throw new ServiceException($"部分确认错误 客户:{e.ClientName},出金:{e.Money},实际可取出资金:{realAvailableFund:0.00};");
|
||||
// }
|
||||
// throw new ServiceException($"部分确认错误,客户:{e.ClientName},应付预付金:{Math.Abs(e.Money ?? 0)},实际可取出资金:{realAvailableFund:0.00};");
|
||||
// }
|
||||
|
||||
}
|
||||
if (PS.Config.Company == Configuration.CompanyEnum.中金)
|
||||
{
|
||||
|
||||
if ("出金".Equals(e.Direction) && !CheckClientCashOut(e.ClientId ?? 0, Math.Abs(e.Money ?? 0), e.CurrencyCode))
|
||||
{
|
||||
throw new ServiceException($"{e.ClientName}币种{e.CurrencyCode}的出金金额不能大于客户账户余额");
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1303,6 +1303,25 @@ namespace YLErp.Modules.EodModule.SettlementModule
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 客户资金未确认状态检查
|
||||
/// </summary>
|
||||
public void ClientCashInCashOutCheck()
|
||||
{
|
||||
var balanceDate = _context.SettleDate;
|
||||
var reqClientIds = _context.Request.ClientIds;
|
||||
var newValuedate = balanceDate.AddDays(1);
|
||||
var cashInCashOuts = DbContext.ClientCashInCashOut.Where(x => x.HappenDate >= balanceDate && x.HappenDate < newValuedate && x.ValidState != ConsGlobal.InValid && ClientCashInCashOut.calcCashs.Contains(x.State) && ClientCashInCashOut.cashStateChecks.Contains(x.Direction)).AsNoTracking().ToList();
|
||||
if (reqClientIds != null && reqClientIds.Any())
|
||||
{
|
||||
cashInCashOuts = cashInCashOuts.Where(x => reqClientIds.Contains(x.ClientId ?? 0)).ToList();
|
||||
}
|
||||
if (cashInCashOuts.Any())
|
||||
{
|
||||
_context.RaiseError("客户资金结算", $"{balanceDate:yyyy年MM月dd日}存在未确认的资金,请先将资金确认后再操作");
|
||||
}
|
||||
}
|
||||
private void AddToFund(Dictionary<string, double> fundDictionary, string currencyCode, double amount)
|
||||
{
|
||||
if (fundDictionary.ContainsKey(currencyCode))
|
||||
|
||||
@@ -503,6 +503,8 @@ where {nameof(t.TaskStartTime)}>'{startDateStr}' and {nameof(t.TaskState)}={(int
|
||||
SetTaskStep("为处于节假日的交易标的复制上日收盘价");
|
||||
new EodCopyPreSettlePrice(_context).Execute();
|
||||
}
|
||||
SetTaskStep("检查标的出入金状态");
|
||||
new EodClientBalanceCalc(_context).ClientCashInCashOutCheck();
|
||||
|
||||
SetTaskStep("检查标的结算价格缺失");
|
||||
new EodCheckSettlePrice(_context).Execute();//t
|
||||
|
||||
@@ -42,6 +42,18 @@ namespace YLErp.Modules.ReportModule
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 维持保证金金额
|
||||
/// </summary>
|
||||
public double? MaintenanceMargin { get; set; }
|
||||
|
||||
public string MaintenanceMarginString
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((MaintenanceMargin == null || MaintenanceMargin == -0) ? 0 : MaintenanceMargin.Value).ToString("0.00");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 初保账户
|
||||
/// </summary>
|
||||
public double? NetFundAll { get; set; }
|
||||
|
||||
+1
@@ -332,6 +332,7 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule
|
||||
NetFundAll = clientBalance?.NetFundAll,
|
||||
SwapMarketAmount= clientBalance?.SwapMarketAmount,
|
||||
VmFundSum= clientBalance?.VmFundSum,
|
||||
MaintenanceMargin=clientBalance?.MaintenanceMargin,
|
||||
};
|
||||
return FundReportModel;
|
||||
}
|
||||
|
||||
@@ -4087,10 +4087,6 @@ namespace YLErp.Modules.RiskModule
|
||||
{
|
||||
precheckQuotaSettingList = precheckQuotaSettingList.Where(x => quotaIndexs.Contains(x.QuotaIndex)).ToList();
|
||||
}
|
||||
if (precheckQuotaSettingList.Count == 0)
|
||||
{
|
||||
return clientRiskCheckResps;
|
||||
}
|
||||
var client = DataCacheProvider.GetClientDataSource().GetData(clientRiskCheckReq.clientId);
|
||||
if (client == null)
|
||||
{
|
||||
@@ -4119,12 +4115,15 @@ namespace YLErp.Modules.RiskModule
|
||||
{
|
||||
throw new ServiceException("适当性评估已经过期,只有在适当性有效期内才可以新开仓");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return clientRiskCheckResps; //平仓不过风控
|
||||
}
|
||||
if (precheckQuotaSettingList.Count == 0)
|
||||
{
|
||||
return clientRiskCheckResps;
|
||||
}
|
||||
foreach (var settingItem in precheckQuotaSettingList)
|
||||
{
|
||||
var clientRiskCheckItem = CreateClientRiskCheckItem(settingItem);
|
||||
|
||||
@@ -819,7 +819,7 @@ namespace YLErp.Modules.SwapModule
|
||||
/// <param name="td"></param>
|
||||
/// <param name="unwindPrice"></param>
|
||||
/// <param name="unwindPriceFee"></param>
|
||||
public void AuotoSwapUnwind(int tradeid, decimal unwindPrice, decimal unwindPriceFee, decimal unwindNetFee, decimal unwindNet, DateTime valueDate, decimal unwindQty, decimal mergeQty, decimal penddingFee)
|
||||
public void AuotoSwapUnwind(int tradeid, decimal unwindPrice, decimal unwindPriceFee, decimal unwindNetFee, decimal unwindNet, DateTime valueDate, decimal unwindQty)
|
||||
{
|
||||
unwindPriceFee = decimal.Parse(unwindPriceFee.ToString("F10"));
|
||||
var td = DbContext.trade.Find(tradeid);
|
||||
@@ -884,10 +884,10 @@ namespace YLErp.Modules.SwapModule
|
||||
floatEvent.TradingAmountNetFeeAvg = unwindNetFee;
|
||||
floatEvent.TradingAmountNetAvg = unwindNet;
|
||||
floatEvent.TradingFeePending = position.PosiTradingFeePending * unwindData.ClosePercent;
|
||||
var mergeClosePercent = mergeQty == 0 ? 0 : unwindQty / mergeQty;
|
||||
floatEvent.TradingFee = penddingFee * mergeClosePercent;
|
||||
floatEvent.TradingFeePending = Math.Round(floatEvent.TradingFeePending, 2, MidpointRounding.AwayFromZero);
|
||||
floatEvent.TradingFee = floatEvent.TradingFeePending;
|
||||
floatEvent.MarkClosePnl = (unwindPrice - position.PosiGrossPrice) * unwindQty * floatRatio * longRatio;
|
||||
floatEvent.MarkClosePnl = Math.Round(floatEvent.MarkClosePnl + (floatEvent.TradingFee * floatRatio * -1), ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
|
||||
floatEvent.MarkClosePnl = Math.Round(floatEvent.MarkClosePnl + (floatEvent.TradingFeePending*2 * floatRatio * -1), ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
|
||||
floatEvent.TradingAmount = unwindPrice * floatEvent.Quantity * floatEvent.ContractSize;
|
||||
floatEvent.OptLog = "流水自动";
|
||||
floatEvent.ClientId = td.ClientId;
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace YLErp.Modules.SwapModule
|
||||
var unwindEvents = flowEvents.Where(x => x.PositionId == posi.id).ToList();//当前日平仓信息
|
||||
var realPosition = realPosiList.FirstOrDefault(s => s.PositionId == posi.id);
|
||||
eod_swap_position eodPosi = new eod_swap_position();
|
||||
if (eodPosition == null || td.TradeDate == settleDate)
|
||||
if (eodPosition == null)
|
||||
{
|
||||
eodPosi = SaveCurrentEodInitalPosi(posi, td, settleDate, preSettleDate, unwindEvents);
|
||||
}
|
||||
@@ -1259,19 +1259,18 @@ namespace YLErp.Modules.SwapModule
|
||||
curretEod.PosiNetFeePrice = position.PosiNetFeePrice;
|
||||
curretEod.PosiNetNoFeePrice = position.PosiNetNoFeePrice;
|
||||
curretEod.PosiQuantity = position.PosiQuantity;
|
||||
curretEod.PosiTradingFee = -position.PosiTradingFee * directionRatio;
|
||||
curretEod.PosiFeePending = -position.PosiTradingFeePending * directionRatio;
|
||||
}
|
||||
else
|
||||
{
|
||||
var eventTradingFee = openFlowEvents.Sum(s => s.TradingFee);
|
||||
curretEod.PosiTradingFee = eod.PosiTradingFee - eventTradingFee * directionRatio;
|
||||
var eventTradingFee = openFlowEvents.Sum(s => s.TradingFeePending);
|
||||
curretEod.PosiFeePending = eod.PosiFeePending - eventTradingFee * directionRatio;
|
||||
if (openFlowEvents.Count() == 0)
|
||||
{
|
||||
curretEod.PosiNetPrice = eod.PosiNetPrice;
|
||||
curretEod.PosiGrossPrice = eod.PosiGrossPrice;
|
||||
curretEod.PosiNetFeePrice = eod.PosiNetFeePrice;
|
||||
curretEod.PosiNetNoFeePrice = eod.PosiNetNoFeePrice;
|
||||
curretEod.PosiFeePending = curretEod.PosiFeePending<0 ? 0: curretEod.PosiFeePending;
|
||||
}
|
||||
else //平仓数量一定<持仓数量
|
||||
{
|
||||
|
||||
@@ -412,6 +412,7 @@ namespace YLErp.Modules.SwapModule
|
||||
interestPosition.interest_rule = swapFloatRate.interest_rule;
|
||||
interestPosition.interest_rest_days = swapFloatRate.interest_rest_days;
|
||||
interestPosition.IsAnnualized = swapFloatRate.is_annualized ?? false;
|
||||
interestPosition.InterestType = swapFloatRate.interest_type??0;
|
||||
}
|
||||
var interval = new IntervalModel()
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -690,6 +690,7 @@ namespace YLErp.Web.Controllers
|
||||
x.SwapMarketAmountPercent=clientBalance.SwapMarketAmountPercent;
|
||||
x.MaintenanceMargin=clientBalance.MaintenanceMargin;
|
||||
x.NeedAddMargin=clientBalance.NeedAddMargin;
|
||||
x.LastDayRemainFund=clientBalance.LastDayRemainFund;
|
||||
if (clientBalance.MarginOccupation == 0)
|
||||
{
|
||||
x.WorstCastClientPayableRatio = 10000;
|
||||
@@ -838,7 +839,7 @@ namespace YLErp.Web.Controllers
|
||||
WinLossSum = pairs["WinLossSum"],
|
||||
PositionPvSum = PS.Config.IsPVRounded ? pairs["RoundedPositionPvSum"] : pairs["PositionPvSum"],
|
||||
PositionPnlSum = PS.Config.IsPVRounded ? pairs["RoundedPositionPnlSum"] : pairs["PositionPnlSum"],
|
||||
TotalAmountSum = PS.Config.IsPVRounded ? pairs["RoundedTotalAmountSum"] : pairs["TotalAmountSum"],
|
||||
LastDayRemainFundSum = pairs["LastDayRemainFundSum"],
|
||||
NetFundSum = pairs["NetFundSum"],
|
||||
NetFundAllSum = pairs["NetFundAllSum"],
|
||||
OtherFundSum = pairs["OtherFundSum"],
|
||||
@@ -848,7 +849,7 @@ namespace YLErp.Web.Controllers
|
||||
DesirableFundSum = pairs["DesirableFundSum"],
|
||||
MySideMarginSum = pairs["MySideMarginSum"],
|
||||
VmFundSumSum = pairs["VmFundSumSum"],
|
||||
MarginBalanceSum = pairs["MarginBalanceSum"],
|
||||
MaintenanceMarginSum = pairs["MaintenanceMarginSum"],
|
||||
SwapMarketAmountSum = pairs["SwapMarketAmountSum"],
|
||||
InfoList = searchList.rows
|
||||
};
|
||||
|
||||
@@ -72,28 +72,6 @@
|
||||
<td>优惠累计量下限</td>
|
||||
<td>@Model.DiscountAccDown.OtcFormatMoney(true)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>现券对冲交易费用</td>
|
||||
@if (Model.BackDeskChargeIsPercent==true)
|
||||
{
|
||||
<td>@Model.FrontDeskCharge.OtcFormatTenThousandsPercent(4)</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>@Model.FrontDeskCharge.OtcFormatMoney(true) 元/笔</td>
|
||||
}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>现券对冲结算费用</td>
|
||||
@if (Model.BackDeskChargeIsPercent == true)
|
||||
{
|
||||
<td>@Model.BackDeskCharge.OtcFormatTenThousandsPercent(4)</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>@Model.BackDeskCharge.OtcFormatMoney(true) 元/笔</td>
|
||||
}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -73,28 +73,6 @@
|
||||
<vue-number-input v-model="rate.DiscountAccDown" v-bind:format="inputFormatSinglePrice" style="width:45% !important;margin-left:4px;"></vue-number-input>
|
||||
<span style="color:red">*</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="formlabel half">现券对冲交易费用</label>
|
||||
<template v-if="rate.FrontDeskChargeIsPercent==true">
|
||||
<vue-number-input v-model="rate.FrontDeskCharge" v-bind:format="inputFormatThousandsRate" style="width:45% !important;margin-left:4px;" v-bind:readonly="!IsDma"></vue-number-input>
|
||||
<a href="javascript:;" title="点击后切换成绝对值" v-on:click="showFrontAbsPrice" class="yt-input-group-append" tabindex="-1">‱</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<vue-number-input v-model="rate.FrontDeskCharge" v-bind:format="inputFormatSinglePrice" style="width:45% !important;margin-left:4px;" v-bind:readonly="!IsDma"></vue-number-input>
|
||||
<a href="javascript:;" title="点击后切换百分比" v-on:click="showFrontPercentPrice" class="yt-input-group-append" tabindex="-1">元/笔</a>
|
||||
</template>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="formlabel half">现券对冲结算费用</label>
|
||||
<template v-if="rate.BackDeskChargeIsPercent==true">
|
||||
<vue-number-input v-model="rate.BackDeskCharge" v-bind:format="inputFormatThousandsRate" style="width:45% !important;margin-left:4px;" v-bind:readonly="!IsDma"></vue-number-input>
|
||||
<a href="javascript:;" title="点击后切换成绝对值" v-on:click="showBackAbsPrice" class="yt-input-group-append" tabindex="-1">‱</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<vue-number-input v-model="rate.BackDeskCharge" v-bind:format="inputFormatSinglePrice" style="width:45% !important;margin-left:4px;" v-bind:readonly="!IsDma"></vue-number-input>
|
||||
<a href="javascript:;" title="点击后切换百分比" v-on:click="showBackPercentPrice" class="yt-input-group-append" tabindex="-1">元/笔</a>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" v-on:click="save">保存</button>
|
||||
|
||||
@@ -50,7 +50,10 @@
|
||||
<td>{{初始保证金金额}}</td>
|
||||
<td>4183.00</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{维持保证金金额}}</td>
|
||||
<td>4183.00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{可用资金}}</td>
|
||||
<td>-548545.26</td>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<tr>
|
||||
<td>期初结存</td>
|
||||
<td id="LastDayRemainFund"></td>
|
||||
<td style="font-weight: bold; color: forestgreen;">初始保证金金额</td>
|
||||
<td>初始保证金金额</td>
|
||||
<td id="MySideMargin"></td>
|
||||
<td>已实现盈亏</td>
|
||||
<td id="WinLoss"></td>
|
||||
@@ -105,8 +105,8 @@
|
||||
<tr>
|
||||
<td>出金入金</td>
|
||||
<td id="CashInCashOutChange"></td>
|
||||
<td>预付金余额</td>
|
||||
<td id="MarginBalance"></td>
|
||||
<td>维持保证金金额</td>
|
||||
<td id="MaintenanceMargin"></td>
|
||||
<td>持仓盈亏</td>
|
||||
<td id="PositionPnl"></td>
|
||||
</tr>
|
||||
@@ -115,16 +115,16 @@
|
||||
<td id="NetFundAll"></td>
|
||||
<td>盯市金额</td>
|
||||
<td id="SwapMarketAmount"></td>
|
||||
<td>持仓市值</td>
|
||||
<td id="Pv"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>追保账户</td>
|
||||
<td id="VmFundSum"></td>
|
||||
<td>可用资金</td>
|
||||
<td id="AvailableFund"></td>
|
||||
<td style="font-weight: bold; color: dodgerblue;">总资产</td>
|
||||
<td id="Amount"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>其他收支</td>
|
||||
@@ -137,7 +137,7 @@
|
||||
<tr>
|
||||
<td>期末结存</td>
|
||||
<td id="ToDayRemainFund"></td>
|
||||
<td style="font-weight: bold; color: dodgerblue;">可取资金</td>
|
||||
<td>可取资金</td>
|
||||
<td id="DesirableFund"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
|
||||
@@ -166,12 +166,12 @@ function getColModelGrid() {
|
||||
name: 'CurrentHoldingPenNumber', label: '持仓笔数', index: 'CurrentHoldingPenNumber', width: 80, align: 'center', formatter: main.toInt, sorttype: 'number'
|
||||
}, {
|
||||
name: 'WinLoss', label: '实现盈亏', index: 'WinLoss', width: 120, align: 'right', value: '0', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'RoundedPositionPv', label: '持仓市值', index: 'RoundedPositionPv', width: 120, align: 'right', value: '0', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'PositionPnl', label: '持仓盈亏', index: 'PositionPnl', width: 120, align: 'right', value: '0', formatter: 'number', optionHide: page.isPvRounded, hidden: page.isPvRounded, sorttype: 'number'
|
||||
}, {
|
||||
name: 'RoundedPositionPnl', label: '持仓盈亏', index: 'RoundedPositionPnl', width: 120, align: 'right', value: '0', formatter: 'number', optionHide: !page.isPvRounded, hidden: !page.isPvRounded, sorttype: 'number'
|
||||
}, {
|
||||
name: 'LastDayRemainFund', label: '期初结存', index: 'LastDayRemainFund', width: 100, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'NetFundAll', label: '出金入金', index: 'NetFundAll', width: 100, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
@@ -182,14 +182,10 @@ function getColModelGrid() {
|
||||
name: 'OtherFund', label: '其他收支', index: 'OtherFund', width: 100, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'AmountFund', label: '期末结存', index: 'AmountFund', width: 100, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'TotalAmount', label: '总资产', index: 'TotalAmount', width: 100, align: 'right', formatter: 'number', optionHide: page.isPvRounded, hidden: page.isPvRounded, sorttype: 'number'
|
||||
}, {
|
||||
name: 'RoundedTotalAmount', label: '总资产', index: 'RoundedTotalAmount', width: 100, align: 'right', formatter: 'number', optionHide: !page.isPvRounded, hidden: !page.isPvRounded, sorttype: 'number'
|
||||
}, {
|
||||
name: 'MySideMargin', label: '初始保证金金额', index: 'MySideMargin', width: 120, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'MarginBalance', label: '预付金余额', index: 'MarginBalance', width: 120, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
name: 'MaintenanceMargin', label: '维持保证金金额', index: 'MaintenanceMargin', width: 120, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
name: 'SwapMarketAmount', label: '盯市金额', index: 'SwapMarketAmount', width: 120, align: 'right', formatter: 'number', sorttype: 'number'
|
||||
}, {
|
||||
@@ -267,12 +263,12 @@ function gridComplete() {
|
||||
Number: "合计", TotalTradeCount: sum.TotalTradeCountSum, TotalNotionalPrincipal: sum.TotalNotionalPrincipalSum,
|
||||
TransactionPenNumber: sum.TransactionPenNumberSum,
|
||||
TodayNotionalPrincipal: sum.TodayNotionalPrincipalSum, PositionNotionalPrincipal: sum.PositionNotionalPrincipalSum, CurrentHoldingPenNumber: sum.CurrentHoldingPenNumberSum,
|
||||
WinLoss: sum.WinLossSum, PositionPv: sum.PositionPvSum, PositionPnl: sum.PositionPnlSum, RoundedPositionPv: sum.RoundedPositionPvSum, RoundedPositionPnl: sum.RoundedPositionPnlSum,
|
||||
WinLoss: sum.WinLossSum, PositionPv: sum.PositionPvSum, PositionPnl: sum.PositionPnlSum, RoundedPositionPnl: sum.RoundedPositionPnlSum,
|
||||
NetFund: sum.NetFundSum, OtherFund: sum.OtherFundSum,
|
||||
AmountFund: sum.AmountFundSum, TotalAmount: sum.TotalAmountSum, RoundedTotalAmount: sum.RoundedTotalAmountSum,
|
||||
AvailableAmount: sum.AvailableAmountSum, InsuredAmount: sum.InsuredAmountSum,
|
||||
DesirableFund: sum.DesirableFundSum, NetFundAll: sum.NetFundAllSum, VmFundSum: sum.VmFundSumSum, MySideMargin: sum.MySideMarginSum,
|
||||
MarginBalance: sum.MarginBalanceSum, SwapMarketAmount: sum.SwapMarketAmountSum
|
||||
MaintenanceMargin: sum.MaintenanceMarginSum, SwapMarketAmount: sum.SwapMarketAmountSum, LastDayRemainFund: sum.LastDayRemainFundSum,
|
||||
});
|
||||
}
|
||||
g_grid = jQuery('#listGrid');
|
||||
@@ -318,8 +314,8 @@ function LoadGrid() {
|
||||
useColSpanStyle: true,
|
||||
groupHeaders: [
|
||||
{ startColumnName: 'Number', numberOfColumns: 2, titleText: '<span class="listGroupHeader">客户信息</span>' },
|
||||
{ startColumnName: 'TotalTradeCount', numberOfColumns: 10, titleText: '<span class="listGroupHeader">交易信息 <span>' },
|
||||
{ startColumnName: 'NetFundAll', numberOfColumns: 14, titleText: '<span class="listGroupHeader">账户状况</span>' }
|
||||
{ startColumnName: 'TotalTradeCount', numberOfColumns: 9, titleText: '<span class="listGroupHeader">交易信息 <span>' },
|
||||
{ startColumnName: 'LastDayRemainFund', numberOfColumns: 13, titleText: '<span class="listGroupHeader">账户状况</span>' }
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -205,7 +205,11 @@ function setDirection(isInit) {
|
||||
!isInit && cardInputMgr.changeInputType(true);
|
||||
let direction = $("#Direction").val();
|
||||
$(".changeInputBtn").toggleClass("hide", ["出金", "应付"].includes(direction));
|
||||
|
||||
if (direction === "出金") {
|
||||
$("#cash_type_container").hide(); // 隐藏资金类型
|
||||
} else {
|
||||
$("#cash_type_container").show(); // 显示资金类型
|
||||
}
|
||||
cardInputMgr.toggle(["入金", "出金"].includes(direction));
|
||||
|
||||
cardInputMgr.updateOptions();
|
||||
|
||||
@@ -305,18 +305,16 @@ function SearchClientBalance() {
|
||||
$("#MySideMargin").text(numFormart(data.MySideMargin));
|
||||
$("#WinLoss").text(numFormart(data.WinLoss));
|
||||
$("#CashInCashOutChange").text(numFormart(data.NetFundAll));
|
||||
$("#MarginBalance").text(numFormart(data.MarginBalance));
|
||||
$("#PositionPnl").text(numFormart(isPvRounded ? data.RoundedPositionPnl : data.PositionPnl));
|
||||
$("#MaintenanceMargin").text(numFormart(data.MaintenanceMargin));
|
||||
$("#NetFundAll").text(numFormart(data.NetFund));
|
||||
$("#SwapMarketAmount").text(numFormart(data.SwapMarketAmount));
|
||||
$("#Pv").text(numFormart(isPvRounded ? data.RoundedPositionPv : data.PositionPv));
|
||||
$("#VmFundSum").text(numFormart(data.VmFundSum));
|
||||
$("#AvailableFund").text(numFormart(data.AvailableAmount));
|
||||
$("#OtherFund").text(numFormart(data.OtherFund));
|
||||
$("#PositionTradePayableFund").text(numFormart(data.PositionTradePayableFundTotal));
|
||||
$("#ToDayRemainFund").text(numFormart(data.AmountFund));
|
||||
$("#DesirableFund").text(numFormart(data.DesirableFundTotal));
|
||||
$("#Amount").text(numFormart(data.SwapMarketAmount));
|
||||
});
|
||||
|
||||
var data = { clientId: $("#ClientId").val(), ValueDateFrom: $("#ValueDateFrom").val(), ValueDateTo: $("#ValueDate").val() };
|
||||
|
||||
Reference in New Issue
Block a user