TRS-ZS-721 资金划转
This commit is contained in:
@@ -602,6 +602,8 @@ namespace YLErp.Modules.ClientModule
|
||||
r.CurrencyCode = req.CurrencyCode;
|
||||
r.cash_type = req.cash_type;
|
||||
r.ValidState = ConsGlobal.Valid;
|
||||
r.TransferOutAccount = req.TransferOutAccount;
|
||||
r.TransferInAccount = req.TransferInAccount;
|
||||
}
|
||||
|
||||
if (isARAP)
|
||||
@@ -696,7 +698,31 @@ namespace YLErp.Modules.ClientModule
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 划转资金时进行验资
|
||||
if ("划转".Equals(r.Direction))
|
||||
{
|
||||
var clientbalance = ClientBalanceUtility.GetClientBanlances(new List<int> { r.ClientId.Value }, DateTime.MinValue, DateTime.Now.Date).FirstOrDefault();
|
||||
if (clientbalance == null)
|
||||
{
|
||||
throw new ServiceException("查询客户资金信息失败");
|
||||
}
|
||||
var money = r.Money ?? 0;
|
||||
money=isAddNew? money: money-(originalMoney??0);
|
||||
if (r.TransferOutAccount == "初保账户" && money > clientbalance.NetFundAll)
|
||||
{
|
||||
throw new ServiceException("划转金额不能超过初保账户金额");
|
||||
}
|
||||
if (r.TransferOutAccount == "追保账户" && money > clientbalance.VmFundSum)
|
||||
{
|
||||
throw new ServiceException("划转金额不能超过追保账户金额");
|
||||
}
|
||||
if (r.TransferOutAccount == "已实现盈亏" && money > clientbalance.WinLoss)
|
||||
{
|
||||
throw new ServiceException("划转金额不能超过已实现盈亏");
|
||||
}
|
||||
r.cash_type = null;
|
||||
}
|
||||
#endregion
|
||||
if (r.Direction != "出金" && r.Direction != "入金")
|
||||
{
|
||||
r.OpenBank = null;
|
||||
|
||||
Reference in New Issue
Block a user