资金划转,金额保留2位小数

This commit is contained in:
吴方海
2025-09-09 16:45:25 +08:00
parent ffd547efcd
commit f15ca632c3
3 changed files with 18 additions and 7 deletions
@@ -708,15 +708,18 @@ namespace YLErp.Modules.ClientModule
}
var money = r.Money ?? 0;
money=isAddNew? money: money-(originalMoney??0);
if (r.TransferOutAccount == "初保账户" && money > clientbalance.NetFundAll)
var netFundAll = Math.Round(clientbalance.NetFundAll,2,MidpointRounding.AwayFromZero);
var vmFundSum = Math.Round(clientbalance.VmFundSum,2,MidpointRounding.AwayFromZero);
var winLoss = Math.Round(clientbalance.WinLoss,2,MidpointRounding.AwayFromZero);
if (r.TransferOutAccount == "初保账户" && money > netFundAll)
{
throw new ServiceException("划转金额不能超过初保账户金额");
}
if (r.TransferOutAccount == "追保账户" && money > clientbalance.VmFundSum)
if (r.TransferOutAccount == "追保账户" && money > vmFundSum)
{
throw new ServiceException("划转金额不能超过追保账户金额");
}
if (r.TransferOutAccount == "已实现盈亏" && money > clientbalance.WinLoss)
if (r.TransferOutAccount == "已实现盈亏" && money > winLoss)
{
throw new ServiceException("划转金额不能超过已实现盈亏");
}