diff --git a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs index ad74c2f1..ccdad4d4 100644 --- a/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs +++ b/YLErpDAL/Modules/ClientModule/ClientCashInCashOutDataService.cs @@ -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("划转金额不能超过已实现盈亏"); } diff --git a/YLErpWeb/Properties/launchSettings.json b/YLErpWeb/Properties/launchSettings.json index 6b0464ba..be61e851 100644 --- a/YLErpWeb/Properties/launchSettings.json +++ b/YLErpWeb/Properties/launchSettings.json @@ -5,7 +5,7 @@ "launchBrowser": true, "launchUrl": "http://localhost:49462", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "local" + "ASPNETCORE_ENVIRONMENT": "dev" }, "applicationUrl": "http://localhost:49462" } diff --git a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js index 159c707e..10d5a0cc 100644 --- a/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js +++ b/YLErpWeb/wwwroot/Scripts/app/client/entryexitEdit.js @@ -256,9 +256,9 @@ function setClientCash() { } }); main.post("/trade_span/GetClientLatestBalance", { clientId: clientId }).done(function (data) { - winloss = data.WinLoss; - netFund = data.NetFund; - vmFund = data.VmFundSum; + winloss = numFormart(data.WinLoss); + netFund = numFormart(data.NetFund); + vmFund = numFormart(data.VmFundSum); setTransferMoney(); }); } @@ -289,6 +289,14 @@ function setTransferMoney() { $("#transfer_in_account_money").text("余额:" + winloss); } } +function numFormart(num) { + num = num || 0; + var result = numeral(num).format("0,0.00") === "NaN" ? "0.00" : numeral(num).format("0,0.00"); + if (result === "-0.00") { + result = "0.00"; + } + return result; +} $(function () { cardInputMgr.init();