TRS-ZS-721 资金划转

This commit is contained in:
吴方海
2025-09-05 14:11:15 +08:00
parent eb4a51110e
commit ac07eae81e
10 changed files with 229 additions and 23 deletions
@@ -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;